#include <mnt6_g2.hpp>
Definition at line 26 of file mnt6_g2.hpp.
◆ base_field
◆ scalar_field
◆ twist_field
◆ mnt6_G2() [1/2]
libff::mnt6_G2::mnt6_G2 |
( |
| ) |
|
◆ mnt6_G2() [2/2]
◆ add()
Definition at line 246 of file mnt6_g2.cpp.
247{
248
250 {
252 }
253
255 {
256 return (*this);
257 }
258
259
260
261
262
263 if (this->operator==(other))
264 {
266 }
267
268#ifdef PROFILE_OP_COUNTS
269 this->add_cnt++;
270#endif
271
272
273
287
289}
Fp3_model squared() const
Fp3_model< mnt6_q_limbs, mnt6_modulus_q > mnt6_Fq3
◆ base_field_char()
Definition at line 82 of file mnt6_g2.hpp.
static bigint< n > field_char()
◆ batch_to_special_all_non_zeros()
void libff::mnt6_G2::batch_to_special_all_non_zeros |
( |
std::vector< mnt6_G2 > & | vec | ) |
|
|
static |
Definition at line 487 of file mnt6_g2.cpp.
488{
489 std::vector<mnt6_Fq3> Z_vec;
490 Z_vec.reserve(vec.size());
491
492 for (auto &el: vec)
493 {
494 Z_vec.emplace_back(el.Z);
495 }
497
499
500 for (size_t i = 0; i < vec.size(); ++i)
501 {
502 vec[i] =
mnt6_G2(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
503 }
504}
static Fp3_model< n, modulus > one()
void batch_invert(std::vector< FieldT > &vec)
◆ dbl()
mnt6_G2 libff::mnt6_G2::dbl |
( |
| ) |
const |
Definition at line 341 of file mnt6_g2.cpp.
342{
343#ifdef PROFILE_OP_COUNTS
344 this->dbl_cnt++;
345#endif
347 {
348 return (*this);
349 }
350 else
351 {
352
353
354
369
371 }
372}
static mnt6_Fq3 mul_by_a(const mnt6_Fq3 &elt)
static const Segment ss(Segment::ss)
◆ is_special()
bool libff::mnt6_G2::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::mnt6_G2::is_well_formed |
( |
| ) |
const |
Definition at line 381 of file mnt6_g2.cpp.
382{
384 {
385 return true;
386 }
387 else
388 {
389
390
391
392
393
394
395
396
397
398
399
404
406 }
407}
mnt6_Fq3 mnt6_twist_coeff_a
mnt6_Fq3 mnt6_twist_coeff_b
◆ is_zero()
bool libff::mnt6_G2::is_zero |
( |
| ) |
const |
Definition at line 120 of file mnt6_g2.cpp.
121{
122
123 return (this->
X.is_zero() && this->Z.is_zero());
124}
◆ mixed_add()
Definition at line 291 of file mnt6_g2.cpp.
292{
293#ifdef PROFILE_OP_COUNTS
294 this->add_cnt++;
295#endif
296
297
298
299
301 {
303 }
304
306 {
307 return (*this);
308 }
309
310#ifdef DEBUG
311 assert(
other.is_special());
312#endif
313
316
317
318
321
322 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
323 {
325 }
326
337
339}
◆ mul_by_a()
Definition at line 42 of file mnt6_g2.cpp.
43{
45}
mnt6_Fq mnt6_twist_mul_by_a_c0
mnt6_Fq mnt6_twist_mul_by_a_c2
mnt6_Fq mnt6_twist_mul_by_a_c1
◆ mul_by_b()
Definition at line 47 of file mnt6_g2.cpp.
48{
50}
mnt6_Fq mnt6_twist_mul_by_b_c2
mnt6_Fq mnt6_twist_mul_by_b_c1
mnt6_Fq mnt6_twist_mul_by_b_c0
◆ mul_by_q()
mnt6_G2 libff::mnt6_G2::mul_by_q |
( |
| ) |
const |
Definition at line 374 of file mnt6_g2.cpp.
375{
378 (this->
Z).Frobenius_map(1));
379}
mnt6_Fq mnt6_twist_mul_by_q_Y
mnt6_Fq mnt6_twist_mul_by_q_X
◆ one()
◆ operator!=()
bool libff::mnt6_G2::operator!= |
( |
const mnt6_G2 & | other | ) |
const |
Definition at line 155 of file mnt6_g2.cpp.
156{
158}
bool operator==(const mnt6_G2 &other) const
◆ operator+()
Definition at line 160 of file mnt6_g2.cpp.
161{
162
164 {
166 }
167
169 {
170 return *this;
171 }
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
192
193
194
197
198 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
199 {
200
215
217 }
218
219
231
233}
◆ operator-() [1/2]
mnt6_G2 libff::mnt6_G2::operator- |
( |
| ) |
const |
◆ operator-() [2/2]
◆ operator==()
bool libff::mnt6_G2::operator== |
( |
const mnt6_G2 & | other | ) |
const |
Definition at line 126 of file mnt6_g2.cpp.
127{
129 {
130 return other.is_zero();
131 }
132
134 {
135 return false;
136 }
137
138
139
140
142 {
143 return false;
144 }
145
146
148 {
149 return false;
150 }
151
152 return true;
153}
◆ order()
◆ print()
void libff::mnt6_G2::print |
( |
| ) |
const |
Definition at line 52 of file mnt6_g2.cpp.
53{
55 {
57 }
58 else
59 {
61 copy.to_affine_coordinates();
62 gmp_printf("(%Nd*z^2 + %Nd*z + %Nd , %Nd*z^2 + %Nd*z + %Nd)\n",
69 }
70}
static const mp_size_t num_limbs
LOGGING_API void printf(Category category, const char *format,...)
void copy(const path &from, const path &to)
◆ print_coordinates()
void libff::mnt6_G2::print_coordinates |
( |
| ) |
const |
Definition at line 72 of file mnt6_g2.cpp.
73{
75 {
77 }
78 else
79 {
80 gmp_printf("(%Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z + %Nd)\n",
90 }
91}
◆ random_element()
mnt6_G2 libff::mnt6_G2::random_element |
( |
| ) |
|
|
static |
Definition at line 419 of file mnt6_g2.cpp.
420{
422}
static Fp_model< n, modulus > random_element()
◆ size_in_bits()
static size_t libff::mnt6_G2::size_in_bits |
( |
| ) |
|
|
inlinestatic |
Definition at line 81 of file mnt6_g2.hpp.
static size_t size_in_bits()
◆ to_affine_coordinates()
void libff::mnt6_G2::to_affine_coordinates |
( |
| ) |
|
Definition at line 93 of file mnt6_g2.cpp.
94{
96 {
100 }
101 else
102 {
104 this->
X = this->
X * Z_inv;
105 this->
Y = this->
Y * Z_inv;
107 }
108}
Fp3_model inverse() const
static Fp3_model< n, modulus > zero()
◆ to_special()
void libff::mnt6_G2::to_special |
( |
| ) |
|
Definition at line 110 of file mnt6_g2.cpp.
111{
113}
void to_affine_coordinates()
◆ zero()
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
const mnt6_G2 & | g ) |
|
friend |
Definition at line 424 of file mnt6_g2.cpp.
425{
427 copy.to_affine_coordinates();
428
430#ifdef NO_PT_COMPRESSION
432#else
433
435#endif
436
437 return out;
438}
◆ operator>>
std::istream & operator>> |
( |
std::istream & | in, |
|
|
mnt6_G2 & | g ) |
|
friend |
Definition at line 440 of file mnt6_g2.cpp.
441{
444
445#ifdef NO_PT_COMPRESSION
448#else
452
453 unsigned char Y_lsb;
454 in >> tX;
456 in.read((char*)&Y_lsb, 1);
457 Y_lsb -= '0';
458
459
461 {
465
466 if ((tY.c0.as_bigint().data[0] & 1) != Y_lsb)
467 {
468 tY = -tY;
469 }
470 }
471#endif
472
474 {
475 g.X = tX;
476 g.Y = tY;
478 }
479 else
480 {
482 }
483
484 return in;
485}
void consume_OUTPUT_SEPARATOR(std::istream &in)
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::mnt6_G2::fixed_base_exp_window_table |
|
static |
◆ G2_one
mnt6_G2 libff::mnt6_G2::G2_one = {} |
|
static |
◆ G2_zero
mnt6_G2 libff::mnt6_G2::G2_zero = {} |
|
static |
◆ initialized
bool libff::mnt6_G2::initialized = false |
|
static |
◆ twist
◆ wnaf_window_table
std::vector< size_t > libff::mnt6_G2::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files:
- libraries/fc/libraries/ff/libff/algebra/curves/mnt/mnt6/mnt6_g2.hpp
- libraries/fc/libraries/ff/libff/algebra/curves/mnt/mnt6/mnt6_g2.cpp