summaryrefslogtreecommitdiff
path: root/include/openssl/rand.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/openssl/rand.h')
-rw-r--r--include/openssl/rand.h41
1 files changed, 21 insertions, 20 deletions
diff --git a/include/openssl/rand.h b/include/openssl/rand.h
index 2553afda20..2a9a85c1f1 100644
--- a/include/openssl/rand.h
+++ b/include/openssl/rand.h
@@ -1,4 +1,3 @@
-/* crypto/rand/rand.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -71,18 +70,14 @@
extern "C" {
#endif
-# if defined(OPENSSL_FIPS)
-# define FIPS_RAND_SIZE_T size_t
-# endif
-
/* Already defined in ossl_typ.h */
/* typedef struct rand_meth_st RAND_METHOD; */
struct rand_meth_st {
- void (*seed) (const void *buf, int num);
+ int (*seed) (const void *buf, int num);
int (*bytes) (unsigned char *buf, int num);
void (*cleanup) (void);
- void (*add) (const void *buf, int num, double entropy);
+ int (*add) (const void *buf, int num, double entropy);
int (*pseudorand) (unsigned char *buf, int num);
int (*status) (void);
};
@@ -96,19 +91,24 @@ const RAND_METHOD *RAND_get_rand_method(void);
# ifndef OPENSSL_NO_ENGINE
int RAND_set_rand_engine(ENGINE *engine);
# endif
-RAND_METHOD *RAND_SSLeay(void);
+RAND_METHOD *RAND_OpenSSL(void);
void RAND_cleanup(void);
int RAND_bytes(unsigned char *buf, int num);
-int RAND_pseudo_bytes(unsigned char *buf, int num);
+DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
void RAND_seed(const void *buf, int num);
+#if defined(__ANDROID__) && defined(__NDK_FPABI__)
+__NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
+#endif
void RAND_add(const void *buf, int num, double entropy);
int RAND_load_file(const char *file, long max_bytes);
int RAND_write_file(const char *file);
const char *RAND_file_name(char *file, size_t num);
int RAND_status(void);
+# ifndef OPENSSL_NO_EGD
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
int RAND_egd(const char *path);
int RAND_egd_bytes(const char *path, int bytes);
+# endif
int RAND_poll(void);
# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
@@ -118,11 +118,6 @@ int RAND_event(UINT, WPARAM, LPARAM);
# endif
-# ifdef OPENSSL_FIPS
-void RAND_set_fips_drbg_type(int type, int flags);
-int RAND_init_fips(void);
-# endif
-
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -133,16 +128,22 @@ void ERR_load_RAND_strings(void);
/* Error codes for the RAND functions. */
/* Function codes. */
+# define RAND_F_FIPS_RAND 102
+# define RAND_F_FIPS_RAND_SET_DT 103
+# define RAND_F_FIPS_SET_PRNG_SEED 104
+# define RAND_F_FIPS_SET_TEST_MODE 105
+# define RAND_F_FIPS_X931_SET_DT 106
+# define RAND_F_RAND_BYTES 100
# define RAND_F_RAND_GET_RAND_METHOD 101
-# define RAND_F_RAND_INIT_FIPS 102
-# define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
-# define RAND_R_DUAL_EC_DRBG_DISABLED 104
-# define RAND_R_ERROR_INITIALISING_DRBG 102
-# define RAND_R_ERROR_INSTANTIATING_DRBG 103
-# define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
+# define RAND_R_NOT_IN_TEST_MODE 101
+# define RAND_R_NO_KEY_SET 102
+# define RAND_R_PRNG_ERROR 103
+# define RAND_R_PRNG_KEYED 104
# define RAND_R_PRNG_NOT_SEEDED 100
+# define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 105
+# define RAND_R_PRNG_STUCK 106
#ifdef __cplusplus
}