A struct representing an element from the group G1 of Montgomery curve of affine coordinates representation. Description: https://hyperelliptic.org/EFD/g1p/auto-montgom.html. More...
#include <element_g1_affine.hpp>
Public Types | |
using | coordinates = coordinates::affine |
using | field_type = typename CurveParams::field_type |
using | form = forms::montgomery |
using | group_type = typename params_type::template group_type< coordinates > |
Public Member Functions | |
constexpr | curve_element () |
constexpr | curve_element (const field_value_type &in_X, const field_value_type &in_Y) |
constexpr curve_element | doubled () const |
Affine doubling formulas: 2(x1,y1)=(x3,y3) where. More... | |
constexpr bool | is_well_formed () const |
Check that point coordinates satisfy curve equitation: b*y^2 = x^3 + a*x^2 + x. More... | |
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 |
Affine negation formulas: -(x1,y1)=(x1,-y1). More... | |
constexpr curve_element | operator- (const curve_element &other) const |
constexpr curve_element | operator= (const curve_element &other) |
constexpr bool | operator== (const curve_element &other) const |
constexpr curve_element | to_affine () const |
constexpr auto | to_twisted_edwards () const |
Convert point coordinates into twisted Edwards 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::montgomery, coordinates::affine >
A struct representing an element from the group G1 of Montgomery curve of affine coordinates representation. Description: https://hyperelliptic.org/EFD/g1p/auto-montgom.html.
Member Typedef Documentation
◆ coordinates
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, coordinates::affine >::coordinates = coordinates::affine |
◆ field_type
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, coordinates::affine >::field_type = typename CurveParams::field_type |
◆ form
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, coordinates::affine >::form = forms::montgomery |
◆ group_type
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, 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 |
Affine doubling formulas: 2(x1,y1)=(x3,y3) where.
x3 = b*(3*x1^2+2*a*x1+1)^2/(2*b*y1)^2-a-x1-x1 y3 = (2*x1+x1+a)*(3*x1^2+2*a*x1+1)/(2*b*y1)-b*(3*x1^2+2*a*x1+1)^3/(2*b*y1)^3-y1
See https://hyperelliptic.org/EFD/g1p/auto-montgom.html
- Returns
- doubled element from group G1
◆ is_well_formed()
|
inlineconstexpr |
Check that point coordinates satisfy curve equitation: b*y^2 = x^3 + a*x^2 + x.
- Returns
- true if element from group G1 lies on the elliptic curve
◆ 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 |
Affine negation formulas: -(x1,y1)=(x1,-y1).
- Returns
- negative element from group G1
◆ 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_twisted_edwards()
|
inlineconstexpr |
Convert point coordinates into twisted Edwards form according to birational equivalence map:
Montgomery(A', B') -–> Twisted Edwards(a, d) (u', v') --> (x, y) where A' = 2 * (a + d) / (a - d) B' = 4 / (a - d)
x = u' / v' y = (u' - 1) / (u' + 1)
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'
Montgomery(A, B) -–> Twisted Edwards(a, d) (u, v) --> (x, y)
x = u' / v' = u / (s * v) y = (u - 1) / (u + 1)
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 twisted Edwards form
◆ zero()
|
inlinestatic |
Get the point at infinity.
Member Data Documentation
◆ X
field_value_type nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, coordinates::affine >::X |
◆ Y
field_value_type nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::montgomery, coordinates::affine >::Y |
The documentation for this struct was generated from the following file: