aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/speed.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-24 12:21:22 -0400
committerJack Lloyd <[email protected]>2017-10-24 12:21:22 -0400
commitec4f5f1aa187a5416a43f10ae5afa5da137f99ae (patch)
tree1a958e10a230d8b7e2382f8b0b673903c04ded4e /src/cli/speed.cpp
parent5c3470fee0d3e8a6c0eb702602364e9e5dd5d658 (diff)
In cipher tests count IV setup as part of the message cost
Splitting this out gives a misleading perf measurement.
Diffstat (limited to 'src/cli/speed.cpp')
-rw-r--r--src/cli/speed.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 518adb857..15b955b3e 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -1084,8 +1084,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);
@@ -1095,23 +1093,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); });
}
}
}
@@ -1119,7 +1112,6 @@ class Speed final : public Command
record_result(encrypt_timer);
record_result(decrypt_timer);
}
- record_result(iv_timer);
}
void bench_rng(