Botan 3.9.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
typedef W WordType

Static Public Member Functions

static constexpr FieldElement x3_ax_b (const FieldElement &x)

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 bool OrderIsLessThanField = bigint_cmp(NW.data(), Words, PW.data(), Words) == -1
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
static constexpr size_t Words = PW.size()

Detailed Description

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

Elliptic Curve

Takes as input a set of parameters, and instantiates the elliptic curve

Definition at line 1194 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 1217 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 1215 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 1218 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 1211 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 1196 of file pcurves_impl.h.

◆ WordType

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

Definition at line 1198 of file pcurves_impl.h.

Member Function Documentation

◆ x3_ax_b()

template<typename Params, template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
constexpr FieldElement Botan::EllipticCurve< Params, FieldRep >::x3_ax_b ( const FieldElement & x)
inlinestaticconstexpr

Return (x^3 + A*x + B) mod p

Definition at line 1241 of file pcurves_impl.h.

1241{ return (x.square() + A) * x + B; }
static constexpr FieldElement A
static constexpr FieldElement B

References A, B, and Botan::IntMod< Rep >::square().

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 1223 of file pcurves_impl.h.

Referenced by x3_ax_b().

◆ AW

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

Definition at line 1202 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 1224 of file pcurves_impl.h.

Referenced by x3_ax_b().

◆ 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 1228 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 1201 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 1220 of file pcurves_impl.h.

◆ OrderIsLessThanField

template<typename Params, template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
bool Botan::EllipticCurve< Params, FieldRep >::OrderIsLessThanField = bigint_cmp(NW.data(), Words, PW.data(), Words) == -1
staticconstexpr

Definition at line 1236 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 1221 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 1200 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

Definition at line 1231 of file pcurves_impl.h.

◆ 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)

Definition at line 1233 of file pcurves_impl.h.

◆ Words

template<typename Params, template< typename FieldParamsT > typename FieldRep = MontgomeryRep>
size_t Botan::EllipticCurve< Params, FieldRep >::Words = PW.size()
staticconstexpr

Definition at line 1207 of file pcurves_impl.h.


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