aboutsummaryrefslogtreecommitdiffstats
path: root/include/sha1prng.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sha1prng.h')
-rw-r--r--include/sha1prng.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/sha1prng.h b/include/sha1prng.h
new file mode 100644
index 000000000..e762cf069
--- /dev/null
+++ b/include/sha1prng.h
@@ -0,0 +1,40 @@
+/*************************************************
+* SHA1PRNG RNG Header File *
+* (C) 2007 FlexSecure GmbH / Manuel Hartl *
+* (C) 2008 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_SHA1PRNG_H__
+#define BOTAN_SHA1PRNG_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* SHA1PRNG (propriery *
+*************************************************/
+class SHA1PRNG : public RandomNumberGenerator
+ {
+ public:
+ void randomize(byte[], u32bit) throw(PRNG_Unseeded);
+ bool is_seeded() const;
+ void clear() throw();
+ std::string name() const;
+
+ SHA1PRNG(RandomNumberGenerator* = 0);
+ ~SHA1PRNG();
+ private:
+ void add_randomness(const byte[], u32bit);
+ void update_state(byte[]);
+
+ RandomNumberGenerator* prng;
+ HashFunction* hash;
+ SecureVector<byte> buffer;
+ SecureVector<byte> state;
+ int buf_pos;
+ };
+
+}
+
+#endif