10#ifndef BOTAN_EC_POINT_H_
11#define BOTAN_EC_POINT_H_
15#include <botan/curve_gfp.h>
16#include <botan/ec_point_format.h>
135 m_y = m_curve.get_p() - m_y;
157 bool is_affine()
const;
163 bool is_zero()
const {
return m_z.is_zero(); }
170 bool on_the_curve()
const;
191 BigInt get_affine_x()
const;
197 BigInt get_affine_y()
const;
228#if defined(BOTAN_DISABLE_DEPRECATED_FEATURES)
275 void add(
const EC_Point& other, std::vector<BigInt>& workspace);
288 void add(
const word x_words[],
290 const word y_words[],
292 const word z_words[],
294 std::vector<BigInt>& workspace);
305 void add_affine(
const EC_Point& other, std::vector<BigInt>& workspace);
317 const word x_words[],
size_t x_size,
const word y_words[],
size_t y_size, std::vector<BigInt>& workspace);
323 void mult2(std::vector<BigInt>& workspace);
330 void mult2i(
size_t i, std::vector<BigInt>& workspace);
340 x.
add(other, workspace);
378 multi_exponentiate(const EC_Point& p1, const BigInt& z1, const EC_Point& p2, const BigInt& z2);
396 return point.
mul(scalar);
400 return point.
mul(scalar);
424 OS2ECP(const uint8_t data[],
size_t data_len, const BigInt& curve_p, const BigInt& curve_a, const BigInt& curve_b);
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_UNSTABLE_API
#define BOTAN_DEPRECATED(msg)
void swap(EC_Point &other) noexcept
bool operator!=(const EC_Point &other) const =default
EC_Point plus(const EC_Point &other, std::vector< BigInt > &workspace) const
void add(const EC_Point &other, std::vector< BigInt > &workspace)
void mult2(std::vector< BigInt > &workspace)
EC_Point double_of(std::vector< BigInt > &workspace) const
const BigInt & get_y() const
friend class EC_Point_Var_Point_Precompute
const BigInt & get_z() const
void swap_coords(BigInt &new_x, BigInt &new_y, BigInt &new_z)
EC_Point & operator=(EC_Point &&other) noexcept
friend class EC_Point_Base_Point_Precompute
friend class EC_Point_Multi_Point_Precompute
EC_Point mul(const BigInt &scalar) const
friend void swap(EC_Point &x, EC_Point &y) noexcept
const CurveGFp & get_curve() const
EC_Point & operator=(const EC_Point &)=default
const BigInt & get_x() const
EC_Point_Format Compression_Type
std::vector< uint8_t > encode(EC_Point_Format format) const
bool _is_x_eq_to_v_mod_order(const BigInt &v) const
BigInt operator*(const BigInt &x, const BigInt &y)
OctetString operator+(const OctetString &k1, const OctetString &k2)
EC_Point multi_exponentiate(const EC_Point &p1, const BigInt &z1, const EC_Point &p2, const BigInt &z2)
BigInt operator-(const BigInt &x, const BigInt &y)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
std::vector< T, secure_allocator< T > > secure_vector
std::conditional_t< HasNative64BitRegisters, std::uint64_t, uint32_t > word
EC_Point OS2ECP(std::span< const uint8_t > data, const CurveGFp &curve)