aboutsummaryrefslogtreecommitdiffstats
path: root/include/randpool.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-27 18:30:07 +0000
committerlloyd <[email protected]>2008-06-27 18:30:07 +0000
commite2a465b75d8baeac912e3f4d428ebc5e03fd76f1 (patch)
tree7490308782cbac8b0ec9ca0cc23d73ec8a0a7b68 /include/randpool.h
parentd84a769cc563aebeae3893f952cba1659562e430 (diff)
New structure for entropy sources + RNGs. The entropy sources are owned by
Randpool, it will query them as needed (or if asked to do so). New function make_rng() that creates an RNG (X9.31 backed by a Randpool) and seeds it. Remove the entropy source related code from the Modules/Builtin_Modules classes.
Diffstat (limited to 'include/randpool.h')
-rw-r--r--include/randpool.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/randpool.h b/include/randpool.h
index e73ba7f3e..b68dec765 100644
--- a/include/randpool.h
+++ b/include/randpool.h
@@ -1,6 +1,6 @@
/*************************************************
* Randpool Header File *
-* (C) 1999-2007 Jack Lloyd *
+* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_RANDPOOL_H__
@@ -8,6 +8,7 @@
#include <botan/rng.h>
#include <botan/base.h>
+#include <vector>
namespace Botan {
@@ -22,10 +23,13 @@ class BOTAN_DLL Randpool : public RandomNumberGenerator
void clear() throw();
std::string name() const;
+ void reseed();
+ void add_entropy_source(EntropySource*);
+ void add_entropy(const byte[], u32bit);
+
Randpool(const std::string&, const std::string&);
~Randpool();
private:
- void add_randomness(const byte[], u32bit);
void update_buffer();
void mix_pool();
@@ -33,6 +37,7 @@ class BOTAN_DLL Randpool : public RandomNumberGenerator
BlockCipher* cipher;
MessageAuthenticationCode* mac;
+ std::vector<EntropySource*> entropy_sources;
SecureVector<byte> pool, buffer, counter;
u32bit entropy;
};