Botan 3.7.1
Crypto and TLS for C&
Botan::EC_Mul2Table_Data_BN Class Referencefinal

#include <ec_inner_bn.h>

Inheritance diagram for Botan::EC_Mul2Table_Data_BN:
Botan::EC_Mul2Table_Data

Public Member Functions

 EC_Mul2Table_Data_BN (const EC_AffinePoint_Data &g, const EC_AffinePoint_Data &h)
 
std::unique_ptr< EC_AffinePoint_Datamul2_vartime (const EC_Scalar_Data &x, const EC_Scalar_Data &y) const override
 
bool mul2_vartime_x_mod_order_eq (const EC_Scalar_Data &v, const EC_Scalar_Data &x, const EC_Scalar_Data &y) const override
 

Detailed Description

Definition at line 97 of file ec_inner_bn.h.

Constructor & Destructor Documentation

◆ EC_Mul2Table_Data_BN()

Botan::EC_Mul2Table_Data_BN::EC_Mul2Table_Data_BN ( const EC_AffinePoint_Data & g,
const EC_AffinePoint_Data & h )

Definition at line 189 of file ec_inner_bn.cpp.

189 :
190 m_group(g.group()), m_tbl(g.to_legacy_point(), h.to_legacy_point()) {
191 BOTAN_ARG_CHECK(h.group() == m_group, "Curve mismatch");
192}
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:29

References BOTAN_ARG_CHECK, and Botan::EC_AffinePoint_Data::group().

Member Function Documentation

◆ mul2_vartime()

std::unique_ptr< EC_AffinePoint_Data > Botan::EC_Mul2Table_Data_BN::mul2_vartime ( const EC_Scalar_Data & x,
const EC_Scalar_Data & y ) const
overridevirtual

Implements Botan::EC_Mul2Table_Data.

Definition at line 194 of file ec_inner_bn.cpp.

195 {
196 BOTAN_ARG_CHECK(x.group() == m_group && y.group() == m_group, "Curve mismatch");
197
198 const auto& bn_x = EC_Scalar_Data_BN::checked_ref(x);
199 const auto& bn_y = EC_Scalar_Data_BN::checked_ref(y);
200 auto pt = m_tbl.multi_exp(bn_x.value(), bn_y.value());
201
202 if(pt.is_zero()) {
203 return nullptr;
204 }
205 return std::make_unique<EC_AffinePoint_Data_BN>(m_group, std::move(pt));
206}
EC_Point multi_exp(const BigInt &k1, const BigInt &k2) const
static const EC_Scalar_Data_BN & checked_ref(const EC_Scalar_Data &data)

References BOTAN_ARG_CHECK, Botan::EC_Scalar_Data_BN::checked_ref(), Botan::EC_Scalar_Data::group(), and Botan::EC_Point_Multi_Point_Precompute::multi_exp().

◆ mul2_vartime_x_mod_order_eq()

bool Botan::EC_Mul2Table_Data_BN::mul2_vartime_x_mod_order_eq ( const EC_Scalar_Data & v,
const EC_Scalar_Data & x,
const EC_Scalar_Data & y ) const
overridevirtual

Implements Botan::EC_Mul2Table_Data.

Definition at line 208 of file ec_inner_bn.cpp.

210 {
211 BOTAN_ARG_CHECK(x.group() == m_group && y.group() == m_group && v.group() == m_group, "Curve mismatch");
212
213 const auto& bn_v = EC_Scalar_Data_BN::checked_ref(v);
214 const auto& bn_x = EC_Scalar_Data_BN::checked_ref(x);
215 const auto& bn_y = EC_Scalar_Data_BN::checked_ref(y);
216 const auto pt = m_tbl.multi_exp(bn_x.value(), bn_y.value());
217
218 return pt._is_x_eq_to_v_mod_order(bn_v.value());
219}
bool _is_x_eq_to_v_mod_order(const BigInt &v) const
Definition ec_point.cpp:675

References Botan::EC_Point::_is_x_eq_to_v_mod_order(), BOTAN_ARG_CHECK, Botan::EC_Scalar_Data_BN::checked_ref(), Botan::EC_Scalar_Data::group(), and Botan::EC_Point_Multi_Point_Precompute::multi_exp().


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