8#include <botan/internal/rfc6979.h>
10#include <botan/hmac_drbg.h>
12#include <botan/internal/fmt.h>
18 m_qlen(m_order.bits()),
19 m_rlen(m_qlen / 8 + (m_qlen % 8 ? 1 : 0)),
32 m_hmac_drbg->initialize_with(m_rng_in.data(), m_rng_in.size());
35 m_hmac_drbg->randomize(m_rng_out.data(), m_rng_out.size());
37 m_k >>= (8 * m_rlen - m_qlen);
38 }
while(m_k == 0 || m_k >= m_order);
void serialize_to(std::span< uint8_t > out) const
void _assign_from_bytes(std::span< const uint8_t > bytes)
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(std::string_view algo_spec, std::string_view provider="")
RFC6979_Nonce_Generator(std::string_view hash, const BigInt &order, const BigInt &x)
const BigInt & nonce_for(const BigInt &m)
~RFC6979_Nonce_Generator()
std::string fmt(std::string_view format, const T &... args)
BigInt generate_rfc6979_nonce(const BigInt &x, const BigInt &q, const BigInt &h, std::string_view hash)