Clearmatics Libff  0.1
C++ library for Finite Fields and Elliptic Curves
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
libff::mnt6_G1 Class Reference

#include <mnt6_g1.hpp>

Collaboration diagram for libff::mnt6_G1:
Collaboration graph
[legend]

Public Types

typedef mnt6_Fq base_field
 
typedef mnt6_Fr scalar_field
 

Public Member Functions

 mnt6_G1 ()
 
 mnt6_G1 (const mnt6_Fq &X, const mnt6_Fq &Y)
 
 mnt6_G1 (const mnt6_Fq &X, const mnt6_Fq &Y, const mnt6_Fq &Z)
 
void print () const
 
void print_coordinates () const
 
void to_affine_coordinates ()
 
void to_special ()
 
bool is_special () const
 
bool is_zero () const
 
bool operator== (const mnt6_G1 &other) const
 
bool operator!= (const mnt6_G1 &other) const
 
mnt6_G1 operator+ (const mnt6_G1 &other) const
 
mnt6_G1 operator- () const
 
mnt6_G1 operator- (const mnt6_G1 &other) const
 
mnt6_G1 add (const mnt6_G1 &other) const
 
mnt6_G1 mixed_add (const mnt6_G1 &other) const
 
mnt6_G1 dbl () const
 
mnt6_G1 mul_by_cofactor () const
 
bool is_well_formed () const
 
bool is_in_safe_subgroup () const
 
void write_uncompressed (std::ostream &) const
 
void write_compressed (std::ostream &) const
 

Static Public Member Functions

static const mnt6_G1zero ()
 
static const mnt6_G1one ()
 
static mnt6_G1 random_element ()
 
static size_t size_in_bits ()
 
static bigint< base_field::num_limbsbase_field_char ()
 
static bigint< scalar_field::num_limbsorder ()
 
static void read_uncompressed (std::istream &, mnt6_G1 &)
 
static void read_compressed (std::istream &, mnt6_G1 &)
 
static void batch_to_special_all_non_zeros (std::vector< mnt6_G1 > &vec)
 

Public Attributes

mnt6_Fq X
 
mnt6_Fq Y
 
mnt6_Fq Z
 

Static Public Attributes

static std::vector< size_t > wnaf_window_table
 
static std::vector< size_t > fixed_base_exp_window_table
 
static mnt6_G1 G1_zero
 
static mnt6_G1 G1_one
 
static mnt6_Fq coeff_a
 
static mnt6_Fq coeff_b
 
static const mp_size_t h_bitcount = 1
 
static const mp_size_t h_limbs
 
static bigint< h_limbsh
 

Detailed Description

Definition at line 26 of file mnt6_g1.hpp.

Member Typedef Documentation

◆ base_field

Definition at line 40 of file mnt6_g1.hpp.

◆ scalar_field

Definition at line 41 of file mnt6_g1.hpp.

Constructor & Destructor Documentation

◆ mnt6_G1() [1/3]

libff::mnt6_G1::mnt6_G1 ( )

Definition at line 32 of file mnt6_g1.cpp.

33 {
34  this->X = G1_zero.X;
35  this->Y = G1_zero.Y;
36  this->Z = G1_zero.Z;
37 }
Here is the caller graph for this function:

◆ mnt6_G1() [2/3]

libff::mnt6_G1::mnt6_G1 ( const mnt6_Fq X,
const mnt6_Fq Y 
)
inline

Definition at line 53 of file mnt6_g1.hpp.

54  : X(X), Y(Y), Z(base_field::one())
55  {
56  }

◆ mnt6_G1() [3/3]

libff::mnt6_G1::mnt6_G1 ( const mnt6_Fq X,
const mnt6_Fq Y,
const mnt6_Fq Z 
)
inline

Definition at line 57 of file mnt6_g1.hpp.

58  : X(X), Y(Y), Z(Z)
59  {
60  }

Member Function Documentation

◆ add()

mnt6_G1 libff::mnt6_G1::add ( const mnt6_G1 other) const

Definition at line 236 of file mnt6_g1.cpp.

