diff options
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/speed.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp index e075e752d..9539e22ec 100644 --- a/src/cli/speed.cpp +++ b/src/cli/speed.cpp @@ -1085,8 +1085,6 @@ class Speed final : public Command record_result(ks_timer); - Timer iv_timer(enc.name(), enc.provider(), "iv setup"); - for(auto buf_size : buf_sizes) { Botan::secure_vector<uint8_t> buffer = rng().random_vec(buf_size); @@ -1096,23 +1094,18 @@ class Speed final : public Command Botan::secure_vector<uint8_t> iv = rng().random_vec(enc.default_nonce_length()); - iv_timer.run([&]() { enc.start(iv); }); - iv_timer.run([&]() { dec.start(iv); }); - if(buf_size >= enc.minimum_final_size()) { while(encrypt_timer.under(runtime) && decrypt_timer.under(runtime)) { // Must run in this order, or AEADs will reject the ciphertext - encrypt_timer.run([&]() { enc.finish(buffer); }); + encrypt_timer.run([&]() { enc.start(iv); enc.finish(buffer); }); - decrypt_timer.run([&]() { dec.finish(buffer); }); + decrypt_timer.run([&]() { dec.start(iv); dec.finish(buffer); }); if(iv.size() > 0) { iv[0] += 1; - iv_timer.run([&]() { enc.start(iv); }); - iv_timer.run([&]() { dec.start(iv); }); } } } @@ -1120,7 +1113,6 @@ class Speed final : public Command record_result(encrypt_timer); record_result(decrypt_timer); } - record_result(iv_timer); } void bench_rng( |