diff options
-rw-r--r-- | include/symkey.h | 2 | ||||
-rw-r--r-- | src/symkey.cpp | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/symkey.h b/include/symkey.h index 93946d12d..f3211eb0f 100644 --- a/include/symkey.h +++ b/include/symkey.h @@ -33,7 +33,7 @@ class BOTAN_DLL OctetString void change(const byte[], u32bit); void change(const MemoryRegion<byte>& in) { bits = in; } - OctetString(u32bit len); + OctetString(class RandomNumberGenerator&, u32bit len); OctetString(const std::string& str = "") { change(str); } OctetString(const byte in[], u32bit len) { change(in, len); } OctetString(const MemoryRegion<byte>& in) { change(in); } 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); } /************************************************* |