#include <mnt4_g2.hpp>
Definition at line 26 of file mnt4_g2.hpp.
◆ base_field
◆ scalar_field
◆ twist_field
◆ mnt4_G2() [1/2]
libff::mnt4_G2::mnt4_G2 |
( |
| ) |
|
◆ mnt4_G2() [2/2]
◆ add()
Definition at line 240 of file mnt4_g2.cpp.
241{
242
244 {
246 }
247
249 {
250 return (*this);
251 }
252
253
254
255
256
257 if (this->operator==(other))
258 {
260 }
261
262#ifdef PROFILE_OP_COUNTS
263 this->add_cnt++;
264#endif
265
266
267
281
283}
Fp2_model squared() const
Fp2_model< mnt4_q_limbs, mnt4_modulus_q > mnt4_Fq2
◆ base_field_char()
Definition at line 82 of file mnt4_g2.hpp.
static bigint< n > field_char()
◆ batch_to_special_all_non_zeros()
void libff::mnt4_G2::batch_to_special_all_non_zeros |
( |
std::vector< mnt4_G2 > & | vec | ) |
|
|
static |
Definition at line 480 of file mnt4_g2.cpp.
481{
482 std::vector<mnt4_Fq2> Z_vec;
483 Z_vec.reserve(vec.size());
484
485 for (auto &el: vec)
486 {
487 Z_vec.emplace_back(el.Z);
488 }
490
492
493 for (size_t i = 0; i < vec.size(); ++i)
494 {
495 vec[i] =
mnt4_G2(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
496 }
497}
static Fp2_model< n, modulus > one()
void batch_invert(std::vector< FieldT > &vec)
◆ dbl()
mnt4_G2 libff::mnt4_G2::dbl |
( |
| ) |
const |
Definition at line 335 of file mnt4_g2.cpp.
336{
337#ifdef PROFILE_OP_COUNTS
338 this->dbl_cnt++;
339#endif
341 {
342 return (*this);
343 }
344 else
345 {
346
347
348
363
365 }
366}
static mnt4_Fq2 mul_by_a(const mnt4_Fq2 &elt)
static const Segment ss(Segment::ss)
◆ is_special()
bool libff::mnt4_G2::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::mnt4_G2::is_well_formed |
( |
| ) |
const |
Definition at line 375 of file mnt4_g2.cpp.
376{
378 {
379 return true;
380 }
381 else
382 {
383
384
385
386
387
388
389
390
391
392
397
399 }
400}
mnt4_Fq2 mnt4_twist_coeff_b
mnt4_Fq2 mnt4_twist_coeff_a
◆ is_zero()
bool libff::mnt4_G2::is_zero |
( |
| ) |
const |
Definition at line 115 of file mnt4_g2.cpp.
116{
117 return (this->
X.is_zero() && this->Z.is_zero());
118}
◆ mixed_add()
Definition at line 285 of file mnt4_g2.cpp.
286{
287#ifdef PROFILE_OP_COUNTS
288 this->add_cnt++;
289#endif
290
291
292
293
295 {
297 }
298
300 {
301 return (*this);
302 }
303
304#ifdef DEBUG
305 assert(
other.is_special());
306#endif
307
310
311
312
315
316 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
317 {
319 }
320
331
333}
◆ mul_by_a()
Definition at line 32 of file mnt4_g2.cpp.
33{
35}
mnt4_Fq mnt4_twist_mul_by_a_c0
mnt4_Fq mnt4_twist_mul_by_a_c1
◆ mul_by_b()
Definition at line 37 of file mnt4_g2.cpp.
38{
40}
mnt4_Fq mnt4_twist_mul_by_b_c1
mnt4_Fq mnt4_twist_mul_by_b_c0
◆ mul_by_q()
mnt4_G2 libff::mnt4_G2::mul_by_q |
( |
| ) |
const |
Definition at line 368 of file mnt4_g2.cpp.
369{
372 (this->
Z).Frobenius_map(1));
373}
mnt4_Fq mnt4_twist_mul_by_q_X
mnt4_Fq mnt4_twist_mul_by_q_Y
◆ one()
◆ operator!=()
bool libff::mnt4_G2::operator!= |
( |
const mnt4_G2 & | other | ) |
const |
Definition at line 149 of file mnt4_g2.cpp.
150{
152}
bool operator==(const mnt4_G2 &other) const
◆ operator+()
Definition at line 154 of file mnt4_g2.cpp.
155{
156
158 {
160 }
161
163 {
164 return *this;
165 }
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
186
187
188
191
192 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1)
193 {
194
209
211 }
212
213
225
227}
◆ operator-() [1/2]
mnt4_G2 libff::mnt4_G2::operator- |
( |
| ) |
const |
◆ operator-() [2/2]
◆ operator==()
bool libff::mnt4_G2::operator== |
( |
const mnt4_G2 & | other | ) |
const |
Definition at line 120 of file mnt4_g2.cpp.
121{
123 {
124 return other.is_zero();
125 }
126
128 {
129 return false;
130 }
131
132
133
134
136 {
137 return false;
138 }
139
140
142 {
143 return false;
144 }
145
146 return true;
147}
◆ order()
◆ print()
void libff::mnt4_G2::print |
( |
| ) |
const |
Definition at line 52 of file mnt4_g2.cpp.
53{
55 {
57 }
58 else
59 {
61 copy.to_affine_coordinates();
62 gmp_printf("(%Nd*z + %Nd , %Nd*z + %Nd)\n",
67 }
68}
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::mnt4_G2::print_coordinates |
( |
| ) |
const |
Definition at line 70 of file mnt4_g2.cpp.
71{
73 {
75 }
76 else
77 {
78 gmp_printf("(%Nd*z + %Nd : %Nd*z + %Nd : %Nd*z + %Nd)\n",
85 }
86}
◆ random_element()
mnt4_G2 libff::mnt4_G2::random_element |
( |
| ) |
|
|
static |
Definition at line 412 of file mnt4_g2.cpp.
413{
415}
static Fp_model< n, modulus > random_element()
◆ size_in_bits()
static size_t libff::mnt4_G2::size_in_bits |
( |
| ) |
|
|
inlinestatic |
Definition at line 81 of file mnt4_g2.hpp.
static size_t size_in_bits()
◆ to_affine_coordinates()
void libff::mnt4_G2::to_affine_coordinates |
( |
| ) |
|
Definition at line 88 of file mnt4_g2.cpp.
89{
91 {
95 }
96 else
97 {
102 }
103}
static Fp2_model< n, modulus > zero()
Fp2_model inverse() const
◆ to_special()
void libff::mnt4_G2::to_special |
( |
| ) |
|
Definition at line 105 of file mnt4_g2.cpp.
106{
108}
void to_affine_coordinates()
◆ zero()
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
const mnt4_G2 & | g ) |
|
friend |
Definition at line 417 of file mnt4_g2.cpp.
418{
420 copy.to_affine_coordinates();
421
423#ifdef NO_PT_COMPRESSION
425#else
426
428#endif
429
430 return out;
431}
◆ operator>>
std::istream & operator>> |
( |
std::istream & | in, |
|
|
mnt4_G2 & | g ) |
|
friend |
Definition at line 433 of file mnt4_g2.cpp.
434{
437
438#ifdef NO_PT_COMPRESSION
441#else
445
446 unsigned char Y_lsb;
447 in >> tX;
449 in.read((char*)&Y_lsb, 1);
450 Y_lsb -= '0';
451
452
454 {
458
459 if ((tY.c0.as_bigint().data[0] & 1) != Y_lsb)
460 {
461 tY = -tY;
462 }
463 }
464#endif
465
467 {
468 g.X = tX;
469 g.Y = tY;
471 }
472 else
473 {
475 }
476
477 return in;
478}
void consume_OUTPUT_SEPARATOR(std::istream &in)
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::mnt4_G2::fixed_base_exp_window_table |
|
static |
◆ G2_one
mnt4_G2 libff::mnt4_G2::G2_one = {} |
|
static |
◆ G2_zero
mnt4_G2 libff::mnt4_G2::G2_zero = {} |
|
static |
◆ initialized
bool libff::mnt4_G2::initialized |
|
static |
◆ twist
◆ wnaf_window_table
std::vector< size_t > libff::mnt4_G2::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files:
- libraries/fc/libraries/ff/libff/algebra/curves/mnt/mnt4/mnt4_g2.hpp
- libraries/fc/libraries/ff/libff/algebra/curves/mnt/mnt4/mnt4_g2.cpp