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/asn1 | |
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/asn1')
-rw-r--r-- | crypto/asn1/a_enum.c | 4 | ||||
-rw-r--r-- | crypto/asn1/a_int.c | 4 | ||||
-rw-r--r-- | crypto/asn1/t_pkey.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index af9fb9b39e..fe9aa13b9c 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -149,7 +149,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED,ERR_R_NESTED_ASN1_ERROR); goto err; } - if(BN_get_sign(bn)) ret->type = V_ASN1_NEG_ENUMERATED; + if(BN_is_negative(bn)) ret->type = V_ASN1_NEG_ENUMERATED; else ret->type=V_ASN1_ENUMERATED; j=BN_num_bits(bn); len=((j == 0)?0:((j/8)+1)); @@ -177,6 +177,6 @@ BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB); - else if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_sign(ret,1); + else if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_negative(ret,1); return(ret); } diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 78a6cb0d29..973f0c1447 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -416,7 +416,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai) ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_NESTED_ASN1_ERROR); goto err; } - if (BN_get_sign(bn)) + if (BN_is_negative(bn)) ret->type = V_ASN1_NEG_INTEGER; else ret->type=V_ASN1_INTEGER; j=BN_num_bits(bn); @@ -451,7 +451,7 @@ BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai, BIGNUM *bn) if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) ASN1err(ASN1_F_ASN1_INTEGER_TO_BN,ASN1_R_BN_LIB); else if(ai->type == V_ASN1_NEG_INTEGER) - BN_set_sign(ret, 1); + BN_set_negative(ret, 1); return(ret); } diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index 86bd2e04e4..94bd37c32e 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -552,7 +552,7 @@ static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, const char *neg; if (num == NULL) return(1); - neg = (BN_get_sign(num))?"-":""; + neg = (BN_is_negative(num))?"-":""; if(!BIO_indent(bp,off,128)) return 0; if (BN_is_zero(num)) |