Botan 3.9.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 188 of file ec_inner_pc.cpp.

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

197 {
198 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
199
200 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
201 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
202
203 const auto& pcurve = m_group->pcurve();
204
205 if(auto pt = pcurve.mul2_vartime(*m_tbl, x.value(), y.value())) {
206 return std::make_unique<EC_AffinePoint_Data_PC>(m_group, pcurve.point_to_affine(*pt));
207 } else {
208 return nullptr;
209 }
210}
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 212 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& v = EC_Scalar_Data_PC::checked_ref(vd);
218 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
219 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
220
221 return m_group->pcurve().mul2_vartime_x_mod_order_eq(*m_tbl, v.value(), x.value(), y.value());
222}

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: