|
Lines 598-604
prime_test(FILE *in, FILE *out, u_int32_
Link Here
|
| 598 |
* that p is also prime. A single pass will weed out the |
598 |
* that p is also prime. A single pass will weed out the |
| 599 |
* vast majority of composite q's. |
599 |
* vast majority of composite q's. |
| 600 |
*/ |
600 |
*/ |
| 601 |
if (BN_is_prime(q, 1, NULL, ctx, NULL) <= 0) { |
601 |
if (BN_is_prime_ex(q, 1, ctx, NULL) <= 0) { |
| 602 |
debug("%10u: q failed first possible prime test", |
602 |
debug("%10u: q failed first possible prime test", |
| 603 |
count_in); |
603 |
count_in); |
| 604 |
continue; |
604 |
continue; |
|
Lines 611-624
prime_test(FILE *in, FILE *out, u_int32_
Link Here
|
| 611 |
* will show up on the first Rabin-Miller iteration so it |
611 |
* will show up on the first Rabin-Miller iteration so it |
| 612 |
* doesn't hurt to specify a high iteration count. |
612 |
* doesn't hurt to specify a high iteration count. |
| 613 |
*/ |
613 |
*/ |
| 614 |
if (!BN_is_prime(p, trials, NULL, ctx, NULL)) { |
614 |
if (!BN_is_prime_ex(p, trials, ctx, NULL)) { |
| 615 |
debug("%10u: p is not prime", count_in); |
615 |
debug("%10u: p is not prime", count_in); |
| 616 |
continue; |
616 |
continue; |
| 617 |
} |
617 |
} |
| 618 |
debug("%10u: p is almost certainly prime", count_in); |
618 |
debug("%10u: p is almost certainly prime", count_in); |
| 619 |
|
619 |
|
| 620 |
/* recheck q more rigorously */ |
620 |
/* recheck q more rigorously */ |
| 621 |
if (!BN_is_prime(q, trials - 1, NULL, ctx, NULL)) { |
621 |
if (!BN_is_prime_ex(q, trials - 1, ctx, NULL)) { |
| 622 |
debug("%10u: q is not prime", count_in); |
622 |
debug("%10u: q is not prime", count_in); |
| 623 |
continue; |
623 |
continue; |
| 624 |
} |
624 |
} |