Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
21 return (this->
PX == other.
PX && this->PY == other.
PY);
46 this->ell_VV == other.
ell_VV);
71 this->
QX == other.
QX && this->QY == other.
QY &&
79 out << prec_Q.
coeffs.size() <<
"\n";
102 for (
size_t i = 0; i < s; ++i) {
106 prec_Q.
coeffs.emplace_back(c);
117 enter_block(
"Call to bls12_381_final_exponentiation_first_chunk");
137 leave_block(
"Call to bls12_381_final_exponentiation_first_chunk");
159 enter_block(
"Call to bls12_381_final_exponentiation_last_chunk");
210 leave_block(
"Call to bls12_381_final_exponentiation_last_chunk");
217 enter_block(
"Call to bls12_381_final_exponentiation");
224 leave_block(
"Call to bls12_381_final_exponentiation");
261 current.
X = A * (B - F);
263 current.
Y = G.
squared() - (E_squared + E_squared + E_squared);
298 current.
Y = E * (I - J) - (H * Y1);
302 c.
ell_0 = E * x2 - D * y2;
311 enter_block(
"Call to bls12_381_ate_precompute_G1");
320 leave_block(
"Call to bls12_381_ate_precompute_G1");
326 enter_block(
"Call to bls12_381_ate_precompute_G2");
345 bool found_one =
false;
348 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
349 const bool bit = loop_count.
test_bit(i);
357 result.
coeffs.push_back(c);
361 result.
coeffs.push_back(c);
365 leave_block(
"Call to bls12_381_ate_precompute_G2");
377 bool found_one =
false;
384 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
385 const bool bit = loop_count.
test_bit(i);
421 enter_block(
"Call to bls12_381_ate_double_miller_loop");
425 bool found_one =
false;
430 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
431 const bool bit = loop_count.
test_bit(i);
469 leave_block(
"Call to bls12_381_ate_double_miller_loop");
488 enter_block(
"Call to bls12_381_ate_reduced_pairing");
491 leave_block(
"Call to bls12_381_ate_reduced_pairing");
bls12_381_Fq12 bls12_381_double_miller_loop(const bls12_381_G1_precomp &prec_P1, const bls12_381_G2_precomp &prec_Q1, const bls12_381_G1_precomp &prec_P2, const bls12_381_G2_precomp &prec_Q2)
bool bls12_381_ate_is_loop_count_neg
bigint< bls12_381_q_limbs > bls12_381_final_exponent_z
bls12_381_Fq12 bls12_381_ate_pairing(const bls12_381_G1 &P, const bls12_381_G2 &Q)
bigint< bls12_381_q_limbs > bls12_381_ate_loop_count
bls12_381_GT bls12_381_ate_reduced_pairing(const bls12_381_G1 &P, const bls12_381_G2 &Q)
void enter_block(const std::string &msg, const bool indent)
static const Fp2_model< n, modulus > & one()
bls12_381_Fq2 bls12_381_twist_coeff_b
Fp_model< bls12_381_q_limbs, bls12_381_modulus_q > bls12_381_Fq
bls12_381_Fq12 bls12_381_final_exponentiation_last_chunk(const bls12_381_Fq12 &elt)
static Fp12_2over3over2_model< n, modulus > one()
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
std::vector< bls12_381_ate_ell_coeffs > coeffs
bls12_381_Fq12 bls12_381_ate_miller_loop(const bls12_381_ate_G1_precomp &prec_P, const bls12_381_ate_G2_precomp &prec_Q)
Fp12_2over3over2_model squared() const
default is squared_complex
bool operator==(const bls12_381_ate_G1_precomp &other) const
bls12_381_Fq12 bls12_381_exp_by_z(const bls12_381_Fq12 &elt)
Fp12_2over3over2_model Frobenius_map(unsigned long power) const
static constexpr size_t max_bits()
The number of bits representable by this bigint type.
void bls12_381_doubling_step_for_miller_loop(const bls12_381_Fq two_inv, bls12_381_G2 ¤t, bls12_381_ate_ell_coeffs &c)
Fp12_2over3over2_model inverse() const
void bls12_381_mixed_addition_step_for_miller_loop(const bls12_381_G2 base, bls12_381_G2 ¤t, bls12_381_ate_ell_coeffs &c)
bool operator==(const bls12_381_ate_G2_precomp &other) const
bool operator==(const bls12_381_ate_ell_coeffs &other) const
bls12_381_Fq12 bls12_381_final_exponentiation_first_chunk(const bls12_381_Fq12 &elt)
void consume_OUTPUT_SEPARATOR(std::istream &in)
void to_affine_coordinates()
Fp12_2over3over2_model unitary_inverse() const
Fp12_2over3over2_model cyclotomic_exp(const bigint< m > &exponent) const
bls12_381_ate_G1_precomp bls12_381_ate_precompute_G1(const bls12_381_G1 &P)
bls12_381_Fq12 bls12_381_pairing(const bls12_381_G1 &P, const bls12_381_G2 &Q)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
void consume_OUTPUT_NEWLINE(std::istream &in)
bls12_381_GT bls12_381_reduced_pairing(const bls12_381_G1 &P, const bls12_381_G2 &Q)
bls12_381_G2_precomp bls12_381_precompute_G2(const bls12_381_G2 &Q)
Fp2_model squared() const
default is squared_complex
bls12_381_G1_precomp bls12_381_precompute_G1(const bls12_381_G1 &P)
void leave_block(const std::string &msg, const bool indent)
bls12_381_ate_G2_precomp bls12_381_ate_precompute_G2(const bls12_381_G2 &Q)
Fp12_2over3over2_model< bls12_381_q_limbs, bls12_381_modulus_q > bls12_381_Fq12
Fp12_2over3over2_model cyclotomic_squared() const
bls12_381_Fq12 bls12_381_ate_double_miller_loop(const bls12_381_ate_G1_precomp &prec_P1, const bls12_381_ate_G2_precomp &prec_Q1, const bls12_381_ate_G1_precomp &prec_P2, const bls12_381_ate_G2_precomp &prec_Q2)
Fp12_2over3over2_model mul_by_045(const my_Fp2 &ell_0, const my_Fp2 &ell_VW, const my_Fp2 &ell_VV) const
bls12_381_Fq2 bls12_381_twist
bool test_bit(const std::size_t bitno) const
bls12_381_Fq12 bls12_381_miller_loop(const bls12_381_G1_precomp &prec_P, const bls12_381_G2_precomp &prec_Q)
bool bls12_381_final_exponent_is_z_neg
void consume_newline(std::istream &in)
bls12_381_GT bls12_381_final_exponentiation(const bls12_381_Fq12 &elt)
void to_affine_coordinates()