aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-07 18:27:44 +0000
committerlloyd <[email protected]>2008-06-07 18:27:44 +0000
commitf180b1a85275279785e145d11fc3a9077400f11b (patch)
tree163a432e78a453d2d3ee99de723cb403c5d05da8
parent0875f4f0d1f16814b784a4ac08f4d631890b3d6e (diff)
Make the contents of Botan_types namespace be just using declarations,
instead of introducing new typedefs.
-rw-r--r--checks/check.cpp2
-rw-r--r--doc/api.tex2
-rw-r--r--include/sha1prng.h40
-rw-r--r--include/types.h4
4 files changed, 44 insertions, 4 deletions
diff --git a/checks/check.cpp b/checks/check.cpp
index f31c9d204..d76e91f0b 100644
--- a/checks/check.cpp
+++ b/checks/check.cpp
@@ -14,7 +14,7 @@
#include <botan/botan.h>
#include <botan/mp_types.h>
-using namespace Botan_types;
+using namespace Botan;
#include "getopt.h"
diff --git a/doc/api.tex b/doc/api.tex
index 35ba9208a..e2dbea9e2 100644
--- a/doc/api.tex
+++ b/doc/api.tex
@@ -148,7 +148,7 @@ several typedef'ed types to help buffer it against changes in machine
architecture. These types are used extensively in the interface, and
thus it would be often be convenient to use them without the
\namespace{Botan} prefix. You can do so by \keyword{using} the
-namespace \namespace{Botan\_types} (this way you can use the type
+namespace \namespace{Botan::types} (this way you can use the type
names without the namespace prefix, but the remainder of the library
stays out of the global namespace). The included types are \type{byte}
and \type{u32bit}, which are unsigned integer types.
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;
}