| 
    Clearmatics Libsnark
    0.1
    
   C++ library for zkSNARK proofs 
   | 
 
 
 
 
Go to the documentation of this file.
   15 #ifndef FP6_GADGETS_HPP_ 
   16 #define FP6_GADGETS_HPP_ 
   28 template<
typename Fp6T>
 
   33     typedef typename Fp6T::my_Fpe 
Fp3T;
 
   59 template<
typename Fp6T>
 
   64     typedef typename Fp6T::my_Fpe 
Fp3T;
 
   79     std::shared_ptr<Fp3_variable<Fp3T>> 
v0;
 
   80     std::shared_ptr<Fp3_variable<Fp3T>> 
v1;
 
  110 template<
typename Fp6T>
 
  115     typedef typename Fp6T::my_Fpe 
Fp3T;
 
  130     std::shared_ptr<Fp3_variable<Fp3T>> 
v0;
 
  131     std::shared_ptr<Fp3_variable<Fp3T>> 
v1;
 
  159 template<
typename Fp6T>
 
  168     std::shared_ptr<Fp6_2over3_mul_gadget<Fp6T>> 
mul;
 
  182 template<
typename Fp6T>
 
  187     typedef typename Fp6T::my_Fp2 
Fp2T;
 
  192     std::shared_ptr<Fp2_variable<Fp2T>> 
a;
 
  193     std::shared_ptr<Fp2_variable<Fp2T>> 
b;
 
  194     std::shared_ptr<Fp2_variable<Fp2T>> 
c;
 
  205     std::shared_ptr<Fp2_variable<Fp2T>> 
asq;
 
  206     std::shared_ptr<Fp2_variable<Fp2T>> 
bsq;
 
  207     std::shared_ptr<Fp2_variable<Fp2T>> 
csq;
 
  226 #endif // FP6_GADGETS_HPP_ 
  
pb_linear_combination< FieldT > Ac0_plus_Ac1_c0
 
std::shared_ptr< Fp2_variable< Fp2T > > csq
 
pb_linear_combination< FieldT > asq_c1
 
Fp6_2over3_variable< Fp6T > B
 
Fp6_2over3_variable< Fp6T > result
 
const std::string annotation_prefix
 
pb_linear_combination< FieldT > v0_c1
 
std::shared_ptr< Fp3_variable< Fp3T > > Bc0_plus_Bc1
 
std::shared_ptr< Fp3_variable< Fp3T > > v0
 
std::shared_ptr< Fp2_variable< Fp2T > > a
 
Fp6_2over3_variable< Fp6T > B
 
std::shared_ptr< Fp2_variable< Fp2T > > b
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c0
 
void generate_r1cs_constraints()
 
protoboard< Fp6T::my_Fp > & pb
 
void generate_r1cs_constraints()
 
std::shared_ptr< Fp3_variable< Fp3T > > v1
 
pb_linear_combination< FieldT > v0_c1
 
std::shared_ptr< Fp3_mul_gadget< Fp3T > > compute_v0
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c1
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c0
 
Fp6_2over3_variable< Fp6T > A
 
std::shared_ptr< Fp3_mul_gadget< Fp3T > > compute_v1
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c0
 
pb_linear_combination< FieldT > Ac0_plus_Ac1_c1
 
pb_linear_combination< FieldT > csq_c0
 
void generate_r1cs_constraints()
 
std::shared_ptr< Fp3_variable< Fp3T > > Ac0_plus_Ac1
 
std::shared_ptr< Fp3_variable< Fp3T > > Bc0_plus_Bc1
 
pb_linear_combination< FieldT > bsq_c1
 
Fp6_2over3_variable< Fp6T > A
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c2
 
void generate_r1cs_witness()
 
std::shared_ptr< Fp3_mul_gadget< Fp3T > > compute_result_c1
 
std::shared_ptr< Fp3_variable< Fp3T > > v1
 
