diff options
author | lloyd <[email protected]> | 2008-06-07 18:27:44 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-07 18:27:44 +0000 |
commit | f180b1a85275279785e145d11fc3a9077400f11b (patch) | |
tree | 163a432e78a453d2d3ee99de723cb403c5d05da8 /include | |
parent | 0875f4f0d1f16814b784a4ac08f4d631890b3d6e (diff) |
Make the contents of Botan_types namespace be just using declarations,
instead of introducing new typedefs.
Diffstat (limited to 'include')
-rw-r--r-- | include/sha1prng.h | 40 | ||||
-rw-r--r-- | include/types.h | 4 |
2 files changed, 42 insertions, 2 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 diff --git a/include/types.h b/include/types.h index e3d93c157..49d1a3c4c 100644 --- a/include/types.h +++ b/include/types.h @@ -30,8 +30,8 @@ typedef signed int s32bit; namespace Botan_types { -typedef Botan::byte byte; -typedef Botan::u32bit u32bit; +using Botan::byte; +using Botan::u32bit; } |