10 #ifndef BOTAN_GFP_CURVE_H__
11 #define BOTAN_GFP_CURVE_H__
13 #include <botan/numthry.h>
69 m_repr(choose_repr(p, a, b))
99 m_repr->to_curve_rep(x, ws);
104 m_repr->from_curve_rep(x, ws);
110 m_repr->from_curve_rep(xt, ws);
118 m_repr->curve_mul(z, x, y, ws);
124 m_repr->curve_mul(z, x, y, ws);
130 m_repr->curve_sqr(z, x, ws);
136 m_repr->curve_sqr(z, x, ws);
142 std::swap(m_repr, other.m_repr);
146 static std::shared_ptr<CurveGFp_Repr>
149 std::shared_ptr<CurveGFp_Repr> m_repr;
167 return !(lhs == rhs);
const BigInt & get_a() const
void sqr(BigInt &z, const BigInt &x, secure_vector< word > &ws) const
virtual const BigInt & get_p() const =0
BigInt mul(const BigInt &x, const BigInt &y, secure_vector< word > &ws) const
CurveGFp(const BigInt &p, const BigInt &a, const BigInt &b)
const BigInt & get_b() const
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
const BigInt & get_a_rep() const
BigInt sqr(const BigInt &x, secure_vector< word > &ws) const
virtual void curve_sqr(BigInt &z, const BigInt &x, secure_vector< word > &ws) const =0
virtual void from_curve_rep(BigInt &x, secure_vector< word > &ws) const =0
virtual const BigInt & get_a() const =0
virtual const BigInt & get_b_rep() const =0
std::vector< T, secure_allocator< T >> secure_vector
void to_rep(BigInt &x, secure_vector< word > &ws) const
void from_rep(BigInt &x, secure_vector< word > &ws) const
virtual ~CurveGFp_Repr()=default
const BigInt & get_b_rep() const
void swap(CurveGFp &other)
virtual void curve_mul(BigInt &z, const BigInt &x, const BigInt &y, secure_vector< word > &ws) const =0
BigInt from_rep(const BigInt &x, secure_vector< word > &ws) const
const BigInt & get_p() const
virtual void to_curve_rep(BigInt &x, secure_vector< word > &ws) const =0
virtual size_t get_p_words() const =0
virtual const BigInt & get_a_rep() const =0
void mul(BigInt &z, const BigInt &x, const BigInt &y, secure_vector< word > &ws) const
virtual const BigInt & get_b() const =0