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

Name

Description

a

Value to encode.

to

Output buffer, or NULL to return only the required length.

Created with MrDocs