Use RAND_METHOD for implementing RAND_status.
[openssl.git] / crypto / rand / rand.h
index 477d7a150a511e00cc5b979eebd23ae82686cd7d..79cb9047a2754729e685d91c574c640cfe0312b2 100644 (file)
 extern "C" {
 #endif
 
-#ifndef NOPROTO
+typedef struct rand_meth_st
+       {
+       void (*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 (*pseudorand)(unsigned char *buf, int num);
+       int (*status)(void);
+       } RAND_METHOD;
+
+#ifdef BN_DEBUG
+extern int rand_predictable;
+#endif
+
+void RAND_set_rand_method(RAND_METHOD *meth);
+RAND_METHOD *RAND_get_rand_method(void );
+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_load_file(char *file,long max_bytes);
-int  RAND_write_file(char *file);
-char *RAND_file_name(char *file,int num);
-#ifdef WINDOWS
+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);
+const char *RAND_file_name(char *file,int num);
+int RAND_status(void);
+int RAND_egd(const char *path);
+#if defined(WINDOWS) || defined(WIN32)
 void RAND_screen(void);
 #endif
-#else
-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
+void   ERR_load_RAND_strings(void);
+
+/* 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.
+ */
+
+/* Error codes for the RAND functions. */
+
+/* Function codes. */
+#define RAND_F_SSLEAY_RAND_BYTES                        100
+
+/* Reason codes. */
+#define RAND_R_PRNG_NOT_SEEDED                          100
 
 #ifdef  __cplusplus
 }
 #endif
-
 #endif
+