18#ifdef PROFILE_OP_COUNTS
19long long mnt4_G2::add_cnt = 0;
20long long mnt4_G2::dbl_cnt = 0;
61 copy.to_affine_coordinates();
62 gmp_printf(
"(%Nd*z + %Nd , %Nd*z + %Nd)\n",
78 gmp_printf(
"(%Nd*z + %Nd : %Nd*z + %Nd : %Nd*z + %Nd)\n",
117 return (this->
X.is_zero() && this->Z.is_zero());
135 if ((this->
X * other.Z) != (other.X * this->Z))
141 if ((this->
Y * other.
Z) != (other.Y * this->Z))
192 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
237 return (*
this) + (-other);
257 if (this->
operator==(other))
262#ifdef PROFILE_OP_COUNTS
271 const mnt4_Fq2 u = (other.Y) * (this->
Z) - Y1Z2;
273 const mnt4_Fq2 v = (other.X) * (this->
Z) - X1Z2;
287#ifdef PROFILE_OP_COUNTS
305 assert(other.is_special());
316 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
337#ifdef PROFILE_OP_COUNTS
372 (this->
Z).Frobenius_map(1));
420 copy.to_affine_coordinates();
423#ifdef NO_PT_COMPRESSION
438#ifdef NO_PT_COMPRESSION
439 in >> is_zero >> tX >> tY;
442 in.read((
char*)&is_zero, 1);
449 in.read((
char*)&Y_lsb, 1);
482 std::vector<mnt4_Fq2> Z_vec;
483 Z_vec.reserve(vec.size());
487 Z_vec.emplace_back(el.Z);
493 for (
size_t i = 0; i < vec.size(); ++i)
495 vec[i] =
mnt4_G2(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
static Fp2_model< n, modulus > zero()
Fp2_model inverse() const
static Fp2_model< n, modulus > one()
Fp2_model squared() const
static const mp_size_t num_limbs
bigint< n > as_bigint() const
static Fp_model< n, modulus > random_element()
static mnt4_G2 random_element()
bool operator!=(const mnt4_G2 &other) const
static std::vector< size_t > fixed_base_exp_window_table
static std::vector< size_t > wnaf_window_table
mnt4_G2 mixed_add(const mnt4_G2 &other) const
mnt4_G2 operator-() const
void print_coordinates() const
static void batch_to_special_all_non_zeros(std::vector< mnt4_G2 > &vec)
bool is_well_formed() const
mnt4_G2 operator+(const mnt4_G2 &other) const
static mnt4_Fq2 mul_by_b(const mnt4_Fq2 &elt)
void to_affine_coordinates()
bool operator==(const mnt4_G2 &other) const
mnt4_G2 add(const mnt4_G2 &other) const
static mnt4_Fq2 mul_by_a(const mnt4_Fq2 &elt)
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
void consume_OUTPUT_SEPARATOR(std::istream &in)
mnt4_Fq mnt4_twist_mul_by_b_c1
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
mnt4_Fq mnt4_twist_mul_by_a_c0
mnt4_Fq2 mnt4_twist_coeff_b
mnt4_Fq mnt4_twist_mul_by_q_X
mnt4_Fq mnt4_twist_mul_by_a_c1
mnt4_Fq2 mnt4_twist_coeff_a
Fp2_model< mnt4_q_limbs, mnt4_modulus_q > mnt4_Fq2
mnt4_Fq mnt4_twist_mul_by_b_c0
mnt4_Fq mnt4_twist_mul_by_q_Y
void batch_invert(std::vector< FieldT > &vec)