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 | Friends | List of all members
libff::bw6_761_G1 Class Reference

#include <bw6_761_g1.hpp>

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

Public Types

typedef bw6_761_Fq base_field
 
typedef bw6_761_Fr scalar_field
 

Public Member Functions

 bw6_761_G1 ()
 
 bw6_761_G1 (const bw6_761_Fq &X, const bw6_761_Fq &Y, const bw6_761_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 bw6_761_G1 &other) const
 
bool operator!= (const bw6_761_G1 &other) const
 
bw6_761_G1 operator+ (const bw6_761_G1 &other) const
 
bw6_761_G1 operator- () const
 
bw6_761_G1 operator- (const bw6_761_G1 &other) const
 
bw6_761_G1 add (const bw6_761_G1 &other) const
 
bw6_761_G1 mixed_add (const bw6_761_G1 &other) const
 
bw6_761_G1 dbl () const
 
bw6_761_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 bw6_761_G1zero ()
 
static const bw6_761_G1one ()
 
static bw6_761_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 &, bw6_761_G1 &)
 
static void read_compressed (std::istream &, bw6_761_G1 &)
 
static void batch_to_special_all_non_zeros (std::vector< bw6_761_G1 > &vec)
 

Public Attributes

bw6_761_Fq X
 
bw6_761_Fq Y
 
bw6_761_Fq Z
 

Static Public Attributes

static std::vector< size_t > wnaf_window_table
 
static std::vector< size_t > fixed_base_exp_window_table
 
static bw6_761_G1 G1_zero
 
static bw6_761_G1 G1_one
 
static bw6_761_Fq coeff_a
 
static bw6_761_Fq coeff_b
 
static const mp_size_t h_bitcount = 384
 
static const mp_size_t h_limbs
 
static bigint< h_limbsh
 

Friends

std::ostream & operator<< (std::ostream &out, const bw6_761_G1 &g)
 
std::istream & operator>> (std::istream &in, bw6_761_G1 &g)
 

Detailed Description

Definition at line 14 of file bw6_761_g1.hpp.

Member Typedef Documentation

◆ base_field

Definition at line 28 of file bw6_761_g1.hpp.

◆ scalar_field

Definition at line 29 of file bw6_761_g1.hpp.

Constructor & Destructor Documentation

◆ bw6_761_G1() [1/2]

libff::bw6_761_G1::bw6_761_G1 ( )

Definition at line 19 of file bw6_761_g1.cpp.

20 {
21  this->X = G1_zero.X;
22  this->Y = G1_zero.Y;
23  this->Z = G1_zero.Z;
24 }
Here is the caller graph for this function:

◆ bw6_761_G1() [2/2]

libff::bw6_761_G1::bw6_761_G1 ( const bw6_761_Fq X,
const bw6_761_Fq Y,
const bw6_761_Fq Z 
)
inline

Definition at line 41 of file bw6_761_g1.hpp.

42  : X(X), Y(Y), Z(Z){};

Member Function Documentation

◆ add()

bw6_761_G1 libff::bw6_761_G1::add ( const bw6_761_G1 other) const

Definition at line 206 of file bw6_761_g1.cpp.

