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/bn/bn_lib.c | |
parent | 04d0d0accfbfe88cb52c92abf521c69577c8d33e (diff) |
- 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/bn/bn_lib.c')
-rw-r--r-- | crypto/bn/bn_lib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index bbefd80309..05d35982e5 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -827,6 +827,14 @@ int BN_mask_bits(BIGNUM *a, int n) return(1); } +void BN_set_negative(BIGNUM *a, int b) + { + if (b && !BN_is_zero(a)) + a->neg = 1; + else + a->neg = 0; + } + int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) { int i; |