24 return (this->
P[0] == other.
P[0] &&
25 this->P[1] == other.P[1] &&
26 this->P[2] == other.P[2]);
31 for (
size_t i = 0; i < 3; ++i)
34 out << prec_P.
P[i] <<
"\n";
36 out.write((
char*) &prec_P.
P[i],
sizeof(prec_P.
P[i]));
44 for (
size_t i = 0; i < 3; ++i)
50 in.read((
char*) &prec_P.
P[i],
sizeof(prec_P.
P[i]));
58 if (!(this->
Q[0] == other.
Q[0] &&
59 this->Q[1] == other.Q[1] &&
60 this->Q[2] == other.Q[2] &&
61 this->coeffs.size() == other.coeffs.size()))
67 for (
size_t i = 0; i < this->
coeffs.size(); ++i)
69 std::stringstream this_ss, other_ss;
70 this_ss << this->
coeffs[i];
71 other_ss << other.coeffs[i];
72 if (this_ss.str() != other_ss.str())
83 for (
size_t i = 0; i < 3; ++i)
86 out << prec_Q.
Q[i].
a_ <<
"\n";
87 out << prec_Q.
Q[i].
b_ <<
"\n";
89 out.write((
char*) &prec_Q.
Q[i].
a_,
sizeof(prec_Q.
Q[i].
a_));
90 out.write((
char*) &prec_Q.
Q[i].
b_,
sizeof(prec_Q.
Q[i].
b_));
94 out << prec_Q.
coeffs.size() <<
"\n";
96 for (
size_t i = 0; i < prec_Q.
coeffs.size(); ++i)
99 out << prec_Q.
coeffs[i].a_.a_ <<
"\n";
100 out << prec_Q.
coeffs[i].a_.b_ <<
"\n";
101 out << prec_Q.
coeffs[i].b_.a_ <<
"\n";
102 out << prec_Q.
coeffs[i].b_.b_ <<
"\n";
103 out << prec_Q.
coeffs[i].c_.a_ <<
"\n";
104 out << prec_Q.
coeffs[i].c_.b_ <<
"\n";
106 out.write((
char*) &prec_Q.
coeffs[i].a_.a_,
sizeof(prec_Q.
coeffs[i].a_.a_));
107 out.write((
char*) &prec_Q.
coeffs[i].a_.b_,
sizeof(prec_Q.
coeffs[i].a_.b_));
108 out.write((
char*) &prec_Q.
coeffs[i].b_.a_,
sizeof(prec_Q.
coeffs[i].b_.a_));
109 out.write((
char*) &prec_Q.
coeffs[i].b_.b_,
sizeof(prec_Q.
coeffs[i].b_.b_));
110 out.write((
char*) &prec_Q.
coeffs[i].c_.a_,
sizeof(prec_Q.
coeffs[i].c_.a_));
111 out.write((
char*) &prec_Q.
coeffs[i].c_.b_,
sizeof(prec_Q.
coeffs[i].c_.b_));
120 for (
size_t i = 0; i < 3; ++i)
123 in >> prec_Q.
Q[i].
a_;
125 in >> prec_Q.
Q[i].
b_;
128 in.read((
char*) &prec_Q.
Q[i].
a_,
sizeof(prec_Q.
Q[i].
a_));
129 in.read((
char*) &prec_Q.
Q[i].
b_,
sizeof(prec_Q.
Q[i].
b_));
137 for (
size_t i = 0; i <
count; ++i)
140 in >> prec_Q.
coeffs[i].a_.a_;
142 in >> prec_Q.
coeffs[i].a_.b_;
144 in >> prec_Q.
coeffs[i].b_.a_;
146 in >> prec_Q.
coeffs[i].b_.b_;
148 in >> prec_Q.
coeffs[i].c_.a_;
150 in >> prec_Q.
coeffs[i].c_.b_;
153 in.read((
char*) &prec_Q.
coeffs[i].a_.a_,
sizeof(prec_Q.
coeffs[i].a_.a_));
154 in.read((
char*) &prec_Q.
coeffs[i].a_.b_,
sizeof(prec_Q.
coeffs[i].a_.b_));
155 in.read((
char*) &prec_Q.
coeffs[i].b_.a_,
sizeof(prec_Q.
coeffs[i].b_.a_));
156 in.read((
char*) &prec_Q.
coeffs[i].b_.b_,
sizeof(prec_Q.
coeffs[i].b_.b_));
157 in.read((
char*) &prec_Q.
coeffs[i].c_.a_,
sizeof(prec_Q.
coeffs[i].c_.a_));
158 in.read((
char*) &prec_Q.
coeffs[i].c_.b_,
sizeof(prec_Q.
coeffs[i].c_.b_));
170 P.fill_coord(P_coord);
void fill_coord(bn::Fp2 coord[3]) const
void millerLoop2(Fp12 &f, const std::vector< Fp6 > &Q1coeff, const Fp precP1[2], const std::vector< Fp6 > &Q2coeff, const Fp precP2[2])
void millerLoop(Fp12 &f, const std::vector< Fp6 > &Qcoeff, const Fp precP[2])
void precomputeG2(std::vector< Fp6 > &coeff, Fp2 Q[3], const Fp2 inQ[3])
void NormalizeJac(FF *out, const FF *in)
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
bn128_Fq12 bn128_double_ate_miller_loop(const bn128_ate_G1_precomp &prec_P1, const bn128_ate_G2_precomp &prec_Q1, const bn128_ate_G1_precomp &prec_P2, const bn128_ate_G2_precomp &prec_Q2)
bn128_ate_G2_precomp bn128_ate_precompute_G2(const bn128_G2 &Q)
bn128_Fq12 bn128_ate_miller_loop(const bn128_ate_G1_precomp &prec_P, const bn128_ate_G2_precomp &prec_Q)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
void enter_block(const std::string &msg, const bool indent)
bn128_GT bn128_final_exponentiation(const bn128_Fq12 &elt)
void leave_block(const std::string &msg, const bool indent)
void consume_newline(std::istream &in)
bn128_ate_G1_precomp bn128_ate_precompute_G1(const bn128_G1 &P)
bool operator==(const bn128_ate_G1_precomp &other) const
std::vector< bn128_ate_ell_coeffs > coeffs
bool operator==(const bn128_ate_G2_precomp &other) const