EVP_RAND_generate

Generate random bytes from a RAND context.

Synopsis

Declared in <openssl/evp.h>

int
EVP_RAND_generate(
    EVP_RAND_CTX* ctx,
    unsigned char* out,
    size_t outlen,
    unsigned int strength,
    int prediction_resistance,
    unsigned char const* addin,
    size_t addin_len);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
ctxRAND context to draw from.
outBuffer receiving random octets.
outlenNumber of bytes to generate.
strengthRequested security strength in bits (0 selects the context default).
prediction_resistanceNon-zero to request prediction resistance / reseed before output.
addinOptional additional input mixed into the generation, or NULL.
addin_lenLength of addin in bytes.