summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/rand.h
diff options
context:
space:
mode:
authormarkus <>2002-09-05 12:51:50 +0000
committermarkus <>2002-09-05 12:51:50 +0000
commit15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch)
treebf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/rand/rand.h
parent027351f729b9e837200dae6e1520cda6577ab930 (diff)
downloadopenbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz
openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2
openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/rand/rand.h')
-rw-r--r--src/lib/libcrypto/rand/rand.h72
1 files changed, 53 insertions, 19 deletions
diff --git a/src/lib/libcrypto/rand/rand.h b/src/lib/libcrypto/rand/rand.h
index 477d7a150a..e17aa7a9f7 100644
--- a/src/lib/libcrypto/rand/rand.h
+++ b/src/lib/libcrypto/rand/rand.h
@@ -59,34 +59,68 @@
59#ifndef HEADER_RAND_H 59#ifndef HEADER_RAND_H
60#define HEADER_RAND_H 60#define HEADER_RAND_H
61 61
62#include <stdlib.h>
63#include <openssl/ossl_typ.h>
64
62#ifdef __cplusplus 65#ifdef __cplusplus
63extern "C" { 66extern "C" {
64#endif 67#endif
65 68
66#ifndef NOPROTO 69typedef struct rand_meth_st
70 {
71 void (*seed)(const void *buf, int num);
72 int (*bytes)(unsigned char *buf, int num);
73 void (*cleanup)(void);
74 void (*add)(const void *buf, int num, double entropy);
75 int (*pseudorand)(unsigned char *buf, int num);
76 int (*status)(void);
77 } RAND_METHOD;
78
79#ifdef BN_DEBUG
80extern int rand_predictable;
81#endif
82
83int RAND_set_rand_method(const RAND_METHOD *meth);
84const RAND_METHOD *RAND_get_rand_method(void);
85int RAND_set_rand_engine(ENGINE *engine);
86RAND_METHOD *RAND_SSLeay(void);
67void RAND_cleanup(void ); 87void RAND_cleanup(void );
68void RAND_bytes( unsigned char *buf,int num); 88int RAND_bytes(unsigned char *buf,int num);
69void RAND_seed( unsigned char *buf,int num); 89int RAND_pseudo_bytes(unsigned char *buf,int num);
70int RAND_load_file(char *file,long max_bytes); 90void RAND_seed(const void *buf,int num);
71int RAND_write_file(char *file); 91void RAND_add(const void *buf,int num,double entropy);
72char *RAND_file_name(char *file,int num); 92int RAND_load_file(const char *file,long max_bytes);
73#ifdef WINDOWS 93int RAND_write_file(const char *file);
94const char *RAND_file_name(char *file,size_t num);
95int RAND_status(void);
96int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
97int RAND_egd(const char *path);
98int RAND_egd_bytes(const char *path,int bytes);
99int RAND_poll(void);
100
101#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
102
74void RAND_screen(void); 103void RAND_screen(void);
104int RAND_event(UINT, WPARAM, LPARAM);
105
75#endif 106#endif
76#else 107
77void RAND_cleanup(); 108/* BEGIN ERROR CODES */
78void RAND_bytes(); 109/* The following lines are auto generated by the script mkerr.pl. Any changes
79void RAND_seed(); 110 * made after this point may be overwritten when the script is next run.
80int RAND_load_file(); 111 */
81int RAND_write_file(); 112void ERR_load_RAND_strings(void);
82char *RAND_file_name(); 113
83#ifdef WINDOWS 114/* Error codes for the RAND functions. */
84void RAND_screen(); 115
85#endif 116/* Function codes. */
86#endif 117#define RAND_F_RAND_GET_RAND_METHOD 101
118#define RAND_F_SSLEAY_RAND_BYTES 100
119
120/* Reason codes. */
121#define RAND_R_PRNG_NOT_SEEDED 100
87 122
88#ifdef __cplusplus 123#ifdef __cplusplus
89} 124}
90#endif 125#endif
91
92#endif 126#endif