Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
Go to the documentation of this file.
15 #ifndef WEIERSTRASS_G2_GADGET_HPP_
16 #define WEIERSTRASS_G2_GADGET_HPP_
23 #include <libff/algebra/curves/public_params.hpp>
24 #include <libff/algebra/fields/fp2.hpp>
35 typedef libff::Fqe<other_curve<ppT>>
FqeT;
36 typedef libff::Fqk<other_curve<ppT>>
FqkT;
38 std::shared_ptr<Fqe_variable<ppT>>
X;
39 std::shared_ptr<Fqe_variable<ppT>>
Y;
70 template<
typename ppT>
100 typedef libff::Fqe<other_curve<ppT>>
FqeT;
101 typedef libff::Fqk<other_curve<ppT>>
FqkT;
204 template<
typename wppT>
229 void generate_fpe_equality_constraints(
235 template<
typename wppT, mp_
size_t scalarLimbs>
237 libff::G2<other_curve<wppT>>,
241 libff::bigint<scalarLimbs>>;
243 template<
typename wppT>
247 template<
typename wppT>
250 libff::G2<other_curve<wppT>>,
254 template<
typename wppT>
258 libff::G2<other_curve<wppT>>,
262 template<
typename wppT>
265 libff::G2<other_curve<wppT>>,
270 template<
typename wppT>
274 libff::G2<other_curve<wppT>>,
279 template<
typename wppT>
282 libff::G2<other_curve<wppT>>,
286 template<
typename wppT>
289 libff::G2<other_curve<wppT>>,
299 #endif // WEIERSTRASS_G2_GADGET_HPP_
G2_variable< wppT > result
Fqe_mul_gadget< wppT > Bx_constraint
std::shared_ptr< Fqe_variable< ppT > > Ysquared
void generate_r1cs_constraints()
libff::Fqk< other_curve< ppT > > FqkT
Fqe_mul_gadget< wppT > Ax_squared_constraint
G2_checker_gadget(protoboard< FieldT > &pb, const G2_variable< ppT > &Q, const std::string &annotation_prefix)
void generate_r1cs_witness()
G2_variable(protoboard< FieldT > &pb, const std::string &annotation_prefix)
libff::G2< other_curve< ppT > > get_element() const
std::shared_ptr< Fqe_variable< ppT > > Xsquared_plus_a
Fqe_mul_gadget< wppT > lambda_constraint
const std::string annotation_prefix
Gadget that represents a G2 variable.
G2_variable operator-() const
Fqe_mul_gadget< wppT > lambda_constraint
const G2_variable< ppT > one_case
std::shared_ptr< Fqe_mul_gadget< ppT > > curve_equation
static size_t __attribute__((noinline)) size_in_bits()
static size_t num_variables()
std::shared_ptr< Fqe_variable< ppT > > Ysquared_minus_b
void generate_r1cs_constraints()
Fqe_mul_gadget< wppT > Rx_constraint
std::shared_ptr< Fqe_variable< ppT > > Y
protoboard< libff::Fr< ppT > > & pb
Fqe_variable< wppT > lambda
const pb_linear_combination< Field > selector
libff::Fqe< other_curve< ppT > > FqeT
G2_add_gadget(protoboard< libff::Fr< wppT >> &pb, const G2_variable< wppT > &A, const G2_variable< wppT > &B, const G2_variable< wppT > &result, const std::string &annotation_prefix)
G2_variable< ppT > result
void generate_r1cs_witness()
libff::Fqk< other_curve< ppT > > FqkT
Fqe_mul_gadget< wppT > By_constraint
std::shared_ptr< Fqe_sqr_gadget< ppT > > compute_Xsquared
void generate_r1cs_constraints()
void generate_r1cs_witness()
std::shared_ptr< Fqe_variable< ppT > > Xsquared
std::shared_ptr< Fqe_variable< ppT > > X
typename pairing_selector< ppT >::Fqe_mul_gadget_type Fqe_mul_gadget
Fqe_variable< wppT > lambda
Selector gadget for variable_or_identity.
typename pairing_selector< ppT >::Fqe_mul_by_lc_gadget_type Fqe_mul_by_lc_gadget
libff::Fqe< other_curve< ppT > > FqeT
G2_dbl_gadget(protoboard< libff::Fr< wppT >> &pb, const G2_variable< wppT > &A, const G2_variable< wppT > &result, const std::string &annotation_prefix)
G2_variable< wppT > result
void generate_r1cs_witness()
G2_equality_gadget(protoboard< libff::Fr< wppT >> &pb, const G2_variable< wppT > &A, const G2_variable< wppT > &B, const std::string &annotation_prefix)
typename pairing_selector< ppT >::Fqe_variable_type Fqe_variable
Gadget that creates constraints for the validity of a G2 variable.
typename pairing_selector< ppT >::other_curve_type other_curve
Fqe_mul_gadget< wppT > Ry_constraint
void generate_r1cs_witness(const libff::G2< other_curve< ppT >> &Q)
Gadget to add 2 G2 points.
pb_linear_combination_array< FieldT > all_vars
void generate_r1cs_witness()
void generate_r1cs_constraints()
Fqe_mul_by_lc_gadget< ppT > mul_select_X
Fqe_mul_by_lc_gadget< ppT > mul_select_Y
G2_variable_selector_gadget(protoboard< Field > &pb, const pb_linear_combination< Field > &selector, const G2_variable< ppT > &zero_case, const G2_variable< ppT > &one_case, const G2_variable< ppT > &result, const std::string &annotation_prefix)
Check equality of 2 G2 points.
void generate_r1cs_constraints()
const G2_variable< ppT > zero_case
std::shared_ptr< Fqe_sqr_gadget< ppT > > compute_Ysquared
Selector gadget for a variable_or_identity, and a variable.