1#ifndef SECP256K1_PRIVATE_KEY_HPP
2#define SECP256K1_PRIVATE_KEY_HPP
40 [[nodiscard]] static
bool from_bytes(const std::uint8_t* bytes32,
44 [[nodiscard]]
static bool from_bytes(
const std::array<std::uint8_t, 32>& bytes,
65 [[nodiscard]] std::array<std::uint8_t, 32>
to_bytes()
const {
85 scalar_ = other.scalar_;
97 scalar_ = other.scalar_;
104 void secure_erase() noexcept {
107 reinterpret_cast<volatile std::uint8_t*
>(&scalar_);
108 for (std::size_t i = 0; i <
sizeof(scalar_); ++i) {
113 fast::Scalar scalar_{};
118 return a.scalar() == b.scalar();
PrivateKey(const PrivateKey &other) noexcept
std::array< std::uint8_t, 32 > to_bytes() const
PrivateKey() noexcept=default
PrivateKey & operator=(PrivateKey &&other) noexcept
static bool from_bytes(const std::uint8_t *bytes32, PrivateKey &out) noexcept
bool is_valid() const noexcept
static bool from_bytes(const std::array< std::uint8_t, 32 > &bytes, PrivateKey &out) noexcept
const fast::Scalar & scalar() const noexcept
PrivateKey & operator=(const PrivateKey &other) noexcept
static PrivateKey wrap(const fast::Scalar &s) noexcept
PrivateKey(PrivateKey &&other) noexcept
static bool parse_bytes_strict_nonzero(const std::uint8_t *bytes32, Scalar &out) noexcept
std::array< std::uint8_t, 32 > to_bytes() const
bool is_zero() const noexcept
bool operator==(const PrivateKey &a, const PrivateKey &b) noexcept