aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-07 14:08:27 +0000
committerlloyd <[email protected]>2008-04-07 14:08:27 +0000
commit9ec64ce60cad6c825b7cf40306a359d019e2c13c (patch)
treeb6bbaab35eb09bf7148541baef89701ccefcfcce /src/rng.cpp
parentab95931a8161005c8fd8aecc6f2f59d182b86de8 (diff)
Remove the Global_RNG namespace, along with rng.h and rng.cpp. This was
essentially a facade for the RNG object living in the global library state. Rewrite all callers to directly invoke the global state object: this makes it more clear what functions are actually accessing mutable state outside of the normal reference graph (and thus, which functions will have to be altered in order to remove this dependency). Other facades remain in place for the configuration object and the memory allocator factory.
Diffstat (limited to 'src/rng.cpp')
-rw-r--r--src/rng.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/rng.cpp b/src/rng.cpp
deleted file mode 100644
index be8891921..000000000
--- a/src/rng.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************
-* Global RNG Source File *
-* (C) 1999-2007 The Botan Project *
-*************************************************/
-
-#include <botan/rng.h>
-#include <botan/libstate.h>
-
-namespace Botan {
-
-namespace Global_RNG {
-
-/*************************************************
-* Get random bits from the global RNG *
-*************************************************/
-void randomize(byte output[], u32bit size)
- {
- global_state().randomize(output, size);
- }
-
-/*************************************************
-* Get random bits from the global RNG *
-*************************************************/
-byte random()
- {
- byte ret = 0;
- randomize(&ret, 1);
- return ret;
- }
-
-/*************************************************
-* Add entropy to the global RNG *
-*************************************************/
-void add_entropy(const byte entropy[], u32bit size)
- {
- global_state().add_entropy(entropy, size);
- }
-
-/*************************************************
-* Add entropy to the global RNG *
-*************************************************/
-void add_entropy(EntropySource& src, bool slow_poll)
- {
- global_state().add_entropy(src, slow_poll);
- }
-
-/*************************************************
-* Add an EntropySource to the RNG seed list *
-*************************************************/
-void add_es(EntropySource* src, bool last)
- {
- global_state().add_entropy_source(src, last);
- }
-
-/*************************************************
-* Seed the global RNG *
-*************************************************/
-u32bit seed(bool slow_poll, u32bit bits_to_get)
- {
- return global_state().seed_prng(slow_poll, bits_to_get);
- }
-
-}
-
-}