8#include <botan/chacha_rng.h>
10#include <botan/assert.h>
51 m_hmac->set_key(std::vector<uint8_t>(m_hmac->output_length(), 0x00));
52 m_chacha->set_key(m_hmac->final());
55void ChaCha_RNG::generate_output(std::span<uint8_t> output, std::span<const uint8_t> input) {
62 m_chacha->write_keystream(output);
65void ChaCha_RNG::update(std::span<const uint8_t> input) {
66 m_hmac->update(input);
67 m_chacha->set_key(m_hmac->final());
68 const auto mac_key = m_chacha->keystream_bytes(m_hmac->output_length());
69 m_hmac->set_key(mac_key);
#define BOTAN_ASSERT_NOMSG(expr)
size_t security_level() const override
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(std::string_view algo_spec, std::string_view provider="")
void add_entropy(std::span< const uint8_t > input)
size_t reseed_interval() const
virtual void clear_state()=0
Stateful_RNG(RandomNumberGenerator &rng, Entropy_Sources &entropy_sources, size_t reseed_interval)
static std::unique_ptr< StreamCipher > create_or_throw(std::string_view algo_spec, std::string_view provider="")