Botan 3.8.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 98 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 184 of file ec_inner_pc.cpp.

184 : m_group(q.group()) {
185 BOTAN_ARG_CHECK(q.group() == m_group, "Curve mismatch");
186
187 const auto& pt_q = EC_AffinePoint_Data_PC::checked_ref(q);
188
189 m_tbl = m_group->pcurve().mul2_setup_g(pt_q.value());
190}
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:31
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 192 of file ec_inner_pc.cpp.

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

210 {
211 BOTAN_ARG_CHECK(xd.group() == m_group && yd.group() == m_group, "Curve mismatch");
212
213 const auto& v = EC_Scalar_Data_PC::checked_ref(vd);
214 const auto& x = EC_Scalar_Data_PC::checked_ref(xd);
215 const auto& y = EC_Scalar_Data_PC::checked_ref(yd);
216
217 return m_group->pcurve().mul2_vartime_x_mod_order_eq(*m_tbl, v.value(), x.value(), y.value());
218}

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: