diff options
author | Felix Laurie von Massenbach <felix@erbridge.co.uk> | 2014-05-27 13:38:59 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2014-06-01 15:31:26 +0100 |
commit | a77889f5609cf49f0c72e1cc414a6c15f7d3cef0 (patch) | |
tree | e0b69ea8e95547bfe353f994d9618c7cdec0655d /apps/speed.c | |
parent | c74e1487765896c528bd19f44eb298632156d41d (diff) |
Only count successful generations.
Diffstat (limited to 'apps/speed.c')
-rw-r--r-- | apps/speed.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/speed.c b/apps/speed.c index eec2fd0999..00a7f1906f 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -2037,7 +2037,7 @@ int MAIN(int argc, char **argv) Time_F(START); for (count=0, run=1; COND(prime_c[D_PRIME_TRIAL_DIVISION]); count++) - bn_probable_prime_dh(rnd, 1024, add, NULL, ctx); + if (!bn_probable_prime_dh(rnd, 1024, add, NULL, ctx)) count--; d=Time_F(STOP); prime_print_result(D_PRIME_TRIAL_DIVISION, count, d); @@ -2057,7 +2057,7 @@ int MAIN(int argc, char **argv) Time_F(START); for (count=0, run=1; COND(prime_c[D_PRIME_TRIAL_DIVISION_RETRY]); count++) - bn_probable_prime_dh_retry(rnd, 1024, ctx); + if (!bn_probable_prime_dh_retry(rnd, 1024, ctx)) count--; d=Time_F(STOP); prime_print_result(D_PRIME_TRIAL_DIVISION_RETRY, count, d); @@ -2076,7 +2076,7 @@ int MAIN(int argc, char **argv) Time_F(START); for (count=0, run=1; COND(prime_c[D_PRIME_COPRIME]); count++) - bn_probable_prime_dh_coprime(rnd, 1024, ctx); + if (!bn_probable_prime_dh_coprime(rnd, 1024, ctx)) count--; d=Time_F(STOP); prime_print_result(D_PRIME_COPRIME, count, d); |