[#RAND_priv_bytes_ex]
= RAND&lowbar;priv&lowbar;bytes&lowbar;ex
:mrdocs:

Like RAND&lowbar;priv&lowbar;bytes(), with an explicit library context and security strength&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
RAND&lowbar;priv&lowbar;bytes&lowbar;ex(
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* ctx,
    unsigned char* buf,
    size&lowbar;t num,
    unsigned int strength);
----

== Return Value

1 on success, &hyphen;1 if not supported by the current RAND method, or 0 on other failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Library context whose private DRBG is used, or NULL for the default&period;
| *buf*
| Buffer that receives `num` random bytes&period;
| *num*
| Number of bytes to generate&period;
| *strength*
| Requested security strength in bits for the generated bytes&period;
|===


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