diff options
author | lloyd <[email protected]> | 2015-02-03 08:11:45 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-03 08:11:45 +0000 |
commit | f9a7c85b74be0f4a7273e8e0591703af83036e81 (patch) | |
tree | 075dbe119fc16863cad99b432ca6251778bd8fd1 /src/lib/rng | |
parent | 69d2cd919c698a6b138b2ccba0de5d5aa2a33a03 (diff) |
Convert PK operations to using Algo_Registry instead of Engine.
Remove global PRNG.
Diffstat (limited to 'src/lib/rng')
-rw-r--r-- | src/lib/rng/rng.cpp | 18 | ||||
-rw-r--r-- | src/lib/rng/rng.h | 6 |
2 files changed, 5 insertions, 19 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(); } } diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h index 9621fb3da..836eb1006 100644 --- a/src/lib/rng/rng.h +++ b/src/lib/rng/rng.h @@ -28,12 +28,6 @@ class BOTAN_DLL RandomNumberGenerator static RandomNumberGenerator* make_rng(); /** - * Create a seeded and active RNG object for general application use - * Added in 1.11.5 - */ - static std::unique_ptr<RandomNumberGenerator> make_rng(class Algorithm_Factory& af); - - /** * Randomize a byte array. * @param output the byte array to hold the random output. * @param length the length of the byte array output. |