[#BN_bn2mpi]
= BN&lowbar;bn2mpi
:mrdocs:

Encode `a` in MPI format (4&hyphen;byte length prefix plus big&hyphen;endian content)&period;

== Synopsis

Declared in `&lt;openssl&sol;bn&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;bn2mpi(
    xref:BIGNUM.adoc[BIGNUM] const* a,
    unsigned char* to);
----

== Return Value

Number of bytes written (or required), including the length prefix&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| Value to encode&period;
| *to*
| Output buffer, or NULL to return only the required length&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
