aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-08 08:58:57 -0500
committerJack Lloyd <[email protected]>2018-12-08 08:58:57 -0500
commit9e81ecff2d853eb644ca98fa9f37fcb9f4ef10d4 (patch)
tree6c17d84f768535e24298020ed32ddf1140bc1fee /src
parent96ccc1ea121311f0df15a0997e5db71b72fdc836 (diff)
In speed, track number of invalid generated signatures and print once
Otherwise this spams the output when something goes wrong.
Diffstat (limited to 'src')
-rw-r--r--src/cli/speed.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 4ec4c0f31..647e8bd8c 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -1743,6 +1743,8 @@ class Speed final : public Command
std::unique_ptr<Timer> sig_timer = make_timer(nm + " " + padding, provider, "sign");
std::unique_ptr<Timer> ver_timer = make_timer(nm + " " + padding, provider, "verify");
+ size_t invalid_sigs = 0;
+
while(ver_timer->under(msec) || sig_timer->under(msec))
{
if(signature.empty() || sig_timer->under(msec))
@@ -1768,7 +1770,7 @@ class Speed final : public Command
if(!verified)
{
- error_output() << "Correct signature rejected in PK signature bench\n";
+ invalid_sigs += 1;
}
const bool verified_bad = ver_timer->run([&]
@@ -1783,6 +1785,9 @@ class Speed final : public Command
}
}
+ if(invalid_sigs > 0)
+ error_output() << invalid_sigs << " generated signatures rejected in PK signature bench\n";
+
const size_t events = std::min(sig_timer->events(), ver_timer->events());
record_result(sig_timer);