projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5d2acf
)
Change comments. (The expected number of iterations in BN_rand_range
author
Bodo Möller
<bodo@openssl.org>
Thu, 8 Feb 2001 12:27:22 +0000
(12:27 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Thu, 8 Feb 2001 12:27:22 +0000
(12:27 +0000)
never exceeds 1.333...).
crypto/bn/bn_rand.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_rand.c
b/crypto/bn/bn_rand.c
index a2e1fdd3e43f93e210f3306119b90584b6a01499..3873eac6896678c46fcfc925889200e134fbb26b 100644
(file)
--- a/
crypto/bn/bn_rand.c
+++ b/
crypto/bn/bn_rand.c
@@
-190,7
+190,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 > .
7
5 */
if (!BN_rand(r, n, 0, 0)) return 0;
}
while (BN_cmp(r, range) >= 0);
@@
-206,7
+206,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 > .
7
5. */
if (BN_cmp(r ,range) >= 0)
{
if (!BN_sub(r, r, range)) return 0;