60 # define HEADER_RAND_H
63 # include <openssl/ossl_typ.h>
64 # include <openssl/e_os2.h>
66 # if defined(OPENSSL_SYS_WINDOWS)
74 # if defined(OPENSSL_FIPS)
75 # define FIPS_RAND_SIZE_T size_t
82 void (*seed) (
const void *buf,
int num);
83 int (*bytes) (
unsigned char *buf,
int num);
84 void (*cleanup) (void);
85 void (*add) (
const void *buf,
int num,
double entropy);
86 int (*pseudorand) (
unsigned char *buf,
int num);
91 extern int rand_predictable;
94 int RAND_set_rand_method(
const RAND_METHOD *meth);
95 const RAND_METHOD *RAND_get_rand_method(
void);
96 # ifndef OPENSSL_NO_ENGINE
97 int RAND_set_rand_engine(ENGINE *engine);
99 RAND_METHOD *RAND_SSLeay(
void);
100 void RAND_cleanup(
void);
101 int RAND_bytes(
unsigned char *buf,
int num);
102 int RAND_pseudo_bytes(
unsigned char *buf,
int num);
103 void RAND_seed(
const void *buf,
int num);
104 void RAND_add(
const void *buf,
int num,
double entropy);
105 int RAND_load_file(
const char *file,
long max_bytes);
106 int RAND_write_file(
const char *file);
107 const char *RAND_file_name(
char *file,
size_t num);
108 int RAND_status(
void);
109 int RAND_query_egd_bytes(
const char *path,
unsigned char *buf,
int bytes);
110 int RAND_egd(
const char *path);
111 int RAND_egd_bytes(
const char *path,
int bytes);
114 # if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
116 void RAND_screen(
void);
117 int RAND_event(UINT, WPARAM, LPARAM);
122 void RAND_set_fips_drbg_type(
int type,
int flags);
123 int RAND_init_fips(
void);
131 void ERR_load_RAND_strings(
void);
136 # define RAND_F_RAND_GET_RAND_METHOD 101
137 # define RAND_F_RAND_INIT_FIPS 102
138 # define RAND_F_SSLEAY_RAND_BYTES 100
141 # define RAND_R_DUAL_EC_DRBG_DISABLED 104
142 # define RAND_R_ERROR_INITIALISING_DRBG 102
143 # define RAND_R_ERROR_INSTANTIATING_DRBG 103
144 # define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
145 # define RAND_R_PRNG_NOT_SEEDED 100