Botan 3.6.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 255 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 639 of file ec_group.cpp.

639: 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 643 of file ec_group.cpp.

643 {
644 auto pt = m_tbl->mul2_vartime(x._inner(), y._inner());
645 if(pt) {
646 return EC_AffinePoint::_from_inner(std::move(pt));
647 } else {
648 return {};
649 }
650}
static EC_AffinePoint _from_inner(std::unique_ptr< EC_AffinePoint_Data > inner)

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

Referenced by Botan::EC_Group::point_multiply().

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

661 {
662 return this->mul2_vartime_x_mod_order_eq(v, c * x, c * y);
663}
bool mul2_vartime_x_mod_order_eq(const EC_Scalar &v, const EC_Scalar &x, const EC_Scalar &y) const
Definition ec_group.cpp:652

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

654 {
655 return m_tbl->mul2_vartime_x_mod_order_eq(v._inner(), x._inner(), y._inner());
656}

References Botan::EC_Scalar::_inner().


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