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 Illegal_Point(
const std::string& err =
"Malformed ECP point detected") :
120 coord_y = curve.get_p() - coord_y;
134 BigInt get_affine_x()
const;
140 BigInt get_affine_y()
const;
147 {
return (coord_x.is_zero() && coord_z.is_zero()); }
154 bool on_the_curve()
const;
177 monty_mult(result, x, y);
188 void monty_mult(BigInt& z,
const BigInt& x,
const BigInt& y)
const;
194 BigInt monty_sqr(
const BigInt& x)
const
197 monty_sqr(result, x);
207 void monty_sqr(BigInt& z,
const BigInt& x)
const;
213 void add(
const PointGFp& other, std::vector<BigInt>& workspace);
219 void mult2(std::vector<BigInt>& workspace);
222 BigInt coord_x, coord_y, coord_z;
223 mutable SecureVector<word> ws;
229 return !(rhs == lhs);
252 return scalar * point;
256 SecureVector<byte> BOTAN_DLL
EC2OSP(
const PointGFp& point,
byte format);
258 PointGFp BOTAN_DLL
OS2ECP(
const byte data[],
size_t data_len,
259 const CurveGFp& curve);
262 {
return OS2ECP(&data[0], data.
size(), curve); }
bool operator!=(const OctetString &s1, const OctetString &s2)
PointGFp OS2ECP(const byte data[], size_t data_len, const CurveGFp &curve)
Illegal_Point(const std::string &err="Malformed ECP point detected")
bool operator==(const OctetString &s1, const OctetString &s2)
const CurveGFp & get_curve() const
SecureVector< byte > EC2OSP(const PointGFp &point, byte format)
OctetString operator+(const OctetString &k1, const OctetString &k2)
BigInt operator*(const BigInt &x, const BigInt &y)
std::runtime_error Exception
MemoryRegion< T > & operator+=(MemoryRegion< T > &out, const MemoryRegion< T > &in)
void swap(Botan::MemoryRegion< T > &x, Botan::MemoryRegion< T > &y)
BigInt operator-(const BigInt &x, const BigInt &y)
PointGFp multi_exponentiate(const PointGFp &p1, const BigInt &z1, const PointGFp &p2, const BigInt &z2)