From 1baa94907c6c58d96a989a98bc319135354c346b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Sun, 30 Jan 2000 03:32:28 +0000 Subject: [PATCH] Make output of "openssl dsaparam 1024" more interesting :-) --- CHANGES | 4 +++- crypto/bn/bn_prime.c | 3 +++ doc/crypto/DSA_generate_parameters.pod | 14 +++++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index f706c10111..1ea0ffba74 100644 --- a/CHANGES +++ b/CHANGES @@ -31,7 +31,9 @@ division before starting the Rabin-Miller test and has an additional BN_CTX * argument (whereas BN_is_prime always has to allocate at least one BN_CTX). - [Bodo Moeller] + 'callback(1, -1, cb_arg)' is called when a number has passed the + trial division stage. + [Bodo Moeller] *) Fix for bug in CRL encoding. The validity dates weren't being handled as ASN1_TIME. diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c index e679c7c822..39b99ea6c3 100644 --- a/crypto/bn/bn_prime.c +++ b/crypto/bn/bn_prime.c @@ -173,9 +173,12 @@ int BN_is_prime_fasttest(BIGNUM *a, int checks, if (!BN_is_odd(a)) return(0); if (do_trial_division) + { for (i = 1; i < NUMPRIMES; i++) if (BN_mod_word(a, primes[i]) == 0) return 0; + if (callback != NULL) callback(1,-1,cb_arg); + } if (ctx_passed != NULL) ctx=ctx_passed; diff --git a/doc/crypto/DSA_generate_parameters.pod b/doc/crypto/DSA_generate_parameters.pod index bae4e1b560..04d8c9dff4 100644 --- a/doc/crypto/DSA_generate_parameters.pod +++ b/doc/crypto/DSA_generate_parameters.pod @@ -42,9 +42,11 @@ When a candidate for q is generated, B is called =item * -While a candidate for q is tested, B -is called in the outer loop of the Miller-Rabin primality tests -(once for each witness that confirms that the candidate may be prime). +When a candidate for q has passed a test by trial division, +B is called. +While a candidate for q is tested by Miller-Rabin primality tests, +B is called in the outer loop +(once for each witness that confirms that the candidate may be prime); i is the loop counter (starting at 0). =item * @@ -59,8 +61,10 @@ B is called. =item * -While a candidate for p is tested, B -is called in the outer loop of the Miller-Rabin primality test +When a candidate for p has passed the test by trial division, +B is called. +While it is tested by the Miller-Rabin primality test, +B is called in the outer loop (once for each witness that confirms that the candidate may be prime). i is the loop counter (starting at 0). -- 2.25.1