Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
#include <bls12_377_g2.hpp>
Definition at line 21 of file bls12_377_g2.hpp.
◆ base_field
◆ scalar_field
◆ twist_field
◆ bls12_377_G2() [1/2]
libff::bls12_377_G2::bls12_377_G2 |
( |
| ) |
|
◆ bls12_377_G2() [2/2]
◆ add()
Definition at line 209 of file bls12_377_g2.cpp.
216 if (other.is_zero()) {
224 if (this->
operator==(other)) {
228 #ifdef PROFILE_OP_COUNTS
262 bls12_377_Fq2 Z3 = ((this->
Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::bls12_377_G2::batch_to_special_all_non_zeros |
( |
std::vector< bls12_377_G2 > & |
vec | ) |
|
|
static |
Definition at line 570 of file bls12_377_g2.cpp.
573 std::vector<bls12_377_Fq2> Z_vec;
574 Z_vec.reserve(vec.size());
576 for (
auto &el : vec) {
577 Z_vec.emplace_back(el.Z);
579 batch_invert<bls12_377_Fq2>(Z_vec);
583 for (
size_t i = 0; i < vec.size(); ++i) {
587 vec[i].X = vec[i].X * Z2;
588 vec[i].Y = vec[i].Y * Z3;
◆ dbl()
Definition at line 331 of file bls12_377_g2.cpp.
333 #ifdef PROFILE_OP_COUNTS
360 eightC = eightC + eightC;
361 eightC = eightC + eightC;
◆ is_in_safe_subgroup()
bool libff::bls12_377_G2::is_in_safe_subgroup |
( |
| ) |
const |
◆ is_special()
bool libff::bls12_377_G2::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::bls12_377_G2::is_well_formed |
( |
| ) |
const |
◆ is_zero()
bool libff::bls12_377_G2::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 270 of file bls12_377_g2.cpp.
273 assert(other.is_special());
280 if (other.is_zero()) {
296 if (this->
X == U2 && this->
Y == S2) {
300 #ifdef PROFILE_OP_COUNTS
324 Y3 = r * (V - X3) - Y3 - Y3;
◆ mul_by_b()
◆ mul_by_cofactor()
◆ mul_by_q()
◆ one()
◆ operator!=()
bool libff::bls12_377_G2::operator!= |
( |
const bls12_377_G2 & |
other | ) |
const |
◆ operator+()
Definition at line 140 of file bls12_377_g2.cpp.
147 if (other.is_zero()) {
171 if (U1 == U2 && S1 == S2) {
194 bls12_377_Fq2 Z3 = ((this->
Z + other.Z).squared() - Z1Z1 - Z2Z2) * H;
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator==()
bool libff::bls12_377_G2::operator== |
( |
const bls12_377_G2 & |
other | ) |
const |
Definition at line 107 of file bls12_377_g2.cpp.
110 return other.is_zero();
113 if (other.is_zero()) {
127 if (((this->
X * Z2_squared) != (other.X * Z1_squared)) ||
128 ((this->
Y * Z2_cubed) != (other.Y * Z1_cubed))) {
◆ order()
◆ print()
void libff::bls12_377_G2::print |
( |
| ) |
const |
Definition at line 40 of file bls12_377_g2.cpp.
46 copy.to_affine_coordinates();
48 "(%Nd*z + %Nd , %Nd*z + %Nd)\n",
49 copy.X.coeffs[1].as_bigint().data,
51 copy.X.coeffs[0].as_bigint().data,
53 copy.Y.coeffs[1].as_bigint().data,
55 copy.Y.coeffs[0].as_bigint().data,
◆ print_coordinates()
void libff::bls12_377_G2::print_coordinates |
( |
| ) |
const |
Definition at line 60 of file bls12_377_g2.cpp.
66 "(%Nd*z + %Nd : %Nd*z + %Nd : %Nd*z + %Nd)\n",
69 this->X.coeffs[0].as_bigint().data,
71 this->Y.coeffs[1].as_bigint().data,
73 this->Y.coeffs[0].as_bigint().data,
75 this->Z.coeffs[1].as_bigint().data,
77 this->Z.coeffs[0].as_bigint().data,
◆ random_element()
◆ read_compressed()
void libff::bls12_377_G2::read_compressed |
( |
std::istream & |
in, |
|
|
bls12_377_G2 & |
g |
|
) |
| |
|
static |
Definition at line 518 of file bls12_377_g2.cpp.
530 in.read((
char *)&Y_lsb, 1);
539 if ((tY.coeffs[0].as_bigint().data[0] & 1) != Y_lsb) {
◆ read_uncompressed()
void libff::bls12_377_G2::read_uncompressed |
( |
std::istream & |
in, |
|
|
bls12_377_G2 & |
g |
|
) |
| |
|
static |
◆ size_in_bits()
static size_t libff::bls12_377_G2::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::bls12_377_G2::to_affine_coordinates |
( |
| ) |
|
◆ to_special()
void libff::bls12_377_G2::to_special |
( |
| ) |
|
◆ untwist_frobenius_twist()
bls12_377_G2 libff::bls12_377_G2::untwist_frobenius_twist |
( |
| ) |
const |
Definition at line 378 of file bls12_377_g2.cpp.
381 g.to_affine_coordinates();
402 const bls12_377_Fq6 frob_untwist_x = untwist_x.Frobenius_map(1);
418 twist_frob_untwist_x.coeffs[0],
419 twist_frob_untwist_y.coeffs[0].coeffs[0],
◆ write_compressed()
void libff::bls12_377_G2::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 492 of file bls12_377_g2.cpp.
495 copy.to_affine_coordinates();
499 << (copy.Y.coeffs[0].as_bigint().data[0] & 1);
◆ write_uncompressed()
void libff::bls12_377_G2::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
◆ zero()
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::bls12_377_G2::fixed_base_exp_window_table |
|
static |
◆ G2_one
◆ G2_zero
◆ h_bitcount
const mp_size_t libff::bls12_377_G2::h_bitcount = 502 |
|
static |
◆ h_limbs
const mp_size_t libff::bls12_377_G2::h_limbs |
|
static |
◆ wnaf_window_table
std::vector< size_t > libff::bls12_377_G2::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files:
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_v_inverse
static bls12_377_G2 G2_one
static Fp_model< n, modulus > random_element()
returns random element of Fp_model
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_v
static Fp6_3over2_model< n, modulus > zero()
static const Fp2_model< n, modulus > & one()
static size_t size_in_bits()
static const bls12_377_G2 & one()
Fp12_2over3over2_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq12
bls12_377_Fq2 bls12_377_twist_coeff_b
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_w_3
bls12_377_Fq2 bls12_377_twist_mul_by_q_X
void to_affine_coordinates()
Fp2_model inverse() const
bls12_377_Fq2 bls12_377_twist_mul_by_q_Y
bigint< bls12_377_r_limbs > bls12_377_g2_mul_by_cofactor_h2_1
Fp2_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq2
Fp6_3over2_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq6
void consume_OUTPUT_SEPARATOR(std::istream &in)
static const mp_size_t num_limbs
bls12_377_Fq bls12_377_twist_mul_by_b_c1
static const bls12_377_G2 & zero()
bigint< bls12_377_r_limbs > bls12_377_trace_of_frobenius
static const bigint< n > & field_char()
static bls12_377_G2 G2_zero
bigint< n > as_bigint() const
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_w_3_inverse
Fp2_model squared() const
default is squared_complex
Fp2_model sqrt() const
HAS TO BE A SQUARE (else does not terminate)
bigint< bls12_377_r_limbs > bls12_377_g2_mul_by_cofactor_h2_0
static const Fp2_model< n, modulus > & zero()
static const mp_size_t h_bitcount
bls12_377_Fq bls12_377_twist_mul_by_b_c0
bls12_377_G2 untwist_frobenius_twist() const
bool operator==(const bls12_377_G2 &other) const