Like RAND_priv_bytes(), with an explicit library context and security strength.
Declared in <openssl/rand.h>
int
RAND_priv_bytes_ex(
OSSL_LIB_CTX* ctx,
unsigned char* buf,
size_t num,
unsigned int strength);
1 on success, -1 if not supported by the current RAND method, or 0 on other failure.
| Name | Description |
|---|---|
| ctx | Library context whose private DRBG is used, or NULL for the default. |
| buf | Buffer that receives num random bytes. |
| num | Number of bytes to generate. |
| strength | Requested security strength in bits for the generated bytes. |