Botan 3.7.1
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
 
 Mul2Table (const EC_AffinePoint &h)
 
 ~Mul2Table ()
 

Detailed Description

Table for computing g*x + h*y.

Definition at line 322 of file ec_group.h.

Constructor & Destructor Documentation

◆ Mul2Table()

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

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

Definition at line 730 of file ec_group.cpp.

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

◆ ~Mul2Table()

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

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 734 of file ec_group.cpp.

734 {
735 auto pt = m_tbl->mul2_vartime(x._inner(), y._inner());
736 if(pt) {
737 return EC_AffinePoint::_from_inner(std::move(pt));
738 } else {
739 return {};
740 }
741}
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 749 of file ec_group.cpp.

752 {
753 return this->mul2_vartime_x_mod_order_eq(v, c * x, c * y);
754}
bool mul2_vartime_x_mod_order_eq(const EC_Scalar &v, const EC_Scalar &x, const EC_Scalar &y) const
Definition ec_group.cpp:743

◆ 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 743 of file ec_group.cpp.

745 {
746 return m_tbl->mul2_vartime_x_mod_order_eq(v._inner(), x._inner(), y._inner());
747}

References Botan::EC_Scalar::_inner().


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