BN_bn2mpi

Encode a in MPI format (4-byte length prefix plus big-endian content).

Synopsis

Declared in <openssl/bn.h>

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

Return Value

Number of bytes written (or required), including the length prefix.

Parameters

NameDescription
aValue to encode.
toOutput buffer, or NULL to return only the required length.