#include <alt_bn128_g2.hpp>
Definition at line 21 of file alt_bn128_g2.hpp.
◆ base_field
◆ scalar_field
◆ twist_field
◆ alt_bn128_G2() [1/2]
libff::alt_bn128_G2::alt_bn128_G2 |
( |
| ) |
|
◆ alt_bn128_G2() [2/2]
◆ add()
Definition at line 166 of file alt_bn128_g2.cpp.
173 if (other.is_zero()) {
203 if (U1 == U2 && S1 == S2) {
208 #ifdef PROFILE_OP_COUNTS
229 const alt_bn128_Fq2 Z3 = ((this->
Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::alt_bn128_G2::batch_to_special_all_non_zeros |
( |
std::vector< alt_bn128_G2 > & |
vec | ) |
|
|
static |
Definition at line 486 of file alt_bn128_g2.cpp.
489 std::vector<alt_bn128_Fq2> Z_vec;
490 Z_vec.reserve(vec.size());
492 for (
auto &el : vec) {
493 Z_vec.emplace_back(el.Z);
495 batch_invert<alt_bn128_Fq2>(Z_vec);
499 for (
size_t i = 0; i < vec.size(); ++i) {
503 vec[i].X = vec[i].X * Z2;
504 vec[i].Y = vec[i].Y * Z3;
◆ dbl()
Definition at line 311 of file alt_bn128_g2.cpp.
313 #ifdef PROFILE_OP_COUNTS
340 eightC = eightC + eightC;
341 eightC = eightC + eightC;
◆ is_in_safe_subgroup()
bool libff::alt_bn128_G2::is_in_safe_subgroup |
( |
| ) |
const |
◆ is_special()
bool libff::alt_bn128_G2::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::alt_bn128_G2::is_well_formed |
( |
| ) |
const |
◆ is_zero()
bool libff::alt_bn128_G2::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 234 of file alt_bn128_g2.cpp.
237 assert(other.is_special());
245 if (other.is_zero()) {
275 if (U1 == U2 && S1 == S2) {
280 #ifdef PROFILE_OP_COUNTS
304 Y3 = r * (V - X3) - Y3 - Y3;
◆ mul_by_b()
◆ mul_by_cofactor()
◆ mul_by_q()
◆ one()
◆ operator!=()
bool libff::alt_bn128_G2::operator!= |
( |
const alt_bn128_G2 & |
other | ) |
const |
◆ operator+()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator==()
bool libff::alt_bn128_G2::operator== |
( |
const alt_bn128_G2 & |
other | ) |
const |
Definition at line 110 of file alt_bn128_g2.cpp.
113 return other.is_zero();
116 if (other.is_zero()) {
132 if ((this->
X * Z2_squared) != (other.X * Z1_squared)) {
139 if ((this->
Y * Z2_cubed) != (other.Y * Z1_cubed)) {
◆ order()
◆ print()
void libff::alt_bn128_G2::print |
( |
| ) |
const |
Definition at line 43 of file alt_bn128_g2.cpp.
49 copy.to_affine_coordinates();
51 "(%Nd*z + %Nd , %Nd*z + %Nd)\n",
52 copy.X.coeffs[1].as_bigint().data,
54 copy.X.coeffs[0].as_bigint().data,
56 copy.Y.coeffs[1].as_bigint().data,
58 copy.Y.coeffs[0].as_bigint().data,
◆ print_coordinates()
void libff::alt_bn128_G2::print_coordinates |
( |
| ) |
const |
Definition at line 63 of file alt_bn128_g2.cpp.
69 "(%Nd*z + %Nd : %Nd*z + %Nd : %Nd*z + %Nd)\n",
72 this->X.coeffs[0].as_bigint().data,
74 this->Y.coeffs[1].as_bigint().data,
76 this->Y.coeffs[0].as_bigint().data,
78 this->Z.coeffs[1].as_bigint().data,
80 this->Z.coeffs[0].as_bigint().data,
◆ random_element()
◆ read_compressed()
void libff::alt_bn128_G2::read_compressed |
( |
std::istream & |
in, |
|
|
alt_bn128_G2 & |
g |
|
) |
| |
|
static |
Definition at line 440 of file alt_bn128_g2.cpp.
444 in.read(&flags_char, 1) >> g.X;
445 const uint8_t flags = flags_char -
'0';
450 if (0 == (flags & G2_ZERO_FLAG)) {
451 const uint8_t Y_lsb = (flags & G2_Y_LSB_FLAG) ? 1 : 0;
456 if ((uint8_t)(g.Y.coeffs[0].as_bigint().data[0] & 1) != Y_lsb) {
◆ read_uncompressed()
void libff::alt_bn128_G2::read_uncompressed |
( |
std::istream & |
in, |
|
|
alt_bn128_G2 & |
g |
|
) |
| |
|
static |
◆ size_in_bits()
static size_t libff::alt_bn128_G2::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::alt_bn128_G2::to_affine_coordinates |
( |
| ) |
|
◆ to_special()
void libff::alt_bn128_G2::to_special |
( |
| ) |
|
◆ write_compressed()
void libff::alt_bn128_G2::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 412 of file alt_bn128_g2.cpp.
416 copy.to_affine_coordinates();
418 const uint8_t flags =
419 (copy.is_zero() ? G2_ZERO_FLAG : 0) |
420 ((copy.Y.coeffs[0].as_bigint().data[0] & 1) ? G2_Y_LSB_FLAG : 0);
421 const char flags_char =
'0' + flags;
422 out.write(&flags_char, 1) << copy.X;
◆ write_uncompressed()
void libff::alt_bn128_G2::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 403 of file alt_bn128_g2.cpp.
407 copy.to_affine_coordinates();
408 const char is_zero = copy.is_zero() ?
'1' :
'0';
409 out.write(&
is_zero, 1) << copy.X << copy.Y;
◆ zero()
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::alt_bn128_G2::fixed_base_exp_window_table |
|
static |
◆ G2_one
◆ G2_zero
◆ h_bitcount
const mp_size_t libff::alt_bn128_G2::h_bitcount = 256 |
|
static |
◆ h_limbs
const mp_size_t libff::alt_bn128_G2::h_limbs |
|
static |
◆ wnaf_window_table
std::vector< size_t > libff::alt_bn128_G2::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files: