aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/rng.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-03 08:11:45 +0000
committerlloyd <[email protected]>2015-02-03 08:11:45 +0000
commitf9a7c85b74be0f4a7273e8e0591703af83036e81 (patch)
tree075dbe119fc16863cad99b432ca6251778bd8fd1 /src/lib/rng/rng.cpp
parent69d2cd919c698a6b138b2ccba0de5d5aa2a33a03 (diff)
Convert PK operations to using Algo_Registry instead of Engine.
Remove global PRNG.
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r--src/lib/rng/rng.cpp18
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();
}
}