nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > Struct Template Reference

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>

+ Collaboration diagram for nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >:

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

◆ field_type

template<typename CurveParams >
using nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::field_type = typename CurveParams::field_type

◆ form

◆ group_type

template<typename CurveParams >
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]

template<typename CurveParams >
constexpr nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::curve_element ( )
inlineconstexpr
Returns
the point at infinity by default

◆ curve_element() [2/2]

template<typename CurveParams >
constexpr nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::curve_element ( field_value_type  in_X,
field_value_type  in_Y 
)
inlineconstexpr
Returns
the selected point $(X:Y:Z)$ in the projective coordinates

Member Function Documentation

◆ doubled()

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::doubled ( ) const
inlineconstexpr
Returns
doubled element from group G1

◆ is_well_formed()

template<typename CurveParams >
constexpr bool nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::is_well_formed ( ) const
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()

template<typename CurveParams >
constexpr bool nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::is_zero ( ) const
inlineconstexpr
Returns
true if element from group G1 is the point at infinity

◆ one()

template<typename CurveParams >
static curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::one ( )
inlinestatic

Get the generator of group G1.

◆ operator!=()

template<typename CurveParams >
constexpr bool nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator!= ( const curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > &  other) const
inlineconstexpr

◆ operator+()

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator+ ( const curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > &  other) const
inlineconstexpr

◆ operator-() [1/2]

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/2]

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator- ( const curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > &  B) const
inlineconstexpr

◆ operator=()

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator= ( const curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > &  other)
inlineconstexpr

◆ operator==()

template<typename CurveParams >
constexpr bool nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::operator== ( const curve_element< CurveParams, forms::twisted_edwards, coordinates::affine > &  other) const
inlineconstexpr

◆ to_affine()

template<typename CurveParams >
constexpr curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::to_affine ( ) const
inlineconstexpr
Returns
return the corresponding element from affine coordinates to affine coordinates. Just for compatibility.

◆ to_extended_with_a_minus_1()

template<typename CurveParams >
constexpr curve_element<params_type, form, typename curves::coordinates::extended_with_a_minus_1> nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::to_extended_with_a_minus_1 ( ) const
inlineconstexpr
Returns
return the corresponding element from affine coordinates to extended coordinates with a=-1

◆ to_inverted()

template<typename CurveParams >
constexpr curve_element<params_type, form, typename curves::coordinates::inverted> nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::to_inverted ( ) const
inlineconstexpr
Returns
return the corresponding element from affine coordinates to inverted coordinates

◆ to_montgomery()

template<typename CurveParams >
constexpr auto nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::to_montgomery ( ) const
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()

template<typename CurveParams >
static curve_element nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::zero ( )
inlinestatic

Get the point at infinity.

Member Data Documentation

◆ X

template<typename CurveParams >
field_value_type nil::crypto3::algebra::curves::detail::curve_element< CurveParams, forms::twisted_edwards, coordinates::affine >::X

◆ Y

template<typename CurveParams >
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: