Botan 1.10.17
auto_rng.h
Go to the documentation of this file.
1/*
2* Auto Seeded RNG
3* (C) 2008 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_AUTO_SEEDING_RNG_H__
9#define BOTAN_AUTO_SEEDING_RNG_H__
10
11#include <botan/rng.h>
12#include <botan/libstate.h>
13#include <string>
14
15namespace Botan {
16
17/**
18* An automatically seeded PRNG
19*/
20class BOTAN_DLL AutoSeeded_RNG : public RandomNumberGenerator
21 {
22 public:
23 void randomize(byte out[], size_t len)
24 { rng->randomize(out, len); }
25
26 bool is_seeded() const { return rng->is_seeded(); }
27
28 void clear() { rng->clear(); }
29
30 std::string name() const { return rng->name(); }
31
32 void reseed(size_t poll_bits = 256) { rng->reseed(poll_bits); }
33
35 { rng->add_entropy_source(es); }
36
37 void add_entropy(const byte in[], size_t len)
38 { rng->add_entropy(in, len); }
39
41 private:
43 };
44
45}
46
47#endif
bool is_seeded() const
Definition auto_rng.h:26
void add_entropy_source(EntropySource *es)
Definition auto_rng.h:34
void add_entropy(const byte in[], size_t len)
Definition auto_rng.h:37
void randomize(byte out[], size_t len)
Definition auto_rng.h:23
void reseed(size_t poll_bits=256)
Definition auto_rng.h:32
std::string name() const
Definition auto_rng.h:30
RandomNumberGenerator & global_rng()
Definition libstate.cpp:183
Library_State & global_state()