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

#include <mnt_precomputation.hpp>

Inheritance diagram for libsnark::mnt_precompute_G1_gadget< ppT >:
Inheritance graph
[legend]
Collaboration diagram for libsnark::mnt_precompute_G1_gadget< ppT >:
Collaboration graph
[legend]

Public Types

typedef libff::Fqe< other_curve< ppT > > FqeT
 
typedef libff::Fqk< other_curve< ppT > > FqkT
 

Public Member Functions

template<typename FieldT >
 mnt_precompute_G1_gadget (protoboard< FieldT > &pb, const G1_variable< ppT > &P, mnt_G1_precomputation< ppT > &precomp, const std::string &annotation_prefix, const typename std::enable_if< libff::Fqk< other_curve< ppT >>::extension_degree()==4, FieldT >::type &=FieldT())
 
template<typename FieldT >
 mnt_precompute_G1_gadget (protoboard< FieldT > &pb, const G1_variable< ppT > &P, mnt_G1_precomputation< ppT > &precomp, const std::string &annotation_prefix, const typename std::enable_if< libff::Fqk< other_curve< ppT >>::extension_degree()==6, FieldT >::type &=FieldT())
 
void generate_r1cs_constraints ()
 
void generate_r1cs_witness ()
 
- Public Member Functions inherited from libsnark::gadget< libff::Fr< ppT > >
 gadget (protoboard< libff::Fr< ppT > > &pb, const std::string &annotation_prefix)
 

Public Attributes

mnt_G1_precomputation< ppT > & precomp
 

Additional Inherited Members

- Protected Attributes inherited from libsnark::gadget< libff::Fr< ppT > >
protoboard< libff::Fr< ppT > > & pb
 
const std::string annotation_prefix
 

Detailed Description

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

Gadget that verifies correct precomputation of the G1 variable.

Definition at line 58 of file mnt_precomputation.hpp.

Member Typedef Documentation

◆ FqeT

template<typename ppT >
typedef libff::Fqe<other_curve<ppT> > libsnark::mnt_precompute_G1_gadget< ppT >::FqeT

Definition at line 61 of file mnt_precomputation.hpp.

◆ FqkT

template<typename ppT >
typedef libff::Fqk<other_curve<ppT> > libsnark::mnt_precompute_G1_gadget< ppT >::FqkT

Definition at line 62 of file mnt_precomputation.hpp.

Constructor & Destructor Documentation

◆ mnt_precompute_G1_gadget() [1/2]

template<typename ppT >
template<typename FieldT >
libsnark::mnt_precompute_G1_gadget< ppT >::mnt_precompute_G1_gadget ( protoboard< FieldT > &  pb,
const G1_variable< ppT > &  P,
mnt_G1_precomputation< ppT > &  precomp,
const std::string &  annotation_prefix,
const typename std::enable_if< libff::Fqk< other_curve< ppT >>::extension_degree()==4, FieldT >::type &  = FieldT() 
)
inline

Definition at line 68 of file mnt_precomputation.hpp.

76  : gadget<FieldT>(pb, annotation_prefix), precomp(precomp)
77  {
78  pb_linear_combination<FieldT> c0, c1;
79  c0.assign(pb, P.Y * ((libff::mnt4_twist).squared().coeffs[0]));
80  c1.assign(pb, P.Y * ((libff::mnt4_twist).squared().coeffs[1]));
81 
82  precomp.P.reset(new G1_variable<ppT>(P));
83  precomp.PY_twist_squared.reset(new Fqe_variable<ppT>(
84  pb, c0, c1, FMT(annotation_prefix, " PY_twist_squared")));
85  }
Here is the call graph for this function:

◆ mnt_precompute_G1_gadget() [2/2]

template<typename ppT >
template<typename FieldT >
libsnark::mnt_precompute_G1_gadget< ppT >::mnt_precompute_G1_gadget ( protoboard< FieldT > &  pb,
const G1_variable< ppT > &  P,
mnt_G1_precomputation< ppT > &  precomp,
const std::string &  annotation_prefix,
const typename std::enable_if< libff::Fqk< other_curve< ppT >>::extension_degree()==6, FieldT >::type &  = FieldT() 
)
inline

Definition at line 88 of file mnt_precomputation.hpp.

96  : gadget<FieldT>(pb, annotation_prefix), precomp(precomp)
97  {
98  pb_linear_combination<FieldT> c0, c1, c2;
99  c0.assign(pb, P.Y * ((libff::mnt6_twist).squared().coeffs[0]));
100  c1.assign(pb, P.Y * ((libff::mnt6_twist).squared().coeffs[1]));
101  c2.assign(pb, P.Y * ((libff::mnt6_twist).squared().coeffs[2]));
102 
103  precomp.P.reset(new G1_variable<ppT>(P));
104  precomp.PY_twist_squared.reset(new Fqe_variable<ppT>(
105  pb, c0, c1, c2, FMT(annotation_prefix, " PY_twist_squared")));
106  }
Here is the call graph for this function:

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename ppT >
void libsnark::mnt_precompute_G1_gadget< ppT >::generate_r1cs_constraints ( )

◆ generate_r1cs_witness()

template<typename ppT >
void libsnark::mnt_precompute_G1_gadget< ppT >::generate_r1cs_witness ( )

Member Data Documentation

◆ precomp

template<typename ppT >
mnt_G1_precomputation<ppT>& libsnark::mnt_precompute_G1_gadget< ppT >::precomp

Definition at line 64 of file mnt_precomputation.hpp.


The documentation for this class was generated from the following file:
libsnark::gadget< libff::Fr< ppT > >::annotation_prefix
const std::string annotation_prefix
Definition: gadget.hpp:20
libsnark::gadget< libff::Fr< ppT > >::pb
protoboard< libff::Fr< ppT > > & pb
Definition: gadget.hpp:19
libsnark::mnt_precompute_G1_gadget::precomp
mnt_G1_precomputation< ppT > & precomp
Definition: mnt_precomputation.hpp:64