Fp6_2over3_mul_gadget(protoboard< FieldT > &pb, const Fp6_2over3_variable< Fp6T > &A, const Fp6_2over3_variable< Fp6T > &B, const Fp6_2over3_variable< Fp6T > &result, const std::string &annotation_prefix)
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c1
 
Fp6_2over3_variable(protoboard< FieldT > &pb, const std::string &annotation_prefix)
 
void generate_r1cs_equals_const_constraints(const Fp6T &el)
 
Fp6_2over3_variable< Fp6T > result
 
Fp6_2over3_variable< Fp6T > result
 
std::shared_ptr< Fp2_sqr_gadget< Fp2T > > compute_csq
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c1
 
std::shared_ptr< Fp2_variable< Fp2T > > bsq
 
Fp6_2over3_mul_by_2345_gadget(protoboard< FieldT > &pb, const Fp6_2over3_variable< Fp6T > &A, const Fp6_2over3_variable< Fp6T > &B, const Fp6_2over3_variable< Fp6T > &result, const std::string &annotation_prefix)
 
std::shared_ptr< Fp3_variable< Fp3T > > result_c1_plus_v0_plus_v1
 
FElem power(const FElem &base, long exponent)
 
pb_linear_combination< FieldT > Ac0_plus_Ac1_c0
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c1
 
pb_linear_combination< FieldT > Ac0_plus_Ac1_c2
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c2
 
pb_linear_combination< FieldT > v0_c2
 
std::shared_ptr< Fp2_sqr_gadget< Fp2T > > compute_asq
 
void generate_r1cs_witness()
 
pb_linear_combination< FieldT > csq_c1
 
pb_linear_combination< FieldT > v0_c2
 
std::shared_ptr< Fp3_mul_gadget< Fp3T > > compute_result_c1
 
Fp6_2over3_variable< Fp6T > Frobenius_map(const size_t power) const
 
void generate_r1cs_constraints()
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c2
 
std::shared_ptr< Fp3_variable< Fp3T > > Ac0_plus_Ac1
 
std::shared_ptr< Fp6_2over3_mul_gadget< Fp6T > > mul
 
Fp6_2over3_variable< Fp6T > A
 
pb_linear_combination< FieldT > v0_c0
 
Fp6_2over3_sqr_gadget(protoboard< FieldT > &pb, const Fp6_2over3_variable< Fp6T > &A, const Fp6_2over3_variable< Fp6T > &result, const std::string &annotation_prefix)
 
void generate_r1cs_witness()
 
std::shared_ptr< Fp2_sqr_gadget< Fp2T > > compute_bsq
 
Fp6_2over3_variable< Fp6T > result
 
void generate_r1cs_witness()
 
std::shared_ptr< Fp2_variable< Fp2T > > c
 
pb_linear_combination< FieldT > result_c1_plus_v0_plus_v1_c0
 
pb_linear_combination< FieldT > asq_c0
 
std::shared_ptr< Fp2_variable< Fp2T > > asq
 
std::shared_ptr< Fp3_variable< Fp3T > > v0
 
std::shared_ptr< Fp3_mul_gadget< Fp3T > > compute_v1
 
pb_linear_combination< FieldT > Bc0_plus_Bc1_c2
 
pb_linear_combination< FieldT > Ac0_plus_Ac1_c2
 
pb_linear_combination< FieldT > v0_c0
 
pb_linear_combination< FieldT > bsq_c0
 
pb_linear_combination< FieldT > Ac0_plus_Ac1_c1
 
void generate_r1cs_witness(const Fp6T &el)
 
Fp6_2over3_cyclotomic_sqr_gadget(protoboard< FieldT > &pb, const Fp6_2over3_variable< Fp6T > &A, const Fp6_2over3_variable< Fp6T > &result, const std::string &annotation_prefix)
 
Fp6_2over3_variable< Fp6T > A
 
std::shared_ptr< Fp3_variable< Fp3T > > result_c1_plus_v0_plus_v1