<sys/select.h> is included for AIX, when USE_SOCKETS is defined.
[openssl.git] / crypto / rand / rand.h
index 34ef90373e70d1da312af114b70e73034a64ce31..e17aa7a9f731fbcaa5f4d17867414e3081c182f0 100644 (file)
 #ifndef HEADER_RAND_H
 #define HEADER_RAND_H
 
+#include <stdlib.h>
+#include <openssl/ossl_typ.h>
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
 typedef struct rand_meth_st
        {
-#ifndef NOPROTO
-       void (*seed)(unsigned char *buf, int num);
-       void (*bytes)(unsigned char *buf, int num);
+       void (*seed)(const void *buf, int num);
+       int (*bytes)(unsigned char *buf, int num);
        void (*cleanup)(void);
-#else
-       void (*seed)();
-       void (*bytes)();
-       void (*cleanup)();
-#endif
+       void (*add)(const void *buf, int num, double entropy);
+       int (*pseudorand)(unsigned char *buf, int num);
+       int (*status)(void);
        } RAND_METHOD;
 
-#ifndef NOPROTO
-void RAND_set_rand_method(RAND_METHOD *meth);
-RAND_METHOD *RAND_get_rand_method(void );
+#ifdef BN_DEBUG
+extern int rand_predictable;
+#endif
+
+int RAND_set_rand_method(const RAND_METHOD *meth);
+const RAND_METHOD *RAND_get_rand_method(void);
+int RAND_set_rand_engine(ENGINE *engine);
 RAND_METHOD *RAND_SSLeay(void);
 void RAND_cleanup(void );
-void RAND_bytes( unsigned char *buf,int num);
-void RAND_seed( unsigned char *buf,int num);
+int  RAND_bytes(unsigned char *buf,int num);
+int  RAND_pseudo_bytes(unsigned char *buf,int num);
+void RAND_seed(const void *buf,int num);
+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);
-char *RAND_file_name(char *file,int num);
-#ifdef WINDOWS
+const char *RAND_file_name(char *file,size_t num);
+int RAND_status(void);
+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);
+int RAND_poll(void);
+
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
+
 void RAND_screen(void);
+int RAND_event(UINT, WPARAM, LPARAM);
+
 #endif
-#else
-void RAND_set_rand_method();
-RAND_METHOD *RAND_get_rand_method();
-RAND_METHOD *RAND_SSLeay();
-void RAND_cleanup();
-void RAND_bytes();
-void RAND_seed();
-int  RAND_load_file();
-int  RAND_write_file();
-char *RAND_file_name();
-#ifdef WINDOWS
-void RAND_screen();
-#endif
-#endif
+
+/* BEGIN ERROR CODES */
+/* The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_RAND_strings(void);
+
+/* Error codes for the RAND functions. */
+
+/* Function codes. */
+#define RAND_F_RAND_GET_RAND_METHOD                     101
+#define RAND_F_SSLEAY_RAND_BYTES                        100
+
+/* Reason codes. */
+#define RAND_R_PRNG_NOT_SEEDED                          100
 
 #ifdef  __cplusplus
 }
 #endif
-
 #endif