12#ifdef PROFILE_OP_COUNTS
13long long edwards_G1::add_cnt = 0;
14long long edwards_G1::dbl_cnt = 0;
42 copy.to_affine_coordinates();
43 gmp_printf(
"(%Nd , %Nd)\n",
57 gmp_printf(
"(%Nd : %Nd : %Nd)\n",
80 this->
X = tX * tZ_inv;
81 this->Y = tY * tZ_inv;
98 this->
X = this->
X * Z_inv;
99 this->
Y = this->
Y * Z_inv;
103 assert((*
this) == copy);
114 return (this->
Y.
is_zero() && this->Z.is_zero());
132 if ((this->
X * other.Z) != (other.X * this->Z))
138 if ((this->
Y * other.
Z) != (other.Y * this->Z))
164 return this->
add(other);
175 return (*
this) + (-other);
180#ifdef PROFILE_OP_COUNTS
202#ifdef PROFILE_OP_COUNTS
217 assert(other.is_special());
239#ifdef PROFILE_OP_COUNTS
310 copy.to_affine_coordinates();
311#ifdef NO_PT_COMPRESSION
325#ifdef NO_PT_COMPRESSION
338 in.read((
char*)&Y_lsb, 1);
346 if ((tY.
as_bigint().data[0] & 1) != Y_lsb)
357#ifdef USE_MIXED_ADDITION
364std::ostream&
operator<<(std::ostream& out,
const std::vector<edwards_G1> &v)
366 out << v.size() <<
"\n";
375std::istream&
operator>>(std::istream& in, std::vector<edwards_G1> &v)
384 for (
size_t i = 0; i <
s; ++i)
397 std::vector<edwards_Fq> Z_vec;
398 Z_vec.reserve(vec.size());
402 Z_vec.emplace_back(el.Z);
408 for (
size_t i = 0; i < vec.size(); ++i)
410 vec[i].X = vec[i].X * Z_vec[i];
411 vec[i].Y = vec[i].Y * Z_vec[i];
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()
edwards_G1 add(const edwards_G1 &other) const
void print_coordinates() const
edwards_G1 operator-() const
void to_affine_coordinates()
bool is_well_formed() const
static std::vector< size_t > fixed_base_exp_window_table
edwards_G1 operator+(const edwards_G1 &other) const
static void batch_to_special_all_non_zeros(std::vector< edwards_G1 > &vec)
static edwards_G1 random_element()
bool operator==(const edwards_G1 &other) const
edwards_G1 mixed_add(const edwards_G1 &other) const
static edwards_G1 G1_zero
bool operator!=(const edwards_G1 &other) const
static std::vector< size_t > wnaf_window_table
#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)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
edwards_Fq edwards_coeff_d
void consume_newline(std::istream &in)
void batch_invert(std::vector< FieldT > &vec)