Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Public Member Functions | Public Attributes | Friends | List of all members
libsnark::uscs_ppzksnark_proof< ppT > Class Template Reference

#include <uscs_ppzksnark.hpp>

Public Member Functions

 uscs_ppzksnark_proof ()
 
 uscs_ppzksnark_proof (libff::G1< ppT > &&V_g1, libff::G1< ppT > &&alpha_V_g1, libff::G1< ppT > &&H_g1, libff::G2< ppT > &&V_g2)
 
size_t G1_size () const
 
size_t G2_size () const
 
size_t size_in_bits () const
 
void print_size () const
 
bool is_well_formed () const
 
bool operator== (const uscs_ppzksnark_proof< ppT > &other) const
 

Public Attributes

libff::G1< ppT > V_g1
 
libff::G1< ppT > alpha_V_g1
 
libff::G1< ppT > H_g1
 
libff::G2< ppT > V_g2
 

Friends

std::ostream & operator (std::ostream &out, const uscs_ppzksnark_proof< ppT > &proof)
 
std::istream & operator>> (std::istream &in, uscs_ppzksnark_proof< ppT > &proof)
 

Detailed Description

template<typename ppT>
class libsnark::uscs_ppzksnark_proof< ppT >

A proof for the USCS ppzkSNARK.

While the proof has a structure, externally one merely opaquely produces, serializes/deserializes, and verifies proofs. We only expose some information about the structure for statistics purposes.

Definition at line 272 of file uscs_ppzksnark.hpp.

Constructor & Destructor Documentation

◆ uscs_ppzksnark_proof() [1/2]

template<typename ppT >
libsnark::uscs_ppzksnark_proof< ppT >::uscs_ppzksnark_proof ( )
inline

Definition at line 296 of file uscs_ppzksnark.hpp.

297  {
298  // invalid proof with valid curve points
299  this->V_g1 = libff::G1<ppT>::one();
300  this->alpha_V_g1 = libff::G1<ppT>::one();
301  this->H_g1 = libff::G1<ppT>::one();
302  this->V_g2 = libff::G2<ppT>::one();
303  }

◆ uscs_ppzksnark_proof() [2/2]

template<typename ppT >
libsnark::uscs_ppzksnark_proof< ppT >::uscs_ppzksnark_proof ( libff::G1< ppT > &&  V_g1,
libff::G1< ppT > &&  alpha_V_g1,
libff::G1< ppT > &&  H_g1,
libff::G2< ppT > &&  V_g2 
)
inline

Definition at line 304 of file uscs_ppzksnark.hpp.

309  : V_g1(std::move(V_g1))
310  , alpha_V_g1(std::move(alpha_V_g1))
311  , H_g1(std::move(H_g1))
312  , V_g2(std::move(V_g2)){};

Member Function Documentation

◆ G1_size()

template<typename ppT >
size_t libsnark::uscs_ppzksnark_proof< ppT >::G1_size ( ) const
inline

Definition at line 314 of file uscs_ppzksnark.hpp.

314 { return 3; }
Here is the caller graph for this function:

◆ G2_size()

template<typename ppT >
size_t libsnark::uscs_ppzksnark_proof< ppT >::G2_size ( ) const
inline

Definition at line 316 of file uscs_ppzksnark.hpp.

316 { return 1; }
Here is the caller graph for this function:

◆ is_well_formed()

template<typename ppT >
bool libsnark::uscs_ppzksnark_proof< ppT >::is_well_formed ( ) const
inline

Definition at line 334 of file uscs_ppzksnark.hpp.

335  {
336  return (
337  V_g1.is_well_formed() && alpha_V_g1.is_well_formed() &&
338  H_g1.is_well_formed() && V_g2.is_well_formed());
339  }

◆ operator==()

template<typename ppT >
bool libsnark::uscs_ppzksnark_proof< ppT >::operator== ( const uscs_ppzksnark_proof< ppT > &  other) const

◆ print_size()

template<typename ppT >
void libsnark::uscs_ppzksnark_proof< ppT >::print_size ( ) const
inline

Definition at line 324 of file uscs_ppzksnark.hpp.

325  {
326  libff::print_indent();
327  printf("* G1 elements in proof: %zu\n", this->G1_size());
328  libff::print_indent();
329  printf("* G2 elements in proof: %zu\n", this->G2_size());
330  libff::print_indent();
331  printf("* Proof size in bits: %zu\n", this->size_in_bits());
332  }
Here is the call graph for this function:

◆ size_in_bits()

template<typename ppT >
size_t libsnark::uscs_ppzksnark_proof< ppT >::size_in_bits ( ) const
inline

Definition at line 318 of file uscs_ppzksnark.hpp.

319  {
320  return G1_size() * libff::G1<ppT>::size_in_bits() +
321  G2_size() * libff::G2<ppT>::size_in_bits();
322  }
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator

template<typename ppT >
std::ostream& operator ( std::ostream &  out,
const uscs_ppzksnark_proof< ppT > &  proof 
)
friend

◆ operator>>

template<typename ppT >
std::istream& operator>> ( std::istream &  in,
uscs_ppzksnark_proof< ppT > &  proof 
)
friend

Member Data Documentation

◆ alpha_V_g1

template<typename ppT >
libff::G1<ppT> libsnark::uscs_ppzksnark_proof< ppT >::alpha_V_g1

Definition at line 292 of file uscs_ppzksnark.hpp.

◆ H_g1

template<typename ppT >
libff::G1<ppT> libsnark::uscs_ppzksnark_proof< ppT >::H_g1

Definition at line 293 of file uscs_ppzksnark.hpp.

◆ V_g1

template<typename ppT >
libff::G1<ppT> libsnark::uscs_ppzksnark_proof< ppT >::V_g1

Definition at line 291 of file uscs_ppzksnark.hpp.

◆ V_g2

template<typename ppT >
libff::G2<ppT> libsnark::uscs_ppzksnark_proof< ppT >::V_g2

Definition at line 294 of file uscs_ppzksnark.hpp.


The documentation for this class was generated from the following file:
libsnark::uscs_ppzksnark_proof::alpha_V_g1
libff::G1< ppT > alpha_V_g1
Definition: uscs_ppzksnark.hpp:292
libsnark::uscs_ppzksnark_proof::H_g1
libff::G1< ppT > H_g1
Definition: uscs_ppzksnark.hpp:293
libsnark::uscs_ppzksnark_proof::V_g2
libff::G2< ppT > V_g2
Definition: uscs_ppzksnark.hpp:294
libsnark::uscs_ppzksnark_proof::size_in_bits
size_t size_in_bits() const
Definition: uscs_ppzksnark.hpp:318
libsnark::uscs_ppzksnark_proof::G1_size
size_t G1_size() const
Definition: uscs_ppzksnark.hpp:314
libsnark::uscs_ppzksnark_proof::G2_size
size_t G2_size() const
Definition: uscs_ppzksnark.hpp:316
libsnark::uscs_ppzksnark_proof::V_g1
libff::G1< ppT > V_g1
Definition: uscs_ppzksnark.hpp:291