diff options
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r-- | src/lib/rng/rng.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/lib/rng/rng.cpp b/src/lib/rng/rng.cpp index 14c7196d1..8989c5026 100644 --- a/src/lib/rng/rng.cpp +++ b/src/lib/rng/rng.cpp @@ -1,5 +1,5 @@ /* -* Random Number Generator Base +* Random Number Generator * (C) 1999-2008 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) @@ -7,28 +7,20 @@ #include <botan/rng.h> #include <botan/hmac_rng.h> -#include <botan/libstate.h> +#include <botan/algo_registry.h> namespace Botan { RandomNumberGenerator* RandomNumberGenerator::make_rng() { - return make_rng(global_state().algorithm_factory()).release(); - } - -/* -* Create and seed a new RNG object -*/ -std::unique_ptr<RandomNumberGenerator> RandomNumberGenerator::make_rng(Algorithm_Factory& af) - { std::unique_ptr<RandomNumberGenerator> rng( - new HMAC_RNG(af.make_mac("HMAC(SHA-512)"), - af.make_mac("HMAC(SHA-256)")) + new HMAC_RNG(make_a<MessageAuthenticationCode>("HMAC(SHA-512)"), + make_a<MessageAuthenticationCode>("HMAC(SHA-256)")) ); rng->reseed(256); - return rng; + return rng.release(); } } |