[#BN_bn2nativepad]
= BN&lowbar;bn2nativepad
:mrdocs:

Encode a BIGNUM as a fixed&hyphen;length native&hyphen;endian unsigned byte string&period;

== Synopsis

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

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

== Return Value

`tolen` on success, or &hyphen;1 if `a` does not fit in `tolen` bytes&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| Value to encode (absolute value&semi; sign is ignored)&period;
| *to*
| Destination buffer of `tolen` bytes&semi; leading zeros are written as needed&period;
| *tolen*
| Exact output length in bytes&period;
|===


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