#include <alt_bn128_g1.hpp>
Definition at line 21 of file alt_bn128_g1.hpp.
◆ base_field
◆ scalar_field
◆ alt_bn128_G1() [1/2]
libff::alt_bn128_G1::alt_bn128_G1 |
( |
| ) |
|
◆ alt_bn128_G1() [2/2]
◆ add()
Definition at line 149 of file alt_bn128_g1.cpp.
156 if (other.is_zero()) {
164 if (this->
operator==(other)) {
168 #ifdef PROFILE_OP_COUNTS
203 const alt_bn128_Fq Z3 = ((this->
Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::alt_bn128_G1::batch_to_special_all_non_zeros |
( |
std::vector< alt_bn128_G1 > & |
vec | ) |
|
|
static |
Definition at line 456 of file alt_bn128_g1.cpp.
459 std::vector<alt_bn128_Fq> Z_vec;
460 Z_vec.reserve(vec.size());
462 for (
auto &el : vec) {
463 Z_vec.emplace_back(el.Z);
465 batch_invert<alt_bn128_Fq>(Z_vec);
469 for (
size_t i = 0; i < vec.size(); ++i) {
473 vec[i].X = vec[i].X * Z2;
474 vec[i].Y = vec[i].Y * Z3;
◆ dbl()
Definition at line 285 of file alt_bn128_g1.cpp.
287 #ifdef PROFILE_OP_COUNTS
317 eightC = eightC + eightC;
318 eightC = eightC + eightC;
◆ is_in_safe_subgroup()
bool libff::alt_bn128_G1::is_in_safe_subgroup |
( |
| ) |
const |
◆ is_special()
bool libff::alt_bn128_G1::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::alt_bn128_G1::is_well_formed |
( |
| ) |
const |
◆ is_zero()
bool libff::alt_bn128_G1::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 208 of file alt_bn128_g1.cpp.
211 assert(other.is_special());
219 if (other.is_zero()) {
249 if (U1 == U2 && S1 == S2) {
254 #ifdef PROFILE_OP_COUNTS
278 Y3 = r * (V - X3) - Y3 - Y3;
◆ mul_by_cofactor()
◆ one()
◆ operator!=()
bool libff::alt_bn128_G1::operator!= |
( |
const alt_bn128_G1 & |
other | ) |
const |
◆ operator+()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator==()
bool libff::alt_bn128_G1::operator== |
( |
const alt_bn128_G1 & |
other | ) |
const |
Definition at line 93 of file alt_bn128_g1.cpp.
96 return other.is_zero();
99 if (other.is_zero()) {
115 if ((this->
X * Z2_squared) != (other.X * Z1_squared)) {
122 if ((this->
Y * Z2_cubed) != (other.Y * Z1_cubed)) {
◆ order()
◆ print()
void libff::alt_bn128_G1::print |
( |
| ) |
const |
Definition at line 36 of file alt_bn128_g1.cpp.
42 copy.to_affine_coordinates();
45 copy.X.as_bigint().data,
47 copy.Y.as_bigint().data,
◆ print_coordinates()
void libff::alt_bn128_G1::print_coordinates |
( |
| ) |
const |
Definition at line 52 of file alt_bn128_g1.cpp.
58 "(%Nd : %Nd : %Nd)\n",
61 this->Y.as_bigint().data,
63 this->Z.as_bigint().data,
◆ random_element()
◆ read_compressed()
void libff::alt_bn128_G1::read_compressed |
( |
std::istream & |
in, |
|
|
alt_bn128_G1 & |
out |
|
) |
| |
|
static |
Definition at line 409 of file alt_bn128_g1.cpp.
413 in.read(&flags_char, 1) >> out.X;
416 const uint8_t flags = flags_char -
'0';
419 if (0 == (flags & G1_ZERO_FLAG)) {
421 const uint8_t Y_lsb = 0 != (flags & G1_Y_LSB_FLAG);
426 if ((uint8_t)(out.Y.as_bigint().data[0] & 1) != Y_lsb) {
◆ read_uncompressed()
void libff::alt_bn128_G1::read_uncompressed |
( |
std::istream & |
in, |
|
|
alt_bn128_G1 & |
out |
|
) |
| |
|
static |
Definition at line 395 of file alt_bn128_g1.cpp.
399 in.read(&is_zero_char, 1) >> out.X >> out.Y;
400 const uint8_t
is_zero = (is_zero_char -
'0') & G1_ZERO_FLAG;
◆ size_in_bits()
static size_t libff::alt_bn128_G1::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::alt_bn128_G1::to_affine_coordinates |
( |
| ) |
|
◆ to_special()
void libff::alt_bn128_G1::to_special |
( |
| ) |
|
◆ write_compressed()
void libff::alt_bn128_G1::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 383 of file alt_bn128_g1.cpp.
387 copy.to_affine_coordinates();
388 const uint8_t flags =
389 (copy.is_zero() ? G1_ZERO_FLAG : 0) |
390 ((copy.Y.as_bigint().data[0] & 1) ? G1_Y_LSB_FLAG : 0);
391 const char flags_char =
'0' + flags;
392 out.write(&flags_char, 1) << copy.X;
◆ write_uncompressed()
void libff::alt_bn128_G1::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 374 of file alt_bn128_g1.cpp.
378 copy.to_affine_coordinates();
379 const char is_zero =
'0' + (copy.is_zero() ? G1_ZERO_FLAG : 0);
380 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_G1::fixed_base_exp_window_table |
|
static |
◆ G1_one
◆ G1_zero
◆ h_bitcount
const mp_size_t libff::alt_bn128_G1::h_bitcount = 1 |
|
static |
◆ h_limbs
const mp_size_t libff::alt_bn128_G1::h_limbs |
|
static |
◆ wnaf_window_table
std::vector< size_t > libff::alt_bn128_G1::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files: