diff options
author | Colin Watson <cjwatson@debian.org> | 2011-01-24 11:46:57 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2011-01-24 11:46:57 +0000 |
commit | 0970072c89b079b022538e3c366fbfa2c53fc821 (patch) | |
tree | b7024712d74234bb5a8b036ccbc9109e2e211296 /moduli.c | |
parent | 4e8aa4da57000c7bba8e5c49163bc0c0ca383f78 (diff) | |
parent | 478ff799463ca926a8dfbabf058f4e84aaffc65a (diff) |
merge 5.7p1
Diffstat (limited to 'moduli.c')
-rw-r--r-- | moduli.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: moduli.c,v 1.21 2008/06/26 09:19:40 djm Exp $ */ | 1 | /* $OpenBSD: moduli.c,v 1.22 2010/11/10 01:33:07 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> | 3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> |
4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> | 4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> |
@@ -54,6 +54,8 @@ | |||
54 | #include "dh.h" | 54 | #include "dh.h" |
55 | #include "log.h" | 55 | #include "log.h" |
56 | 56 | ||
57 | #include "openbsd-compat/openssl-compat.h" | ||
58 | |||
57 | /* | 59 | /* |
58 | * File output defines | 60 | * File output defines |
59 | */ | 61 | */ |
@@ -600,7 +602,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted) | |||
600 | * that p is also prime. A single pass will weed out the | 602 | * that p is also prime. A single pass will weed out the |
601 | * vast majority of composite q's. | 603 | * vast majority of composite q's. |
602 | */ | 604 | */ |
603 | if (BN_is_prime(q, 1, NULL, ctx, NULL) <= 0) { | 605 | if (BN_is_prime_ex(q, 1, ctx, NULL) <= 0) { |
604 | debug("%10u: q failed first possible prime test", | 606 | debug("%10u: q failed first possible prime test", |
605 | count_in); | 607 | count_in); |
606 | continue; | 608 | continue; |
@@ -613,14 +615,14 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted) | |||
613 | * will show up on the first Rabin-Miller iteration so it | 615 | * will show up on the first Rabin-Miller iteration so it |
614 | * doesn't hurt to specify a high iteration count. | 616 | * doesn't hurt to specify a high iteration count. |
615 | */ | 617 | */ |
616 | if (!BN_is_prime(p, trials, NULL, ctx, NULL)) { | 618 | if (!BN_is_prime_ex(p, trials, ctx, NULL)) { |
617 | debug("%10u: p is not prime", count_in); | 619 | debug("%10u: p is not prime", count_in); |
618 | continue; | 620 | continue; |
619 | } | 621 | } |
620 | debug("%10u: p is almost certainly prime", count_in); | 622 | debug("%10u: p is almost certainly prime", count_in); |
621 | 623 | ||
622 | /* recheck q more rigorously */ | 624 | /* recheck q more rigorously */ |
623 | if (!BN_is_prime(q, trials - 1, NULL, ctx, NULL)) { | 625 | if (!BN_is_prime_ex(q, trials - 1, ctx, NULL)) { |
624 | debug("%10u: q is not prime", count_in); | 626 | debug("%10u: q is not prime", count_in); |
625 | continue; | 627 | continue; |
626 | } | 628 | } |