Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
6 #ifdef PROFILE_OP_COUNTS
7 long long bw6_761_G1::add_cnt = 0;
8 long long bw6_761_G1::dbl_cnt = 0;
48 "(%Nd : %Nd : %Nd)\n",
51 this->Y.as_bigint().data,
53 this->Z.as_bigint().data,
66 this->
X = this->
X * Z_inv;
67 this->
Y = this->
Y * Z_inv;
81 return (this->
X.
is_zero() && this->Z.is_zero());
98 if (((this->
X * other.
Z) != (other.
X * this->Z)) ||
99 ((this->Y * other.
Z) != (other.
Y * this->Z))) {
138 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
185 const bw6_761_Fq A = uu * Z1Z2 - (vvv + R + R);
189 const bw6_761_Fq Y3 = u * (R - A) - vvv * Y1Z2;
203 return (*
this) + (-other);
220 if (this->
operator==(other)) {
224 #ifdef PROFILE_OP_COUNTS
249 const bw6_761_Fq A = uu * Z1Z2 - (vvv + R + R);
253 const bw6_761_Fq Y3 = u * (R - A) - vvv * Y1Z2;
284 if (this->
X == X2Z1 && this->
Y == Y2Z1) {
288 #ifdef PROFILE_OP_COUNTS
320 #ifdef PROFILE_OP_COUNTS
418 #ifdef NO_PT_COMPRESSION
457 in.read((
char *)&Y_lsb, 1);
467 if ((tY.
as_bigint().data[0] & 1) != Y_lsb) {
481 #ifdef NO_PT_COMPRESSION
491 std::vector<bw6_761_Fq> Z_vec;
492 Z_vec.reserve(vec.size());
494 for (
auto &el : vec) {
495 Z_vec.emplace_back(el.Z);
497 batch_invert<bw6_761_Fq>(Z_vec);
501 for (
size_t i = 0; i < vec.size(); ++i) {
502 vec[i].X = vec[i].X * Z_vec[i];
503 vec[i].Y = vec[i].Y * Z_vec[i];
static std::vector< size_t > fixed_base_exp_window_table
bool is_well_formed() const
static Fp_model< n, modulus > random_element()
returns random element of Fp_model
bw6_761_G1 operator-() const
static bw6_761_G1 G1_zero
bool operator==(const bw6_761_G1 &other) const
static bw6_761_Fq coeff_b
static std::vector< size_t > wnaf_window_table
static const bw6_761_G1 & zero()
Fp_model< bw6_761_q_limbs, bw6_761_modulus_q > bw6_761_Fq
static const Fp_model< n, modulus > & zero()
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
bw6_761_G1 add(const bw6_761_G1 &other) const
bw6_761_G1 operator+(const bw6_761_G1 &other) const
void print_coordinates() const
static void read_uncompressed(std::istream &, bw6_761_G1 &)
static void read_compressed(std::istream &, bw6_761_G1 &)
Fp_model sqrt() const
HAS TO BE A SQUARE (else does not terminate)
static const Fp_model< n, modulus > & one()
void write_uncompressed(std::ostream &) const
bool operator!=(const bw6_761_G1 &other) const
static const bw6_761_G1 & one()
static bw6_761_Fq coeff_a
bool is_in_safe_subgroup() const
bw6_761_G1 mul_by_cofactor() const
void consume_OUTPUT_SEPARATOR(std::istream &in)
static const mp_size_t num_limbs
static void batch_to_special_all_non_zeros(std::vector< bw6_761_G1 > &vec)
bw6_761_Fq bw6_761_coeff_b
bigint< n > as_bigint() const
void write_compressed(std::ostream &) const
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
static bigint< h_limbs > h
static const constexpr bigint< n > & mod
bw6_761_G1 mixed_add(const bw6_761_G1 &other) const
static bw6_761_G1 random_element()
void to_affine_coordinates()