1 .TH "RAND crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*-
5 RAND crypto functions \-
10 .RI "void \fBRAND_seed\fP (const void *indata, size_t size)"
13 .RI "int \fBRAND_bytes\fP (void *outdata, size_t size)"
16 .RI "void \fBRAND_cleanup\fP (void)"
19 .RI "void \fBRAND_add\fP (const void *indata, size_t size, double entropi)"
22 .RI "int \fBRAND_pseudo_bytes\fP (void *outdata, size_t size)"
25 .RI "int \fBRAND_status\fP (void)"
28 .RI "int \fBRAND_set_rand_method\fP (const RAND_METHOD *meth)"
31 .RI "const RAND_METHOD * \fBRAND_get_rand_method\fP (void)"
34 .RI "int \fBRAND_set_rand_engine\fP (ENGINE *engine)"
37 .RI "int \fBRAND_load_file\fP (const char *filename, size_t size)"
40 .RI "int \fBRAND_write_file\fP (const char *filename)"
43 .RI "const char * \fBRAND_file_name\fP (char *filename, size_t size)"
46 .SH "Detailed Description"
48 See the \fBRAND - random number\fP for description and examples.
49 .SH "Function Documentation"
51 .SS "void RAND_add (const void * indata, size_t size, double entropi)"
53 Seed that random number generator. Secret material can securely be feed into the function, they will never be returned.
57 \fIindata\fP the input data.
59 \fIsize\fP size of in data.
61 \fIentropi\fP entropi in data.
65 .SS "int RAND_bytes (void * outdata, size_t size)"
67 Get a random block from the random generator, can be used for key material.
71 \fIoutdata\fP random data
73 \fIsize\fP length random data
78 1 on success, 0 on failure.
82 .SS "void RAND_cleanup (void)"
84 Reset and free memory used by the random generator.
85 .SS "const char* RAND_file_name (char * filename, size_t size)"
87 Return the default random state filename for a user to use for \fBRAND_load_file()\fP, and \fBRAND_write_file()\fP.
91 \fIfilename\fP buffer to hold file name.
93 \fIsize\fP size of buffer filename.
98 the buffer filename or NULL on failure.
102 .SS "const RAND_METHOD* RAND_get_rand_method (void)"
104 Get the default random method.
105 .SS "int RAND_load_file (const char * filename, size_t size)"
107 Load a a file and feed it into \fBRAND_seed()\fP.
111 \fIfilename\fP name of file to read.
113 \fIsize\fP minimum size to read.
117 .SS "int RAND_pseudo_bytes (void * outdata, size_t size)"
119 Get a random block from the random generator, should NOT be used for key material.
123 \fIoutdata\fP random data
125 \fIsize\fP length random data
130 1 on success, 0 on failure.
134 .SS "void RAND_seed (const void * indata, size_t size)"
136 Seed that random number generator. Secret material can securely be feed into the function, they will never be returned.
140 \fIindata\fP seed data
142 \fIsize\fP length seed data
146 .SS "int RAND_set_rand_engine (ENGINE * engine)"
148 Set the default random method from engine.
152 \fIengine\fP use engine, if NULL is passed it, old method and engine is cleared.
157 1 on success, 0 on failure.
161 .SS "int RAND_set_rand_method (const RAND_METHOD * meth)"
163 Set the default random method.
167 \fImeth\fP set the new default method.
176 .SS "int RAND_status (void)"
178 Return status of the random generator
182 1 if the random generator can deliver random data.
186 .SS "int RAND_write_file (const char * filename)"
188 Write of random numbers to a file to store for later initiation with \fBRAND_load_file()\fP.
192 \fIfilename\fP name of file to write.
197 1 on success and non-one on failure.