aboutsummaryrefslogtreecommitdiffstats
path: root/src/rng
diff options
context:
space:
mode:
Diffstat (limited to 'src/rng')
-rw-r--r--src/rng/x931_rng/x931_rng.cpp13
-rw-r--r--src/rng/x931_rng/x931_rng.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/rng/x931_rng/x931_rng.cpp b/src/rng/x931_rng/x931_rng.cpp
index f4b0f71a9..72ddb51c5 100644
--- a/src/rng/x931_rng/x931_rng.cpp
+++ b/src/rng/x931_rng/x931_rng.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/x931_rng.h>
-#include <botan/lookup.h>
#include <botan/xor_buf.h>
#include <algorithm>
@@ -117,14 +116,14 @@ std::string ANSI_X931_RNG::name() const
/*************************************************
* ANSI X931 RNG Constructor *
*************************************************/
-ANSI_X931_RNG::ANSI_X931_RNG(const std::string& cipher_name,
- RandomNumberGenerator* prng_ptr)
+ANSI_X931_RNG::ANSI_X931_RNG(BlockCipher* cipher_in,
+ RandomNumberGenerator* prng_in)
{
- if(!prng_ptr)
- throw Invalid_Argument("ANSI_X931_RNG constructor: NULL prng");
+ if(!prng_in || !cipher_in)
+ throw Invalid_Argument("ANSI_X931_RNG constructor: NULL arguments");
- prng = prng_ptr;
- cipher = get_block_cipher(cipher_name);
+ cipher = cipher_in;
+ prng = prng_in;
R.create(cipher->BLOCK_SIZE);
position = 0;
diff --git a/src/rng/x931_rng/x931_rng.h b/src/rng/x931_rng/x931_rng.h
index 7914b605d..220b47ab8 100644
--- a/src/rng/x931_rng/x931_rng.h
+++ b/src/rng/x931_rng/x931_rng.h
@@ -26,7 +26,7 @@ class BOTAN_DLL ANSI_X931_RNG : public RandomNumberGenerator
void add_entropy_source(EntropySource*);
void add_entropy(const byte[], u32bit);
- ANSI_X931_RNG(const std::string&, RandomNumberGenerator*);
+ ANSI_X931_RNG(BlockCipher*, RandomNumberGenerator*);
~ANSI_X931_RNG();
private:
void update_buffer();