18#ifdef PROFILE_OP_COUNTS
19long long mnt6_G2::add_cnt = 0;
20long long mnt6_G2::dbl_cnt = 0;
61 copy.to_affine_coordinates();
62 gmp_printf(
"(%Nd*z^2 + %Nd*z + %Nd , %Nd*z^2 + %Nd*z + %Nd)\n",
80 gmp_printf(
"(%Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z + %Nd)\n",
104 this->
X = this->
X * Z_inv;
105 this->
Y = this->
Y * Z_inv;
123 return (this->
X.is_zero() && this->Z.is_zero());
141 if ((this->
X * other.Z) != (other.X * this->Z))
147 if ((this->
Y * other.
Z) != (other.Y * this->Z))
198 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
243 return (*
this) + (-other);
263 if (this->
operator==(other))
268#ifdef PROFILE_OP_COUNTS
277 const mnt6_Fq3 u = (other.Y) * (this->
Z) - Y1Z2;
279 const mnt6_Fq3 v = (other.X) * (this->
Z) - X1Z2;
293#ifdef PROFILE_OP_COUNTS
311 assert(other.is_special());
322 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
343#ifdef PROFILE_OP_COUNTS
378 (this->
Z).Frobenius_map(1));
427 copy.to_affine_coordinates();
430#ifdef NO_PT_COMPRESSION
445#ifdef NO_PT_COMPRESSION
446 in >> is_zero >> tX >> tY;
449 in.read((
char*)&is_zero, 1);
456 in.read((
char*)&Y_lsb, 1);
489 std::vector<mnt6_Fq3> Z_vec;
490 Z_vec.reserve(vec.size());
494 Z_vec.emplace_back(el.Z);
500 for (
size_t i = 0; i < vec.size(); ++i)
502 vec[i] =
mnt6_G2(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
Fp3_model inverse() const
Fp3_model squared() const
static Fp3_model< n, modulus > one()
static Fp3_model< n, modulus > zero()
static const mp_size_t num_limbs
bigint< n > as_bigint() const
static Fp_model< n, modulus > random_element()
static std::vector< size_t > wnaf_window_table
mnt6_G2 operator+(const mnt6_G2 &other) const
static void batch_to_special_all_non_zeros(std::vector< mnt6_G2 > &vec)
mnt6_G2 operator-() const
mnt6_G2 add(const mnt6_G2 &other) const
bool is_well_formed() const
static mnt6_Fq3 mul_by_b(const mnt6_Fq3 &elt)
static mnt6_G2 random_element()
bool operator==(const mnt6_G2 &other) const
mnt6_G2 mixed_add(const mnt6_G2 &other) const
static mnt6_Fq3 mul_by_a(const mnt6_Fq3 &elt)
bool operator!=(const mnt6_G2 &other) const
void to_affine_coordinates()
void print_coordinates() const
static std::vector< size_t > fixed_base_exp_window_table
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
void consume_OUTPUT_SEPARATOR(std::istream &in)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
mnt6_Fq mnt6_twist_mul_by_a_c0
mnt6_Fq mnt6_twist_mul_by_a_c2
mnt6_Fq mnt6_twist_mul_by_b_c2
mnt6_Fq mnt6_twist_mul_by_b_c1
mnt6_Fq3 mnt6_twist_coeff_a
mnt6_Fq mnt6_twist_mul_by_q_Y
mnt6_Fq mnt6_twist_mul_by_b_c0
mnt6_Fq mnt6_twist_mul_by_q_X
Fp3_model< mnt6_q_limbs, mnt6_modulus_q > mnt6_Fq3
mnt6_Fq3 mnt6_twist_coeff_b
void batch_invert(std::vector< FieldT > &vec)
mnt6_Fq mnt6_twist_mul_by_a_c1