Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
14 return (this->
PX == other.
PX && this->PY == other.
PY);
39 this->ell_VV == other.
ell_VV);
64 this->
QX == other.
QX && this->QY == other.
QY &&
72 out << prec_Q.
coeffs.size() <<
"\n";
94 for (
size_t i = 0; i < s; ++i) {
98 prec_Q.
coeffs.emplace_back(c);
119 enter_block(
"Call to bls12_377_final_exponentiation_first_chunk");
132 leave_block(
"Call to bls12_377_final_exponentiation_first_chunk");
154 enter_block(
"Call to bls12_377_final_exponentiation_last_chunk");
212 leave_block(
"Call to bls12_377_final_exponentiation_last_chunk");
225 enter_block(
"Call to bls12_377_final_exponentiation");
232 leave_block(
"Call to bls12_377_final_exponentiation");
276 current.
X = A * (B - F);
280 current.
Y = G.
squared() - (E_squared + E_squared + E_squared);
322 current.
X = lambda * H;
323 current.
Y = theta * (G - H) - I;
335 enter_block(
"Call to bls12_377_ate_precompute_G1");
344 leave_block(
"Call to bls12_377_ate_precompute_G1");
365 enter_block(
"Call to bls12_377_ate_precompute_G2");
384 bool found_one =
false;
387 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
388 const bool bit = loop_count.
test_bit(i);
396 result.
coeffs.push_back(c);
400 result.
coeffs.push_back(c);
404 leave_block(
"Call to bls12_377_ate_precompute_G2");
416 bool found_one =
false;
431 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
432 const bool bit = loop_count.
test_bit(i);
459 std::cout <<
"[DEBUG] NB_DOUBLE (Should be 63): " << nb_double
460 <<
" NB_ADD (Should be 7): " << nb_add << std::endl;
471 enter_block(
"Call to bls12_377_ate_double_miller_loop");
475 bool found_one =
false;
480 for (
long i = loop_count.
max_bits(); i >= 0; --i) {
481 const bool bit = loop_count.
test_bit(i);
514 leave_block(
"Call to bls12_377_ate_double_miller_loop");
533 enter_block(
"Call to bls12_377_ate_reduced_pairing");
536 leave_block(
"Call to bls12_377_ate_reduced_pairing");
bls12_377_Fq12 bls12_377_miller_loop(const bls12_377_G1_precomp &prec_P, const bls12_377_G2_precomp &prec_Q)
void bls12_377_doubling_step_for_miller_loop(const bls12_377_Fq two_inv, bls12_377_G2 ¤t, bls12_377_ate_ell_coeffs &c)
bls12_377_Fq12 bls12_377_ate_miller_loop(const bls12_377_ate_G1_precomp &prec_P, const bls12_377_ate_G2_precomp &prec_Q)
bls12_377_Fq12 bls12_377_final_exponentiation_last_chunk(const bls12_377_Fq12 &elt)
bls12_377_Fq12 bls12_377_pairing(const bls12_377_G1 &P, const bls12_377_G2 &Q)
void enter_block(const std::string &msg, const bool indent)
bool operator==(const bls12_377_ate_G2_precomp &other) const
bls12_377_G2_precomp bls12_377_precompute_G2(const bls12_377_G2 &Q)
bls12_377_GT bls12_377_reduced_pairing(const bls12_377_G1 &P, const bls12_377_G2 &Q)
bool bls12_377_final_exponent_is_z_neg
static const Fp2_model< n, modulus > & one()
bigint< bls12_377_q_limbs > bls12_377_ate_loop_count
bigint< bls12_377_q_limbs > bls12_377_final_exponent_z
static Fp12_2over3over2_model< n, modulus > one()
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
Fp_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq
bls12_377_Fq2 bls12_377_twist_coeff_b
Fp12_2over3over2_model squared() const
default is squared_complex
bls12_377_Fq12 bls12_377_ate_pairing(const bls12_377_G1 &P, const bls12_377_G2 &Q)
bool operator==(const bls12_377_ate_G1_precomp &other) const
void to_affine_coordinates()
bls12_377_G1_precomp bls12_377_precompute_G1(const bls12_377_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.
void to_affine_coordinates()
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
void consume_OUTPUT_SEPARATOR(std::istream &in)
Fp12_2over3over2_model unitary_inverse() const
bls12_377_GT bls12_377_ate_reduced_pairing(const bls12_377_G1 &P, const bls12_377_G2 &Q)
Fp12_2over3over2_model cyclotomic_exp(const bigint< m > &exponent) const
void bls12_377_mixed_addition_step_for_miller_loop(const bls12_377_G2 &base, bls12_377_G2 ¤t, bls12_377_ate_ell_coeffs &c)
bls12_377_Fq12 bls12_377_final_exponentiation_first_chunk(const bls12_377_Fq12 &elt)
bls12_377_Fq2 bls12_377_twist
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
bool operator==(const bls12_377_ate_ell_coeffs &other) const
void consume_OUTPUT_NEWLINE(std::istream &in)
bls12_377_GT bls12_377_final_exponentiation(const bls12_377_Fq12 &elt)
Fp2_model squared() const
default is squared_complex
void leave_block(const std::string &msg, const bool indent)
Fp12_2over3over2_model cyclotomic_squared() const
bool test_bit(const std::size_t bitno) const
bls12_377_ate_G2_precomp bls12_377_ate_precompute_G2(const bls12_377_G2 &Q)
std::vector< bls12_377_ate_ell_coeffs > coeffs
bls12_377_ate_G1_precomp bls12_377_ate_precompute_G1(const bls12_377_G1 &P)
bls12_377_Fq12 bls12_377_ate_double_miller_loop(const bls12_377_ate_G1_precomp &prec_P1, const bls12_377_ate_G2_precomp &prec_Q1, const bls12_377_ate_G1_precomp &prec_P2, const bls12_377_ate_G2_precomp &prec_Q2)
void consume_newline(std::istream &in)
bls12_377_Fq12 bls12_377_double_miller_loop(const bls12_377_G1_precomp &prec_P1, const bls12_377_G2_precomp &prec_Q1, const bls12_377_G1_precomp &prec_P2, const bls12_377_G2_precomp &prec_Q2)
bls12_377_Fq12 bls12_377_exp_by_z(const bls12_377_Fq12 &elt)