A struct representing an element from the group G1 of twisted Edwards curve of affine coordinates representation. Twisted Edwards curves introduced on https://eprint.iacr.org/2008/013.pdf Description: https://hyperelliptic.org/EFD/g1p/auto-twisted.html. More...
#include <element_g1_affine.hpp>
Public Types | |
using | coordinates = coordinates::affine |
using | field_type = typename CurveParams::field_type |
using | form = forms::twisted_edwards |
using | group_type = typename params_type::template group_type< coordinates > |
Public Member Functions | |
constexpr | curve_element () |
constexpr | curve_element (field_value_type in_X, field_value_type in_Y) |
constexpr curve_element | doubled () const |
constexpr bool | is_well_formed () const |
constexpr bool | is_zero () const |
constexpr bool | operator!= (const curve_element &other) const |
constexpr curve_element | operator+ (const curve_element &other) const |
constexpr curve_element | operator- () const |
constexpr curve_element | operator- (const curve_element &B) const |
constexpr curve_element | operator= (const curve_element &other) |
constexpr bool | operator== (const curve_element &other) const |
constexpr curve_element | to_affine () const |
constexpr curve_element< params_type, form, typename curves::coordinates::extended_with_a_minus_1 > | to_extended_with_a_minus_1 () const |
constexpr curve_element< params_type, form, typename curves::coordinates::inverted > | to_inverted () const |
constexpr auto | to_montgomery () const |
Convert point coordinates into Montgomery form according to birational equivalence map: More... | |
Static Public Member Functions | |
static curve_element | one () |
Get the generator of group G1. More... | |
static curve_element | zero () |
Get the point at infinity. More... | |
Public Attributes | |
field_value_type | X |
field_value_type | Y |
Detailed Description
template<typename CurveParams>
struct nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >
A struct representing an element from the group G1 of twisted Edwards curve of affine coordinates representation. Twisted Edwards curves introduced on https://eprint.iacr.org/2008/013.pdf Description: https://hyperelliptic.org/EFD/g1p/auto-twisted.html.
Member Typedef Documentation
◆ coordinates
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::coordinates = coordinates::affine |
◆ field_type
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::field_type = typename CurveParams::field_type |
◆ form
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::form = forms::twisted_edwards |
◆ group_type
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::group_type = typename params_type::template group_type<coordinates> |
Constructor & Destructor Documentation
◆ curve_element() [1/2]
|
inlineconstexpr |
- Returns
- the point at infinity by default
◆ curve_element() [2/2]
|
inlineconstexpr |
- Returns
- the selected point $(X:Y:Z)$ in the projective coordinates
Member Function Documentation
◆ doubled()
|
inlineconstexpr |
- Returns
- doubled element from group G1
◆ is_well_formed()
|
inlineconstexpr |
- Returns
- true if element from group G1 lies on the elliptic curve
A check, that a*X*X + Y*Y = 1 + d*X*X*Y*Y
◆ is_zero()
|
inlineconstexpr |
- Returns
- true if element from group G1 is the point at infinity
◆ one()
|
inlinestatic |
Get the generator of group G1.
◆ operator!=()
|
inlineconstexpr |
◆ operator+()
|
inlineconstexpr |
◆ operator-() [1/2]
|
inlineconstexpr |
◆ operator-() [2/2]
|
inlineconstexpr |
◆ operator=()
|
inlineconstexpr |
◆ operator==()
|
inlineconstexpr |
◆ to_affine()
|
inlineconstexpr |
- Returns
- return the corresponding element from affine coordinates to affine coordinates. Just for compatibility.
◆ to_extended_with_a_minus_1()
|
inlineconstexpr |
- Returns
- return the corresponding element from affine coordinates to extended coordinates with a=-1
◆ to_inverted()
|
inlineconstexpr |
- Returns
- return the corresponding element from affine coordinates to inverted coordinates
◆ to_montgomery()
|
inlineconstexpr |
Convert point coordinates into Montgomery form according to birational equivalence map:
Twisted Edwards(a, d) -–> Montgomery(A', B') (x, y) --> (u', v') where A' = 2 * (a + d) / (a - d) B' = 4 / (a - d)
u' = (1 + y) / (1 - y) v' = (1 + y) / ((1 - y) * x)
Montgomery(A', B') -–> Montgomery(A, B) (u', v') --> (u, v) where A == A' B = s^2 * B' (mod p) <=> s = (B / B').sqrt() (mod p)
u = u' s * v = v'
Twisted Edwards(a, d) -–> Montgomery(A, B) (x, y) --> (u, v)
u = u' = (1 + y) / (1 - y) v = v' / s = (1 + y) / ((1 - y) * x * s)
See https://math.stackexchange.com/questions/1391732/birational-equvalence-of-twisted-edwards-and-montgomery-curves See https://math.stackexchange.com/questions/1392277/point-conversion-between-twisted-edwards-and-montgomery-curves
- Returns
- point in affine coordinates of Montgomery form
◆ zero()
|
inlinestatic |
Get the point at infinity.
Member Data Documentation
◆ X
field_value_type nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::X |
◆ Y
field_value_type nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::Y |
The documentation for this struct was generated from the following file: