diff options
Diffstat (limited to 'src/x931_rng.cpp')
-rw-r--r-- | src/x931_rng.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/x931_rng.cpp b/src/x931_rng.cpp index 01b8c33d2..94d5f9247 100644 --- a/src/x931_rng.cpp +++ b/src/x931_rng.cpp @@ -108,18 +108,17 @@ std::string ANSI_X931_RNG::name() const ANSI_X931_RNG::ANSI_X931_RNG(const std::string& cipher_name, RandomNumberGenerator* prng_ptr) { - if(cipher_name == "") - cipher = get_block_cipher("AES-256"); - else - cipher = get_block_cipher(cipher_name); + if(!prng_ptr) + throw Invalid_Argument("ANSI_X931_RNG constructor: NULL prng"); + + prng = prng_ptr; + cipher = get_block_cipher(cipher_name); const u32bit BLOCK_SIZE = cipher->BLOCK_SIZE; V.create(BLOCK_SIZE); R.create(BLOCK_SIZE); - prng = (prng_ptr ? prng_ptr : new Randpool); - position = 0; } |