aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2005-04-22 20:02:44 +0000
committerNils Larsch <nils@openssl.org>2005-04-22 20:02:44 +0000
commitff22e913a3fbeb025e612828859102aa1a3effaa (patch)
tree9b30cca57b4f6fd9436fb222dbd2fe9647bc56a9 /crypto/rsa
parent04d0d0accfbfe88cb52c92abf521c69577c8d33e (diff)
downloadopenssl-ff22e913a3fbeb025e612828859102aa1a3effaa.tar.gz
- use BN_set_negative and BN_is_negative instead of BN_set_sign
and BN_get_sign - implement BN_set_negative as a function - always use "#define BN_is_zero(a) ((a)->top == 0)"
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_eay.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c
index b66b4bc140..3ee753ec86 100644
--- a/crypto/rsa/rsa_eay.c
+++ b/crypto/rsa/rsa_eay.c
@@ -622,7 +622,7 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
if (!BN_sub(r0,r0,m1)) goto err;
/* This will help stop the size of r0 increasing, which does
* affect the multiply if it optimised for a power of 2 size */
- if (BN_get_sign(r0))
+ if (BN_is_negative(r0))
if (!BN_add(r0,r0,rsa->p)) goto err;
if (!BN_mul(r1,r0,rsa->iqmp,ctx)) goto err;
@@ -634,7 +634,7 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
* This will *never* happen with OpenSSL generated keys because
* they ensure p > q [steve]
*/
- if (BN_get_sign(r0))
+ if (BN_is_negative(r0))
if (!BN_add(r0,r0,rsa->p)) goto err;
if (!BN_mul(r1,r0,rsa->q,ctx)) goto err;
if (!BN_add(r0,r1,m1)) goto err;
@@ -648,7 +648,7 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
* for absolute equality, just congruency. */
if (!BN_sub(vrfy, vrfy, I)) goto err;
if (!BN_mod(vrfy, vrfy, rsa->n, ctx)) goto err;
- if (BN_get_sign(vrfy))
+ if (BN_is_negative(vrfy))
if (!BN_add(vrfy, vrfy, rsa->n)) goto err;
if (!BN_is_zero(vrfy))
/* 'I' and 'vrfy' aren't congruent mod n. Don't leak