BN_priv_rand_ex

Generate a cryptographically strong private random BIGNUM with strength.

Synopsis

Declared in <openssl/bn.h>

int
BN_priv_rand_ex(
    BIGNUM* rnd,
    int bits,
    int top,
    int bottom,
    unsigned int strength,
    BN_CTX* ctx);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
rndDestination BIGNUM (allocated if needed by the implementation).
bitsDesired bit length of the result.
topBN_RAND_TOP_* controlling the most-significant bits.
bottomBN_RAND_BOTTOM_* controlling whether the number must be odd.
strengthRequested security strength in bits for the RNG.
ctxBN_CTX for temporary allocations, or NULL.