237 {
238  // handle special cases having to do with O
239  if (this->is_zero()) {
240  return other;
241  }
242 
243  if (other.is_zero()) {
244  return (*this);
245  }
246 
247  // no need to handle points of order 2,4
248  // (they cannot exist in a prime-order subgroup)
249 
250  // handle double case
251  if (this->operator==(other)) {
252  return this->dbl();
253  }
254 
255 #ifdef PROFILE_OP_COUNTS
256  this->add_cnt++;
257 #endif
258  // NOTE: does not handle O and pts of order 2,4
259  // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-projective.html#addition-add-1998-cmo-2
260 
261  // Y1Z2 = Y1*Z2
262  const mnt6_Fq Y1Z2 = (this->Y) * (other.Z);
263  // X1Z2 = X1*Z2
264  const mnt6_Fq X1Z2 = (this->X) * (other.Z);
265  // Z1Z2 = Z1*Z2
266  const mnt6_Fq Z1Z2 = (this->Z) * (other.Z);
267  // u = Y2*Z1-Y1Z2
268  const mnt6_Fq u = (other.Y) * (this->Z) - Y1Z2;
269  // uu = u^2
270  const mnt6_Fq uu = u.squared();
271  // v = X2*Z1-X1Z2
272  const mnt6_Fq v = (other.X) * (this->Z) - X1Z2;
273  // vv = v^2
274  const mnt6_Fq vv = v.squared();
275  // vvv = v*vv
276  const mnt6_Fq vvv = v * vv;
277  // R = vv*X1Z2
278  const mnt6_Fq R = vv * X1Z2;
279  // A = uu*Z1Z2 - vvv - 2*R
280  const mnt6_Fq A = uu * Z1Z2 - (vvv + R + R);
281  // X3 = v*A
282  const mnt6_Fq X3 = v * A;
283  // Y3 = u*(R-A) - vvv*Y1Z2
284  const mnt6_Fq Y3 = u * (R - A) - vvv * Y1Z2;
285  // Z3 = vvv*Z1Z2
286  const mnt6_Fq Z3 = vvv * Z1Z2;
287 
288  return mnt6_G1(X3, Y3, Z3);
289 }
Here is the call graph for this function:

◆ base_field_char()

static bigint<base_field::num_limbs> libff::mnt6_G1::base_field_char ( )
inlinestatic

Definition at line 91 of file mnt6_g1.hpp.

92  {
93  return base_field::field_char();
94  }
Here is the call graph for this function:

◆ batch_to_special_all_non_zeros()

void libff::mnt6_G1::batch_to_special_all_non_zeros ( std::vector< mnt6_G1 > &  vec)
static

Definition at line 507 of file mnt6_g1.cpp.

508 {
509  std::vector<mnt6_Fq> Z_vec;
510  Z_vec.reserve(vec.size());
511 
512  for (auto &el : vec) {
513  Z_vec.emplace_back(el.Z);
514  }
515  batch_invert<mnt6_Fq>(Z_vec);
516 
517  const mnt6_Fq one = mnt6_Fq::one();
518 
519  for (size_t i = 0; i < vec.size(); ++i) {
520  vec[i] = mnt6_G1(vec[i].X * Z_vec[i], vec[i].Y * Z_vec[i], one);
521  }
522 }
Here is the call graph for this function:

◆ dbl()

mnt6_G1 libff::mnt6_G1::dbl ( ) const

Definition at line 352 of file mnt6_g1.cpp.

