BN_signed_bn2bin

Encode a signed BIGNUM as big-endian two's-complement of fixed width.

Synopsis

Declared in <openssl/bn.h>

int
BN_signed_bn2bin(
    BIGNUM const* a,
    unsigned char* to,
    int tolen);

Return Value

tolen on success, or -1 if a does not fit in tolen bytes.

Parameters

NameDescription
aValue to encode (may be negative).
toDestination buffer of tolen bytes.
tolenFixed output width in bytes.