[#BN_rand_range_ex]
= BN&lowbar;rand&lowbar;range&lowbar;ex
:mrdocs:

Generate a cryptographically strong uniform random BIGNUM in &lsqb;0, range)&period;&rsqb;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;rand&lowbar;range&lowbar;ex(
    xref:BIGNUM.adoc[BIGNUM]* r,
    xref:BIGNUM.adoc[BIGNUM] const* range,
    unsigned int strength,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *r*
| Destination for the random value&period;
| *range*
| Exclusive upper bound&semi; must be positive&period;
| *strength*
| Desired security strength in bits for the RNG draw&period;
| *ctx*
| BN&lowbar;CTX for temporary storage, or NULL&period;
|===


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