10 #ifndef BOTAN_POINT_GFP_H__
11 #define BOTAN_POINT_GFP_H__
13 #include <botan/curve_gfp.h>
25 "Requested transformation is not possible") :
34 explicit Illegal_Point(
const std::string& err =
"Malformed ECP point detected") :
151 m_coord_y =
m_curve.get_p() - m_coord_y;
165 BigInt get_affine_x()
const;
171 BigInt get_affine_y()
const;
178 {
return (m_coord_x.is_zero() && m_coord_z.is_zero()); }
185 bool on_the_curve()
const;
209 m_curve.mul(z, x, y, m_monty_ws);
215 m_curve.mul(z, x, y, m_monty_ws);
218 BigInt curve_sqr(
const BigInt& x)
const
225 void curve_sqr(BigInt& z,
const BigInt& x)
const
234 void add(
const PointGFp& other, std::vector<BigInt>& workspace);
240 void mult2(std::vector<BigInt>& workspace);
243 BigInt m_coord_x, m_coord_y, m_coord_z;
244 mutable secure_vector<word> m_monty_ws;
250 return !(rhs == lhs);
273 return scalar * point;
277 secure_vector<uint8_t> BOTAN_DLL
EC2OSP(
const PointGFp& point, uint8_t format);
279 PointGFp BOTAN_DLL
OS2ECP(
const uint8_t data[],
size_t data_len,
280 const CurveGFp& curve);
282 template<
typename Alloc>
284 {
return OS2ECP(data.data(), data.size(), curve); }
298 std::vector<BigInt> m_ws;
299 std::vector<PointGFp> m_U;
static PointGFp zero_of(const CurveGFp &curve)
secure_vector< uint8_t > EC2OSP(const PointGFp &point, uint8_t format)
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
Illegal_Point(const std::string &err="Malformed ECP point detected")
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
PointGFp & operator=(PointGFp &&other)
OID operator+(const OID &oid, uint32_t component)
const CurveGFp & get_curve() const
PointGFp OS2ECP(const uint8_t data[], size_t data_len, const CurveGFp &curve)
std::vector< T, Alloc > & operator+=(std::vector< T, Alloc > &out, const std::vector< T, Alloc2 > &in)
BigInt operator*(const BigInt &x, const BigInt &y)
BigInt operator-(const BigInt &x, const BigInt &y)
PointGFp(PointGFp &&other)
PointGFp multi_exponentiate(const PointGFp &p1, const BigInt &z1, const PointGFp &p2, const BigInt &z2)