Botan 3.5.0
Crypto and TLS for C&
Botan::PCurve::PrimeOrderCurve::ProjectivePoint Class Referencefinal

#include <pcurves.h>

Public Member Functions

const auto & _curve () const
 
const auto & _x () const
 
const auto & _y () const
 
const auto & _z () const
 
ProjectivePoint dbl () const
 
ProjectivePoint negate () const
 
ProjectivePointoperator= (const ProjectivePoint &other)=default
 
ProjectivePointoperator= (ProjectivePoint &&other)=default
 
 ProjectivePoint (const ProjectivePoint &other)=default
 
 ProjectivePoint (ProjectivePoint &&other)=default
 
AffinePoint to_affine () const
 
 ~ProjectivePoint ()=default
 

Static Public Member Functions

static ProjectivePoint _create (CurvePtr curve, StorageUnit x, StorageUnit y, StorageUnit z)
 
static ProjectivePoint from_affine (const AffinePoint &pt)
 

Friends

ProjectivePoint operator+ (const ProjectivePoint &x, const AffinePoint &y)
 
ProjectivePoint operator+ (const ProjectivePoint &x, const ProjectivePoint &y)
 

Detailed Description

A point on the elliptic curve in projective form

This is a form that is convenient for computation; it must be converted to affine form for comparisons or serialization.

Definition at line 223 of file pcurves.h.

Constructor & Destructor Documentation

◆ ProjectivePoint() [1/2]

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

◆ ProjectivePoint() [2/2]

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

◆ ~ProjectivePoint()

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

Member Function Documentation

◆ _create()

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

Definition at line 264 of file pcurves.h.

264 {
265 return ProjectivePoint(std::move(curve), x, y, z);
266 }
ProjectivePoint(const ProjectivePoint &other)=default

◆ _curve()

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

Definition at line 256 of file pcurves.h.

256{ return m_curve; }

◆ _x()

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

Definition at line 258 of file pcurves.h.

258{ return m_x; }

◆ _y()

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

Definition at line 260 of file pcurves.h.

260{ return m_y; }

◆ _z()

const auto & Botan::PCurve::PrimeOrderCurve::ProjectivePoint::_z ( ) const
inline

Definition at line 262 of file pcurves.h.

262{ return m_z; }

◆ dbl()

ProjectivePoint Botan::PCurve::PrimeOrderCurve::ProjectivePoint::dbl ( ) const
inline

Definition at line 244 of file pcurves.h.

244{ return m_curve->point_double(*this); }

◆ from_affine()

static ProjectivePoint Botan::PCurve::PrimeOrderCurve::ProjectivePoint::from_affine ( const AffinePoint & pt)
inlinestatic

Convert a point from affine to projective form

Definition at line 234 of file pcurves.h.

234{ return pt._curve()->point_to_projective(pt); }

References Botan::PCurve::PrimeOrderCurve::AffinePoint::_curve().

◆ negate()

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

Definition at line 246 of file pcurves.h.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ to_affine()

AffinePoint Botan::PCurve::PrimeOrderCurve::ProjectivePoint::to_affine ( ) const
inline

Convert a point from projective to affine form

This operation is expensive; perform it only when required for serialization

Definition at line 242 of file pcurves.h.

242{ return m_curve->point_to_affine(*this); }

Referenced by Botan::PCurve::PrimeOrderCurveImpl< C >::base_point_mul_x_mod_order(), and Botan::PCurve::PrimeOrderCurveImpl< C >::mul2_vartime_x_mod_order().

Friends And Related Symbol Documentation

◆ operator+ [1/2]

ProjectivePoint operator+ ( const ProjectivePoint & x,
const AffinePoint & y )
friend

Definition at line 252 of file pcurves.h.

252 {
253 return x.m_curve->point_add_mixed(x, y);
254 }

◆ operator+ [2/2]

ProjectivePoint operator+ ( const ProjectivePoint & x,
const ProjectivePoint & y )
friend

Definition at line 248 of file pcurves.h.

248 {
249 return x.m_curve->point_add(x, y);
250 }

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