diff options
author | lloyd <[email protected]> | 2008-06-10 18:14:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-10 18:14:54 +0000 |
commit | 54fecdc60438d15f970055bb691e18c6469e1785 (patch) | |
tree | 1bd44b39489876256adf3d9a0f4ae88e88cfc9d5 /checks/pk_bench.cpp | |
parent | dec416d649715617e0eb66b18d69f6dbe9c308b3 (diff) |
PK_Encryptor::encrypt now takes a RandomNumberGenerator reference, instead
of using the global RNG object.
Diffstat (limited to 'checks/pk_bench.cpp')
-rw-r--r-- | checks/pk_bench.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp index 58d0a2f39..c34827258 100644 --- a/checks/pk_bench.cpp +++ b/checks/pk_bench.cpp @@ -226,7 +226,7 @@ void bench_enc(PK_Encryptor* enc, const std::string& algo_name, global_state().randomize(msg, MSG_SIZE); u64bit start = get_clock(); - enc->encrypt(msg, MSG_SIZE); + enc->encrypt(msg, MSG_SIZE, global_state().prng_reference()); clocks_used += get_clock() - start; } @@ -247,7 +247,8 @@ void bench_dec(PK_Encryptor* enc, PK_Decryptor* dec, u32bit runs = 0; u64bit clocks_used = 0; - SecureVector<byte> encrypted_msg = enc->encrypt(msg, MSG_SIZE); + SecureVector<byte> encrypted_msg = enc->encrypt(msg, MSG_SIZE, + global_state().prng_reference()); const u64bit ticks = get_ticks(); while(clocks_used < seconds * ticks) @@ -256,7 +257,8 @@ void bench_dec(PK_Encryptor* enc, PK_Decryptor* dec, global_state().randomize(msg, MSG_SIZE); msg[0] |= 0x80; // make sure it works with "Raw" padding - encrypted_msg = enc->encrypt(msg, MSG_SIZE); + encrypted_msg = enc->encrypt(msg, MSG_SIZE, + global_state().prng_reference()); u64bit start = get_clock(); output = dec->decrypt(encrypted_msg); |