Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <fp12_2over3over2_gadgets.hpp>
Public Types | |
using | FieldT = typename Fp12T::my_Fp |
using | Fp6T = typename Fp12T::my_Fp6 |
Public Member Functions | |
Fp12_2over3over2_square_gadget (protoboard< FieldT > &pb, const Fp12_2over3over2_variable< Fp12T > &A, const Fp12_2over3over2_variable< Fp12T > &result, const std::string &annotation_prefix) | |
const Fp12_2over3over2_variable< Fp12T > & | result () const |
void | generate_r1cs_constraints () |
void | generate_r1cs_witness () |
![]() | |
gadget (protoboard< Fp12T::my_Fp > &pb, const std::string &annotation_prefix) | |
Public Attributes | |
Fp12_2over3over2_variable< Fp12T > | _A |
Fp12_2over3over2_variable< Fp12T > | _result |
Fp6_3over2_mul_gadget< Fp6T > | _compute_alpha |
Fp6_3over2_mul_gadget< Fp6T > | _compute_beta |
Additional Inherited Members | |
![]() | |
protoboard< Fp12T::my_Fp > & | pb |
const std::string | annotation_prefix |
Follows implementation in libff::Fp12_2over3over2_model, which is based on Section 3 of [DOSD06].
Let (a0, a1) = a0 + a1 * w be an element of Fp12, where a0, a1 in Fp6 and w = v^2 for v in Fp6. By simple expansion of terms: (a0, a1)^2 = (a0^2 + a1^2 * v, 2 * a0 * a1) However, since a0^2 + a1^2 * v = (a0 + a1)*(a0 + a1 * v) - (a0 * a1) * v - a0 * a1, it follows that (a0, a1)^2 can be computed with just 2 full multiplications in Fp6. (Note that multiplications by v are free in an arithmetic circuit - see mul_by_non_residue).
Definition at line 92 of file fp12_2over3over2_gadgets.hpp.
using libsnark::Fp12_2over3over2_square_gadget< Fp12T >::FieldT = typename Fp12T::my_Fp |
Definition at line 95 of file fp12_2over3over2_gadgets.hpp.
using libsnark::Fp12_2over3over2_square_gadget< Fp12T >::Fp6T = typename Fp12T::my_Fp6 |
Definition at line 96 of file fp12_2over3over2_gadgets.hpp.
libsnark::Fp12_2over3over2_square_gadget< Fp12T >::Fp12_2over3over2_square_gadget | ( | protoboard< FieldT > & | pb, |
const Fp12_2over3over2_variable< Fp12T > & | A, | ||
const Fp12_2over3over2_variable< Fp12T > & | result, | ||
const std::string & | annotation_prefix | ||
) |
void libsnark::Fp12_2over3over2_square_gadget< Fp12T >::generate_r1cs_constraints | ( | ) |
void libsnark::Fp12_2over3over2_square_gadget< Fp12T >::generate_r1cs_witness | ( | ) |
const Fp12_2over3over2_variable<Fp12T>& libsnark::Fp12_2over3over2_square_gadget< Fp12T >::result | ( | ) | const |
Fp12_2over3over2_variable<Fp12T> libsnark::Fp12_2over3over2_square_gadget< Fp12T >::_A |
Definition at line 110 of file fp12_2over3over2_gadgets.hpp.
Fp6_3over2_mul_gadget<Fp6T> libsnark::Fp12_2over3over2_square_gadget< Fp12T >::_compute_alpha |
Definition at line 112 of file fp12_2over3over2_gadgets.hpp.
Fp6_3over2_mul_gadget<Fp6T> libsnark::Fp12_2over3over2_square_gadget< Fp12T >::_compute_beta |
Definition at line 113 of file fp12_2over3over2_gadgets.hpp.
Fp12_2over3over2_variable<Fp12T> libsnark::Fp12_2over3over2_square_gadget< Fp12T >::_result |
Definition at line 111 of file fp12_2over3over2_gadgets.hpp.