12#ifdef PROFILE_OP_COUNTS
13long long alt_bn128_G1::add_cnt = 0;
14long long alt_bn128_G1::dbl_cnt = 0;
42 copy.to_affine_coordinates();
43 gmp_printf(
"(%Nd , %Nd)\n",
57 gmp_printf(
"(%Nd : %Nd : %Nd)\n",
77 this->
X = this->
X * Z2_inv;
78 this->
Y = this->
Y * Z3_inv;
122 if ((this->
X * Z2_squared) != (other.X * Z1_squared))
130 if ((this->
Y * Z2_cubed) != (other.Y * Z1_cubed))
180 if (U1 == U2 && S1 == S2)
209 return (*
this) + (-other);
229 if (this->
operator==(other))
234#ifdef PROFILE_OP_COUNTS
263 assert(other.is_special());
301 if (U1 == U2 && S1 == S2)
307#ifdef PROFILE_OP_COUNTS
323 Y3 =
r*(
V-X3) - Y3 - Y3;
331#ifdef PROFILE_OP_COUNTS
355 eightC = eightC + eightC;
356 eightC = eightC + eightC;
411 copy.to_affine_coordinates();
414#ifdef NO_PT_COMPRESSION
429#ifdef NO_PT_COMPRESSION
430 in >> is_zero >> tX >> tY;
433 in.read((
char*)&is_zero, 1);
440 in.read((
char*)&Y_lsb, 1);
450 if ((tY.
as_bigint().data[0] & 1) != Y_lsb)
471std::ostream&
operator<<(std::ostream& out,
const std::vector<alt_bn128_G1> &v)
473 out << v.size() <<
"\n";
482std::istream&
operator>>(std::istream& in, std::vector<alt_bn128_G1> &v)
492 for (
size_t i = 0; i <
s; ++i)
505 std::vector<alt_bn128_Fq> Z_vec;
506 Z_vec.reserve(vec.size());
510 Z_vec.emplace_back(el.Z);
516 for (
size_t i = 0; i < vec.size(); ++i)
521 vec[i].X = vec[i].X * Z2;
522 vec[i].Y = vec[i].Y * Z3;
static Fp_model< n, modulus > zero()
static Fp_model< n, modulus > one()
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
bool operator!=(const alt_bn128_G1 &other) const
static std::vector< size_t > fixed_base_exp_window_table
static alt_bn128_G1 zero()
static alt_bn128_G1 G1_one
bool is_well_formed() const
static alt_bn128_G1 one()
bool operator==(const alt_bn128_G1 &other) const
static void batch_to_special_all_non_zeros(std::vector< alt_bn128_G1 > &vec)
void print_coordinates() const
static alt_bn128_G1 G1_zero
alt_bn128_G1 mixed_add(const alt_bn128_G1 &other) const
alt_bn128_G1 operator-() const
alt_bn128_G1 add(const alt_bn128_G1 &other) const
alt_bn128_G1 operator+(const alt_bn128_G1 &other) const
static alt_bn128_G1 random_element()
void to_affine_coordinates()
#define D(var, file, col, who, lev,...)
void consume_OUTPUT_NEWLINE(std::istream &in)
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
void consume_OUTPUT_SEPARATOR(std::istream &in)
alt_bn128_Fq alt_bn128_coeff_b
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
void consume_newline(std::istream &in)
void batch_invert(std::vector< FieldT > &vec)