BN_bn2lebinpad

Encode a BIGNUM as fixed-length little-endian unsigned bytes with zero padding.

Synopsis

Declared in <openssl/bn.h>

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

Return Value

tolen on success, or -1 if tolen is too small or on error.

Parameters

NameDescription
aValue to encode (absolute value; sign is ignored).
toDestination buffer of tolen bytes.
tolenRequired output length; must be large enough for a.