Botan 3.9.0
Crypto and TLS for C&
Botan::EC_Group::Mul2Table Class Referencefinal

Table for computing g*x + h*y. More...

#include <ec_group.h>

Public Member Functions

std::optional< EC_AffinePointmul2_vartime (const EC_Scalar &x, const EC_Scalar &y) const
bool mul2_vartime_x_mod_order_eq (const EC_Scalar &v, const EC_Scalar &c, const EC_Scalar &x, const EC_Scalar &y) const
bool mul2_vartime_x_mod_order_eq (const EC_Scalar &v, const EC_Scalar &x, const EC_Scalar &y) const
BOTAN_FUTURE_EXPLICIT Mul2Table (const EC_AffinePoint &h)
 Mul2Table (const Mul2Table &other)=delete
 Mul2Table (Mul2Table &&other) noexcept
Mul2Tableoperator= (const Mul2Table &other)=delete
Mul2Tableoperator= (Mul2Table &&other) noexcept
 ~Mul2Table ()

Detailed Description

Table for computing g*x + h*y.

Definition at line 334 of file ec_group.h.

Constructor & Destructor Documentation

◆ Mul2Table() [1/3]

Botan::EC_Group::Mul2Table::Mul2Table ( const EC_AffinePoint & h)

Create a table for computing g*x + h*y

Definition at line 771 of file ec_group.cpp.

771: m_tbl(h._group()->make_mul2_table(h._inner())) {}

Referenced by Mul2Table(), Mul2Table(), operator=(), and operator=().

◆ ~Mul2Table()

Botan::EC_Group::Mul2Table::~Mul2Table ( )
default

◆ Mul2Table() [2/3]

Botan::EC_Group::Mul2Table::Mul2Table ( const Mul2Table & other)
delete

References Mul2Table().

◆ Mul2Table() [3/3]

Botan::EC_Group::Mul2Table::Mul2Table ( Mul2Table && other)
defaultnoexcept

References Mul2Table().

Member Function Documentation

◆ mul2_vartime()

std::optional< EC_AffinePoint > Botan::EC_Group::Mul2Table::mul2_vartime ( const EC_Scalar & x,
const EC_Scalar & y ) const

Return the elliptic curve point g*x + h*y

Where g is the group generator and h is the value passed to the constructor

Returns nullopt if g*x + h*y was the point at infinity

Warning
this function is variable time with respect to x and y

Definition at line 775 of file ec_group.cpp.

775 {
776 auto pt = m_tbl->mul2_vartime(x._inner(), y._inner());
777 if(pt) {
778 return EC_AffinePoint::_from_inner(std::move(pt));
779 } else {
780 return {};
781 }
782}
static EC_AffinePoint _from_inner(std::unique_ptr< EC_AffinePoint_Data > inner)

References Botan::EC_AffinePoint::_from_inner(), and Botan::EC_Scalar::_inner().

◆ mul2_vartime_x_mod_order_eq() [1/2]

bool Botan::EC_Group::Mul2Table::mul2_vartime_x_mod_order_eq ( const EC_Scalar & v,
const EC_Scalar & c,
const EC_Scalar & x,
const EC_Scalar & y ) const

Check if v equals the x coordinate of g*x*c + h*y*c reduced modulo the order

Where g is the group generator and h is the value passed to the constructor

Returns false if unequal, including if g*x*c + h*y*c was the point at infinity

Warning
this function is variable time with respect to x and y

Definition at line 790 of file ec_group.cpp.

793 {
794 return this->mul2_vartime_x_mod_order_eq(v, c * x, c * y);
795}
bool mul2_vartime_x_mod_order_eq(const EC_Scalar &v, const EC_Scalar &x, const EC_Scalar &y) const
Definition ec_group.cpp:784

References mul2_vartime_x_mod_order_eq().

◆ mul2_vartime_x_mod_order_eq() [2/2]

bool Botan::EC_Group::Mul2Table::mul2_vartime_x_mod_order_eq ( const EC_Scalar & v,
const EC_Scalar & x,
const EC_Scalar & y ) const

Check if v equals the x coordinate of g*x + h*y reduced modulo the order

Where g is the group generator and h is the value passed to the constructor

Returns false if unequal, including if g*x + h*y was the point at infinity

Warning
this function is variable time with respect to x and y

Definition at line 784 of file ec_group.cpp.

786 {
787 return m_tbl->mul2_vartime_x_mod_order_eq(v._inner(), x._inner(), y._inner());
788}

References Botan::EC_Scalar::_inner().

Referenced by mul2_vartime_x_mod_order_eq().

◆ operator=() [1/2]

Mul2Table & Botan::EC_Group::Mul2Table::operator= ( const Mul2Table & other)
delete

References Mul2Table().

◆ operator=() [2/2]

EC_Group::Mul2Table & Botan::EC_Group::Mul2Table::operator= ( Mul2Table && other)
defaultnoexcept

References Mul2Table().


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