Botan 3.7.1
Crypto and TLS for C&
Botan::PCurve::PrimeOrderCurve::AffinePoint Class Referencefinal

#include <pcurves.h>

Public Member Functions

const auto & _curve () const
 
const auto & _x () const
 
const auto & _y () const
 
 AffinePoint (AffinePoint &&other)=default
 
 AffinePoint (const AffinePoint &other)=default
 
size_t bytes () const
 
size_t compressed_bytes () const
 
bool is_identity () const
 
AffinePoint negate () const
 
AffinePointoperator= (AffinePoint &&other)=default
 
AffinePointoperator= (const AffinePoint &other)=default
 
template<concepts::resizable_byte_buffer T = std::vector<uint8_t>>
T serialize () const
 
template<concepts::resizable_byte_buffer T = std::vector<uint8_t>>
T serialize_compressed () const
 
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T x_bytes () const
 
 ~AffinePoint ()=default
 

Static Public Member Functions

static AffinePoint _create (CurvePtr curve, StorageUnit x, StorageUnit y)
 
static AffinePoint generator (CurvePtr curve)
 

Detailed Description

A point on the elliptic curve in affine form

These points can be serialized, or converted to projective form for computation

Definition at line 151 of file pcurves.h.

Constructor & Destructor Documentation

◆ AffinePoint() [1/2]

Botan::PCurve::PrimeOrderCurve::AffinePoint::AffinePoint ( const AffinePoint & other)
default

Referenced by _create().

◆ AffinePoint() [2/2]

Botan::PCurve::PrimeOrderCurve::AffinePoint::AffinePoint ( AffinePoint && other)
default

◆ ~AffinePoint()

Botan::PCurve::PrimeOrderCurve::AffinePoint::~AffinePoint ( )
default

Member Function Documentation

◆ _create()

static AffinePoint Botan::PCurve::PrimeOrderCurve::AffinePoint::_create ( CurvePtr curve,
StorageUnit x,
StorageUnit y )
inlinestatic

Definition at line 217 of file pcurves.h.

217 {
218 return AffinePoint(std::move(curve), x, y);
219 }
AffinePoint(const AffinePoint &other)=default

References AffinePoint().

◆ _curve()

const auto & Botan::PCurve::PrimeOrderCurve::AffinePoint::_curve ( ) const
inline

Definition at line 211 of file pcurves.h.

211{ return m_curve; }

Referenced by Botan::PCurve::PrimeOrderCurve::ProjectivePoint::from_affine().

◆ _x()

const auto & Botan::PCurve::PrimeOrderCurve::AffinePoint::_x ( ) const
inline

Definition at line 213 of file pcurves.h.

213{ return m_x; }

◆ _y()

const auto & Botan::PCurve::PrimeOrderCurve::AffinePoint::_y ( ) const
inline

Definition at line 215 of file pcurves.h.

215{ return m_y; }

◆ bytes()

size_t Botan::PCurve::PrimeOrderCurve::AffinePoint::bytes ( ) const
inline

Return the size of the uncompressed encoding of points

Definition at line 164 of file pcurves.h.

164{ return 1 + 2 * m_curve->field_element_bytes(); }

Referenced by serialize(), serialize_compressed(), and x_bytes().

◆ compressed_bytes()

size_t Botan::PCurve::PrimeOrderCurve::AffinePoint::compressed_bytes ( ) const
inline

Return the size of the compressed encoding of points

Definition at line 169 of file pcurves.h.

169{ return 1 + m_curve->field_element_bytes(); }

Referenced by serialize_compressed().

◆ generator()

static AffinePoint Botan::PCurve::PrimeOrderCurve::AffinePoint::generator ( CurvePtr curve)
inlinestatic

Definition at line 159 of file pcurves.h.

159{ return curve->generator(); }

References generator().

Referenced by generator().

◆ is_identity()

bool Botan::PCurve::PrimeOrderCurve::AffinePoint::is_identity ( ) const
inline

Return true if this is the curve identity element (aka the point at infinity)

Definition at line 209 of file pcurves.h.

209{ return m_curve->affine_point_is_identity(*this); }

Referenced by Botan::EC_AffinePoint_Data_PC::EC_AffinePoint_Data_PC(), and Botan::EC_AffinePoint_Data_PC::EC_AffinePoint_Data_PC().

◆ negate()

AffinePoint Botan::PCurve::PrimeOrderCurve::AffinePoint::negate ( ) const
inline

Point negation

Definition at line 204 of file pcurves.h.

204{ return m_curve->point_negate(*this); }

◆ operator=() [1/2]

AffinePoint & Botan::PCurve::PrimeOrderCurve::AffinePoint::operator= ( AffinePoint && other)
default

◆ operator=() [2/2]

AffinePoint & Botan::PCurve::PrimeOrderCurve::AffinePoint::operator= ( const AffinePoint & other)
default

◆ serialize()

template<concepts::resizable_byte_buffer T = std::vector<uint8_t>>
T Botan::PCurve::PrimeOrderCurve::AffinePoint::serialize ( ) const
inline

Return the serialization of the point in uncompressed form

Definition at line 175 of file pcurves.h.

175 {
176 T bytes(this->bytes());
177 m_curve->serialize_point(bytes, *this);
178 return bytes;
179 }
FE_25519 T
Definition ge.cpp:34

References bytes(), and T.

◆ serialize_compressed()

template<concepts::resizable_byte_buffer T = std::vector<uint8_t>>
T Botan::PCurve::PrimeOrderCurve::AffinePoint::serialize_compressed ( ) const
inline

Return the serialization of the point in compressed form

Definition at line 185 of file pcurves.h.

185 {
186 T bytes(this->compressed_bytes());
187 m_curve->serialize_point_compressed(bytes, *this);
188 return bytes;
189 }

References bytes(), compressed_bytes(), and T.

◆ x_bytes()

template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T Botan::PCurve::PrimeOrderCurve::AffinePoint::x_bytes ( ) const
inline

Return the serialization of the x coordinate

Definition at line 195 of file pcurves.h.

195 {
196 secure_vector<uint8_t> bytes(m_curve->field_element_bytes());
197 m_curve->serialize_point_x(bytes, *this);
198 return bytes;
199 }
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61

References bytes().


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