353 {
354 #ifdef PROFILE_OP_COUNTS
355  this->dbl_cnt++;
356 #endif
357  if (this->is_zero()) {
358  return (*this);
359  } else {
360  // NOTE: does not handle O and pts of order 2,4
361  // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-projective.html#doubling-dbl-2007-bl
362 
363  // XX = X1^2
364  const mnt6_Fq XX = (this->X).squared();
365  // ZZ = Z1^2
366  const mnt6_Fq ZZ = (this->Z).squared();
367  // w = a*ZZ + 3*XX
368  const mnt6_Fq w = mnt6_G1::coeff_a * ZZ + (XX + XX + XX);
369  const mnt6_Fq Y1Z1 = (this->Y) * (this->Z);
370  // s = 2*Y1*Z1
371  const mnt6_Fq s = Y1Z1 + Y1Z1;
372  // ss = s^2
373  const mnt6_Fq ss = s.squared();
374  // sss = s*ss
375  const mnt6_Fq sss = s * ss;
376  // R = Y1*s
377  const mnt6_Fq R = (this->Y) * s;
378  // RR = R^2
379  const mnt6_Fq RR = R.squared();
380  // B = (X1+R)^2 - XX - RR
381  const mnt6_Fq B = ((this->X) + R).squared() - XX - RR;
382  // h = w^2 - 2*B
383  const mnt6_Fq h = w.squared() - (B + B);
384  // X3 = h*s
385  const mnt6_Fq X3 = h * s;
386  // Y3 = w*(B-h) - 2*RR
387  const mnt6_Fq Y3 = w * (B - h) - (RR + RR);
388  // Z3 = sss
389  const mnt6_Fq Z3 = sss;
390 
391  return mnt6_G1(X3, Y3, Z3);
392  }
393 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_in_safe_subgroup()

bool libff::mnt6_G1::is_in_safe_subgroup ( ) const

Definition at line 424 of file mnt6_g1.cpp.

424 { return true; }

◆ is_special()

bool libff::mnt6_G1::is_special ( ) const

Definition at line 87 of file mnt6_g1.cpp.

88 {
89  return (this->is_zero() || this->Z == mnt6_Fq::one());
90 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_well_formed()

bool libff::mnt6_G1::is_well_formed ( ) const

Definition at line 401 of file mnt6_g1.cpp.

402 {
403  if (this->is_zero()) {
404  return true;
405  } else {
406  // y^2 = x^3 + ax + b
407  //
408  // We are using projective, so equation we need to check is actually
409  //
410  // (y/z)^2 = (x/z)^3 + a (x/z) + b
411  // z y^2 = x^3 + a z^2 x + b z^3
412  //
413  // z (y^2 - b z^2) = x ( x^2 + a z^2)
414  const mnt6_Fq X2 = this->X.squared();
415  const mnt6_Fq Y2 = this->Y.squared();
416  const mnt6_Fq Z2 = this->Z.squared();
417 
418  return (
419  this->Z * (Y2 - mnt6_G1::coeff_b * Z2) ==
420  this->X * (X2 + mnt6_G1::coeff_a * Z2));
421  }
422 }
Here is the call graph for this function:

◆ is_zero()

bool libff::mnt6_G1::is_zero ( ) const

Definition at line 92 of file mnt6_g1.cpp.

93 {
94  return (this->X.is_zero() && this->Z.is_zero());
95 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixed_add()

mnt6_G1 libff::mnt6_G1::mixed_add ( const mnt6_G1 other) const

Definition at line 291 of file mnt6_g1.cpp.

292 {
293 #ifdef PROFILE_OP_COUNTS
294  this->add_cnt++;
295 #endif
296  // NOTE: does not handle O and pts of order 2,4
297  // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-projective.html#addition-add-1998-cmo-2
298  // assert(other.Z == mnt6_Fq::one());
299 
300  if (this->is_zero()) {
301  return other;
302  }
303 
304  if (other.is_zero()) {
305  return (*this);
306  }
307 
308 #ifdef DEBUG
309  assert(other.is_special());
310 #endif
311 
312  // X1Z2 = X1*Z2 (but other is special and not zero)
313  const mnt6_Fq &X1Z2 = (this->X);
314  // X2Z1 = X2*Z1
315  const mnt6_Fq X2Z1 = (this->Z) * (other.X);
316 
317  // (used both in add and double checks)
318 
319  // Y1Z2 = Y1*Z2 (but other is special and not zero)
320  const mnt6_Fq &Y1Z2 = (this->Y);
321  // Y2Z1 = Y2*Z1
322  const mnt6_Fq Y2Z1 = (this->Z) * (other.Y);
323 
324  if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
325  return this->dbl();
326  }
327 
328  // u = Y2*Z1-Y1
329  mnt6_Fq u = Y2Z1 - this->Y;
330  // uu = u2
331  mnt6_Fq uu = u.squared();
332  // v = X2*Z1-X1
333  mnt6_Fq v = X2Z1 - this->X;
334  // vv = v2
335  mnt6_Fq vv = v.squared();
336  // vvv = v*vv
337  mnt6_Fq vvv = v * vv;
338  // R = vv*X1
339  mnt6_Fq R = vv * this->X;
340  // A = uu*Z1-vvv-2*R
341  mnt6_Fq A = uu * this->Z - vvv - R - R;
342  // X3 = v*A
343  mnt6_Fq X3 = v * A;
344  // Y3 = u*(R-A)-vvv*Y1
345  mnt6_Fq Y3 = u * (R - A) - vvv * this->Y;
346  // Z3 = vvv*Z1
347  mnt6_Fq Z3 = vvv * this->Z;
348 
349  return mnt6_G1(X3, Y3, Z3);
350 }
Here is the call graph for this function:

◆ mul_by_cofactor()

mnt6_G1 libff::mnt6_G1::mul_by_cofactor ( ) const

Definition at line 395 of file mnt6_g1.cpp.

396 {
397  // Cofactor = 1
398  return (*this);
399 }

◆ one()

const mnt6_G1 & libff::mnt6_G1::one ( )
static

Definition at line 428 of file mnt6_g1.cpp.

428 { return G1_one; }
Here is the caller graph for this function:

◆ operator!=()

bool libff::mnt6_G1::operator!= ( const mnt6_G1 other) const

Definition at line 122 of file mnt6_g1.cpp.

123 {
124  return !(operator==(other));
125 }
Here is the call graph for this function:

◆ operator+()

mnt6_G1 libff::mnt6_G1::operator+ ( const mnt6_G1 other) const

Definition at line 127 of file mnt6_g1.cpp.

128 {
129  // handle special cases having to do with O
130  if (this->is_zero()) {
131  return other;
132  }
133 
134  if (other.is_zero()) {
135  return *this;
136  }
137 
138  // no need to handle points of order 2,4
139  // (they cannot exist in a prime-order subgroup)
140 
141  // handle double case, and then all the rest
142 
143  // The code below is equivalent to (but faster than) the snippet below:
144  //
145  // if (this->operator==(other))
146  // {
147  // return this->dbl();
148  // }
149  // else
150  // {
151  // return this->add(other);
152  // }
153 
154  // X1Z2 = X1*Z2
155  const mnt6_Fq X1Z2 = (this->X) * (other.Z);
156  // X2Z1 = X2*Z1
157  const mnt6_Fq X2Z1 = (this->Z) * (other.X);
158 
159  // (used both in add and double checks)
160 
161  // Y1Z2 = Y1*Z2
162  const mnt6_Fq Y1Z2 = (this->Y) * (other.Z);
163  // Y2Z1 = Y2*Z1
164  const mnt6_Fq Y2Z1 = (this->Z) * (other.Y);
165 
166  if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
167  // perform dbl case
168  // XX = X1^2
169  const mnt6_Fq XX = (this->X).squared();
170  // ZZ = Z1^2
171  const mnt6_Fq ZZ = (this->Z).squared();
172  // w = a*ZZ + 3*XX
173  const mnt6_Fq w = mnt6_G1::coeff_a * ZZ + (XX + XX + XX);
174  const mnt6_Fq Y1Z1 = (this->Y) * (this->Z);
175  // s = 2*Y1*Z1
176  const mnt6_Fq s = Y1Z1 + Y1Z1;
177  // ss = s^2
178  const mnt6_Fq ss = s.squared();
179  // sss = s*ss
180  const mnt6_Fq sss = s * ss;
181  // R = Y1*s
182  const mnt6_Fq R = (this->Y) * s;
183  // RR = R^2
184  const mnt6_Fq RR = R.squared();
185  // B = (X1+R)^2 - XX - RR
186  const mnt6_Fq B = ((this->X) + R).squared() - XX - RR;
187  // h = w^2 - 2*B
188  const mnt6_Fq h = w.squared() - (B + B);
189  // X3 = h*s
190  const mnt6_Fq X3 = h * s;
191  // Y3 = w*(B-h) - 2*RR
192  const mnt6_Fq Y3 = w * (B - h) - (RR + RR);
193  // Z3 = sss
194  const mnt6_Fq Z3 = sss;
195 
196  return mnt6_G1(X3, Y3, Z3);
197  }
198 
199  // if we have arrived here we are in the add case
200  // Z1Z2 = Z1*Z2
201  const mnt6_Fq Z1Z2 = (this->Z) * (other.Z);
202  // u = Y2*Z1-Y1Z2
203  const mnt6_Fq u = Y2Z1 - Y1Z2;
204  // uu = u^2
205  const mnt6_Fq uu = u.squared();
206  // v = X2*Z1-X1Z2
207  const mnt6_Fq v = X2Z1 - X1Z2;
208  // vv = v^2
209  const mnt6_Fq vv = v.squared();
210  // vvv = v*vv
211  const mnt6_Fq vvv = v * vv;
212  // R = vv*X1Z2
213  const mnt6_Fq R = vv * X1Z2;
214  // A = uu*Z1Z2 - vvv - 2*R
215  const mnt6_Fq A = uu * Z1Z2 - (vvv + R + R);
216  // X3 = v*A
217  const mnt6_Fq X3 = v * A;
218  // Y3 = u*(R-A) - vvv*Y1Z2
219  const mnt6_Fq Y3 = u * (R - A) - vvv * Y1Z2;
220  // Z3 = vvv*Z1Z2
221  const mnt6_Fq Z3 = vvv * Z1Z2;
222 
223  return mnt6_G1(X3, Y3, Z3);
224 }
Here is the call graph for this function:

◆ operator-() [1/2]

mnt6_G1 libff::mnt6_G1::operator- ( ) const

Definition at line 226 of file mnt6_g1.cpp.

227 {
228  return mnt6_G1(this->X, -(this->Y), this->Z);
229 }
Here is the call graph for this function:

◆ operator-() [2/2]

mnt6_G1 libff::mnt6_G1::operator- ( const mnt6_G1 other) const

Definition at line 231 of file mnt6_g1.cpp.

232 {
233  return (*this) + (-other);
234 }

◆ operator==()

bool libff::mnt6_G1::operator== ( const mnt6_G1 other) const

Definition at line 97 of file mnt6_g1.cpp.

98 {
99  if (this->is_zero()) {
100  return other.is_zero();
101  }
102 
103  if (other.is_zero()) {
104  return false;
105  }
106 
107  /* now neither is O */
108 
109  // X1/Z1 = X2/Z2 <=> X1*Z2 = X2*Z1
110  if ((this->X * other.Z) != (other.X * this->Z)) {
111  return false;
112  }
113 
114  // Y1/Z1 = Y2/Z2 <=> Y1*Z2 = Y2*Z1
115  if ((this->Y * other.Z) != (other.Y * this->Z)) {
116  return false;
117  }
118 
119  return true;
120 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ order()

static bigint<scalar_field::num_limbs> libff::mnt6_G1::order ( )
inlinestatic

Definition at line 95 of file mnt6_g1.hpp.

96  {
97  return scalar_field::field_char();
98  }
Here is the call graph for this function:

◆ print()

void libff::mnt6_G1::print ( ) const

Definition at line 39 of file mnt6_g1.cpp.

40 {
41  if (this->is_zero()) {
42  printf("O\n");
43  } else {
44  mnt6_G1 copy(*this);
45  copy.to_affine_coordinates();
46  gmp_printf(
47  "(%Nd , %Nd)\n",
48  copy.X.as_bigint().data,
50  copy.Y.as_bigint().data,
52  }
53 }
Here is the call graph for this function:

◆ print_coordinates()

void libff::mnt6_G1::print_coordinates ( ) const

Definition at line 55 of file mnt6_g1.cpp.

56 {
57  if (this->is_zero()) {
58  printf("O\n");
59  } else {
60  gmp_printf(
61  "(%Nd : %Nd : %Nd)\n",
62  this->X.as_bigint().data,
64  this->Y.as_bigint().data,
66  this->Z.as_bigint().data,
68  }
69 }
Here is the call graph for this function:

◆ random_element()

mnt6_G1 libff::mnt6_G1::random_element ( )
static

Definition at line 430 of file mnt6_g1.cpp.

431 {
432  return (scalar_field::random_element().as_bigint()) * G1_one;
433 }
Here is the call graph for this function:

◆ read_compressed()

void libff::mnt6_G1::read_compressed ( std::istream &  in,
mnt6_G1 g 
)
static

Definition at line 471 of file mnt6_g1.cpp.

472 {
473  char is_zero;
474  mnt6_Fq tX, tY;
475  // this reads is_zero;
476  in.read((char *)&is_zero, 1);
477  is_zero -= '0';
479 
480  unsigned char Y_lsb;
481  in >> tX;
483  in.read((char *)&Y_lsb, 1);
484  Y_lsb -= '0';
485 
486  // y = +/- sqrt(x^3 + a*x + b)
487  if (!is_zero) {
488  mnt6_Fq tX2 = tX.squared();
489  mnt6_Fq tY2 = (tX2 + mnt6_G1::coeff_a) * tX + mnt6_G1::coeff_b;
490  tY = tY2.sqrt();
491 
492  if ((tY.as_bigint().data[0] & 1) != Y_lsb) {
493  tY = -tY;
494  }
495  }
496 
497  // using projective coordinates
498  if (!is_zero) {
499  g.X = tX;
500  g.Y = tY;
501  g.Z = mnt6_Fq::one();
502  } else {
503  g = mnt6_G1::zero();
504  }
505 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_uncompressed()

void libff::mnt6_G1::read_uncompressed ( std::istream &  in,
mnt6_G1 g 
)
static

Definition at line 454 of file mnt6_g1.cpp.

455 {
456  char is_zero;
457  mnt6_Fq tX, tY;
458  in >> is_zero >> tX >> tY;
459  is_zero -= '0';
460 
461  // using projective coordinates
462  if (!is_zero) {
463  g.X = tX;
464  g.Y = tY;
465  g.Z = mnt6_Fq::one();
466  } else {
467  g = mnt6_G1::zero();
468  }
469 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ size_in_bits()

static size_t libff::mnt6_G1::size_in_bits ( )
inlinestatic

Definition at line 90 of file mnt6_g1.hpp.

90 { return base_field::size_in_bits() + 1; }
Here is the call graph for this function:

◆ to_affine_coordinates()

void libff::mnt6_G1::to_affine_coordinates ( )

Definition at line 71 of file mnt6_g1.cpp.

72 {
73  if (this->is_zero()) {
74  this->X = mnt6_Fq::zero();
75  this->Y = mnt6_Fq::one();
76  this->Z = mnt6_Fq::zero();
77  } else {
78  const mnt6_Fq Z_inv = Z.inverse();
79  this->X = this->X * Z_inv;
80  this->Y = this->Y * Z_inv;
81  this->Z = mnt6_Fq::one();
82  }
83 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_special()

void libff::mnt6_G1::to_special ( )

Definition at line 85 of file mnt6_g1.cpp.

85 { this->to_affine_coordinates(); }
Here is the call graph for this function:

◆ write_compressed()

void libff::mnt6_G1::write_compressed ( std::ostream &  out) const

Definition at line 444 of file mnt6_g1.cpp.

445 {
446  mnt6_G1 copy(*this);
447  copy.to_affine_coordinates();
448 
449  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
450  /* storing LSB of Y */
451  out << copy.X << OUTPUT_SEPARATOR << (copy.Y.as_bigint().data[0] & 1);
452 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_uncompressed()

void libff::mnt6_G1::write_uncompressed ( std::ostream &  out) const

Definition at line 435 of file mnt6_g1.cpp.

436 {
437  mnt6_G1 copy(*this);
438  copy.to_affine_coordinates();
439 
440  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
441  out << copy.X << OUTPUT_SEPARATOR << copy.Y;
442 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero()

const mnt6_G1 & libff::mnt6_G1::zero ( )
static

Definition at line 426 of file mnt6_g1.cpp.

426 { return G1_zero; }
Here is the caller graph for this function:

Member Data Documentation

◆ coeff_a

mnt6_Fq libff::mnt6_G1::coeff_a
static

Definition at line 37 of file mnt6_g1.hpp.

◆ coeff_b

mnt6_Fq libff::mnt6_G1::coeff_b
static

Definition at line 38 of file mnt6_g1.hpp.

◆ fixed_base_exp_window_table

std::vector< size_t > libff::mnt6_G1::fixed_base_exp_window_table
static

Definition at line 34 of file mnt6_g1.hpp.

◆ G1_one

mnt6_G1 libff::mnt6_G1::G1_one
static

Definition at line 36 of file mnt6_g1.hpp.

◆ G1_zero

mnt6_G1 libff::mnt6_G1::G1_zero
static

Definition at line 35 of file mnt6_g1.hpp.

◆ h

bigint< mnt6_G1::h_limbs > libff::mnt6_G1::h
static

Definition at line 47 of file mnt6_g1.hpp.

◆ h_bitcount

const mp_size_t libff::mnt6_G1::h_bitcount = 1
static

Definition at line 44 of file mnt6_g1.hpp.

◆ h_limbs

const mp_size_t libff::mnt6_G1::h_limbs
static
Initial value:
=
(h_bitcount + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS

Definition at line 45 of file mnt6_g1.hpp.

◆ wnaf_window_table

std::vector< size_t > libff::mnt6_G1::wnaf_window_table
static

Definition at line 33 of file mnt6_g1.hpp.

◆ X

mnt6_Fq libff::mnt6_G1::X

Definition at line 49 of file mnt6_g1.hpp.

◆ Y

mnt6_Fq libff::mnt6_G1::Y

Definition at line 49 of file mnt6_g1.hpp.

◆ Z

mnt6_Fq libff::mnt6_G1::Z

Definition at line 49 of file mnt6_g1.hpp.


The documentation for this class was generated from the following files:
libff::mnt6_G1::coeff_a
static mnt6_Fq coeff_a
Definition: mnt6_g1.hpp:37
libff::Fp_model::random_element
static Fp_model< n, modulus > random_element()
returns random element of Fp_model
libff::Fp_model::squared
Fp_model squared() const
libff::mnt6_G1::G1_one
static mnt6_G1 G1_one
Definition: mnt6_g1.hpp:36
libff::mnt6_Fq
Fp_model< mnt6_q_limbs, mnt6_modulus_q > mnt6_Fq
Definition: mnt6_init.hpp:37
libff::Fp_model< mnt6_q_limbs, mnt6_modulus_q >::zero
static const Fp_model< n, modulus > & zero()
libff::Fp_model::is_zero
bool is_zero() const
libff::mnt6_G1::Z
mnt6_Fq Z
Definition: mnt6_g1.hpp:49
libff::Fp_model::inverse
Fp_model inverse() const
libff::mnt6_G1::is_zero
bool is_zero() const
Definition: mnt6_g1.cpp:92
libff::mnt6_G1::G1_zero
static mnt6_G1 G1_zero
Definition: mnt6_g1.hpp:35
libff::mnt6_G1::to_affine_coordinates
void to_affine_coordinates()
Definition: mnt6_g1.cpp:71
libff::mnt6_G1::operator==
bool operator==(const mnt6_G1 &other) const
Definition: mnt6_g1.cpp:97
libff::Fp_model::sqrt
Fp_model sqrt() const
HAS TO BE A SQUARE (else does not terminate)
libff::mnt6_G1::coeff_b
static mnt6_Fq coeff_b
Definition: mnt6_g1.hpp:38
libff::Fp_model< mnt6_q_limbs, mnt6_modulus_q >::one
static const Fp_model< n, modulus > & one()
OUTPUT_SEPARATOR
#define OUTPUT_SEPARATOR
Definition: serialization.hpp:69
libff::Fp_model< mnt6_q_limbs, mnt6_modulus_q >::size_in_bits
static size_t size_in_bits()
Definition: fp.hpp:134
libff::mnt6_G1::h
static bigint< h_limbs > h
Definition: mnt6_g1.hpp:47
libff::consume_OUTPUT_SEPARATOR
void consume_OUTPUT_SEPARATOR(std::istream &in)
libff::Fp_model< mnt6_q_limbs, mnt6_modulus_q >::num_limbs
static const mp_size_t num_limbs
Definition: fp.hpp:47
libff::mnt6_G1::X
mnt6_Fq X
Definition: mnt6_g1.hpp:49
libff::mnt6_G1::zero
static const mnt6_G1 & zero()
Definition: mnt6_g1.cpp:426
libff::mnt6_G1::dbl
mnt6_G1 dbl() const
Definition: mnt6_g1.cpp:352
libff::Fp_model< mnt6_q_limbs, mnt6_modulus_q >::field_char
static const bigint< n > & field_char()
Definition: fp.hpp:136
libff::Fp_model::as_bigint
bigint< n > as_bigint() const
libff::mnt6_G1::h_bitcount
static const mp_size_t h_bitcount
Definition: mnt6_g1.hpp:44
libff::mnt6_G1::Y
mnt6_Fq Y
Definition: mnt6_g1.hpp:49
libff::mnt6_G1::one
static const mnt6_G1 & one()
Definition: mnt6_g1.cpp:428
libff::mnt6_G1::mnt6_G1
mnt6_G1()
Definition: mnt6_g1.cpp:32