aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-27 15:46:02 +0000
committerlloyd <[email protected]>2008-06-27 15:46:02 +0000
commit09d2b6df9a2a680476160a6a0a56c4b4f2fb91aa (patch)
treeaec3bd3a9b2eb520067b8af20e61c9f654cd230a /src
parent9d77dd59ab4a7d122a20b0d89ae081a177f38287 (diff)
OctetString now requires a RandomNumberGenerator& to create a random
key or IV; it does not reference the global RNG.
Diffstat (limited to 'src')
-rw-r--r--src/symkey.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/symkey.cpp b/src/symkey.cpp
index b5ddb6af9..f07421bef 100644
--- a/src/symkey.cpp
+++ b/src/symkey.cpp
@@ -5,9 +5,9 @@
#include <botan/symkey.h>
#include <botan/bit_ops.h>
+#include <botan/rng.h>
#include <botan/pipe.h>
#include <botan/hex.h>
-#include <botan/libstate.h>
#include <algorithm>
namespace Botan {
@@ -15,10 +15,11 @@ namespace Botan {
/*************************************************
* Create an OctetString from RNG output *
*************************************************/
-OctetString::OctetString(u32bit length)
+OctetString::OctetString(RandomNumberGenerator& rng,
+ u32bit length)
{
bits.create(length);
- global_state().randomize(bits, length);
+ rng.randomize(bits, length);
}
/*************************************************