207 {
208  if (this->is_zero()) {
209  return other;
210  }
211 
212  if (other.is_zero()) {
213  return (*this);
214  }
215 
216  // No need to handle points of order 2,4
217  // (they cannot exist in a prime-order subgroup)
218 
219  // Point doubling (i.e. P + P)
220  if (this->operator==(other)) {
221  return this->dbl();
222  }
223 
224 #ifdef PROFILE_OP_COUNTS
225  this->add_cnt++;
226 #endif
227  // NOTE: does not handle O and pts of order 2,4
228  // Point addition (i.e. P + Q, P =/= Q)
229  // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-projective.html#addition-add-1998-cmo-2
230  // Y1Z2 = Y1*Z2
231  const bw6_761_Fq Y1Z2 = (this->Y) * (other.Z);
232  // X1Z2 = X1*Z2
233  const bw6_761_Fq X1Z2 = (this->X) * (other.Z);
234  // Z1Z2 = Z1*Z2
235  const bw6_761_Fq Z1Z2 = (this->Z) * (other.Z);
236  // u = Y2*Z1-Y1Z2
237  const bw6_761_Fq u = (other.Y) * (this->Z) - Y1Z2;
238  // uu = u^2
239  const bw6_761_Fq uu = u.squared();
240  // v = X2*Z1-X1Z2
241  const bw6_761_Fq v = (other.X) * (this->Z) - X1Z2;
242  // vv = v^2
243  const bw6_761_Fq vv = v.squared();
244  // vvv = v*vv
245  const bw6_761_Fq vvv = v * vv;
246  // R = vv*X1Z2
247  const bw6_761_Fq R = vv * X1Z2;
248  // A = uu*Z1Z2 - vvv - 2*R
249  const bw6_761_Fq A = uu * Z1Z2 - (vvv + R + R);
250  // X3 = v*A
251  const bw6_761_Fq X3 = v * A;
252  // Y3 = u*(R-A) - vvv*Y1Z2
253  const bw6_761_Fq Y3 = u * (R - A) - vvv * Y1Z2;
254  // Z3 = vvv*Z1Z2
255  const bw6_761_Fq Z3 = vvv * Z1Z2;
256 
257  return bw6_761_G1(X3, Y3, Z3);
258 }
Here is the call graph for this function:

◆ base_field_char()

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

Definition at line 73 of file bw6_761_g1.hpp.

74  {
75  return base_field::field_char();
76  }
Here is the call graph for this function:

◆ batch_to_special_all_non_zeros()

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

Definition at line 489 of file bw6_761_g1.cpp.

490 {
491  std::vector<bw6_761_Fq> Z_vec;
492  Z_vec.reserve(vec.size());
493 
494  for (auto &el : vec) {
495  Z_vec.emplace_back(el.Z);
496  }
497  batch_invert<bw6_761_Fq>(Z_vec);
498 
499  const bw6_761_Fq one = bw6_761_Fq::one();
500 
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];
504  vec[i].Z = one;
505  }
506 }
Here is the call graph for this function:

◆ dbl()

bw6_761_G1 libff::bw6_761_G1::dbl ( ) const

Definition at line 318 of file bw6_761_g1.cpp.

