diff options
author | Felix Laurie von Massenbach <felix@erbridge.co.uk> | 2014-05-27 02:12:59 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2014-06-01 15:31:26 +0100 |
commit | c09ec5d2a0e368b18efc1cbf2444fdb37ca7270b (patch) | |
tree | 2ee78e4877b8f73b76040a7c9e61f0d65bc80baa /apps/speed.c | |
parent | b0513819e043b13692c9e923adf5aafa26cddec0 (diff) |
Generate safe primes not divisible by 3, 5 or 7.
~2% speed improvement on trial division.
Diffstat (limited to 'apps/speed.c')
-rw-r--r-- | apps/speed.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/speed.c b/apps/speed.c index 84d0829ad2..78b79239b2 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * Copyright 2002-2014 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * * Portions of the attached software ("Contribution") are developed by * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. @@ -2054,7 +2054,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, add, NULL, ctx); + bn_probable_prime_dh_coprime_safe(rnd, 1024, add, NULL, ctx); d=Time_F(STOP); prime_print_result(D_PRIME_COPRIME, count, d); @@ -2700,9 +2700,9 @@ static void print_result(int alg,int run_no,int count,double time_used) static void prime_print_result(int alg, int count, double time_used) { BIO_printf(bio_err, - mr ? "+R:%d:%s:%f:%f\n" : "%d %s's in %.2fs (%.2fms/run)\n", + mr ? "+R:%d:%s:%f:%f\n" : "%d %s's in %.2fs (%.2f microseconds / run)\n", count, prime_names[alg], time_used, - time_used / ((double)count) * 1000); + time_used / ((double)count) * 1000000); } #ifndef NO_FORK |