21 this->c_XY == other.c_XY &&
22 this->c_XZ == other.c_XZ);
43 out << prec_P.size() <<
"\n";
62 for (
size_t i = 0; i <
s; ++i)
67 prec_P.emplace_back(cc);
75 return (this->
y0 == other.
y0 &&
76 this->eta == other.eta);
96 this->c_XY == other.c_XY &&
97 this->c_XZ == other.c_XZ);
118 out << prec_Q.size() <<
"\n";
138 for (
size_t i = 0; i <
s; ++i)
143 prec_Q.emplace_back(cc);
152 this->P_XZ == other.P_XZ &&
153 this->P_ZZplusYZ == other.P_ZZplusYZ);
173 enter_block(
"Call to edwards_final_exponentiation_last_chunk");
184 leave_block(
"Call to edwards_final_exponentiation_last_chunk");
191 enter_block(
"Call to edwards_final_exponentiation_first_chunk");
198 const edwards_Fq6 elt_q3_over_elt = elt_q3 * elt_inv;
203 leave_block(
"Call to edwards_final_exponentiation_first_chunk");
209 enter_block(
"Call to edwards_final_exponentiation");
214 leave_block(
"Call to edwards_final_exponentiation");
240 printf(
"extended edwards_G1 projective X/Y/Z/T:\n");
256 const edwards_Fq &
X = current.X, &Y = current.Y, &Z = current.Z, &
T = current.T;
282 current.test_invariant();
290 const edwards_Fq &X1 = current.X, &Y1 = current.Y, &Z1 = current.Z, &T1 = current.T;
291 const edwards_Fq &X2 = base.X, &Y2 = base.Y, &Z2 = base.Z, &T2 = base.T;
303 cc.
c_ZZ = (T1-X1)*(T2+X2)-I+
A;
304 cc.
c_XY = X1*Z2-X2*Z1+F;
305 cc.
c_XZ = (Y1-T1)*(Y2+T2)-
B+I-H;
312 current.test_invariant();
320 const edwards_Fq &X1 = current.X, &Y1 = current.Y, &Z1 = current.Z, &T1 = current.T;
321 const edwards_Fq &X2 = base.X, &Y2 = base.Y, &T2 = base.T;
333 cc.
c_ZZ = (T1-X1)*(T2+X2)-I+
A;
334 cc.
c_XY = X1-X2*Z1+F;
335 cc.
c_XZ = (Y1-T1)*(Y2+T2)-
B+I-H;
342 current.test_invariant();
358 P_ext.
T = Pcopy.
X*Pcopy.
Y;
362 bool found_one =
false;
378 result.push_back(cc);
383 result.push_back(cc);
398 bool found_one =
false;
416 f =
f.squared() * g_RR_at_Q;
443 enter_block(
"Call to edwards_tate_reduced_pairing");
446 leave_block(
"Call to edwards_tate_reduce_pairing");
458 printf(
"extended edwards_G2 projective X/Y/Z/T:\n");
474 const edwards_Fq3 &
X = current.X, &Y = current.Y, &Z = current.Z, &
T = current.T;
504 current.test_invariant();
512 const edwards_Fq3 &X1 = current.X, &Y1 = current.Y, &Z1 = current.Z, &T1 = current.T;
513 const edwards_Fq3 &X2 = base.X, &Y2 = base.Y, &Z2 = base.Z, &T2 = base.T;
529 cc.
c_XY = X1*Z2-X2*Z1+F;
530 cc.
c_XZ = (Y1-T1)*(Y2+T2)-
B+I-H;
537 current.test_invariant();
545 const edwards_Fq3 &X1 = current.X, &Y1 = current.Y, &Z1 = current.Z, &T1 = current.T;
546 const edwards_Fq3 &X2 = base.X, &Y2 = base.Y, &T2 = base.T;
561 cc.
c_XY = X1-X2*Z1+F;
562 cc.
c_XZ = (Y1-T1)*(Y2+T2)-
B+I-H;
569 current.test_invariant();
579 result.P_XY = Pcopy.
X*Pcopy.
Y;
580 result.P_XZ = Pcopy.
X;
599 Q_ext.
T = Qcopy.
X*Qcopy.
Y;
603 bool found_one =
false;
604 for (
long i = loop_count.
max_bits()-1; i >= 0; --i)
616 result.push_back(cc);
620 result.push_back(cc);
636 bool found_one =
false;
638 for (
long i = loop_count.
max_bits()-1; i >= 0; --i)
655 f =
f.squared() * g_RR_at_P;
674 enter_block(
"Call to edwards_ate_double_miller_loop");
679 bool found_one =
false;
681 for (
long i = loop_count.
max_bits()-1; i >= 0; --i)
703 f =
f.squared() * g_RR_at_P1 * g_RR_at_P2;
714 f =
f * g_RQ_at_P1 * g_RQ_at_P2;
717 leave_block(
"Call to edwards_ate_double_miller_loop");
734 enter_block(
"Call to edwards_ate_reduced_pairing");
737 leave_block(
"Call to edwards_ate_reduced_pairing");
Fp3_model inverse() const
Fp3_model squared() const
Fp6_2over3_model inverse() const
Fp6_2over3_model cyclotomic_exp(const bigint< m > &exponent) const
static Fp6_2over3_model< n, modulus > one()
static my_Fp3 mul_by_non_residue(const my_Fp3 &elem)
Fp6_2over3_model Frobenius_map(unsigned long power) const
static Fp_model< n, modulus > one()
bool test_bit(const std::size_t bitno) const
void to_affine_coordinates()
static edwards_Fq3 mul_by_a(const edwards_Fq3 &elt)
void to_affine_coordinates()
#define D(var, file, col, who, lev,...)
void mixed_addition_step_for_miller_loop(const extended_edwards_G1_projective &base, extended_edwards_G1_projective ¤t, edwards_Fq_conic_coefficients &cc)
edwards_Fq6 edwards_ate_miller_loop(const edwards_ate_G1_precomp &prec_P, const edwards_ate_G2_precomp &prec_Q)
Fp3_model< edwards_q_limbs, edwards_modulus_q > edwards_Fq3
edwards_ate_G2_precomp edwards_ate_precompute_G2(const edwards_G2 &Q)
bigint< edwards_r_limbs > edwards_modulus_r
edwards_Fq6 edwards_final_exponentiation_first_chunk(const edwards_Fq6 &elt, const edwards_Fq6 &elt_inv)
std::vector< edwards_Fq_conic_coefficients > edwards_tate_G1_precomp
void consume_OUTPUT_NEWLINE(std::istream &in)
edwards_tate_G2_precomp edwards_tate_precompute_G2(const edwards_G2 &Q)
edwards_ate_G1_precomp edwards_ate_precompute_G1(const edwards_G1 &P)
void full_addition_step_for_miller_loop(const extended_edwards_G1_projective &base, extended_edwards_G1_projective ¤t, edwards_Fq_conic_coefficients &cc)
Fp_model< edwards_q_limbs, edwards_modulus_q > edwards_Fq
edwards_Fq6 edwards_ate_double_miller_loop(const edwards_ate_G1_precomp &prec_P1, const edwards_ate_G2_precomp &prec_Q1, const edwards_ate_G1_precomp &prec_P2, const edwards_ate_G2_precomp &prec_Q2)
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
void consume_OUTPUT_SEPARATOR(std::istream &in)
edwards_tate_G1_precomp edwards_tate_precompute_G1(const edwards_G1 &P)
void doubling_step_for_miller_loop(extended_edwards_G1_projective ¤t, edwards_Fq_conic_coefficients &cc)
edwards_GT edwards_ate_reduced_pairing(const edwards_G1 &P, const edwards_G2 &Q)
edwards_Fq6 edwards_miller_loop(const edwards_G1_precomp &prec_P, const edwards_G2_precomp &prec_Q)
edwards_G1_precomp edwards_precompute_G1(const edwards_G1 &P)
edwards_GT edwards_tate_reduced_pairing(const edwards_G1 &P, const edwards_G2 &Q)
bigint< edwards_q_limbs > edwards_final_exponent_last_chunk_abs_of_w0
edwards_ate_G2_precomp edwards_G2_precomp
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
void enter_block(const std::string &msg, const bool indent)
void doubling_step_for_flipped_miller_loop(const alt_bn128_Fq two_inv, alt_bn128_G2 ¤t, alt_bn128_ate_ell_coeffs &c)
edwards_GT edwards_final_exponentiation(const edwards_Fq6 &elt)
edwards_Fq6 edwards_double_miller_loop(const edwards_G1_precomp &prec_P1, const edwards_G2_precomp &prec_Q1, const edwards_G1_precomp &prec_P2, const edwards_G2_precomp &prec_Q2)
edwards_Fq6 edwards_tate_pairing(const edwards_G1 &P, const edwards_G2 &Q)
edwards_Fq6 edwards_pairing(const edwards_G1 &P, const edwards_G2 &Q)
bigint< edwards_q_limbs > edwards_final_exponent_last_chunk_w1
void full_addition_step_for_flipped_miller_loop(const extended_edwards_G2_projective &base, extended_edwards_G2_projective ¤t, edwards_Fq3_conic_coefficients &cc)
Fp6_2over3_model< edwards_q_limbs, edwards_modulus_q > edwards_Fq6
bool edwards_final_exponent_last_chunk_is_w0_neg
edwards_Fq6 edwards_ate_pairing(const edwards_G1 &P, const edwards_G2 &Q)
edwards_Fq6 edwards_tate_miller_loop(const edwards_tate_G1_precomp &prec_P, const edwards_tate_G2_precomp &prec_Q)
edwards_GT edwards_reduced_pairing(const edwards_G1 &P, const edwards_G2 &Q)
std::vector< edwards_Fq3_conic_coefficients > edwards_ate_G2_precomp
void leave_block(const std::string &msg, const bool indent)
edwards_Fq6 edwards_final_exponentiation_last_chunk(const edwards_Fq6 &elt, const edwards_Fq6 &elt_inv)
void consume_newline(std::istream &in)
edwards_G2_precomp edwards_precompute_G2(const edwards_G2 &Q)
bigint< edwards_q_limbs > edwards_ate_loop_count
void mixed_addition_step_for_flipped_miller_loop(const alt_bn128_G2 base, alt_bn128_G2 ¤t, alt_bn128_ate_ell_coeffs &c)
#define T(meth, val, expected)
bool operator==(const edwards_Fq3_conic_coefficients &other) const
bool operator==(const edwards_Fq_conic_coefficients &other) const
bool operator==(const edwards_ate_G1_precomp &other) const
bool operator==(const edwards_tate_G2_precomp &other) const
void test_invariant() const
void test_invariant() const