BN_priv_rand_range_ex

Generate a private random BIGNUM uniformly in [0, ]range) with strength bits.

Synopsis

Declared in <openssl/bn.h>

int
BN_priv_rand_range_ex(
    BIGNUM* r,
    BIGNUM const* range,
    unsigned int strength,
    BN_CTX* ctx);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
rDestination for the random value.
rangeExclusive upper bound (must be positive).
strengthRequested security strength in bits for the DRBG draw.
ctxBN_CTX scratch, or NULL.