8#include <botan/internal/rfc6979.h>
10#include <botan/hmac_drbg.h>
12#include <botan/internal/fmt.h>
19 m_qlen(order_bits), m_rlen((m_qlen + 7) / 8), m_rng_in(m_rlen * 2), m_rng_out(m_rlen) {
30 m_hmac_drbg->initialize_with(m_rng_in);
32 const size_t shift = 8 * m_rlen - m_qlen;
38 m_hmac_drbg->randomize(m_rng_out);
44 }
while(k == 0 || k >= order);
49#if defined(BOTAN_HAS_ECC_GROUP)
51 m_qlen(order_bits), m_rlen((m_qlen + 7) / 8), m_rng_in(m_rlen * 2), m_rng_out(m_rlen) {
60 m_hmac_drbg->initialize_with(m_rng_in);
62 const size_t shift = 8 * m_rlen - m_qlen;
66 m_hmac_drbg->randomize(m_rng_out);
70 for(uint8_t&
b : m_rng_out) {
73 carry = w << (8 - shift);
#define BOTAN_ASSERT_NOMSG(expr)
#define BOTAN_DEBUG_ASSERT(expr)
void serialize_to(std::span< uint8_t > out) const
void _assign_from_bytes(std::span< const uint8_t > bytes)
static std::optional< EC_Scalar > deserialize(const EC_Group &group, std::span< const uint8_t > bytes)
void serialize_to(std::span< uint8_t > bytes) const
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(std::string_view algo_spec, std::string_view provider="")
RFC6979_Nonce_Generator(std::string_view hash, size_t order_bits, const BigInt &x)
~RFC6979_Nonce_Generator()
BigInt nonce_for(const BigInt &group_order, const BigInt &m)
std::string fmt(std::string_view format, const T &... args)
void carry(int64_t &h0, int64_t &h1)