#include <mnt4_g1.hpp>
Definition at line 26 of file mnt4_g1.hpp.
◆ base_field
◆ scalar_field
◆ mnt4_G1() [1/3]
libff::mnt4_G1::mnt4_G1 |
( |
| ) |
|
◆ mnt4_G1() [2/3]
◆ mnt4_G1() [3/3]
◆ add()
Definition at line 237 of file mnt4_g1.cpp.
244 if (other.is_zero()) {
252 if (this->
operator==(other)) {
256 #ifdef PROFILE_OP_COUNTS
263 const mnt4_Fq Y1Z2 = (this->
Y) * (other.Z);
265 const mnt4_Fq X1Z2 = (this->
X) * (other.Z);
267 const mnt4_Fq Z1Z2 = (this->
Z) * (other.Z);
269 const mnt4_Fq u = (other.Y) * (this->
Z) - Y1Z2;
273 const mnt4_Fq v = (other.X) * (this->
Z) - X1Z2;
281 const mnt4_Fq A = uu * Z1Z2 - (vvv + R + R);
285 const mnt4_Fq Y3 = u * (R - A) - vvv * Y1Z2;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::mnt4_G1::batch_to_special_all_non_zeros |
( |
std::vector< mnt4_G1 > & |
vec | ) |
|
|
static |
Definition at line 527 of file mnt4_g1.cpp.
529 std::vector<mnt4_Fq> Z_vec;
530 Z_vec.reserve(vec.size());
532 for (
auto &el : vec) {
533 Z_vec.emplace_back(el.Z);
535 batch_invert<mnt4_Fq>(Z_vec);
539 for (
size_t i = 0; i < vec.size(); ++i) {
540 vec[i] =
mnt4_G1(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
◆ dbl()
mnt4_G1 libff::mnt4_G1::dbl |
( |
| ) |
const |
Definition at line 353 of file mnt4_g1.cpp.
355 #ifdef PROFILE_OP_COUNTS
365 const mnt4_Fq XX = (this->
X).squared();
367 const mnt4_Fq ZZ = (this->
Z).squared();
370 const mnt4_Fq Y1Z1 = (this->
Y) * (this->
Z);
384 const mnt4_Fq h = w.squared() - (B + B);
388 const mnt4_Fq Y3 = w * (B -
h) - (RR + RR);
◆ is_in_safe_subgroup()
bool libff::mnt4_G1::is_in_safe_subgroup |
( |
| ) |
const |
◆ is_special()
bool libff::mnt4_G1::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::mnt4_G1::is_well_formed |
( |
| ) |
const |
◆ is_zero()
bool libff::mnt4_G1::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 292 of file mnt4_g1.cpp.
294 #ifdef PROFILE_OP_COUNTS
305 if (other.is_zero()) {
310 assert(other.is_special());
316 const mnt4_Fq X2Z1 = (this->
Z) * (other.X);
323 const mnt4_Fq Y2Z1 = (this->
Z) * (other.Y);
325 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
342 const mnt4_Fq A = uu * this->
Z - vvv - R - R;
346 const mnt4_Fq Y3 = u * (R - A) - vvv * this->Y;
◆ mul_by_cofactor()
mnt4_G1 libff::mnt4_G1::mul_by_cofactor |
( |
| ) |
const |
◆ one()
const mnt4_G1 & libff::mnt4_G1::one |
( |
| ) |
|
|
static |
◆ operator!=()
bool libff::mnt4_G1::operator!= |
( |
const mnt4_G1 & |
other | ) |
const |
◆ operator+()
Definition at line 127 of file mnt4_g1.cpp.
134 if (other.is_zero()) {
156 const mnt4_Fq X1Z2 = (this->
X) * (other.Z);
158 const mnt4_Fq X2Z1 = (this->
Z) * (other.X);
163 const mnt4_Fq Y1Z2 = (this->
Y) * (other.Z);
165 const mnt4_Fq Y2Z1 = (this->
Z) * (other.Y);
167 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
170 const mnt4_Fq XX = (this->
X).squared();
172 const mnt4_Fq ZZ = (this->
Z).squared();
175 const mnt4_Fq Y1Z1 = (this->
Y) * (this->
Z);
189 const mnt4_Fq h = w.squared() - (B + B);
193 const mnt4_Fq Y3 = w * (B -
h) - (RR + RR);
202 const mnt4_Fq Z1Z2 = (this->
Z) * (other.Z);
216 const mnt4_Fq A = uu * Z1Z2 - (vvv + R + R);
220 const mnt4_Fq Y3 = u * (R - A) - vvv * Y1Z2;
◆ operator-() [1/2]
mnt4_G1 libff::mnt4_G1::operator- |
( |
| ) |
const |
◆ operator-() [2/2]
Definition at line 232 of file mnt4_g1.cpp.
234 return (*
this) + (-other);
◆ operator==()
bool libff::mnt4_G1::operator== |
( |
const mnt4_G1 & |
other | ) |
const |
Definition at line 97 of file mnt4_g1.cpp.
100 return other.is_zero();
103 if (other.is_zero()) {
110 if ((this->
X * other.Z) != (other.X * this->Z)) {
115 if ((this->
Y * other.Z) != (other.Y * this->Z)) {
◆ order()
◆ print()
void libff::mnt4_G1::print |
( |
| ) |
const |
Definition at line 39 of file mnt4_g1.cpp.
45 copy.to_affine_coordinates();
48 copy.X.as_bigint().data,
50 copy.Y.as_bigint().data,
◆ print_coordinates()
void libff::mnt4_G1::print_coordinates |
( |
| ) |
const |
Definition at line 55 of file mnt4_g1.cpp.
61 "(%Nd : %Nd : %Nd)\n",
64 this->Y.as_bigint().data,
66 this->Z.as_bigint().data,
◆ random_element()
mnt4_G1 libff::mnt4_G1::random_element |
( |
| ) |
|
|
static |
◆ read_compressed()
void libff::mnt4_G1::read_compressed |
( |
std::istream & |
in, |
|
|
mnt4_G1 & |
g |
|
) |
| |
|
static |
Definition at line 472 of file mnt4_g1.cpp.
483 in.read((
char *)&Y_lsb, 1);
492 if ((tY.as_bigint().data[0] & 1) != Y_lsb) {
◆ read_uncompressed()
void libff::mnt4_G1::read_uncompressed |
( |
std::istream & |
in, |
|
|
mnt4_G1 & |
g |
|
) |
| |
|
static |
◆ size_in_bits()
static size_t libff::mnt4_G1::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::mnt4_G1::to_affine_coordinates |
( |
| ) |
|
Definition at line 71 of file mnt4_g1.cpp.
79 this->
X = this->
X * Z_inv;
80 this->
Y = this->
Y * Z_inv;
◆ to_special()
void libff::mnt4_G1::to_special |
( |
| ) |
|
◆ write_compressed()
void libff::mnt4_G1::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 445 of file mnt4_g1.cpp.
448 copy.to_affine_coordinates();
◆ write_uncompressed()
void libff::mnt4_G1::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 436 of file mnt4_g1.cpp.
439 copy.to_affine_coordinates();
◆ zero()
const mnt4_G1 & libff::mnt4_G1::zero |
( |
| ) |
|
|
static |
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::mnt4_G1::fixed_base_exp_window_table |
|
static |
◆ G1_one
◆ G1_zero
◆ h_bitcount
const mp_size_t libff::mnt4_G1::h_bitcount = 1 |
|
static |
◆ h_limbs
const mp_size_t libff::mnt4_G1::h_limbs |
|
static |
◆ wnaf_window_table
std::vector< size_t > libff::mnt4_G1::wnaf_window_table |
|
static |
The documentation for this class was generated from the following files:
- /home/runner/work/libff/libff/libff/algebra/curves/mnt/mnt4/mnt4_g1.hpp
- /home/runner/work/libff/libff/libff/algebra/curves/mnt/mnt4/mnt4_g1.cpp