#include <mnt6_g1.hpp>
Definition at line 26 of file mnt6_g1.hpp.
◆ base_field
◆ scalar_field
◆ mnt6_G1() [1/3]
libff::mnt6_G1::mnt6_G1 |
( |
| ) |
|
◆ mnt6_G1() [2/3]
◆ mnt6_G1() [3/3]
◆ add()
Definition at line 236 of file mnt6_g1.cpp.
243 if (other.is_zero()) {
251 if (this->
operator==(other)) {
255 #ifdef PROFILE_OP_COUNTS
262 const mnt6_Fq Y1Z2 = (this->
Y) * (other.Z);
264 const mnt6_Fq X1Z2 = (this->
X) * (other.Z);
266 const mnt6_Fq Z1Z2 = (this->
Z) * (other.Z);
268 const mnt6_Fq u = (other.Y) * (this->
Z) - Y1Z2;
272 const mnt6_Fq v = (other.X) * (this->
Z) - X1Z2;
280 const mnt6_Fq A = uu * Z1Z2 - (vvv + R + R);
284 const mnt6_Fq Y3 = u * (R - A) - vvv * Y1Z2;
◆ base_field_char()
◆ batch_to_special_all_non_zeros()
void libff::mnt6_G1::batch_to_special_all_non_zeros |
( |
std::vector< mnt6_G1 > & |
vec | ) |
|
|
static |
Definition at line 507 of file mnt6_g1.cpp.
509 std::vector<mnt6_Fq> Z_vec;
510 Z_vec.reserve(vec.size());
512 for (
auto &el : vec) {
513 Z_vec.emplace_back(el.Z);
515 batch_invert<mnt6_Fq>(Z_vec);
519 for (
size_t i = 0; i < vec.size(); ++i) {
520 vec[i] =
mnt6_G1(vec[i].
X * Z_vec[i], vec[i].
Y * Z_vec[i],
one);
◆ dbl()
mnt6_G1 libff::mnt6_G1::dbl |
( |
| ) |
const |
Definition at line 352 of file mnt6_g1.cpp.
354 #ifdef PROFILE_OP_COUNTS
364 const mnt6_Fq XX = (this->
X).squared();
366 const mnt6_Fq ZZ = (this->
Z).squared();
369 const mnt6_Fq Y1Z1 = (this->
Y) * (this->
Z);
383 const mnt6_Fq h = w.squared() - (B + B);
387 const mnt6_Fq Y3 = w * (B -
h) - (RR + RR);
◆ is_in_safe_subgroup()
bool libff::mnt6_G1::is_in_safe_subgroup |
( |
| ) |
const |
◆ is_special()
bool libff::mnt6_G1::is_special |
( |
| ) |
const |
◆ is_well_formed()
bool libff::mnt6_G1::is_well_formed |
( |
| ) |
const |
◆ is_zero()
bool libff::mnt6_G1::is_zero |
( |
| ) |
const |
◆ mixed_add()
Definition at line 291 of file mnt6_g1.cpp.
293 #ifdef PROFILE_OP_COUNTS
304 if (other.is_zero()) {
309 assert(other.is_special());
315 const mnt6_Fq X2Z1 = (this->
Z) * (other.X);
322 const mnt6_Fq Y2Z1 = (this->
Z) * (other.Y);
324 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
341 mnt6_Fq A = uu * this->
Z - vvv - R - R;
345 mnt6_Fq Y3 = u * (R - A) - vvv * this->Y;
◆ mul_by_cofactor()
mnt6_G1 libff::mnt6_G1::mul_by_cofactor |
( |
| ) |
const |
◆ one()
const mnt6_G1 & libff::mnt6_G1::one |
( |
| ) |
|
|
static |
◆ operator!=()
bool libff::mnt6_G1::operator!= |
( |
const mnt6_G1 & |
other | ) |
const |
◆ operator+()
Definition at line 127 of file mnt6_g1.cpp.
134 if (other.is_zero()) {
155 const mnt6_Fq X1Z2 = (this->
X) * (other.Z);
157 const mnt6_Fq X2Z1 = (this->
Z) * (other.X);
162 const mnt6_Fq Y1Z2 = (this->
Y) * (other.Z);
164 const mnt6_Fq Y2Z1 = (this->
Z) * (other.Y);
166 if (X1Z2 == X2Z1 && Y1Z2 == Y2Z1) {
169 const mnt6_Fq XX = (this->
X).squared();
171 const mnt6_Fq ZZ = (this->
Z).squared();
174 const mnt6_Fq Y1Z1 = (this->
Y) * (this->
Z);
188 const mnt6_Fq h = w.squared() - (B + B);
192 const mnt6_Fq Y3 = w * (B -
h) - (RR + RR);
201 const mnt6_Fq Z1Z2 = (this->
Z) * (other.Z);
215 const mnt6_Fq A = uu * Z1Z2 - (vvv + R + R);
219 const mnt6_Fq Y3 = u * (R - A) - vvv * Y1Z2;
◆ operator-() [1/2]
mnt6_G1 libff::mnt6_G1::operator- |
( |
| ) |
const |
◆ operator-() [2/2]
Definition at line 231 of file mnt6_g1.cpp.
233 return (*
this) + (-other);
◆ operator==()
bool libff::mnt6_G1::operator== |
( |
const mnt6_G1 & |
other | ) |
const |
Definition at line 97 of file mnt6_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::mnt6_G1::print |
( |
| ) |
const |
Definition at line 39 of file mnt6_g1.cpp.
45 copy.to_affine_coordinates();
48 copy.X.as_bigint().data,
50 copy.Y.as_bigint().data,
◆ print_coordinates()
void libff::mnt6_G1::print_coordinates |
( |
| ) |
const |
Definition at line 55 of file mnt6_g1.cpp.
61 "(%Nd : %Nd : %Nd)\n",
64 this->Y.as_bigint().data,
66 this->Z.as_bigint().data,
◆ random_element()
mnt6_G1 libff::mnt6_G1::random_element |
( |
| ) |
|
|
static |
◆ read_compressed()
void libff::mnt6_G1::read_compressed |
( |
std::istream & |
in, |
|
|
mnt6_G1 & |
g |
|
) |
| |
|
static |
Definition at line 471 of file mnt6_g1.cpp.
483 in.read((
char *)&Y_lsb, 1);
492 if ((tY.as_bigint().data[0] & 1) != Y_lsb) {
◆ read_uncompressed()
void libff::mnt6_G1::read_uncompressed |
( |
std::istream & |
in, |
|
|
mnt6_G1 & |
g |
|
) |
| |
|
static |
◆ size_in_bits()
static size_t libff::mnt6_G1::size_in_bits |
( |
| ) |
|
|
inlinestatic |
◆ to_affine_coordinates()
void libff::mnt6_G1::to_affine_coordinates |
( |
| ) |
|
Definition at line 71 of file mnt6_g1.cpp.
79 this->
X = this->
X * Z_inv;
80 this->
Y = this->
Y * Z_inv;
◆ to_special()
void libff::mnt6_G1::to_special |
( |
| ) |
|
◆ write_compressed()
void libff::mnt6_G1::write_compressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 444 of file mnt6_g1.cpp.
447 copy.to_affine_coordinates();
◆ write_uncompressed()
void libff::mnt6_G1::write_uncompressed |
( |
std::ostream & |
out | ) |
const |
Definition at line 435 of file mnt6_g1.cpp.
438 copy.to_affine_coordinates();
◆ zero()
const mnt6_G1 & libff::mnt6_G1::zero |
( |
| ) |
|
|
static |
◆ coeff_a
◆ coeff_b
◆ fixed_base_exp_window_table
std::vector< size_t > libff::mnt6_G1::fixed_base_exp_window_table |
|
static |
◆ G1_one
◆ G1_zero
◆ h_bitcount
const mp_size_t libff::mnt6_G1::h_bitcount = 1 |
|
static |
◆ h_limbs
const mp_size_t libff::mnt6_G1::h_limbs |
|
static |
◆ wnaf_window_table
std::vector< size_t > libff::mnt6_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/mnt6/mnt6_g1.hpp
- /home/runner/work/libff/libff/libff/algebra/curves/mnt/mnt6/mnt6_g1.cpp