[#EVP_RAND_generate]
= EVP&lowbar;RAND&lowbar;generate
:mrdocs:

Generate random bytes from a RAND context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;RAND&lowbar;generate(
    xref:EVP_RAND_CTX.adoc[EVP&lowbar;RAND&lowbar;CTX]* ctx,
    unsigned char* out,
    size&lowbar;t outlen,
    unsigned int strength,
    int prediction&lowbar;resistance,
    unsigned char const* addin,
    size&lowbar;t addin&lowbar;len);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| RAND context to draw from&period;
| *out*
| Buffer receiving random octets&period;
| *outlen*
| Number of bytes to generate&period;
| *strength*
| Requested security strength in bits (0 selects the context default)&period;
| *prediction&lowbar;resistance*
| Non&hyphen;zero to request prediction resistance &sol; reseed before output&period;
| *addin*
| Optional additional input mixed into the generation, or NULL&period;
| *addin&lowbar;len*
| Length of `addin` in bytes&period;
|===


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