libdecaf
Public Member Functions | Static Public Member Functions | List of all members
decaf::Ristretto::Precomputed Class Reference

Precomputed table of points. More...

Public Member Functions

 ~Precomputed () DECAF_NOEXCEPT
 Destructor securely zeorizes the memory. More...
 
 Precomputed (const Precomputed_U &yours= *decaf_255_precomputed_base) DECAF_NOEXCEPT
 Initialize from underlying type, declared as a reference to prevent it from being called with 0, thereby breaking override. More...
 
Precomputedoperator= (const Point &it)
 Initilaize from point. More...
 
 Precomputed (const Precomputed &it)
 Copy constructor.
 
 Precomputed (const Point &it)
 Constructor which initializes from point.
 
Point operator* (const Scalar &s) const DECAF_NOEXCEPT
 Fixed base scalarmul. More...
 
Point operator/ (const Scalar &s) const
 Multiply by s.inverse(). More...
 

Static Public Member Functions

static const Precomputed base () DECAF_NOEXCEPT
 Return the table for the base point. More...
 

Detailed Description

Precomputed table of points.

Minor difficulties arise here because the decaf API doesn't expose, as a constant, how big such an object is. Therefore we have to call malloc() or friends, but that's probably for the best, because you don't want to stack-allocate a 15kiB object anyway.

Constructor & Destructor Documentation

◆ ~Precomputed()

decaf::Ristretto::Precomputed::~Precomputed ( )
inline

Destructor securely zeorizes the memory.

◆ Precomputed()

decaf::Ristretto::Precomputed::Precomputed ( const Precomputed_U &  yours = *decaf_255_precomputed_base)
inline

Initialize from underlying type, declared as a reference to prevent it from being called with 0, thereby breaking override.

The underlying object must remain valid throughout the lifetime of this one.

By default, initializes to the table for the base point.

Warning
The empty initializer makes this equal to base, unlike the empty initializer for points which makes this equal to the identity.

Member Function Documentation

◆ base()

static const Precomputed decaf::Ristretto::Precomputed::base ( )
inlinestatic

Return the table for the base point.

◆ operator*()

Point decaf::Ristretto::Precomputed::operator* ( const Scalar s) const
inline

Fixed base scalarmul.

◆ operator/()

Point decaf::Ristretto::Precomputed::operator/ ( const Scalar s) const
inline

Multiply by s.inverse().

If s=0, maps to the identity.

◆ operator=()

Precomputed& decaf::Ristretto::Precomputed::operator= ( const Point it)
inline

Initilaize from point.

Must allocate memory, and may throw.


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