#include <edwards_g2.hpp>
Definition at line 22 of file edwards_g2.hpp.
◆ base_field
◆ scalar_field
◆ twist_field
◆ edwards_G2() [1/2]
libff::edwards_G2::edwards_G2 |
( |
| ) |
|
◆ edwards_G2() [2/2]
◆ add()
Definition at line 210 of file edwards_g2.cpp.
212 #ifdef PROFILE_OP_COUNTS
231 const edwards_Fq3 I = (this->
X + this->
Y) * (other.X + other.Y) - C - D;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::edwards_G2::batch_to_special_all_non_zeros |
( |
std::vector< edwards_G2 > & |
vec | ) |
|
|
static |
Definition at line 446 of file edwards_g2.cpp.
448 std::vector<edwards_Fq3> Z_vec;
449 Z_vec.reserve(vec.size());
451 for (
auto &el : vec) {
452 Z_vec.emplace_back(el.Z);
454 batch_invert<edwards_Fq3>(Z_vec);
458 for (
size_t i = 0; i < vec.size(); ++i) {
459 vec[i].X = vec[i].X * Z_vec[i];
460 vec[i].Y = vec[i].Y * Z_vec[i];
◆ dbl()
◆ is_special()
bool libff::edwards_G2::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::edwards_G2::is_well_formed |
( |
| ) |
const |
Definition at line 330 of file edwards_g2.cpp.
348 return (Z2 * (aY2 + X2 - dZ2) == X2 * Y2);
◆ is_zero()
bool libff::edwards_G2::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 242 of file edwards_g2.cpp.
244 #ifdef PROFILE_OP_COUNTS
252 if (other.is_zero()) {
257 assert(other.is_special());
276 const edwards_Fq3 I = (this->
X + this->
Y) * (other.X + other.Y) - C - D;
◆ mul_by_a()
◆ mul_by_d()
◆ mul_by_q()
◆ one()
◆ operator!=()
bool libff::edwards_G2::operator!= |
( |
const edwards_G2 & |
other | ) |
const |
◆ operator+()
Definition at line 186 of file edwards_g2.cpp.
193 if (other.is_zero()) {
197 return this->
add(other);
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator==()
bool libff::edwards_G2::operator== |
( |
const edwards_G2 & |
other | ) |
const |
Definition at line 156 of file edwards_g2.cpp.
159 return other.is_zero();
162 if (other.is_zero()) {
169 if ((this->
X * other.Z) != (other.X * this->Z)) {
174 if ((this->
Y * other.Z) != (other.Y * this->Z)) {
◆ order()
◆ print()
void libff::edwards_G2::print |
( |
| ) |
const |
Definition at line 54 of file edwards_g2.cpp.
60 copy.to_affine_coordinates();
62 "(%Nd*z^2 + %Nd*z + %Nd , %Nd*z^2 + %Nd*z + %Nd)\n",
63 copy.X.coeffs[2].as_bigint().data,
65 copy.X.coeffs[1].as_bigint().data,
67 copy.X.coeffs[0].as_bigint().data,
69 copy.Y.coeffs[2].as_bigint().data,
71 copy.Y.coeffs[1].as_bigint().data,
73 copy.Y.coeffs[0].as_bigint().data,
◆ print_coordinates()
void libff::edwards_G2::print_coordinates |
( |
| ) |
const |
Definition at line 78 of file edwards_g2.cpp.
84 "(%Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z + %Nd : %Nd*z^2 + %Nd*z "
88 this->X.coeffs[1].as_bigint().data,
90 this->X.coeffs[0].as_bigint().data,
92 this->Y.coeffs[2].as_bigint().data,
94 this->Y.coeffs[1].as_bigint().data,
96 this->Y.coeffs[0].as_bigint().data,
98 this->Z.coeffs[2].as_bigint().data,
100 this->Z.coeffs[1].as_bigint().data,
102 this->Z.coeffs[0].as_bigint().data,
◆ random_element()
◆ read_compressed()
void libff::edwards_G2::read_compressed |
( |
std::istream & |
in, |
|
|
edwards_G2 & |
g |
|
) |
| |
|
static |
Definition at line 394 of file edwards_g2.cpp.
403 in.read((
char *)&Y_lsb, 1);
412 if ((tY.coeffs[0].as_bigint().data[0] & 1) != Y_lsb) {
421 #ifdef USE_MIXED_ADDITION
◆ read_uncompressed()
void libff::edwards_G2::read_uncompressed |
( |
std::istream & |
in, |
|
|
edwards_G2 & |
g |
|
) |
| |
|
static |
◆ size_in_bits()
static size_t libff::edwards_G2::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::edwards_G2::to_affine_coordinates |
( |
| ) |
|
Definition at line 107 of file edwards_g2.cpp.
120 this->
X = tX * tZ_inv;
121 this->Y = tY * tZ_inv;
◆ to_special()
void libff::edwards_G2::to_special |
( |
| ) |
|
Definition at line 126 of file edwards_g2.cpp.
132 #if defined(DEBUG) && !defined(NDEBUG)
137 this->
X = this->
X * Z_inv;
138 this->
Y = this->
Y * Z_inv;
142 assert((*
this) == copy);
◆ write_compressed()
void libff::edwards_G2::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 368 of file edwards_g2.cpp.
371 copy.to_affine_coordinates();
374 << (copy.Y.coeffs[0].as_bigint().data[0] & 1);
◆ write_uncompressed()
void libff::edwards_G2::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
◆ zero()
◆ fixed_base_exp_window_table
std::vector< size_t > libff::edwards_G2::fixed_base_exp_window_table |
|
static |
◆ G2_one
◆ G2_zero
◆ wnaf_window_table
std::vector< size_t > libff::edwards_G2::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files:
- /home/runner/work/libff/libff/libff/algebra/curves/edwards/edwards_g2.hpp
- /home/runner/work/libff/libff/libff/algebra/curves/edwards/edwards_g2.cpp