aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/speed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/speed.cpp')
-rw-r--r--src/cli/speed.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 222a98d3f..c1f3a91e8 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -521,10 +521,11 @@ class Speed final : public Command
Timer encrypt_timer(cipher.name(), provider, "encrypt", buffer.size());
+ const Botan::SymmetricKey key(rng(), cipher.maximum_keylength());
+ cipher.set_key(key);
+
while(encrypt_timer.under(runtime))
{
- const Botan::SymmetricKey key(rng(), cipher.maximum_keylength());
- cipher.set_key(key);
encrypt_timer.run([&] { cipher.encipher(buffer); });
}