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

#include <r1cs_gg_ppzksnark.hpp>

Public Member Functions

 r1cs_gg_ppzksnark_proof ()
 
 r1cs_gg_ppzksnark_proof (libff::G1< ppT > &&g_A, libff::G2< ppT > &&g_B, libff::G1< ppT > &&g_C)
 
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 r1cs_gg_ppzksnark_proof< ppT > &other) const
 

Public Attributes

libff::G1< ppT > g_A
 
libff::G2< ppT > g_B
 
libff::G1< ppT > g_C
 

Friends

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

Detailed Description

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

A proof for the R1CS GG-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 306 of file r1cs_gg_ppzksnark.hpp.

Constructor & Destructor Documentation

◆ r1cs_gg_ppzksnark_proof() [1/2]

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

Definition at line 329 of file r1cs_gg_ppzksnark.hpp.

330  {
331  // invalid proof with valid curve points
332  this->g_A = libff::G1<ppT>::one();
333  this->g_B = libff::G2<ppT>::one();
334  this->g_C = libff::G1<ppT>::one();
335  }

◆ r1cs_gg_ppzksnark_proof() [2/2]

template<typename ppT >
libsnark::r1cs_gg_ppzksnark_proof< ppT >::r1cs_gg_ppzksnark_proof ( libff::G1< ppT > &&  g_A,
libff::G2< ppT > &&  g_B,
libff::G1< ppT > &&  g_C 
)
inline

Definition at line 336 of file r1cs_gg_ppzksnark.hpp.

338  : g_A(std::move(g_A)), g_B(std::move(g_B)), g_C(std::move(g_C)){};

Member Function Documentation

◆ G1_size()

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

Definition at line 340 of file r1cs_gg_ppzksnark.hpp.

340 { return 2; }
Here is the caller graph for this function:

◆ G2_size()

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

Definition at line 342 of file r1cs_gg_ppzksnark.hpp.

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

◆ is_well_formed()

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

Definition at line 360 of file r1cs_gg_ppzksnark.hpp.

361  {
362  return (
363  g_A.is_well_formed() && g_B.is_well_formed() &&
364  g_C.is_well_formed());
365  }

◆ operator==()

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

◆ print_size()

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

Definition at line 350 of file r1cs_gg_ppzksnark.hpp.

351  {
352  libff::print_indent();
353  printf("* G1 elements in proof: %zu\n", this->G1_size());
354  libff::print_indent();
355  printf("* G2 elements in proof: %zu\n", this->G2_size());
356  libff::print_indent();
357  printf("* Proof size in bits: %zu\n", this->size_in_bits());
358  }
Here is the call graph for this function:

◆ size_in_bits()

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

Definition at line 344 of file r1cs_gg_ppzksnark.hpp.

345  {
346  return G1_size() * libff::G1<ppT>::size_in_bits() +
347  G2_size() * libff::G2<ppT>::size_in_bits();
348  }
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 r1cs_gg_ppzksnark_proof< ppT > &  proof 
)
friend

◆ operator>>

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

Member Data Documentation

◆ g_A

template<typename ppT >
libff::G1<ppT> libsnark::r1cs_gg_ppzksnark_proof< ppT >::g_A

Definition at line 325 of file r1cs_gg_ppzksnark.hpp.

◆ g_B

template<typename ppT >
libff::G2<ppT> libsnark::r1cs_gg_ppzksnark_proof< ppT >::g_B

Definition at line 326 of file r1cs_gg_ppzksnark.hpp.

◆ g_C

template<typename ppT >
libff::G1<ppT> libsnark::r1cs_gg_ppzksnark_proof< ppT >::g_C

Definition at line 327 of file r1cs_gg_ppzksnark.hpp.


The documentation for this class was generated from the following file:
libsnark::r1cs_gg_ppzksnark_proof::G2_size
size_t G2_size() const
Definition: r1cs_gg_ppzksnark.hpp:342
libsnark::r1cs_gg_ppzksnark_proof::g_C
libff::G1< ppT > g_C
Definition: r1cs_gg_ppzksnark.hpp:327
libsnark::r1cs_gg_ppzksnark_proof::size_in_bits
size_t size_in_bits() const
Definition: r1cs_gg_ppzksnark.hpp:344
libsnark::r1cs_gg_ppzksnark_proof::G1_size
size_t G1_size() const
Definition: r1cs_gg_ppzksnark.hpp:340
libsnark::r1cs_gg_ppzksnark_proof::g_A
libff::G1< ppT > g_A
Definition: r1cs_gg_ppzksnark.hpp:325
libsnark::r1cs_gg_ppzksnark_proof::g_B
libff::G2< ppT > g_B
Definition: r1cs_gg_ppzksnark.hpp:326