aboutsummaryrefslogtreecommitdiffstats
path: root/include/rng.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-29 00:15:14 +0000
committerlloyd <[email protected]>2008-09-29 00:15:14 +0000
commit68d3d539ad7752dc80c20c1a2ade909b1a4c4a6e (patch)
treec7e588d28427960c95eca9900844d5bf36c079df /include/rng.h
parent8269e2897e0a652bbd949d38b74873976a98adeb (diff)
Move what is left of the uncategorized library to 'core'. There is still
a lot of public key stuff in here that needs to be extracted however, and probably 2-3 other modules worth of stuff to split off (engines, etc)
Diffstat (limited to 'include/rng.h')
-rw-r--r--include/rng.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/include/rng.h b/include/rng.h
deleted file mode 100644
index f8b9a7f62..000000000
--- a/include/rng.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************
-* RandomNumberGenerator Header File *
-* (C) 1999-2008 Jack Lloyd *
-*************************************************/
-
-#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
-#define BOTAN_RANDOM_NUMBER_GENERATOR__
-
-#include <botan/exceptn.h>
-
-namespace Botan {
-
-/*************************************************
-* Entropy Source *
-*************************************************/
-class BOTAN_DLL EntropySource
- {
- public:
- virtual u32bit slow_poll(byte[], u32bit) = 0;
- virtual u32bit fast_poll(byte[], u32bit);
- virtual ~EntropySource() {}
- };
-
-/*************************************************
-* Random Number Generator *
-*************************************************/
-class BOTAN_DLL RandomNumberGenerator
- {
- public:
- static RandomNumberGenerator* make_rng();
-
- virtual void randomize(byte[], u32bit) = 0;
- virtual bool is_seeded() const = 0;
- virtual void clear() throw() = 0;
-
- byte next_byte();
-
- virtual void reseed() {}
- virtual void add_entropy_source(EntropySource*) = 0;
- virtual void add_entropy(const byte[], u32bit) = 0;
-
- RandomNumberGenerator() {}
- virtual ~RandomNumberGenerator() {}
- private:
- RandomNumberGenerator(const RandomNumberGenerator&) {}
- RandomNumberGenerator& operator=(const RandomNumberGenerator&)
- { return (*this); }
- };
-
-/*************************************************
-* Null Random Number Generator *
-*************************************************/
-class BOTAN_DLL Null_RNG : public RandomNumberGenerator
- {
- public:
- void randomize(byte[], u32bit) { throw PRNG_Unseeded("Null_RNG"); }
- void clear() throw() {};
-
- bool is_seeded() const { return false; }
- void add_entropy(const byte[], u32bit) {}
- void add_entropy_source(EntropySource* es) { delete es; }
- };
-
-}
-
-#endif