Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <fp6_3over2_gadgets.hpp>
Public Types | |
using | FieldT = typename Fp6T::my_Fp |
using | Fp2T = typename Fp6T::my_Fp2 |
Public Member Functions | |
Fp6_3over2_mul_gadget (protoboard< FieldT > &pb, const Fp6_3over2_variable< Fp6T > &A, const Fp6_3over2_variable< Fp6T > &B, const Fp6_3over2_variable< Fp6T > &result, const std::string &annotation_prefix) | |
void | generate_r1cs_constraints () |
void | generate_r1cs_witness () |
![]() | |
gadget (protoboard< Fp6T::my_Fp > &pb, const std::string &annotation_prefix) | |
Public Attributes | |
Fp6_3over2_variable< Fp6T > | _A |
Fp6_3over2_variable< Fp6T > | _B |
Fp6_3over2_variable< Fp6T > | _result |
Fp2_mul_gadget< Fp2T > | _compute_v1 |
Fp2_mul_gadget< Fp2T > | _compute_v2 |
Fp2_mul_gadget< Fp2T > | _compute_a1a2_times_b1b2 |
Fp2_mul_gadget< Fp2T > | _compute_v0 |
Fp2_mul_gadget< Fp2T > | _compute_a0a1_times_b0b1 |
Fp2_mul_gadget< Fp2T > | _compute_a0a2_times_b0b2 |
Additional Inherited Members | |
![]() | |
protoboard< Fp6T::my_Fp > & | pb |
const std::string | annotation_prefix |
Follows implementation in libff::Fp6_3over2_model, based on Devegili OhEig Scott Dahab "Multiplication and Squaring on Pairing-Friendly Fields"; Section 4 (Karatsuba).
For elements a=(a0, a1, a2) and b=(b0, b1, b2) in Fp6, c=a*b can be written as:
c = ( v0 + non_residue*((a1 + a2)(b1 + b2) - v1 - v2), (a0 + a1)(b0 + b1) - v0 - v1 + non_residue * v2, (a0 + a2)(b0 + b2) - v0 - v2 + v1)
where v0 = a0*b0 v1 = a1*b1 v2 = a2*b2 and non_residue is the element in Fp2 in the function v^3 - non_residue used to define Fp6.
Definition at line 85 of file fp6_3over2_gadgets.hpp.
using libsnark::Fp6_3over2_mul_gadget< Fp6T >::FieldT = typename Fp6T::my_Fp |
Definition at line 88 of file fp6_3over2_gadgets.hpp.
using libsnark::Fp6_3over2_mul_gadget< Fp6T >::Fp2T = typename Fp6T::my_Fp2 |
Definition at line 89 of file fp6_3over2_gadgets.hpp.
libsnark::Fp6_3over2_mul_gadget< Fp6T >::Fp6_3over2_mul_gadget | ( | protoboard< FieldT > & | pb, |
const Fp6_3over2_variable< Fp6T > & | A, | ||
const Fp6_3over2_variable< Fp6T > & | B, | ||
const Fp6_3over2_variable< Fp6T > & | result, | ||
const std::string & | annotation_prefix | ||
) |
void libsnark::Fp6_3over2_mul_gadget< Fp6T >::generate_r1cs_constraints | ( | ) |
void libsnark::Fp6_3over2_mul_gadget< Fp6T >::generate_r1cs_witness | ( | ) |
Fp6_3over2_variable<Fp6T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_A |
Definition at line 91 of file fp6_3over2_gadgets.hpp.
Fp6_3over2_variable<Fp6T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_B |
Definition at line 92 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_a0a1_times_b0b1 |
Definition at line 104 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_a0a2_times_b0b2 |
Definition at line 105 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_a1a2_times_b1b2 |
Definition at line 102 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_v0 |
Definition at line 103 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_v1 |
Definition at line 100 of file fp6_3over2_gadgets.hpp.
Fp2_mul_gadget<Fp2T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_compute_v2 |
Definition at line 101 of file fp6_3over2_gadgets.hpp.
Fp6_3over2_variable<Fp6T> libsnark::Fp6_3over2_mul_gadget< Fp6T >::_result |
Definition at line 93 of file fp6_3over2_gadgets.hpp.