Botan 3.6.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
 
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 144 of file pcurves.h.

Constructor & Destructor Documentation

◆ AffinePoint() [1/2]

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

◆ 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 205 of file pcurves.h.

205 {
206 return AffinePoint(std::move(curve), x, y);
207 }
AffinePoint(const AffinePoint &other)=default

◆ _curve()

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

Definition at line 199 of file pcurves.h.

199{ return m_curve; }

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

◆ _x()

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

Definition at line 201 of file pcurves.h.

201{ return m_x; }

◆ _y()

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

Definition at line 203 of file pcurves.h.

203{ 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 157 of file pcurves.h.

157{ return 1 + 2 * m_curve->field_element_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 162 of file pcurves.h.

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

◆ generator()

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

Definition at line 152 of file pcurves.h.

152{ 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 197 of file pcurves.h.

197{ 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().

◆ 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 168 of file pcurves.h.

168 {
169 T bytes(this->bytes());
170 m_curve->serialize_point(bytes, *this);
171 return bytes;
172 }
FE_25519 T
Definition ge.cpp:34

References 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 178 of file pcurves.h.

178 {
179 T bytes(this->compressed_bytes());
180 m_curve->serialize_point_compressed(bytes, *this);
181 return bytes;
182 }

References 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 188 of file pcurves.h.

188 {
189 secure_vector<uint8_t> bytes(m_curve->field_element_bytes());
190 m_curve->serialize_point_x(bytes, *this);
191 return bytes;
192 }
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61

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