1#ifndef C870F4A3_192C_4B96_9AE6_497D1885C5D9
2#define C870F4A3_192C_4B96_9AE6_497D1885C5D9
20#if defined(__SIZEOF_INT128__) && !defined(SECP256K1_PLATFORM_ESP32) && !defined(SECP256K1_PLATFORM_STM32) && !defined(__EMSCRIPTEN__)
21 #ifndef SECP256K1_FAST_52BIT
22 #define SECP256K1_FAST_52BIT 1
46#if defined(SECP256K1_GLV_WINDOW_WIDTH)
49 static_assert(SECP256K1_GLV_WINDOW_WIDTH >= 4 && SECP256K1_GLV_WINDOW_WIDTH <= 7,
50 "SECP256K1_GLV_WINDOW_WIDTH must be in [4,7]");
52#elif defined(__riscv) || defined(__aarch64__) || defined(_M_ARM64)
54#elif defined(__x86_64__) || defined(_M_X64)
71 std::array<int32_t, kWnafBufLen>
wnaf1{};
73 std::array<int32_t, kWnafBufLen>
wnaf2{};
93 static Point from_hex(
const std::string& x_hex,
const std::string& y_hex);
98 bool is_gen() const noexcept {
return is_generator_; }
107#if defined(SECP256K1_FAST_52BIT)
114 const FieldElement52& Z52() const noexcept {
return z_; }
133 bool neg1,
bool neg2)
const;
139 const std::vector<int32_t>& wnaf2,
140 bool neg1,
bool neg2)
const;
143 const int32_t* wnaf2, std::size_t len2,
144 bool neg1,
bool neg2)
const;
167#if defined(SECP256K1_FAST_52BIT)
199 std::array<uint8_t, 33>* out);
204 std::array<uint8_t, 32>* out);
219#if defined(SECP256K1_FAST_52BIT)
230#if defined(SECP256K1_FAST_52BIT)
239#if defined(SECP256K1_FAST_52BIT)
248 bool z_fe_nonzero(
FieldElement& out_z_fe)
const noexcept;
251#if defined(SECP256K1_FAST_52BIT)
static Point from_hex(const std::string &x_hex, const std::string &y_hex)
static Point from_affine(const FieldElement &x, const FieldElement &y)
static Point dual_scalar_mul_gen_point(const Scalar &a, const Scalar &b, const Point &P)
const FieldElement & z_raw() const noexcept
static Point from_jacobian_coords(const FieldElement &x, const FieldElement &y, const FieldElement &z, bool infinity)
static void batch_x_only_bytes(const Point *points, size_t n, std::array< uint8_t, 32 > *out)
std::array< std::uint8_t, 65 > to_uncompressed() const
void add_affine_constant_inplace(const FieldElement &ax, const FieldElement &ay)
const FieldElement & Y() const noexcept
std::pair< std::array< uint8_t, 32 >, bool > x_bytes_and_parity() const
static void batch_to_compressed(const Point *points, size_t n, std::array< uint8_t, 33 > *out)
bool is_gen() const noexcept
std::array< uint8_t, 32 > x_only_bytes() const
static void batch_normalize(const Point *points, size_t n, FieldElement *out_x, FieldElement *out_y)
Point scalar_mul(const Scalar &scalar) const
void sub_mixed_inplace(const FieldElement &ax, const FieldElement &ay)
void add_inplace(const Point &other)
bool is_infinity() const noexcept
Point scalar_mul_with_plan(const KPlan &plan) const
bool is_normalized() const noexcept
Point add(const Point &other) const
const FieldElement & z() const noexcept
const FieldElement & y_raw() const noexcept
void add_mixed_inplace(const FieldElement &ax, const FieldElement &ay)
Point scalar_mul_precomputed_wnaf(const std::vector< int32_t > &wnaf1, const std::vector< int32_t > &wnaf2, bool neg1, bool neg2) const
Point scalar_mul_precomputed_wnaf(const int32_t *wnaf1, std::size_t len1, const int32_t *wnaf2, std::size_t len2, bool neg1, bool neg2) const
const FieldElement & x_raw() const noexcept
Point scalar_mul_predecomposed(const Scalar &k1, const Scalar &k2, bool neg1, bool neg2) const
void sub_inplace(const Point &other)
Point scalar_mul_precomputed_k(const Scalar &k) const
const FieldElement & X() const noexcept
std::array< uint8_t, 16 > x_first_half() const
std::array< std::uint8_t, 33 > to_compressed() const
std::array< uint8_t, 16 > x_second_half() const
bool Selftest(bool verbose)
constexpr std::size_t kWnafBufLen
constexpr uint8_t kDefaultGlvWindow
std::array< int32_t, kWnafBufLen > wnaf2
static KPlan from_scalar(const Scalar &k, uint8_t w=kDefaultGlvWindow)
std::array< int32_t, kWnafBufLen > wnaf1