rand.3 (100947) | rand.3 (110010) |
---|---|
1.\" Automatically generated by Pod::Man version 1.15 | 1.\" Automatically generated by Pod::Man version 1.15 |
2.\" Tue Jul 30 09:22:09 2002 | 2.\" Mon Jan 13 19:29:28 2003 |
3.\" 4.\" Standard preamble: 5.\" ====================================================================== 6.de Sh \" Subsection heading 7.br 8.if t .Sp 9.ne 5 10.PP --- 122 unchanged lines hidden (view full) --- 133. ds Th \o'LP' 134. ds ae ae 135. ds Ae AE 136.\} 137.rm #[ #] #H #V #F C 138.\" ====================================================================== 139.\" 140.IX Title "rand 3" | 3.\" 4.\" Standard preamble: 5.\" ====================================================================== 6.de Sh \" Subsection heading 7.br 8.if t .Sp 9.ne 5 10.PP --- 122 unchanged lines hidden (view full) --- 133. ds Th \o'LP' 134. ds ae ae 135. ds Ae AE 136.\} 137.rm #[ #] #H #V #F C 138.\" ====================================================================== 139.\" 140.IX Title "rand 3" |
141.TH rand 3 "0.9.6e" "2001-07-19" "OpenSSL" | 141.TH rand 3 "0.9.7" "2003-01-13" "OpenSSL" |
142.UC 143.SH "NAME" 144rand \- pseudo-random number generator 145.SH "SYNOPSIS" 146.IX Header "SYNOPSIS" 147.Vb 1 148\& #include <openssl/rand.h> 149.Ve | 142.UC 143.SH "NAME" 144rand \- pseudo-random number generator 145.SH "SYNOPSIS" 146.IX Header "SYNOPSIS" 147.Vb 1 148\& #include <openssl/rand.h> 149.Ve |
150.Vb 1 151\& int RAND_set_rand_engine(ENGINE *engine); 152.Ve |
|
150.Vb 2 151\& int RAND_bytes(unsigned char *buf, int num); 152\& int RAND_pseudo_bytes(unsigned char *buf, int num); 153.Ve | 153.Vb 2 154\& int RAND_bytes(unsigned char *buf, int num); 155\& int RAND_pseudo_bytes(unsigned char *buf, int num); 156.Ve |
154.Vb 4 | 157.Vb 3 |
155\& void RAND_seed(const void *buf, int num); 156\& void RAND_add(const void *buf, int num, int entropy); 157\& int RAND_status(void); | 158\& void RAND_seed(const void *buf, int num); 159\& void RAND_add(const void *buf, int num, int entropy); 160\& int RAND_status(void); |
158\& void RAND_screen(void); | |
159.Ve 160.Vb 3 161\& int RAND_load_file(const char *file, long max_bytes); 162\& int RAND_write_file(const char *file); 163\& const char *RAND_file_name(char *file, size_t num); 164.Ve 165.Vb 1 166\& int RAND_egd(const char *path); 167.Ve 168.Vb 3 | 161.Ve 162.Vb 3 163\& int RAND_load_file(const char *file, long max_bytes); 164\& int RAND_write_file(const char *file); 165\& const char *RAND_file_name(char *file, size_t num); 166.Ve 167.Vb 1 168\& int RAND_egd(const char *path); 169.Ve 170.Vb 3 |
169\& void RAND_set_rand_method(RAND_METHOD *meth); 170\& RAND_METHOD *RAND_get_rand_method(void); | 171\& void RAND_set_rand_method(const RAND_METHOD *meth); 172\& const RAND_METHOD *RAND_get_rand_method(void); |
171\& RAND_METHOD *RAND_SSLeay(void); 172.Ve 173.Vb 1 174\& void RAND_cleanup(void); 175.Ve | 173\& RAND_METHOD *RAND_SSLeay(void); 174.Ve 175.Vb 1 176\& void RAND_cleanup(void); 177.Ve |
178.Vb 3 179\& /* For Win32 only */ 180\& void RAND_screen(void); 181\& int RAND_event(UINT, WPARAM, LPARAM); 182.Ve |
|
176.SH "DESCRIPTION" 177.IX Header "DESCRIPTION" | 183.SH "DESCRIPTION" 184.IX Header "DESCRIPTION" |
185Since the introduction of the \s-1ENGINE\s0 \s-1API\s0, the recommended way of controlling 186default implementations is by using the \s-1ENGINE\s0 \s-1API\s0 functions. The default 187\&\fB\s-1RAND_METHOD\s0\fR, as set by \fIRAND_set_rand_method()\fR and returned by 188\&\fIRAND_get_rand_method()\fR, is only used if no \s-1ENGINE\s0 has been set as the default 189\&\*(L"rand\*(R" implementation. Hence, these two functions are no longer the recommened 190way to control defaults. 191.PP 192If an alternative \fB\s-1RAND_METHOD\s0\fR implementation is being used (either set 193directly or as provided by an \s-1ENGINE\s0 module), then it is entirely responsible 194for the generation and management of a cryptographically secure \s-1PRNG\s0 stream. The 195mechanisms described below relate solely to the software \s-1PRNG\s0 implementation 196built in to OpenSSL and used by default. 197.PP |
|
178These functions implement a cryptographically secure pseudo-random 179number generator (\s-1PRNG\s0). It is used by other library functions for 180example to generate random keys, and applications can use it when they 181need randomness. 182.PP 183A cryptographic \s-1PRNG\s0 must be seeded with unpredictable data such as 184mouse movements or keys pressed at random by the user. This is 185described in RAND_add(3). Its state can be saved in a seed file --- 102 unchanged lines hidden --- | 198These functions implement a cryptographically secure pseudo-random 199number generator (\s-1PRNG\s0). It is used by other library functions for 200example to generate random keys, and applications can use it when they 201need randomness. 202.PP 203A cryptographic \s-1PRNG\s0 must be seeded with unpredictable data such as 204mouse movements or keys pressed at random by the user. This is 205described in RAND_add(3). Its state can be saved in a seed file --- 102 unchanged lines hidden --- |