aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk_keys.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-05-24 18:52:52 +0000
committerlloyd <[email protected]>2008-05-24 18:52:52 +0000
commitf8078f5904fce5cbfd69516b175872496bdc2267 (patch)
treef2fb2ef681947328a64a13feddc3c256da6c4305 /src/pk_keys.cpp
parentc4bad5476b30811ad51b1edd3bd873864d423c07 (diff)
Pass a RNG reference to load_check and gen_check functions
Diffstat (limited to 'src/pk_keys.cpp')
-rw-r--r--src/pk_keys.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/pk_keys.cpp b/src/pk_keys.cpp
index 8ada71133..c442b7555 100644
--- a/src/pk_keys.cpp
+++ b/src/pk_keys.cpp
@@ -6,7 +6,6 @@
#include <botan/pk_keys.h>
#include <botan/config.h>
#include <botan/oids.h>
-#include <botan/libstate.h>
namespace Botan {
@@ -42,30 +41,27 @@ OID Public_Key::get_oid() const
/*************************************************
* Run checks on a loaded public key *
*************************************************/
-void Public_Key::load_check() const
+void Public_Key::load_check(RandomNumberGenerator& rng) const
{
- if(!check_key(global_state().prng_reference(),
- key_check_level("public")))
+ if(!check_key(rng, key_check_level("public")))
throw Invalid_Argument(algo_name() + ": Invalid public key");
}
/*************************************************
* Run checks on a loaded private key *
*************************************************/
-void Private_Key::load_check() const
+void Private_Key::load_check(RandomNumberGenerator& rng) const
{
- if(!check_key(global_state().prng_reference(),
- key_check_level("private")))
+ if(!check_key(rng, key_check_level("private")))
throw Invalid_Argument(algo_name() + ": Invalid private key");
}
/*************************************************
* Run checks on a generated private key *
*************************************************/
-void Private_Key::gen_check() const
+void Private_Key::gen_check(RandomNumberGenerator& rng) const
{
- if(!check_key(global_state().prng_reference(),
- key_check_level("private_gen")))
+ if(!check_key(rng, key_check_level("private_gen")))
throw Self_Test_Failure(algo_name() + " private key generation failed");
}