projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7d0d099
)
code documentation
author
Bodo Möller
<bodo@openssl.org>
Sun, 8 Apr 2001 18:41:35 +0000
(18:41 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Sun, 8 Apr 2001 18:41:35 +0000
(18:41 +0000)
crypto/bn/bn_gcd.c
patch
|
blob
|
history
test/bctest
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_gcd.c
b/crypto/bn/bn_gcd.c
index 2c6fb2379a99328add8f52434e3c50efcd2d39d9..1691877f31079edfce6344a58a5e2cb7a614fb4f 100644
(file)
--- a/
crypto/bn/bn_gcd.c
+++ b/
crypto/bn/bn_gcd.c
@@
-254,7
+254,8
@@
BIGNUM *BN_mod_inverse(BIGNUM *in,
while (!BN_is_zero(B))
{
/*
while (!BN_is_zero(B))
{
/*
- * 0 < B < A <= |n|,
+ * 0 < B < |n|,
+ * 0 < A <= |n|,
* (1) -sign*X*a == B (mod |n|),
* (2) sign*Y*a == A (mod |n|)
*/
* (1) -sign*X*a == B (mod |n|),
* (2) sign*Y*a == A (mod |n|)
*/
@@
-299,13
+300,16
@@
BIGNUM *BN_mod_inverse(BIGNUM *in,
}
}
- /* We still have (1) and (2)
, but A may no longer be larger than B
.
+ /* We still have (1) and (2).
* Both A and B are odd.
* The following computations ensure that
*
* Both A and B are odd.
* The following computations ensure that
*
- * 0 =< B < A = |n|,
+ * 0 <= B < |n|,
+ * 0 < A < |n|,
* (1) -sign*X*a == B (mod |n|),
* (1) -sign*X*a == B (mod |n|),
- * (2) sign*Y*a == A (mod |n|)
+ * (2) sign*Y*a == A (mod |n|),
+ *
+ * and that either A or B is even in the next iteration.
*/
if (BN_ucmp(B, A) >= 0)
{
*/
if (BN_ucmp(B, A) >= 0)
{
diff --git
a/test/bctest
b/test/bctest
index 7dde7816531186cb3638d7472d352bac1deb8879..fbe74ed90bda53ca57dad5f95528cbd3c115ec19 100755
(executable)
--- a/
test/bctest
+++ b/
test/bctest
@@
-12,13
+12,13
@@
IFS=:
IFS=:
-try_
path
=true
+try_
without_dir
=true
# First we try "bc", then "$dir/bc" for each item in $PATH.
for dir in dummy:$PATH; do
# First we try "bc", then "$dir/bc" for each item in $PATH.
for dir in dummy:$PATH; do
- if [ "$try_
path
" = true ]; then
+ if [ "$try_
without_dir
" = true ]; then
# first iteration
bc=bc
# first iteration
bc=bc
- try_
path
=false
+ try_
without_dir
=false
else
# second and later iterations
bc="$dir/bc"
else
# second and later iterations
bc="$dir/bc"