Botan 3.5.0
Crypto and TLS for C&
Botan::EllipticCurve< Params, FieldRep > Class Template Reference

#include <pcurves_impl.h>

Classes

class  FieldParams
 
class  ScalarParams
 

Public Types

using AffinePoint = AffineCurvePoint<FieldElement, Params>
 
using FieldElement = IntMod<FieldRep<FieldParams>>
 
using ProjectivePoint = ProjectiveCurvePoint<FieldElement, Params>
 
using Scalar = IntMod<MontgomeryRep<ScalarParams>>
 
typedef Params::W W
 

Static Public Member Functions

static const FieldElementSSWU_C1 ()
 
static const FieldElementSSWU_C2 ()
 

Static Public Attributes

static constexpr FieldElement A = FieldElement::from_words(Params::AW)
 
static constexpr auto AW = Params::AW
 
static constexpr FieldElement B = FieldElement::from_words(Params::BW)
 
static constexpr AffinePoint G
 
static constexpr auto NW = Params::NW
 
static constexpr size_t OrderBits = Scalar::BITS
 
static constexpr size_t PrimeFieldBits = FieldElement::BITS
 
static constexpr auto PW = Params::PW
 
static constexpr FieldElement SSWU_Z = FieldElement::constant(Params::Z)
 
static constexpr bool ValidForSswuHash
 

Detailed Description

template<typename Params, template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
class Botan::EllipticCurve< Params, FieldRep >

Definition at line 889 of file pcurves_impl.h.

Member Typedef Documentation

◆ AffinePoint

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
using Botan::EllipticCurve< Params, FieldRep >::AffinePoint = AffineCurvePoint<FieldElement, Params>

Definition at line 908 of file pcurves_impl.h.

◆ FieldElement

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
using Botan::EllipticCurve< Params, FieldRep >::FieldElement = IntMod<FieldRep<FieldParams>>

Definition at line 906 of file pcurves_impl.h.

◆ ProjectivePoint

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
using Botan::EllipticCurve< Params, FieldRep >::ProjectivePoint = ProjectiveCurvePoint<FieldElement, Params>

Definition at line 909 of file pcurves_impl.h.

◆ Scalar

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
using Botan::EllipticCurve< Params, FieldRep >::Scalar = IntMod<MontgomeryRep<ScalarParams>>

Definition at line 902 of file pcurves_impl.h.

◆ W

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
typedef Params::W Botan::EllipticCurve< Params, FieldRep >::W

Definition at line 891 of file pcurves_impl.h.

Member Function Documentation

◆ SSWU_C1()

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
static const FieldElement & Botan::EllipticCurve< Params, FieldRep >::SSWU_C1 ( )
inlinestatic

Definition at line 926 of file pcurves_impl.h.

928 {
929 // We derive it from C2 to avoid a second inversion
930 static const auto C1 = (SSWU_C2() * SSWU_Z).negate();
931 return C1;
932 }
static const FieldElement & SSWU_C2()
static constexpr FieldElement SSWU_Z

References Botan::EllipticCurve< Params, FieldRep >::SSWU_C2(), and Botan::EllipticCurve< Params, FieldRep >::SSWU_Z.

◆ SSWU_C2()

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
static const FieldElement & Botan::EllipticCurve< Params, FieldRep >::SSWU_C2 ( )
inlinestatic

Definition at line 935 of file pcurves_impl.h.

937 {
938 // This could use a variable time inversion
939 static const auto C2 = (B * (SSWU_Z * A).invert());
940 return C2;
941 }
static constexpr FieldElement A
static constexpr FieldElement B

References Botan::EllipticCurve< Params, FieldRep >::A, Botan::EllipticCurve< Params, FieldRep >::B, and Botan::EllipticCurve< Params, FieldRep >::SSWU_Z.

Referenced by Botan::EllipticCurve< Params, FieldRep >::SSWU_C1().

Member Data Documentation

◆ A

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
FieldElement Botan::EllipticCurve< Params, FieldRep >::A = FieldElement::from_words(Params::AW)
staticconstexpr

Definition at line 914 of file pcurves_impl.h.

Referenced by Botan::EllipticCurve< Params, FieldRep >::SSWU_C2().

◆ AW

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
auto Botan::EllipticCurve< Params, FieldRep >::AW = Params::AW
staticconstexpr

Definition at line 895 of file pcurves_impl.h.

◆ B

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
FieldElement Botan::EllipticCurve< Params, FieldRep >::B = FieldElement::from_words(Params::BW)
staticconstexpr

Definition at line 915 of file pcurves_impl.h.

Referenced by Botan::EllipticCurve< Params, FieldRep >::SSWU_C2().

◆ G

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
AffinePoint Botan::EllipticCurve< Params, FieldRep >::G
staticconstexpr
Initial value:
=
AffineCurvePoint< FieldElement, Params > AffinePoint
static constexpr Self from_words(std::array< W, L > w)

Definition at line 917 of file pcurves_impl.h.

◆ NW

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
auto Botan::EllipticCurve< Params, FieldRep >::NW = Params::NW
staticconstexpr

Definition at line 894 of file pcurves_impl.h.

◆ OrderBits

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
size_t Botan::EllipticCurve< Params, FieldRep >::OrderBits = Scalar::BITS
staticconstexpr

Definition at line 911 of file pcurves_impl.h.

◆ PrimeFieldBits

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
size_t Botan::EllipticCurve< Params, FieldRep >::PrimeFieldBits = FieldElement::BITS
staticconstexpr

Definition at line 912 of file pcurves_impl.h.

◆ PW

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
auto Botan::EllipticCurve< Params, FieldRep >::PW = Params::PW
staticconstexpr

Definition at line 893 of file pcurves_impl.h.

◆ SSWU_Z

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
FieldElement Botan::EllipticCurve< Params, FieldRep >::SSWU_Z = FieldElement::constant(Params::Z)
staticconstexpr

◆ ValidForSswuHash

template<typename Params , template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
bool Botan::EllipticCurve< Params, FieldRep >::ValidForSswuHash
staticconstexpr
Initial value:
=
(Params::Z != 0 && A.is_nonzero().as_bool() && B.is_nonzero().as_bool() && FieldElement::P_MOD_4 == 3)
constexpr bool as_bool() const
Definition ct_utils.h:160
static constexpr auto P_MOD_4
constexpr CT::Choice is_nonzero() const

Definition at line 922 of file pcurves_impl.h.


The documentation for this class was generated from the following file: