7#include <botan/auto_rng.h>
8#include <botan/entropy_src.h>
9#include <botan/hmac_drbg.h>
11#if defined(BOTAN_HAS_SYSTEM_RNG)
12 #include <botan/system_rng.h>
15#if !defined(BOTAN_AUTO_RNG_HMAC)
16#error "No hash function defined for AutoSeeded_RNG in build.h (try enabling sha2_32)"
27 size_t reseed_interval)
36 size_t reseed_interval)
46 size_t reseed_interval)
50 underlying_rng, entropy_sources, reseed_interval));
55#if defined(BOTAN_HAS_SYSTEM_RNG)
65 m_rng->force_reseed();
68 if(!m_rng->is_seeded())
76 return m_rng->is_seeded();
91 m_rng->add_entropy(in, len);
96 std::chrono::milliseconds poll_timeout)
98 return m_rng->reseed(srcs, poll_bits, poll_timeout);
103 m_rng->randomize_with_ts_input(output, output_len);
107 const uint8_t ad[],
size_t ad_len)
109 m_rng->randomize_with_input(output, output_len, ad, ad_len);
void randomize_with_input(uint8_t output[], size_t output_len, const uint8_t input[], size_t input_len) override
std::string name() const override
void randomize(uint8_t out[], size_t len) override
AutoSeeded_RNG(size_t reseed_interval=BOTAN_RNG_DEFAULT_RESEED_INTERVAL)
bool is_seeded() const override
size_t reseed(Entropy_Sources &srcs, size_t poll_bits=BOTAN_RNG_RESEED_POLL_BITS, std::chrono::milliseconds poll_timeout=BOTAN_RNG_RESEED_DEFAULT_TIMEOUT) override
void add_entropy(const uint8_t in[], size_t len) override
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(const std::string &algo_spec, const std::string &provider="")
RandomNumberGenerator & system_rng()