8 #include <botan/rfc6979.h>
9 #include <botan/hmac_drbg.h>
10 #include <botan/mac.h>
19 m_rlen(m_qlen / 8 + (m_qlen % 8 ? 1 : 0)),
36 m_hmac_drbg->initialize_with(m_rng_in.data(), m_rng_in.size());
40 m_hmac_drbg->randomize(m_rng_out.data(), m_rng_out.size());
42 m_k >>= (8*m_rlen - m_qlen);
44 while(m_k == 0 || m_k >= m_order);
52 const std::string&
hash)
static std::unique_ptr< MessageAuthenticationCode > create(const std::string &algo_spec, const std::string &provider="")
~RFC6979_Nonce_Generator()
RFC6979_Nonce_Generator(const std::string &hash, const BigInt &order, const BigInt &x)
BigInt generate_rfc6979_nonce(const BigInt &x, const BigInt &q, const BigInt &h, const std::string &hash)
void binary_decode(const uint8_t buf[], size_t length)
static secure_vector< uint8_t > encode_1363(const BigInt &n, size_t bytes)
const BigInt & nonce_for(const BigInt &m)