Clearmatics Libff  0.1
C++ library for Finite Fields and Elliptic Curves
bls12_377_g1.cpp
Go to the documentation of this file.
1 
9 
10 namespace libff
11 {
12 
13 #ifdef PROFILE_OP_COUNTS
14 long long bls12_377_G1::add_cnt = 0;
15 long long bls12_377_G1::dbl_cnt = 0;
16 #endif
17 
18 std::vector<size_t> bls12_377_G1::wnaf_window_table;
20 bls12_377_G1 bls12_377_G1::G1_zero;
21 bls12_377_G1 bls12_377_G1::G1_one;
24 bigint<bls12_377_G1::h_limbs> bls12_377_G1::h;
25 
27 {
28  this->X = G1_zero.X;
29  this->Y = G1_zero.Y;
30  this->Z = G1_zero.Z;
31 }
32 
33 void bls12_377_G1::print() const
34 {
35  if (this->is_zero()) {
36  printf("O\n");
37  } else {
38  bls12_377_G1 copy(*this);
39  copy.to_affine_coordinates();
40  gmp_printf(
41  "(%Nd , %Nd)\n",
42  copy.X.as_bigint().data,
44  copy.Y.as_bigint().data,
46  }
47 }
48 
50 {
51  if (this->is_zero()) {
52  printf("O\n");
53  } else {
54  gmp_printf(
55  "(%Nd : %Nd : %Nd)\n",
56  this->X.as_bigint().data,
58  this->Y.as_bigint().data,
60  this->Z.as_bigint().data,
62  }
63 }
64 
66 {
67  if (this->is_zero()) {
68  this->X = bls12_377_Fq::zero();
69  this->Y = bls12_377_Fq::one();
70  this->Z = bls12_377_Fq::zero();
71  } else {
72  bls12_377_Fq Z_inv = Z.inverse();
73  bls12_377_Fq Z2_inv = Z_inv.squared();
74  bls12_377_Fq Z3_inv = Z2_inv * Z_inv;
75  this->X = this->X * Z2_inv;
76  this->Y = this->Y * Z3_inv;
77  this->Z = bls12_377_Fq::one();
78  }
79 }
80 
82 
84 {
85  return (this->is_zero() || this->Z == bls12_377_Fq::one());
86 }
87 
88 bool bls12_377_G1::is_zero() const { return (this->Z.is_zero()); }
89 
90 bool bls12_377_G1::operator==(const bls12_377_G1 &other) const
91 {
92  if (this->is_zero()) {
93  return other.is_zero();
94  }
95 
96  if (other.is_zero()) {
97  return false;
98  }
99 
100  // Using Jacobian coordinates so:
101  // (X1:Y1:Z1) = (X2:Y2:Z2) <=>
102  // X1/Z1^2 == X2/Z2^2 AND Y1/Z1^3 == Y2/Z2^3 <=>
103  // X1 * Z2^2 == X2 * Z1^2 and Y1 * Z2^3 == Y2 * Z1^3
104  bls12_377_Fq Z1_squared = (this->Z).squared();
105  bls12_377_Fq Z2_squared = (other.Z).squared();
106  bls12_377_Fq Z1_cubed = (this->Z) * Z1_squared;
107  bls12_377_Fq Z2_cubed = (other.Z) * Z2_squared;
108  if (((this->X * Z2_squared) != (other.X * Z1_squared)) ||
109  ((this->Y * Z2_cubed) != (other.Y * Z1_cubed))) {
110  return false;
111  }
112 
113  return true;
114 }
115 
116 bool bls12_377_G1::operator!=(const bls12_377_G1 &other) const
117 {
118  return !(operator==(other));
119 }
120 
122 {
123  // handle special cases having to do with O
124  if (this->is_zero()) {
125  return other;
126  }
127 
128  if (other.is_zero()) {
129  return *this;
130  }
131 
132  // No need to handle points of order 2,4
133  // (they cannot exist in a prime-order subgroup)
134 
135  // Z1Z1 = Z1*Z1
136  bls12_377_Fq Z1Z1 = (this->Z).squared();
137  // Z2Z2 = Z2*Z2
138  bls12_377_Fq Z2Z2 = (other.Z).squared();
139 
140  // U1 = X1*Z2Z2
141  bls12_377_Fq U1 = this->X * Z2Z2;
142  // U2 = X2*Z1Z1
143  bls12_377_Fq U2 = other.X * Z1Z1;
144 
145  // S1 = Y1*Z2*Z2Z2
146  bls12_377_Fq S1 = (this->Y) * ((other.Z) * Z2Z2);
147  // S2 = Y2*Z1*Z1Z1
148  bls12_377_Fq S2 = (other.Y) * ((this->Z) * Z1Z1);
149 
150  // Check if the 2 points are equal, in which can we do a point doubling
151  // (i.e. P + P)
152  if (U1 == U2 && S1 == S2) {
153  return this->dbl();
154  }
155 
156  // Point addition (i.e. P + Q, P =/= Q)
157  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/jacobian-0/addition/add-2007-bl
158  // H = U2-U1
159  bls12_377_Fq H = U2 - U1;
160  // I = (2*H)^2
161  bls12_377_Fq I = (H + H).squared();
162  // J = H*I
163  bls12_377_Fq J = H * I;
164  // r = 2*(S2-S1)
165  bls12_377_Fq S2_minus_S1 = S2 - S1;
166  bls12_377_Fq r = S2_minus_S1 + S2_minus_S1;
167  // V = U1*I
168  bls12_377_Fq V = U1 * I;
169  // X3 = r^2-J-2*V
170  bls12_377_Fq X3 = r.squared() - J - (V + V);
171  bls12_377_Fq S1_J = S1 * J;
172  // Y3 = r*(V-X3)-2*S1*J
173  bls12_377_Fq Y3 = r * (V - X3) - (S1_J + S1_J);
174  // Z3 = ((Z1+Z2)^2-Z1Z1-Z2Z2) * H
175  bls12_377_Fq Z3 = ((this->Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
176 
177  return bls12_377_G1(X3, Y3, Z3);
178 }
179 
181 {
182  return bls12_377_G1(this->X, -(this->Y), this->Z);
183 }
184 
186 {
187  return (*this) + (-other);
188 }
189 
191 {
192  // Handle special cases having to do with O
193  if (this->is_zero()) {
194  return other;
195  }
196 
197  if (other.is_zero()) {
198  return *this;
199  }
200 
201  // No need to handle points of order 2,4
202  // (they cannot exist in a prime-order subgroup)
203 
204  // Handle double case
205  if (this->operator==(other)) {
206  return this->dbl();
207  }
208 
209 #ifdef PROFILE_OP_COUNTS
210  this->add_cnt++;
211 #endif
212  // NOTE: does not handle O and pts of order 2,4
213  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/jacobian-0/addition/add-2007-bl
214  // Z1Z1 = Z1*Z1
215  bls12_377_Fq Z1Z1 = (this->Z).squared();
216  // Z2Z2 = Z2*Z2
217  bls12_377_Fq Z2Z2 = (other.Z).squared();
218  // U1 = X1*Z2Z2
219  bls12_377_Fq U1 = this->X * Z2Z2;
220  // U2 = X2*Z1Z1
221  bls12_377_Fq U2 = other.X * Z1Z1;
222  // S1 = Y1*Z2*Z2Z2
223  bls12_377_Fq S1 = (this->Y) * ((other.Z) * Z2Z2);
224  // S2 = Y2*Z1*Z1Z1
225  bls12_377_Fq S2 = (other.Y) * ((this->Z) * Z1Z1);
226  // H = U2-U1
227  bls12_377_Fq H = U2 - U1;
228  // I = (2*H)^2
229  bls12_377_Fq I = (H + H).squared();
230  // J = H*I
231  bls12_377_Fq J = H * I;
232  // r = 2*(S2-S1)
233  bls12_377_Fq S2_minus_S1 = S2 - S1;
234  bls12_377_Fq r = S2_minus_S1 + S2_minus_S1;
235  // V = U1*I
236  bls12_377_Fq V = U1 * I;
237  // X3 = r^2-J-2*V
238  bls12_377_Fq X3 = r.squared() - J - (V + V);
239  bls12_377_Fq S1_J = S1 * J;
240  // Y3 = r*(V-X3)-2*S1*J
241  bls12_377_Fq Y3 = r * (V - X3) - (S1_J + S1_J);
242  // Z3 = ((Z1+Z2)^2-Z1Z1-Z2Z2) * H
243  bls12_377_Fq Z3 = ((this->Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
244 
245  return bls12_377_G1(X3, Y3, Z3);
246 }
247 
248 // This function assumes that:
249 // *this is of the form (X1/Z1, Y1/Z1), and that
250 // other is of the form (X2, Y2), i.e. Z2=1
252 {
253 #ifdef DEBUG
254  assert(other.is_special());
255 #endif
256 
257  // handle special cases having to do with O
258  if (this->is_zero()) {
259  return other;
260  }
261 
262  if (other.is_zero()) {
263  return *this;
264  }
265 
266  // No need to handle points of order 2,4
267  // (they cannot exist in a prime-order subgroup)
268  // Z1Z1 = Z1*Z1
269  const bls12_377_Fq Z1Z1 = (this->Z).squared();
270  // U2 = X2*Z1Z1
271  const bls12_377_Fq U2 = other.X * Z1Z1;
272  // S2 = Y2 * Z1 * Z1Z1
273  const bls12_377_Fq S2 = (other.Y) * ((this->Z) * Z1Z1);
274 
275  // (X1/Z1^2) == X2 => X1 == X2*Z1^2
276  // (Y1/Z1^3) == Y2 => Y1 == Y2*Z1^3
277  if (this->X == U2 && this->Y == S2) {
278  return this->dbl();
279  }
280 
281 #ifdef PROFILE_OP_COUNTS
282  this->add_cnt++;
283 #endif
284 
285  // NOTE: does not handle O and pts of order 2,4
286  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/jacobian-0/addition/madd-2007-bl
287  // H = U2-X1
288  bls12_377_Fq H = U2 - (this->X);
289  // HH = H^2
290  bls12_377_Fq HH = H.squared();
291  // I = 4*HH
292  bls12_377_Fq I = HH + HH;
293  I = I + I;
294  // J = H*I
295  bls12_377_Fq J = H * I;
296  // r = 2*(S2-Y1)
297  bls12_377_Fq r = S2 - (this->Y);
298  r = r + r;
299  // V = X1*I
300  bls12_377_Fq V = (this->X) * I;
301  // X3 = r^2-J-2*V
302  bls12_377_Fq X3 = r.squared() - J - V - V;
303  // Y3 = r*(V-X3)-2*Y1*J
304  bls12_377_Fq Y3 = (this->Y) * J;
305  Y3 = r * (V - X3) - Y3 - Y3;
306  // Z3 = (Z1+H)^2-Z1Z1-HH
307  bls12_377_Fq Z3 = ((this->Z) + H).squared() - Z1Z1 - HH;
308 
309  return bls12_377_G1(X3, Y3, Z3);
310 }
311 
313 {
314 #ifdef PROFILE_OP_COUNTS
315  this->dbl_cnt++;
316 #endif
317  // Handle point at infinity
318  if (this->is_zero()) {
319  return (*this);
320  }
321 
322  // no need to handle points of order 2,4
323  // (they cannot exist in a prime-order subgroup)
324 
325  // NOTE: does not handle O and pts of order 2,4
326  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/jacobian-0/doubling/dbl-2009-l
327  // A = X1^2
328  bls12_377_Fq A = (this->X).squared();
329  // B = Y1^2
330  bls12_377_Fq B = (this->Y).squared();
331  // C = B^2
332  bls12_377_Fq C = B.squared();
333  // D = 2 * ((X1 + B)^2 - A - C)
334  bls12_377_Fq D = (this->X + B).squared() - A - C;
335  D = D + D;
336  // E = 3 * A
337  bls12_377_Fq E = A + A + A;
338  // F = E^2
339  bls12_377_Fq F = E.squared();
340  // X3 = F - 2 D
341  bls12_377_Fq X3 = F - (D + D);
342  // Y3 = E * (D - X3) - 8 * C
343  bls12_377_Fq eightC = C + C;
344  eightC = eightC + eightC;
345  eightC = eightC + eightC;
346  bls12_377_Fq Y3 = E * (D - X3) - eightC;
347  // Z3 = 2 * Y1 * Z1
348  bls12_377_Fq Y1Z1 = (this->Y) * (this->Z);
349  bls12_377_Fq Z3 = Y1Z1 + Y1Z1;
350 
351  return bls12_377_G1(X3, Y3, Z3);
352 }
353 
355 {
356  return bls12_377_G1::h * (*this);
357 }
358 
360 {
361  bls12_377_G1 result = *this;
362  result.to_affine_coordinates();
363  result.X = bls12_377_g1_endomorphism_beta * result.X;
364  return result;
365 }
366 
368 {
369  if (this->is_zero()) {
370  return true;
371  }
372 
373  // The curve equation is
374  // E': y^2 = x^3 + ax + b, where a=0
375  // We are using Jacobian coordinates. As such, the equation becomes:
376  // y^2/z^6 = x^3/z^6 + b
377  // = y^2 = x^3 + b z^6
378  bls12_377_Fq X2 = this->X.squared();
379  bls12_377_Fq Y2 = this->Y.squared();
380  bls12_377_Fq Z2 = this->Z.squared();
381  bls12_377_Fq X3 = this->X * X2;
382  bls12_377_Fq Z3 = this->Z * Z2;
383  bls12_377_Fq Z6 = Z3.squared();
384  return (Y2 == X3 + bls12_377_coeff_b * Z6);
385 }
386 
388 {
389  // Check that [c0]P + [c1]\sigma(P) == 0 (see bls12_377.sage), where:
390  // c0: 1
391  // c1: 91893752504881257701523279626832445441
392  // (0x452217cc900000010a11800000000001)
393  const bls12_377_G1 sigma_g = sigma();
394  const bls12_377_G1 r_times_g =
395  bls12_377_g1_safe_subgroup_check_c1 * sigma_g + *this;
396  return zero() == r_times_g;
397 }
398 
400 {
401  // See bls12_377.sage.
402  // w = 5285428838741532253824584287042945485047145357130994810877
403 
404  return bls12_377_g1_proof_of_safe_subgroup_w * (*this) +
405  bls12_377_G1(
409 }
410 
412 
414 
416 {
417  return (scalar_field::random_element().as_bigint()) * G1_one;
418 }
419 
420 void bls12_377_G1::write_uncompressed(std::ostream &out) const
421 {
422  bls12_377_G1 copy(*this);
423  copy.to_affine_coordinates();
424  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
425  out << copy.X << OUTPUT_SEPARATOR << copy.Y;
426 }
427 
428 void bls12_377_G1::write_compressed(std::ostream &out) const
429 {
430  bls12_377_G1 copy(*this);
431  copy.to_affine_coordinates();
432  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
433  /* storing LSB of Y */
434  out << copy.X << OUTPUT_SEPARATOR << (copy.Y.as_bigint().data[0] & 1);
435 }
436 
438 {
439  char is_zero;
440  bls12_377_Fq tX, tY;
441 
442  in >> is_zero >> tX >> tY;
443  is_zero -= '0';
444 
445  // using Jacobian coordinates
446  if (!is_zero) {
447  g.X = tX;
448  g.Y = tY;
449  g.Z = bls12_377_Fq::one();
450  } else {
451  g = bls12_377_G1::zero();
452  }
453 }
454 
455 void bls12_377_G1::read_compressed(std::istream &in, bls12_377_G1 &g)
456 {
457  char is_zero;
458  bls12_377_Fq tX, tY;
459 
460  // this reads is_zero;
461  in.read((char *)&is_zero, 1);
462  is_zero -= '0';
464 
465  unsigned char Y_lsb;
466  in >> tX;
468  in.read((char *)&Y_lsb, 1);
469  Y_lsb -= '0';
470 
471  // y = +/- sqrt(x^3 + b)
472  if (!is_zero) {
473  bls12_377_Fq tX2 = tX.squared();
474  bls12_377_Fq tY2 = tX2 * tX + bls12_377_coeff_b;
475  tY = tY2.sqrt();
476 
477  if ((tY.as_bigint().data[0] & 1) != Y_lsb) {
478  tY = -tY;
479  }
480  }
481 
482  // using Jacobian coordinates
483  if (!is_zero) {
484  g.X = tX;
485  g.Y = tY;
486  g.Z = bls12_377_Fq::one();
487  } else {
488  g = bls12_377_G1::zero();
489  }
490 }
491 
492 std::ostream &operator<<(std::ostream &out, const bls12_377_G1 &g)
493 {
494 #ifdef NO_PT_COMPRESSION
495  g.write_uncompressed(out);
496 #else
497  g.write_compressed(out);
498 #endif
499  return out;
500 }
501 
502 std::istream &operator>>(std::istream &in, bls12_377_G1 &g)
503 {
504 #ifdef NO_PT_COMPRESSION
506 #else
508 #endif
509  return in;
510 }
511 
513  std::vector<bls12_377_G1> &vec)
514 {
515  std::vector<bls12_377_Fq> Z_vec;
516  Z_vec.reserve(vec.size());
517 
518  for (auto &el : vec) {
519  Z_vec.emplace_back(el.Z);
520  }
521  batch_invert<bls12_377_Fq>(Z_vec);
522 
524 
525  for (size_t i = 0; i < vec.size(); ++i) {
526  bls12_377_Fq Z2 = Z_vec[i].squared();
527  bls12_377_Fq Z3 = Z_vec[i] * Z2;
528 
529  vec[i].X = vec[i].X * Z2;
530  vec[i].Y = vec[i].Y * Z3;
531  vec[i].Z = one;
532  }
533 }
534 
535 } // namespace libff
libff::bls12_377_G1::is_special
bool is_special() const
Definition: bls12_377_g1.cpp:83
libff::bls12_377_G1::coeff_b
static bls12_377_Fq coeff_b
Definition: bls12_377_g1.hpp:33
libff::bls12_377_G1::G1_zero
static bls12_377_G1 G1_zero
Definition: bls12_377_g1.hpp:30
libff::bls12_377_G1::write_compressed
void write_compressed(std::ostream &) const
Definition: bls12_377_g1.cpp:428
libff::Fp_model::random_element
static Fp_model< n, modulus > random_element()
returns random element of Fp_model
libff
Definition: ffi.cpp:8
libff::bls12_377_G1::is_in_safe_subgroup
bool is_in_safe_subgroup() const
Definition: bls12_377_g1.cpp:387
libff::Fp_model::squared
Fp_model squared() const
libff::bls12_377_G1::zero
static const bls12_377_G1 & zero()
Definition: bls12_377_g1.cpp:411
libff::bls12_377_G1::sigma
bls12_377_G1 sigma() const
Definition: bls12_377_g1.cpp:359
libff::Fp_model< bls12_377_q_limbs, bls12_377_modulus_q >::zero
static const Fp_model< n, modulus > & zero()
libff::Fp_model::is_zero
bool is_zero() const
libff::bls12_377_G1::write_uncompressed
void write_uncompressed(std::ostream &) const
Definition: bls12_377_g1.cpp:420
libff::operator>>
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
Definition: alt_bn128_g1.cpp:446
libff::bls12_377_G1::Z
bls12_377_Fq Z
Definition: bls12_377_g1.hpp:44
libff::bls12_377_G1::coeff_a
static bls12_377_Fq coeff_a
Definition: bls12_377_g1.hpp:32
libff::bls12_377_coeff_b
bls12_377_Fq bls12_377_coeff_b
Definition: bls12_377_init.cpp:16
libff::bls12_377_G1::random_element
static bls12_377_G1 random_element()
Definition: bls12_377_g1.cpp:415
libff::bls12_377_G1::mixed_add
bls12_377_G1 mixed_add(const bls12_377_G1 &other) const
Definition: bls12_377_g1.cpp:251
libff::bls12_377_Fq
Fp_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq
Definition: bls12_377_init.hpp:48
libff::Fp_model::inverse
Fp_model inverse() const
libff::bls12_377_G1
Definition: bls12_377_g1.hpp:21
libff::bls12_377_g1_safe_subgroup_check_c1
bigint< bls12_377_r_limbs > bls12_377_g1_safe_subgroup_check_c1
Definition: bls12_377_init.cpp:27
libff::bls12_377_G1::operator+
bls12_377_G1 operator+(const bls12_377_G1 &other) const
Definition: bls12_377_g1.cpp:121
libff::bls12_377_G1::operator==
bool operator==(const bls12_377_G1 &other) const
Definition: bls12_377_g1.cpp:90
libff::Fp_model::sqrt
Fp_model sqrt() const
HAS TO BE A SQUARE (else does not terminate)
libff::Fp_model< bls12_377_q_limbs, bls12_377_modulus_q >::one
static const Fp_model< n, modulus > & one()
libff::bls12_377_g1_proof_of_safe_subgroup_non_member_y
bls12_377_Fq bls12_377_g1_proof_of_safe_subgroup_non_member_y
Definition: bls12_377_init.cpp:30
OUTPUT_SEPARATOR
#define OUTPUT_SEPARATOR
Definition: serialization.hpp:69
libff::bls12_377_G1::to_affine_coordinates
void to_affine_coordinates()
Definition: bls12_377_g1.cpp:65
libff::bls12_377_G1::wnaf_window_table
static std::vector< size_t > wnaf_window_table
Definition: bls12_377_g1.hpp:28
libff::bls12_377_G1::print_coordinates
void print_coordinates() const
Definition: bls12_377_g1.cpp:49
libff::bls12_377_G1::to_special
void to_special()
Definition: bls12_377_g1.cpp:81
libff::bls12_377_g1_proof_of_safe_subgroup_non_member_x
bls12_377_Fq bls12_377_g1_proof_of_safe_subgroup_non_member_x
Definition: bls12_377_init.cpp:29
libff::bls12_377_G1::operator!=
bool operator!=(const bls12_377_G1 &other) const
Definition: bls12_377_g1.cpp:116
libff::consume_OUTPUT_SEPARATOR
void consume_OUTPUT_SEPARATOR(std::istream &in)
libff::Fp_model< bls12_377_q_limbs, bls12_377_modulus_q >::num_limbs
static const mp_size_t num_limbs
Definition: fp.hpp:47
libff::bls12_377_g1_proof_of_safe_subgroup_w
bigint< bls12_377_r_limbs > bls12_377_g1_proof_of_safe_subgroup_w
Definition: bls12_377_init.cpp:28
bls12_377_g1.hpp
libff::bls12_377_G1::mul_by_cofactor
bls12_377_G1 mul_by_cofactor() const
Definition: bls12_377_g1.cpp:354
libff::bls12_377_G1::print
void print() const
Definition: bls12_377_g1.cpp:33
libff::bls12_377_G1::is_well_formed
bool is_well_formed() const
Definition: bls12_377_g1.cpp:367
libff::bls12_377_G1::read_uncompressed
static void read_uncompressed(std::istream &, bls12_377_G1 &)
Definition: bls12_377_g1.cpp:437
libff::Fp_model::as_bigint
bigint< n > as_bigint() const
libff::bls12_377_G1::batch_to_special_all_non_zeros
static void batch_to_special_all_non_zeros(std::vector< bls12_377_G1 > &vec)
Definition: bls12_377_g1.cpp:512
libff::Fp_model< bls12_377_q_limbs, bls12_377_modulus_q >
libff::bls12_377_G1::X
bls12_377_Fq X
Definition: bls12_377_g1.hpp:44
libff::operator<<
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
Definition: alt_bn128_g1.cpp:436
libff::bls12_377_G1::one
static const bls12_377_G1 & one()
Definition: bls12_377_g1.cpp:413
libff::bls12_377_G1::bls12_377_G1
bls12_377_G1()
Definition: bls12_377_g1.cpp:26
libff::bls12_377_G1::G1_one
static bls12_377_G1 G1_one
Definition: bls12_377_g1.hpp:31
libff::bls12_377_G1::read_compressed
static void read_compressed(std::istream &, bls12_377_G1 &)
Definition: bls12_377_g1.cpp:455
libff::bls12_377_G1::Y
bls12_377_Fq Y
Definition: bls12_377_g1.hpp:44
libff::bls12_377_G1::is_zero
bool is_zero() const
Definition: bls12_377_g1.cpp:88
libff::bls12_377_G1::add
bls12_377_G1 add(const bls12_377_G1 &other) const
Definition: bls12_377_g1.cpp:190
libff::bls12_377_G1::fixed_base_exp_window_table
static std::vector< size_t > fixed_base_exp_window_table
Definition: bls12_377_g1.hpp:29
libff::bls12_377_G1::h
static bigint< h_limbs > h
Definition: bls12_377_g1.hpp:42
libff::bls12_377_G1::proof_of_safe_subgroup
bls12_377_G1 proof_of_safe_subgroup() const
Definition: bls12_377_g1.cpp:399
libff::bls12_377_G1::operator-
bls12_377_G1 operator-() const
Definition: bls12_377_g1.cpp:180
libff::bls12_377_G1::dbl
bls12_377_G1 dbl() const
Definition: bls12_377_g1.cpp:312
libff::bls12_377_g1_endomorphism_beta
bls12_377_Fq bls12_377_g1_endomorphism_beta
Definition: bls12_377_init.cpp:26