Botan 3.7.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 &q)
 
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 104 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 & q)

Definition at line 205 of file ec_inner_pc.cpp.

205 : m_group(q.group()) {
206 BOTAN_ARG_CHECK(q.group() == m_group, "Curve mismatch");
207
208 const auto& pt_q = EC_AffinePoint_Data_PC::checked_ref(q);
209
210 m_tbl = m_group->pcurve().mul2_setup_g(pt_q.value());
211}
#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 213 of file ec_inner_pc.cpp.

214 {
215 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
216
217 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
218 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
219
220 if(auto pt = m_group->pcurve().mul2_vartime(*m_tbl, x.value(), y.value())) {
221 return std::make_unique<EC_AffinePoint_Data_PC>(m_group, pt->to_affine());
222 } else {
223 return nullptr;
224 }
225}
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 227 of file ec_inner_pc.cpp.

229 {
230 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
231
232 const auto& v = EC_Scalar_Data_PC::checked_ref(vd);
233 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
234 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
235
236 return m_group->pcurve().mul2_vartime_x_mod_order_eq(*m_tbl, v.value(), x.value(), y.value());
237}

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: