1#ifndef B4F0584E_3733_4C2F_BB01_D4BDC40E1760
2#define B4F0584E_3733_4C2F_BB01_D4BDC40E1760
10#include "secp256k1/types.hpp"
55 bool operator==(const
Scalar& rhs) const noexcept;
71 std::memcpy(&d, &limbs_,
sizeof(d));
75 return from_limbs({d.limbs[0], d.limbs[1], d.limbs[2], d.limbs[3]});
78 std::uint8_t
bit(std::size_t index)
const;
91 std::vector<int8_t>
to_wnaf(
unsigned width)
const;
101 "CPU Scalar must match shared data layout size");
102static_assert(
sizeof(
Scalar) == 32,
"Scalar must be 256 bits");
Scalar & operator-=(const Scalar &rhs)
static bool parse_bytes_strict_nonzero(const std::uint8_t *bytes32, Scalar &out) noexcept
Scalar & operator+=(const Scalar &rhs)
std::vector< int8_t > to_naf() const
static Scalar from_data(const ::secp256k1::ScalarData &d)
std::array< std::uint8_t, 32 > to_bytes() const
std::uint8_t bit(std::size_t index) const
bool is_even() const noexcept
bool is_zero() const noexcept
std::vector< int8_t > to_wnaf(unsigned width) const
Scalar operator-(const Scalar &rhs) const
static Scalar from_hex(const std::string &hex)
const limbs_type & limbs() const noexcept
static Scalar from_uint64(std::uint64_t value)
std::array< std::uint64_t, 4 > limbs_type
static bool parse_bytes_strict(const std::uint8_t *bytes32, Scalar &out) noexcept
std::string to_hex() const
Scalar operator+(const Scalar &rhs) const
static Scalar from_limbs(const limbs_type &limbs)
Scalar & operator*=(const Scalar &rhs)
static bool parse_bytes_strict(const std::array< std::uint8_t, 32 > &bytes, Scalar &out) noexcept
static Scalar from_bytes(const std::array< std::uint8_t, 32 > &bytes)
Scalar operator*(const Scalar &rhs) const
static Scalar from_bytes(const std::uint8_t *bytes32)
::secp256k1::ScalarData data() const noexcept
static bool parse_bytes_strict_nonzero(const std::array< std::uint8_t, 32 > &bytes, Scalar &out) noexcept
void write_bytes(std::uint8_t *out32) const noexcept