Botan 3.13.0
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 100 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)
explicit

Definition at line 190 of file ec_inner_pc.cpp.

190 : m_group(q.group()) {
191 BOTAN_ARG_CHECK(q.group() == m_group, "Curve mismatch");
192
193 const auto& pt_q = EC_AffinePoint_Data_PC::checked_ref(q);
194
195 m_tbl = m_group->pcurve().mul2_setup_g(pt_q.value());
196}
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:33
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 198 of file ec_inner_pc.cpp.

199 {
200 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
201
202 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
203 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
204
205 const auto& pcurve = m_group->pcurve();
206
207 if(auto pt = pcurve.mul2_vartime(*m_tbl, x.value(), y.value())) {
208 return std::make_unique<EC_AffinePoint_Data_PC>(m_group, pcurve.point_to_affine(*pt));
209 } else {
210 return nullptr;
211 }
212}
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 214 of file ec_inner_pc.cpp.

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

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: