19 fq2 T0 =
a.x.frobenius_map();
20 fq2 T1 =
a.y.frobenius_map();
42 fq2 h = current.
y + current.
z;
107 throw_or_abort(
"Computing Miller lines when Q is the point at infinity");
114 for (
unsigned char loop_bit :
loop_bits) {
120 }
else if (loop_bit == 3) {
141 for (
unsigned char loop_bit :
loop_bits) {
142 work_scalar = work_scalar.
sqr();
144 work_line.
o = lines.
lines[it].o;
145 work_line.
vw = lines.
lines[it].vw.mul_by_fq(P.
y);
146 work_line.
vv = lines.
lines[it].vv.mul_by_fq(P.
x);
151 work_line.
o = lines.
lines[it].o;
152 work_line.
vw = lines.
lines[it].vw.mul_by_fq(P.
y);
153 work_line.
vv = lines.
lines[it].vv.mul_by_fq(P.
x);
159 work_line.
o = lines.
lines[it].o;
160 work_line.
vw = lines.
lines[it].vw.mul_by_fq(P.
y);
161 work_line.
vv = lines.
lines[it].vv.mul_by_fq(P.
x);
164 work_line.
o = lines.
lines[it].o;
165 work_line.
vw = lines.
lines[it].vw.mul_by_fq(P.
y);
166 work_line.
vv = lines.
lines[it].vv.mul_by_fq(P.
x);
179 for (
unsigned char loop_bit :
loop_bits) {
180 work_scalar = work_scalar.
sqr();
181 for (
size_t j = 0; j < num_pairs; ++j) {
182 work_line.
o = lines[j].
lines[it].o;
183 work_line.
vw = lines[j].
lines[it].vw.mul_by_fq(points[j].y);
184 work_line.
vv = lines[j].
lines[it].vv.mul_by_fq(points[j].x);
189 for (
size_t j = 0; j < num_pairs; ++j) {
190 work_line.
o = lines[j].
lines[it].o;
191 work_line.
vw = lines[j].
lines[it].vw.mul_by_fq(points[j].y);
192 work_line.
vv = lines[j].
lines[it].vv.mul_by_fq(points[j].x);
199 for (
size_t j = 0; j < num_pairs; ++j) {
200 work_line.
o = lines[j].
lines[it].o;
201 work_line.
vw = lines[j].
lines[it].vw.mul_by_fq(points[j].y);
202 work_line.
vv = lines[j].
lines[it].vv.mul_by_fq(points[j].x);
206 for (
size_t j = 0; j < num_pairs; ++j) {
207 work_line.
o = lines[j].
lines[it].o;
208 work_line.
vw = lines[j].
lines[it].vw.mul_by_fq(points[j].y);
209 work_line.
vv = lines[j].
lines[it].vv.mul_by_fq(points[j].x);
220 return a *
a.frobenius_map_two();
229 if (neg_z_loop_bit) {
284 const size_t num_points)
287 for (
size_t i = 0; i < num_points; ++i) {
298 const size_t num_points)
305 size_t num_pairings = 0;
306 for (
size_t i = 0; i < num_points; ++i) {
309 if (!P_affines[i].is_point_at_infinity() && !Q_affines[i].is_point_at_infinity()) {
constexpr field12 cyclotomic_squared() const
constexpr field12 frobenius_map_three() const
constexpr field12 invert() const
constexpr field12 unitary_inverse() const
constexpr void self_sparse_mul(const ell_coeffs &ell)
static constexpr field12 one()
constexpr field12 sqr() const
constexpr field12 frobenius_map_two() const
constexpr field12 frobenius_map_one() const
static constexpr base_field mul_by_non_residue(const base_field &a)
element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic....
BB_INLINE constexpr bool is_point_at_infinity() const noexcept
group_elements::element< Fq, Fr, Params > element
#define G(r, i, a, b, c, d)
constexpr void precompute_miller_lines(const g2::element &Q, miller_lines &lines)
constexpr void final_exponentiation_tricky_part(const fq12 &elt, fq12 &r)
constexpr fq12 miller_loop(const g1::element &P, const miller_lines &lines)
constexpr std::array< uint8_t, loop_length > loop_bits
constexpr fq12 miller_loop_batch(const g1::element *points, const miller_lines *lines, size_t num_pairs)
constexpr fq12 reduced_ate_pairing(const g1::affine_element &P_affine, const g2::affine_element &Q_affine)
constexpr void final_exponentiation_easy_part(const fq12 &elt, fq12 &r)
constexpr void doubling_step_for_flipped_miller_loop(g2::element ¤t, fq12::ell_coeffs &ell)
fq12 reduced_ate_pairing_batch_precomputed(const g1::affine_element *P_affines, const miller_lines *lines, size_t num_points)
constexpr void final_exponentiation_exp_by_neg_z(const fq12 &elt, fq12 &r)
fq12 reduced_ate_pairing_batch(const g1::affine_element *P_affines, const g2::affine_element *Q_affines, size_t num_points)
constexpr g2::element mul_by_q(const g2::element &a)
constexpr std::array< bool, neg_z_loop_length > neg_z_loop_bits
constexpr void mixed_addition_step_for_flipped_miller_loop(const g2::element &base, g2::element &Q, fq12::ell_coeffs &line)
field< Bn254FqParams > fq
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
constexpr field2 sqr() const noexcept
static constexpr field2 twist_mul_by_q_y()
static constexpr field2 one()
static constexpr field2 twist_mul_by_q_x()
static constexpr field2 twist_coeff_b()
constexpr field invert() const noexcept
BB_INLINE constexpr field sqr() const noexcept
std::array< fq12::ell_coeffs, precomputed_coefficients_length > lines
void throw_or_abort(std::string const &err)