diff options
author | Nils Larsch <nils@openssl.org> | 2005-04-22 20:02:44 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-04-22 20:02:44 +0000 |
commit | ff22e913a3fbeb025e612828859102aa1a3effaa (patch) | |
tree | 9b30cca57b4f6fd9436fb222dbd2fe9647bc56a9 /crypto/ec/ec2_mult.c | |
parent | 04d0d0accfbfe88cb52c92abf521c69577c8d33e (diff) | |
download | openssl-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/ec/ec2_mult.c')
-rw-r--r-- | crypto/ec/ec2_mult.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/ec/ec2_mult.c b/crypto/ec/ec2_mult.c index a8ead01d61..3431671444 100644 --- a/crypto/ec/ec2_mult.c +++ b/crypto/ec/ec2_mult.c @@ -296,8 +296,8 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, } /* GF(2^m) field elements should always have BIGNUM::neg = 0 */ - BN_set_sign(&r->X, 0); - BN_set_sign(&r->Y, 0); + BN_set_negative(&r->X, 0); + BN_set_negative(&r->Y, 0); ret = 1; @@ -343,7 +343,7 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, if (scalar) { if (!ec_GF2m_montgomery_point_multiply(group, p, scalar, group->generator, ctx)) goto err; - if (BN_get_sign(scalar)) + if (BN_is_negative(scalar)) if (!group->meth->invert(group, p, ctx)) goto err; if (!group->meth->add(group, r, r, p, ctx)) goto err; } @@ -351,7 +351,7 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, for (i = 0; i < num; i++) { if (!ec_GF2m_montgomery_point_multiply(group, p, scalars[i], points[i], ctx)) goto err; - if (BN_get_sign(scalars[i])) + if (BN_is_negative(scalars[i])) if (!group->meth->invert(group, p, ctx)) goto err; if (!group->meth->add(group, r, r, p, ctx)) goto err; } |