diff options
author | lloyd <[email protected]> | 2008-04-07 14:08:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-04-07 14:08:27 +0000 |
commit | 9ec64ce60cad6c825b7cf40306a359d019e2c13c (patch) | |
tree | b6bbaab35eb09bf7148541baef89701ccefcfcce /checks/pk_bench.cpp | |
parent | ab95931a8161005c8fd8aecc6f2f59d182b86de8 (diff) |
Remove the Global_RNG namespace, along with rng.h and rng.cpp. This was
essentially a facade for the RNG object living in the global library state.
Rewrite all callers to directly invoke the global state object: this makes
it more clear what functions are actually accessing mutable state outside of
the normal reference graph (and thus, which functions will have to be
altered in order to remove this dependency). Other facades remain in place
for the configuration object and the memory allocator factory.
Diffstat (limited to 'checks/pk_bench.cpp')
-rw-r--r-- | checks/pk_bench.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp index c06f12abf..51a454f4a 100644 --- a/checks/pk_bench.cpp +++ b/checks/pk_bench.cpp @@ -8,7 +8,7 @@ #include <botan/pkcs8.h> #include <botan/look_pk.h> -#include <botan/rng.h> +#include <botan/libstate.h> using namespace Botan; @@ -219,7 +219,7 @@ void bench_enc(PK_Encryptor* enc, const std::string& algo_name, while(clocks_used < seconds * ticks) { runs++; - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); u64bit start = get_clock(); enc->encrypt(msg, MSG_SIZE); @@ -237,7 +237,7 @@ void bench_dec(PK_Encryptor* enc, PK_Decryptor* dec, { static const u32bit MSG_SIZE = 16; byte msg[MSG_SIZE]; - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); SecureVector<byte> output; u32bit runs = 0; @@ -250,7 +250,7 @@ void bench_dec(PK_Encryptor* enc, PK_Decryptor* dec, { runs++; - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); msg[0] |= 0x80; // make sure it works with "Raw" padding encrypted_msg = enc->encrypt(msg, MSG_SIZE); @@ -286,7 +286,7 @@ void bench_sig(PK_Signer* sig, const std::string& algo_name, while(clocks_used < seconds * ticks) { runs++; - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); u64bit start = get_clock(); sig->update(msg, MSG_SIZE); sig->signature(); @@ -304,7 +304,7 @@ void bench_ver(PK_Signer* sig, PK_Verifier* ver, { static const u32bit MSG_SIZE = 16; byte msg[MSG_SIZE]; - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); sig->update(msg, MSG_SIZE); SecureVector<byte> signature = sig->signature(); @@ -317,7 +317,7 @@ void bench_ver(PK_Signer* sig, PK_Verifier* ver, // feel free to tweak, but make sure this always runs when runs == 0 if(runs % 100 == 0) { - Global_RNG::randomize(msg, MSG_SIZE); + global_state().randomize(msg, MSG_SIZE); sig->update(msg, MSG_SIZE); signature = sig->signature(); } @@ -352,7 +352,7 @@ void bench_kas(PK_Key_Agreement* kas, const std::string& algo_name, while(clocks_used < seconds * ticks) { runs++; - Global_RNG::randomize(key, REMOTE_KEY_SIZE); + global_state().randomize(key, REMOTE_KEY_SIZE); u64bit start = get_clock(); kas->derive_key(0, key, REMOTE_KEY_SIZE); |