diff options
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index f58d5f55a0..a01f193daa 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -372,7 +372,17 @@ int BN_GENCB_call(BN_GENCB *cb, int a, int b); #define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1)) #define BN_one(a) (BN_set_word((a),1)) +#define BN_zero_ex(a) \ + do { \ + BIGNUM *_tmp_bn = (a); \ + _tmp_bn->top = 0; \ + _tmp_bn->neg = 0; \ + } while(0) +#ifdef OPENSSL_NO_DEPRECATED +#define BN_zero(a) BN_zero_ex(a) +#else #define BN_zero(a) (BN_set_word((a),0)) +#endif /* BN_set_sign(BIGNUM *, int) sets the sign of a BIGNUM * (0 for a non-negative value, 1 for negative) */ #define BN_set_sign(a,b) ((a)->neg = (b)) |