aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-04 20:28:15 -0400
committerJack Lloyd <[email protected]>2018-09-10 13:27:45 -0400
commit63493f2ccd66d453b5a4e1e92a8a39278ab0cf28 (patch)
tree0124438de904a30b566ad4f319fa5c7f7d736aa1 /src/cli
parent9e88329b1d5c64e399c1677ccc6c158e45f19511 (diff)
Add tests
This is a contribution of Ribose Inc (@riboseinc)
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/speed.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 3ba6da24f..f7e9da1cf 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -1636,11 +1636,11 @@ class Speed final : public Command
}
}
- void bench_pk_sig(const Botan::Private_Key& key,
- const std::string& nm,
- const std::string& provider,
- const std::string& padding,
- std::chrono::milliseconds msec)
+ size_t bench_pk_sig(const Botan::Private_Key& key,
+ const std::string& nm,
+ const std::string& provider,
+ const std::string& padding,
+ std::chrono::milliseconds msec)
{
std::vector<uint8_t> message, signature, bad_signature;
@@ -1690,8 +1690,12 @@ class Speed final : public Command
}
}
+ const size_t events = std::min(sig_timer->events(), ver_timer->events());
+
record_result(sig_timer);
record_result(ver_timer);
+
+ return events;
}
#endif
@@ -1925,7 +1929,8 @@ class Speed final : public Command
}));
record_result(keygen_timer);
- bench_pk_sig(*key, params, provider, "", msec);
+ if(bench_pk_sig(*key, params, provider, "", msec) == 1)
+ break;
}
}
#endif
@@ -1981,7 +1986,7 @@ class Speed final : public Command
std::chrono::milliseconds msec)
{
- for(size_t N : { 8192, 16384, 32768, 65536, 1 << 17, 1 << 18, 1 << 19 })
+ for(size_t N : { 8192, 16384, 32768, 65536 })
{
for(size_t r : { 1, 8, 16 })
{
@@ -2006,10 +2011,8 @@ class Speed final : public Command
record_result(scrypt_timer);
- /*
if(scrypt_timer->events() == 1)
break;
- */
}
}
}