7 #ifndef BOTAN_STATEFUL_RNG_H__
8 #define BOTAN_STATEFUL_RNG_H__
10 #include <botan/rng.h>
37 size_t reseed_interval) :
38 m_underlying_rng(&rng),
39 m_entropy_sources(&entropy_sources),
40 m_reseed_interval(reseed_interval)
50 m_underlying_rng(&rng),
51 m_reseed_interval(reseed_interval)
60 m_entropy_sources(&entropy_sources),
61 m_reseed_interval(reseed_interval)
74 void initialize_with(
const uint8_t input[],
size_t length);
76 bool is_seeded() const override final;
84 size_t poll_bits = BOTAN_RNG_RESEED_POLL_BITS) override final;
90 void randomize_with_ts_input(uint8_t output[],
size_t output_len) override final;
98 size_t poll_bits = BOTAN_RNG_RESEED_POLL_BITS,
99 std::chrono::milliseconds poll_timeout = BOTAN_RNG_RESEED_DEFAULT_TIMEOUT) override;
104 virtual
size_t security_level() const = 0;
106 void clear() override;
114 uint32_t last_pid()
const {
return m_last_pid; }
123 const size_t m_reseed_interval;
124 uint32_t m_last_pid = 0;
132 size_t m_reseed_counter = 0;
Stateful_RNG(RandomNumberGenerator &rng, size_t reseed_interval)
Stateful_RNG(Entropy_Sources &entropy_sources, size_t reseed_interval)
Stateful_RNG(RandomNumberGenerator &rng, Entropy_Sources &entropy_sources, size_t reseed_interval)