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";
101 for (
size_t i = 0; i < s; ++i) {
105 prec_Q.
coeffs.emplace_back(c);
116 enter_block(
"Call to alt_bn128_final_exponentiation_first_chunk");
136 leave_block(
"Call to alt_bn128_final_exponentiation_first_chunk");
158 enter_block(
"Call to alt_bn128_final_exponentiation_last_chunk");
226 leave_block(
"Call to alt_bn128_final_exponentiation_last_chunk");
233 enter_block(
"Call to alt_bn128_final_exponentiation");
240 leave_block(
"Call to alt_bn128_final_exponentiation");
277 current.
X = A * (B - F);
279 current.
Y = G.
squared() - (E_squared + E_squared + E_squared);
314 current.
Y = E * (I - J) - (H * Y1);
327 enter_block(
"Call to alt_bn128_ate_precompute_G1");
336 leave_block(
"Call to alt_bn128_ate_precompute_G1");
342 enter_block(
"Call to alt_bn128_ate_precompute_G2");
361 bool found_one =
false;
364 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
365 const bool bit = loop_count.
test_bit(i);
373 result.
coeffs.push_back(c);
377 result.
coeffs.push_back(c);
392 result.
coeffs.push_back(c);
395 result.
coeffs.push_back(c);
397 leave_block(
"Call to alt_bn128_ate_precompute_G2");
409 bool found_one =
false;
416 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
417 const bool bit = loop_count.
test_bit(i);
459 enter_block(
"Call to alt_bn128_ate_double_miller_loop");
463 bool found_one =
false;
468 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
469 const bool bit = loop_count.
test_bit(i);
519 leave_block(
"Call to alt_bn128_ate_double_miller_loop");
538 enter_block(
"Call to alt_bn128_ate_reduced_pairing");
541 leave_block(
"Call to alt_bn128_ate_reduced_pairing");
void enter_block(const std::string &msg, const bool indent)
void to_affine_coordinates()
alt_bn128_Fq12 alt_bn128_exp_by_neg_z(const alt_bn128_Fq12 &elt)
static const Fp2_model< n, modulus > & one()
void doubling_step_for_flipped_miller_loop(const alt_bn128_Fq two_inv, alt_bn128_G2 ¤t, alt_bn128_ate_ell_coeffs &c)
alt_bn128_Fq12 alt_bn128_double_miller_loop(const alt_bn128_G1_precomp &prec_P1, const alt_bn128_G2_precomp &prec_Q1, const alt_bn128_G1_precomp &prec_P2, const alt_bn128_G2_precomp &prec_Q2)
alt_bn128_Fq12 alt_bn128_final_exponentiation_first_chunk(const alt_bn128_Fq12 &elt)
static Fp12_2over3over2_model< n, modulus > one()
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
alt_bn128_Fq12 alt_bn128_pairing(const alt_bn128_G1 &P, const alt_bn128_G2 &Q)
bool operator==(const alt_bn128_ate_G2_precomp &other) const
alt_bn128_G2 mul_by_q() const
void mixed_addition_step_for_flipped_miller_loop(const alt_bn128_G2 base, alt_bn128_G2 ¤t, alt_bn128_ate_ell_coeffs &c)
Fp12_2over3over2_model squared() const
default is squared_complex
alt_bn128_Fq2 alt_bn128_twist_coeff_b
alt_bn128_G1_precomp alt_bn128_precompute_G1(const alt_bn128_G1 &P)
Fp12_2over3over2_model Frobenius_map(unsigned long power) const
static constexpr size_t max_bits()
The number of bits representable by this bigint type.
bigint< alt_bn128_q_limbs > alt_bn128_final_exponent_z
alt_bn128_Fq12 alt_bn128_ate_double_miller_loop(const alt_bn128_ate_G1_precomp &prec_P1, const alt_bn128_ate_G2_precomp &prec_Q1, const alt_bn128_ate_G1_precomp &prec_P2, const alt_bn128_ate_G2_precomp &prec_Q2)
Fp12_2over3over2_model inverse() const
Fp12_2over3over2_model mul_by_024(const my_Fp2 &ell_0, const my_Fp2 &ell_VW, const my_Fp2 &ell_VV) const
alt_bn128_G2_precomp alt_bn128_precompute_G2(const alt_bn128_G2 &Q)
bool alt_bn128_final_exponent_is_z_neg
bool alt_bn128_ate_is_loop_count_neg
void consume_OUTPUT_SEPARATOR(std::istream &in)
alt_bn128_GT alt_bn128_reduced_pairing(const alt_bn128_G1 &P, const alt_bn128_G2 &Q)
Fp12_2over3over2_model unitary_inverse() const
Fp_model< alt_bn128_q_limbs, alt_bn128_modulus_q > alt_bn128_Fq
Fp12_2over3over2_model cyclotomic_exp(const bigint< m > &exponent) const
alt_bn128_GT alt_bn128_ate_reduced_pairing(const alt_bn128_G1 &P, const alt_bn128_G2 &Q)
alt_bn128_Fq12 alt_bn128_final_exponentiation_last_chunk(const alt_bn128_Fq12 &elt)
alt_bn128_ate_G2_precomp alt_bn128_ate_precompute_G2(const alt_bn128_G2 &Q)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
void to_affine_coordinates()
void consume_OUTPUT_NEWLINE(std::istream &in)
alt_bn128_Fq12 alt_bn128_ate_miller_loop(const alt_bn128_ate_G1_precomp &prec_P, const alt_bn128_ate_G2_precomp &prec_Q)
std::vector< alt_bn128_ate_ell_coeffs > coeffs
Fp2_model squared() const
default is squared_complex
void leave_block(const std::string &msg, const bool indent)
alt_bn128_Fq12 alt_bn128_ate_pairing(const alt_bn128_G1 &P, const alt_bn128_G2 &Q)
Fp12_2over3over2_model cyclotomic_squared() const
Fp12_2over3over2_model< alt_bn128_q_limbs, alt_bn128_modulus_q > alt_bn128_Fq12
bool operator==(const alt_bn128_ate_G1_precomp &other) const
alt_bn128_ate_G1_precomp alt_bn128_ate_precompute_G1(const alt_bn128_G1 &P)
bool test_bit(const std::size_t bitno) const
alt_bn128_Fq12 alt_bn128_miller_loop(const alt_bn128_G1_precomp &prec_P, const alt_bn128_G2_precomp &prec_Q)
void consume_newline(std::istream &in)
alt_bn128_GT alt_bn128_final_exponentiation(const alt_bn128_Fq12 &elt)
bigint< alt_bn128_q_limbs > alt_bn128_ate_loop_count
bool operator==(const alt_bn128_ate_ell_coeffs &other) const
alt_bn128_Fq2 alt_bn128_twist