diff options
author | Cristian Stoica <cristian.stoica@nxp.com> | 2016-08-02 11:38:45 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-02-10 11:59:33 +0100 |
commit | c8bff7ad501c38f1ce9bfe9392fcb22a709e0f6f (patch) | |
tree | fab756fc19824235bf0c28c0b58b0ca8551ec9dc | |
parent | 0d4de7563cdced60122059e9085ab8d7f66b9de4 (diff) |
speed.c: simplify aggregation of ecdsa --multi results
CLA: trivial
Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
Reviewed-by: Geoff Thorpe <geoff@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1377)
-rw-r--r-- | apps/speed.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/apps/speed.c b/apps/speed.c index a45edc3c4a..462e3e7cfe 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2519,7 +2519,7 @@ int speed_main(int argc, char **argv) mr ? "+R5:%ld:%d:%.2f\n" : "%ld %d bit ECDSA signs in %.2fs \n", count, test_curves_bits[testnum], d); - ecdsa_results[testnum][0] = d / (double)count; + ecdsa_results[testnum][0] = (double)count / d; rsa_count = count; } @@ -2547,7 +2547,7 @@ int speed_main(int argc, char **argv) mr ? "+R6:%ld:%d:%.2f\n" : "%ld %d bit ECDSA verify in %.2fs\n", count, test_curves_bits[testnum], d); - ecdsa_results[testnum][1] = d / (double)count; + ecdsa_results[testnum][1] = (double)count / d; } if (rsa_count <= 1) { @@ -2829,8 +2829,8 @@ int speed_main(int argc, char **argv) printf("%4u bit ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n", test_curves_bits[k], test_curves_names[k], - ecdsa_results[k][0], ecdsa_results[k][1], - 1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1]); + 1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1], + ecdsa_results[k][0], ecdsa_results[k][1]); } testnum = 1; @@ -3068,16 +3068,10 @@ static int do_multi(int multi) sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); - if (n) - ecdsa_results[k][0] = 1 / (1 / ecdsa_results[k][0] + 1 / d); - else - ecdsa_results[k][0] = d; + ecdsa_results[k][0] += d; d = atof(sstrsep(&p, sep)); - if (n) - ecdsa_results[k][1] = 1 / (1 / ecdsa_results[k][1] + 1 / d); - else - ecdsa_results[k][1] = d; + ecdsa_results[k][1] += d; } else if (strncmp(buf, "+F5:", 4) == 0) { int k; double d; |