Generate a cryptographically strong public random BIGNUM with explicit strength.
Declared in <openssl/bn.h>
int
BN_rand_ex(
BIGNUM* rnd,
int bits,
int top,
int bottom,
unsigned int strength,
BN_CTX* ctx);
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| rnd | Destination BIGNUM (allocated/resized as needed). |
| bits | Desired bit length of the result. |
| top | BN_RAND_TOP_* controlling the most-significant bits. |
| bottom | BN_RAND_BOTTOM_* controlling the least-significant bit. |
| strength | Requested security strength in bits for the DRBG draw. |
| ctx | BN_CTX scratch, or NULL. |