Botan 3.6.1
Crypto and TLS for C&
Botan::EC_Mul2Table_Data_PC Class Referencefinal

#include <ec_inner_pc.h>

Inheritance diagram for Botan::EC_Mul2Table_Data_PC:
Botan::EC_Mul2Table_Data

Public Member Functions

 EC_Mul2Table_Data_PC (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 96 of file ec_inner_pc.h.

Constructor & Destructor Documentation

◆ EC_Mul2Table_Data_PC()

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

Definition at line 189 of file ec_inner_pc.cpp.

189 :
190 m_group(g.group()) {
191 BOTAN_ARG_CHECK(h.group() == m_group, "Curve mismatch");
192
193 const auto& pt_g = EC_AffinePoint_Data_PC::checked_ref(g);
194 const auto& pt_h = EC_AffinePoint_Data_PC::checked_ref(h);
195
196 m_tbl = m_group->pcurve().mul2_setup(pt_g.value(), pt_h.value());
197}
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:29
static const EC_AffinePoint_Data_PC & checked_ref(const EC_AffinePoint_Data &data)

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

Member Function Documentation

◆ mul2_vartime()

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

Implements Botan::EC_Mul2Table_Data.

Definition at line 199 of file ec_inner_pc.cpp.

200 {
201 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
202
203 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
204 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
205
206 if(auto pt = m_group->pcurve().mul2_vartime(*m_tbl, x.value(), y.value())) {
207 return std::make_unique<EC_AffinePoint_Data_PC>(m_group, pt->to_affine());
208 } else {
209 return nullptr;
210 }
211}
static const EC_Scalar_Data_PC & checked_ref(const EC_Scalar_Data &data)

References BOTAN_ARG_CHECK, Botan::EC_Scalar_Data_PC::checked_ref(), and Botan::EC_Scalar_Data::group().

◆ mul2_vartime_x_mod_order_eq()

bool Botan::EC_Mul2Table_Data_PC::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 213 of file ec_inner_pc.cpp.

215 {
216 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
217
218 const auto& v = EC_Scalar_Data_PC::checked_ref(vd);
219 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
220 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
221
222 return m_group->pcurve().mul2_vartime_x_mod_order_eq(*m_tbl, v.value(), x.value(), y.value());
223}

References BOTAN_ARG_CHECK, Botan::EC_Scalar_Data_PC::checked_ref(), and Botan::EC_Scalar_Data::group().


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