Change comments. (The expected number of iterations in BN_rand_range
authorBodo Möller <bodo@openssl.org>
Thu, 8 Feb 2001 12:27:00 +0000 (12:27 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 8 Feb 2001 12:27:00 +0000 (12:27 +0000)
never exceeds 1.333...).

crypto/bn/bn_rand.c

index e614f3eef8ba5030638a3816b59a99289459dfb3..38c6e3b4fa5d4d0f8df1d81f854d080cd6206ed2 100644 (file)
@@ -162,7 +162,7 @@ int BN_rand_range(BIGNUM *r, BIGNUM *min, BIGNUM *range)
                {
                do
                        {
-                       /* range = 11..._2, so each iteration succeeds with probability > .5 */
+                       /* range = 11..._2, so each iteration succeeds with probability > .75 */
                        if (!BN_rand(r, n, 0, 0)) return 0;
                        }
                while (BN_cmp(r, range) >= 0);
@@ -178,7 +178,7 @@ int BN_rand_range(BIGNUM *r, BIGNUM *min, BIGNUM *range)
                         * (which is either  r, r - range,  or  r - 2*range).
                         * Otherwise, iterate once more.
                         * Since  3*range = 11..._2, each iteration succeeds with
-                        * probability > .5. */
+                        * probability > .75. */
                        if (BN_cmp(r ,range) >= 0)
                                {
                                if (!BN_sub(r, r, range)) return 0;