Use uniformly chosen witnesses for Miller-Rabin test (by using new BN_pseudo_rand_range function)
diff --git a/doc/crypto/BN_rand.pod b/doc/crypto/BN_rand.pod index cbae2fc..ecd410f 100644 --- a/doc/crypto/BN_rand.pod +++ b/doc/crypto/BN_rand.pod
@@ -14,6 +14,8 @@ int BN_rand_range(BIGNUM *rnd, BIGNUM *range); + int BN_pseudo_rand_range(BIGNUM *rnd, int bits, int top, int bottom); + =head1 DESCRIPTION BN_rand() generates a cryptographically strong pseudo-random number of @@ -31,6 +33,8 @@ BN_rand_range() generates a cryptographically strong pseudo-random number B<rnd> in the range 0 <lt>= B<rnd> E<lt> B<range>. +BN_pseudo_rand_range() does the same, but is based on BN_pseudo_rand(), +and hence numbers generated by it are not necessarily unpredictable. The PRNG must be seeded prior to calling BN_rand() or BN_rand_range(). @@ -49,5 +53,6 @@ BN_rand() is available in all versions of SSLeay and OpenSSL. BN_pseudo_rand() was added in OpenSSL 0.9.5. The B<top> == -1 case and the function BN_rand_range() were added in OpenSSL 0.9.6a. +BN_pseudo_rand_range() was added in OpenSSL 0.9.6c. =cut