diff options
author | Bodo Möller <bodo@openssl.org> | 2001-04-08 18:23:44 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-04-08 18:23:44 +0000 |
commit | 7d0d0996aa0e85734eaf5c8a3e6bd9e62604c166 (patch) | |
tree | e309176a16443d6e98e34d4b1479df4a6c8ed2c8 /crypto/bn/bn_mod.c | |
parent | 9cddbf14dbda732e72bc5113746f85cb7ee2b4ab (diff) | |
download | openssl-7d0d0996aa0e85734eaf5c8a3e6bd9e62604c166.tar.gz |
binary algorithm for modular inversion
Diffstat (limited to 'crypto/bn/bn_mod.c')
-rw-r--r-- | crypto/bn/bn_mod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bn_mod.c b/crypto/bn/bn_mod.c index 92fe11684c..5cf82480d7 100644 --- a/crypto/bn/bn_mod.c +++ b/crypto/bn/bn_mod.c @@ -150,8 +150,8 @@ int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_ int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m) { if (!BN_add(r, a, b)) return 0; - if (BN_cmp(r, m) >= 0) - return BN_sub(r, r, m); + if (BN_ucmp(r, m) >= 0) + return BN_usub(r, r, m); return 1; } |