Change comments. (The expected number of iterations in BN_rand_range
[openssl.git] / crypto / bn / bn_rand.c
index a7e35357d6d9d00f7e8175febb75cd3ba14ec2e0..3873eac6896678c46fcfc925889200e134fbb26b 100644 (file)
@@ -190,12 +190,10 @@ 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;
-                       fprintf(stderr, "?");
                        }
                while (BN_cmp(r, range) >= 0);
-               fprintf(stderr, "! (11...)\n");
                }
        else
                {
@@ -208,17 +206,15 @@ 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;
                                if (BN_cmp(r, range) >= 0)
                                        if (!BN_sub(r, r, range)) return 0;
                                }
-                       fprintf(stderr, "?");
                        }
                while (BN_cmp(r, range) >= 0);
-               fprintf(stderr, "! (10...)\n");
                }
 
        if (min != NULL)