Lines Matching refs:bn
15 #include <openssl/bn.h>
461 static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai,
479 if (BN_is_negative(bn) && !BN_is_zero(bn))
482 len = BN_num_bytes(bn);
493 if (BN_is_zero(bn))
496 len = BN_bn2bin(bn, ret->data);
505 static BIGNUM *asn1_string_to_bn(const ASN1_INTEGER *ai, BIGNUM *bn,
515 ret = BN_bin2bn(ai->data, ai->length, bn);
564 ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
566 return bn_to_asn1_string(bn, ai, V_ASN1_INTEGER);
569 BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn)
571 return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
607 ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)
609 return bn_to_asn1_string(bn, ai, V_ASN1_ENUMERATED);
612 BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)
614 return asn1_string_to_bn(ai, bn, V_ASN1_ENUMERATED);