319 {
320 #ifdef PROFILE_OP_COUNTS
321  this->dbl_cnt++;
322 #endif
323  if (this->is_zero()) {
324  return (*this);
325  }
326 
327  // NOTE: does not handle O and pts of order 2,4
328  // (they cannot exist in a prime-order subgroup)
329 
330  // Point doubling (i.e. P + P)
331  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/projective/doubling/dbl-2007-bl
332  // XX = X1^2
333  const bw6_761_Fq XX = (this->X).squared();
334  // w = a*ZZ + 3*XX = 3*XX (since a=0)
335  const bw6_761_Fq w = XX + XX + XX;
336  const bw6_761_Fq Y1Z1 = (this->Y) * (this->Z);
337  // s = 2*Y1*Z1
338  const bw6_761_Fq s = Y1Z1 + Y1Z1;
339  // ss = s^2
340  const bw6_761_Fq ss = s.squared();
341  // sss = s*ss
342  const bw6_761_Fq sss = s * ss;
343  // R = Y1*s
344  const bw6_761_Fq R = (this->Y) * s;
345  // RR = R^2
346  const bw6_761_Fq RR = R.squared();
347  // B = (X1+R)^2 - XX - RR
348  const bw6_761_Fq B = ((this->X) + R).squared() - XX - RR;
349  // h = w^2 - 2*B
350  const bw6_761_Fq h = w.squared() - (B + B);
351  // X3 = h*s
352  const bw6_761_Fq X3 = h * s;
353  // Y3 = w*(B-h) - 2*RR
354  const bw6_761_Fq Y3 = w * (B - h) - (RR + RR);
355  // Z3 = sss
356  const bw6_761_Fq Z3 = sss;
357  return bw6_761_G1(X3, Y3, Z3);
358 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_in_safe_subgroup()

bool libff::bw6_761_G1::is_in_safe_subgroup ( ) const

Definition at line 385 of file bw6_761_g1.cpp.

386 {
387  return zero() == scalar_field::mod * (*this);
388 }
Here is the call graph for this function:

◆ is_special()

bool libff::bw6_761_G1::is_special ( ) const

Definition at line 74 of file bw6_761_g1.cpp.

75 {
76  return (this->is_zero() || this->Z == bw6_761_Fq::one());
77 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_well_formed()

bool libff::bw6_761_G1::is_well_formed ( ) const

Definition at line 365 of file bw6_761_g1.cpp.

366 {
367  if (this->is_zero()) {
368  return true;
369  }
370 
371  // The curve equation is
372  // y^2 = x^3 + ax + b, where a=0 and b=-1
373  // We are using Projective coordinates. As such, the equation becomes:
374  // (y/z)^2 = (x/z)^3 + a (x/z) + b
375  // = z y^2 = x^3 + a z^2 x + b z^3
376  // = z (y^2 - b z^2) = x ( x^2 + a z^2)
377  // = z (y^2 - b z^2) = x^3, since a = 0
378  const bw6_761_Fq X2 = this->X.squared();
379  const bw6_761_Fq Y2 = this->Y.squared();
380  const bw6_761_Fq Z2 = this->Z.squared();
381 
382  return (this->Z * (Y2 - bw6_761_coeff_b * Z2) == this->X * X2);
383 }
Here is the call graph for this function:

◆ is_zero()

bool libff::bw6_761_G1::is_zero ( ) const

Definition at line 79 of file bw6_761_g1.cpp.

80 {
81  return (this->X.is_zero() && this->Z.is_zero());
82 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixed_add()

bw6_761_G1 libff::bw6_761_G1::mixed_add ( const bw6_761_G1 other) const

Definition at line 263 of file bw6_761_g1.cpp.

264 {
265 #ifdef DEBUG
266  assert(other.is_special());
267 #endif
268 
269  if (this->is_zero()) {
270  return other;
271  }
272 
273  if (other.is_zero()) {
274  return (*this);
275  }
276 
277  // X2Z1 = X2*Z1
278  const bw6_761_Fq X2Z1 = (this->Z) * (other.X);
279  // Y2Z1 = Y2*Z1
280  const bw6_761_Fq Y2Z1 = (this->Z) * (other.Y);
281 
282  // (X1/Z1) == X2 => X1 == X2Z1
283  // (Y1/Z1) == Y2 => Y1 == Y2Z1
284  if (this->X == X2Z1 && this->Y == Y2Z1) {
285  return this->dbl();
286  }
287 
288 #ifdef PROFILE_OP_COUNTS
289  this->add_cnt++;
290 #endif
291 
292  // Mixed point addition
293  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/projective/addition/madd-1998-cmo
294  // u = Y2*Z1-Y1
295  bw6_761_Fq u = Y2Z1 - this->Y;
296  // uu = u2
297  bw6_761_Fq uu = u.squared();
298  // v = X2*Z1-X1
299  bw6_761_Fq v = X2Z1 - this->X;
300  // vv = v2
301  bw6_761_Fq vv = v.squared();
302  // vvv = v*vv
303  bw6_761_Fq vvv = v * vv;
304  // R = vv*X1
305  bw6_761_Fq R = vv * this->X;
306  // A = uu*Z1-vvv-2*R
307  bw6_761_Fq A = uu * this->Z - vvv - R - R;
308  // X3 = v*A
309  bw6_761_Fq X3 = v * A;
310  // Y3 = u*(R-A)-vvv*Y1
311  bw6_761_Fq Y3 = u * (R - A) - vvv * this->Y;
312  // Z3 = vvv*Z1
313  bw6_761_Fq Z3 = vvv * this->Z;
314 
315  return bw6_761_G1(X3, Y3, Z3);
316 }
Here is the call graph for this function:

◆ mul_by_cofactor()

bw6_761_G1 libff::bw6_761_G1::mul_by_cofactor ( ) const

Definition at line 360 of file bw6_761_g1.cpp.

361 {
362  return bw6_761_G1::h * (*this);
363 }

◆ one()

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

Definition at line 392 of file bw6_761_g1.cpp.

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

◆ operator!=()

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

Definition at line 106 of file bw6_761_g1.cpp.

107 {
108  return !(operator==(other));
109 }
Here is the call graph for this function:

◆ operator+()

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

Definition at line 111 of file bw6_761_g1.cpp.

112 {
113  // Handle special cases having to do with O
114  if (this->is_zero()) {
115  return other;
116  }
117 
118  if (other.is_zero()) {
119  return *this;
120  }
121 
122  // No need to handle points of order 2,4
123  // (they cannot exist in a prime-order subgroup)
124 
125  // X1Z2 = X1*Z2
126  const bw6_761_Fq X1Z2 = (this->X) * (other.Z);
127  // X2Z1 = X2*Z1
128  const bw6_761_Fq X2Z1 = (this->Z) * (other.X);
129 
130  // Y1Z2 = Y1*Z2
131  const bw6_761_Fq Y1Z2 = (this->Y) * (other.Z);
132  // Y2Z1 = Y2*Z1
133  const bw6_761_Fq Y2Z1 = (this->Z) * (other.Y);
134 
135  // Check if the 2 points are equal, in which can we do a point doubling
136  // (i.e. P + P)
137  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/projective/doubling/dbl-2007-bl
138  if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
139  // XX = X1^2
140  const bw6_761_Fq XX = (this->X).squared();
141  // w = a*ZZ + 3*XX = 3*XX (since a=0)
142  const bw6_761_Fq w = XX + XX + XX;
143  const bw6_761_Fq Y1Z1 = (this->Y) * (this->Z);
144  // s = 2*Y1*Z1
145  const bw6_761_Fq s = Y1Z1 + Y1Z1;
146  // ss = s^2
147  const bw6_761_Fq ss = s.squared();
148  // sss = s*ss
149  const bw6_761_Fq sss = s * ss;
150  // R = Y1*s
151  const bw6_761_Fq R = (this->Y) * s;
152  // RR = R^2
153  const bw6_761_Fq RR = R.squared();
154  // B = (X1+R)^2 - XX - RR
155  const bw6_761_Fq B = ((this->X) + R).squared() - XX - RR;
156  // h = w^2 - 2*B
157  const bw6_761_Fq h = w.squared() - (B + B);
158  // X3 = h*s
159  const bw6_761_Fq X3 = h * s;
160  // Y3 = w*(B-h) - 2*RR
161  const bw6_761_Fq Y3 = w * (B - h) - (RR + RR);
162  // Z3 = sss
163  const bw6_761_Fq Z3 = sss;
164 
165  return bw6_761_G1(X3, Y3, Z3);
166  }
167 
168  // Point addition (i.e. P + Q, P =/= Q)
169  // https://www.hyperelliptic.org/EFD/g1p/data/shortw/projective/addition/add-1998-cmo-2
170  // Z1Z2 = Z1*Z2
171  const bw6_761_Fq Z1Z2 = (this->Z) * (other.Z);
172  // u = Y2*Z1-Y1Z2
173  const bw6_761_Fq u = Y2Z1 - Y1Z2;
174  // uu = u^2
175  const bw6_761_Fq uu = u.squared();
176  // v = X2*Z1-X1Z2
177  const bw6_761_Fq v = X2Z1 - X1Z2;
178  // vv = v^2
179  const bw6_761_Fq vv = v.squared();
180  // vvv = v*vv
181  const bw6_761_Fq vvv = v * vv;
182  // R = vv*X1Z2
183  const bw6_761_Fq R = vv * X1Z2;
184  // A = uu*Z1Z2 - vvv - 2*R
185  const bw6_761_Fq A = uu * Z1Z2 - (vvv + R + R);
186  // X3 = v*A
187  const bw6_761_Fq X3 = v * A;
188  // Y3 = u*(R-A) - vvv*Y1Z2
189  const bw6_761_Fq Y3 = u * (R - A) - vvv * Y1Z2;
190  // Z3 = vvv*Z1Z2
191  const bw6_761_Fq Z3 = vvv * Z1Z2;
192 
193  return bw6_761_G1(X3, Y3, Z3);
194 }
Here is the call graph for this function:

◆ operator-() [1/2]

bw6_761_G1 libff::bw6_761_G1::operator- ( ) const

Definition at line 196 of file bw6_761_g1.cpp.

197 {
198  return bw6_761_G1(this->X, -(this->Y), this->Z);
199 }
Here is the call graph for this function:

◆ operator-() [2/2]

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

Definition at line 201 of file bw6_761_g1.cpp.

202 {
203  return (*this) + (-other);
204 }

◆ operator==()

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

Definition at line 84 of file bw6_761_g1.cpp.

85 {
86  if (this->is_zero()) {
87  return other.is_zero();
88  }
89 
90  if (other.is_zero()) {
91  return false;
92  }
93 
94  // Using Projective coordinates so:
95  // (X1:Y1:Z1) = (X2:Y2:Z2) <=>
96  // X1/Z1 = X2/Z2 AND Y1/Z1 = Y2/Z2 <=>
97  // X1*Z2 = X2*Z1 AND Y1*Z2 = Y2*Z1
98  if (((this->X * other.Z) != (other.X * this->Z)) ||
99  ((this->Y * other.Z) != (other.Y * this->Z))) {
100  return false;
101  }
102 
103  return true;
104 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ order()

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

Definition at line 77 of file bw6_761_g1.hpp.

78  {
79  return scalar_field::field_char();
80  }
Here is the call graph for this function:

◆ print()

void libff::bw6_761_G1::print ( ) const

Definition at line 26 of file bw6_761_g1.cpp.

27 {
28  if (this->is_zero()) {
29  printf("O\n");
30  } else {
31  bw6_761_G1 copy(*this);
32  copy.to_affine_coordinates();
33  gmp_printf(
34  "(%Nd , %Nd)\n",
35  copy.X.as_bigint().data,
37  copy.Y.as_bigint().data,
39  }
40 }
Here is the call graph for this function:

◆ print_coordinates()

void libff::bw6_761_G1::print_coordinates ( ) const

Definition at line 42 of file bw6_761_g1.cpp.

43 {
44  if (this->is_zero()) {
45  printf("O\n");
46  } else {
47  gmp_printf(
48  "(%Nd : %Nd : %Nd)\n",
49  this->X.as_bigint().data,
51  this->Y.as_bigint().data,
53  this->Z.as_bigint().data,
55  }
56 }
Here is the call graph for this function:

◆ random_element()

bw6_761_G1 libff::bw6_761_G1::random_element ( )
static

Definition at line 394 of file bw6_761_g1.cpp.

395 {
396  return (scalar_field::random_element().as_bigint()) * G1_one;
397 }
Here is the call graph for this function:

◆ read_compressed()

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

Definition at line 444 of file bw6_761_g1.cpp.

445 {
446  char is_zero;
447  bw6_761_Fq tX, tY;
448 
449  // this reads is_zero;
450  in.read((char *)&is_zero, 1);
451  is_zero -= '0';
453 
454  unsigned char Y_lsb;
455  in >> tX;
457  in.read((char *)&Y_lsb, 1);
458  Y_lsb -= '0';
459 
460  // y = +/- sqrt(x^3 + a*x + b)
461  if (!is_zero) {
462  // using Projective coordinates
463  bw6_761_Fq tX2 = tX.squared();
464  bw6_761_Fq tY2 = tX2 * tX + bw6_761_coeff_b;
465  tY = tY2.sqrt();
466 
467  if ((tY.as_bigint().data[0] & 1) != Y_lsb) {
468  tY = -tY;
469  }
470 
471  g.X = tX;
472  g.Y = tY;
473  g.Z = bw6_761_Fq::one();
474  } else {
475  g = bw6_761_G1::zero();
476  }
477 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_uncompressed()

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

Definition at line 426 of file bw6_761_g1.cpp.

427 {
428  char is_zero;
429  bw6_761_Fq tX, tY;
430 
431  in >> is_zero >> tX >> tY;
432  is_zero -= '0';
433 
434  // using projective coordinates
435  if (!is_zero) {
436  g.X = tX;
437  g.Y = tY;
438  g.Z = bw6_761_Fq::one();
439  } else {
440  g = bw6_761_G1::zero();
441  }
442 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ size_in_bits()

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

Definition at line 72 of file bw6_761_g1.hpp.

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

◆ to_affine_coordinates()

void libff::bw6_761_G1::to_affine_coordinates ( )

Definition at line 58 of file bw6_761_g1.cpp.

59 {
60  if (this->is_zero()) {
61  this->X = bw6_761_Fq::zero();
62  this->Y = bw6_761_Fq::one();
63  this->Z = bw6_761_Fq::zero();
64  } else {
65  const bw6_761_Fq Z_inv = Z.inverse();
66  this->X = this->X * Z_inv;
67  this->Y = this->Y * Z_inv;
68  this->Z = bw6_761_Fq::one();
69  }
70 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_special()

void libff::bw6_761_G1::to_special ( )

Definition at line 72 of file bw6_761_g1.cpp.

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

◆ write_compressed()

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

Definition at line 407 of file bw6_761_g1.cpp.

408 {
409  bw6_761_G1 copy(*this);
410  copy.to_affine_coordinates();
411  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
412  /* storing LSB of Y */
413  out << copy.X << OUTPUT_SEPARATOR << (copy.Y.as_bigint().data[0] & 1);
414 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_uncompressed()

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

Definition at line 399 of file bw6_761_g1.cpp.

400 {
401  bw6_761_G1 copy(*this);
402  copy.to_affine_coordinates();
403  out << (copy.is_zero() ? 1 : 0) << OUTPUT_SEPARATOR;
404  out << copy.X << OUTPUT_SEPARATOR << copy.Y;
405 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero()

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

Definition at line 390 of file bw6_761_g1.cpp.

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

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const bw6_761_G1 g 
)
friend

Definition at line 416 of file bw6_761_g1.cpp.

417 {
418 #ifdef NO_PT_COMPRESSION
419  g.write_uncompressed(out);
420 #else
421  g.write_compressed(out);
422 #endif
423  return out;
424 }

◆ operator>>

std::istream& operator>> ( std::istream &  in,
bw6_761_G1 g 
)
friend

Definition at line 479 of file bw6_761_g1.cpp.

480 {
481 #ifdef NO_PT_COMPRESSION
483 #else
485 #endif
486  return in;
487 }

Member Data Documentation

◆ coeff_a

bw6_761_Fq libff::bw6_761_G1::coeff_a
static

Definition at line 25 of file bw6_761_g1.hpp.

◆ coeff_b

bw6_761_Fq libff::bw6_761_G1::coeff_b
static

Definition at line 26 of file bw6_761_g1.hpp.

◆ fixed_base_exp_window_table

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

Definition at line 22 of file bw6_761_g1.hpp.

◆ G1_one

bw6_761_G1 libff::bw6_761_G1::G1_one
static

Definition at line 24 of file bw6_761_g1.hpp.

◆ G1_zero

bw6_761_G1 libff::bw6_761_G1::G1_zero
static

Definition at line 23 of file bw6_761_g1.hpp.

◆ h

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

Definition at line 35 of file bw6_761_g1.hpp.

◆ h_bitcount

const mp_size_t libff::bw6_761_G1::h_bitcount = 384
static

Definition at line 32 of file bw6_761_g1.hpp.

◆ h_limbs

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

Definition at line 33 of file bw6_761_g1.hpp.

◆ wnaf_window_table

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

Definition at line 21 of file bw6_761_g1.hpp.

◆ X

bw6_761_Fq libff::bw6_761_G1::X

Definition at line 37 of file bw6_761_g1.hpp.

◆ Y

bw6_761_Fq libff::bw6_761_G1::Y

Definition at line 37 of file bw6_761_g1.hpp.

◆ Z

bw6_761_Fq libff::bw6_761_G1::Z

Definition at line 37 of file bw6_761_g1.hpp.


The documentation for this class was generated from the following files:
libff::Fp_model::random_element
static Fp_model< n, modulus > random_element()
returns random element of Fp_model
libff::bw6_761_G1::G1_zero
static bw6_761_G1 G1_zero
Definition: bw6_761_g1.hpp:23
libff::bw6_761_G1::operator==
bool operator==(const bw6_761_G1 &other) const
Definition: bw6_761_g1.cpp:84
libff::Fp_model::squared
Fp_model squared() const
libff::bw6_761_G1::zero
static const bw6_761_G1 & zero()
Definition: bw6_761_g1.cpp:390
libff::bw6_761_Fq
Fp_model< bw6_761_q_limbs, bw6_761_modulus_q > bw6_761_Fq
Definition: bw6_761_init.hpp:24
libff::Fp_model< bw6_761_q_limbs, bw6_761_modulus_q >::zero
static const Fp_model< n, modulus > & zero()
libff::Fp_model::is_zero
bool is_zero() const
libff::Fp_model::inverse
Fp_model inverse() const
libff::bw6_761_G1::read_uncompressed
static void read_uncompressed(std::istream &, bw6_761_G1 &)
Definition: bw6_761_g1.cpp:426
libff::bw6_761_G1::read_compressed
static void read_compressed(std::istream &, bw6_761_G1 &)
Definition: bw6_761_g1.cpp:444
libff::Fp_model::sqrt
Fp_model sqrt() const
HAS TO BE A SQUARE (else does not terminate)
libff::Fp_model< bw6_761_q_limbs, bw6_761_modulus_q >::one
static const Fp_model< n, modulus > & one()
OUTPUT_SEPARATOR
#define OUTPUT_SEPARATOR
Definition: serialization.hpp:69
libff::bw6_761_G1::one
static const bw6_761_G1 & one()
Definition: bw6_761_g1.cpp:392
libff::Fp_model< bw6_761_q_limbs, bw6_761_modulus_q >::size_in_bits
static size_t size_in_bits()
Definition: fp.hpp:134
libff::bw6_761_G1::is_zero
bool is_zero() const
Definition: bw6_761_g1.cpp:79
libff::bw6_761_G1::dbl
bw6_761_G1 dbl() const
Definition: bw6_761_g1.cpp:318
libff::consume_OUTPUT_SEPARATOR
void consume_OUTPUT_SEPARATOR(std::istream &in)
libff::Fp_model< bw6_761_q_limbs, bw6_761_modulus_q >::num_limbs
static const mp_size_t num_limbs
Definition: fp.hpp:47
libff::bw6_761_G1::h_bitcount
static const mp_size_t h_bitcount
Definition: bw6_761_g1.hpp:32
libff::bw6_761_G1::Z
bw6_761_Fq Z
Definition: bw6_761_g1.hpp:37
libff::bw6_761_G1::Y
bw6_761_Fq Y
Definition: bw6_761_g1.hpp:37
libff::bw6_761_coeff_b
bw6_761_Fq bw6_761_coeff_b
Definition: bw6_761_init.cpp:17
libff::Fp_model< bw6_761_q_limbs, bw6_761_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::bw6_761_G1::X
bw6_761_Fq X
Definition: bw6_761_g1.hpp:37
libff::bw6_761_G1::h
static bigint< h_limbs > h
Definition: bw6_761_g1.hpp:35
libff::bw6_761_G1::G1_one
static bw6_761_G1 G1_one
Definition: bw6_761_g1.hpp:24
libff::Fp_model::mod
static const constexpr bigint< n > & mod
Definition: fp.hpp:48
libff::bw6_761_G1::bw6_761_G1
bw6_761_G1()
Definition: bw6_761_g1.cpp:19
libff::bw6_761_G1::to_affine_coordinates
void to_affine_coordinates()
Definition: bw6_761_g1.cpp:58