]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / crypto / heimdal / doc / doxyout / hcrypto / man / man3 / hcrypto_rand.3
1 .TH "RAND crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 RAND crypto functions \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "void \fBRAND_seed\fP (const void *indata, size_t size)"
11 .br
12 .ti -1c
13 .RI "int \fBRAND_bytes\fP (void *outdata, size_t size)"
14 .br
15 .ti -1c
16 .RI "void \fBRAND_cleanup\fP (void)"
17 .br
18 .ti -1c
19 .RI "void \fBRAND_add\fP (const void *indata, size_t size, double entropi)"
20 .br
21 .ti -1c
22 .RI "int \fBRAND_pseudo_bytes\fP (void *outdata, size_t size)"
23 .br
24 .ti -1c
25 .RI "int \fBRAND_status\fP (void)"
26 .br
27 .ti -1c
28 .RI "int \fBRAND_set_rand_method\fP (const RAND_METHOD *meth)"
29 .br
30 .ti -1c
31 .RI "const RAND_METHOD * \fBRAND_get_rand_method\fP (void)"
32 .br
33 .ti -1c
34 .RI "int \fBRAND_set_rand_engine\fP (ENGINE *engine)"
35 .br
36 .ti -1c
37 .RI "int \fBRAND_load_file\fP (const char *filename, size_t size)"
38 .br
39 .ti -1c
40 .RI "int \fBRAND_write_file\fP (const char *filename)"
41 .br
42 .ti -1c
43 .RI "const char * \fBRAND_file_name\fP (char *filename, size_t size)"
44 .br
45 .in -1c
46 .SH "Detailed Description"
47 .PP 
48 See the \fBRAND - random number\fP for description and examples. 
49 .SH "Function Documentation"
50 .PP 
51 .SS "void RAND_add (const void * indata, size_t size, double entropi)"
52 .PP
53 Seed that random number generator. Secret material can securely be feed into the function, they will never be returned.
54 .PP
55 \fBParameters:\fP
56 .RS 4
57 \fIindata\fP the input data. 
58 .br
59 \fIsize\fP size of in data. 
60 .br
61 \fIentropi\fP entropi in data. 
62 .RE
63 .PP
64
65 .SS "int RAND_bytes (void * outdata, size_t size)"
66 .PP
67 Get a random block from the random generator, can be used for key material.
68 .PP
69 \fBParameters:\fP
70 .RS 4
71 \fIoutdata\fP random data 
72 .br
73 \fIsize\fP length random data
74 .RE
75 .PP
76 \fBReturns:\fP
77 .RS 4
78 1 on success, 0 on failure. 
79 .RE
80 .PP
81
82 .SS "void RAND_cleanup (void)"
83 .PP
84 Reset and free memory used by the random generator. 
85 .SS "const char* RAND_file_name (char * filename, size_t size)"
86 .PP
87 Return the default random state filename for a user to use for \fBRAND_load_file()\fP, and \fBRAND_write_file()\fP.
88 .PP
89 \fBParameters:\fP
90 .RS 4
91 \fIfilename\fP buffer to hold file name. 
92 .br
93 \fIsize\fP size of buffer filename.
94 .RE
95 .PP
96 \fBReturns:\fP
97 .RS 4
98 the buffer filename or NULL on failure. 
99 .RE
100 .PP
101
102 .SS "const RAND_METHOD* RAND_get_rand_method (void)"
103 .PP
104 Get the default random method. 
105 .SS "int RAND_load_file (const char * filename, size_t size)"
106 .PP
107 Load a a file and feed it into \fBRAND_seed()\fP.
108 .PP
109 \fBParameters:\fP
110 .RS 4
111 \fIfilename\fP name of file to read. 
112 .br
113 \fIsize\fP minimum size to read. 
114 .RE
115 .PP
116
117 .SS "int RAND_pseudo_bytes (void * outdata, size_t size)"
118 .PP
119 Get a random block from the random generator, should NOT be used for key material.
120 .PP
121 \fBParameters:\fP
122 .RS 4
123 \fIoutdata\fP random data 
124 .br
125 \fIsize\fP length random data
126 .RE
127 .PP
128 \fBReturns:\fP
129 .RS 4
130 1 on success, 0 on failure. 
131 .RE
132 .PP
133
134 .SS "void RAND_seed (const void * indata, size_t size)"
135 .PP
136 Seed that random number generator. Secret material can securely be feed into the function, they will never be returned.
137 .PP
138 \fBParameters:\fP
139 .RS 4
140 \fIindata\fP seed data 
141 .br
142 \fIsize\fP length seed data 
143 .RE
144 .PP
145
146 .SS "int RAND_set_rand_engine (ENGINE * engine)"
147 .PP
148 Set the default random method from engine.
149 .PP
150 \fBParameters:\fP
151 .RS 4
152 \fIengine\fP use engine, if NULL is passed it, old method and engine is cleared.
153 .RE
154 .PP
155 \fBReturns:\fP
156 .RS 4
157 1 on success, 0 on failure. 
158 .RE
159 .PP
160
161 .SS "int RAND_set_rand_method (const RAND_METHOD * meth)"
162 .PP
163 Set the default random method.
164 .PP
165 \fBParameters:\fP
166 .RS 4
167 \fImeth\fP set the new default method.
168 .RE
169 .PP
170 \fBReturns:\fP
171 .RS 4
172 1 on success. 
173 .RE
174 .PP
175
176 .SS "int RAND_status (void)"
177 .PP
178 Return status of the random generator
179 .PP
180 \fBReturns:\fP
181 .RS 4
182 1 if the random generator can deliver random data. 
183 .RE
184 .PP
185
186 .SS "int RAND_write_file (const char * filename)"
187 .PP
188 Write of random numbers to a file to store for later initiation with \fBRAND_load_file()\fP.
189 .PP
190 \fBParameters:\fP
191 .RS 4
192 \fIfilename\fP name of file to write.
193 .RE
194 .PP
195 \fBReturns:\fP
196 .RS 4
197 1 on success and non-one on failure. 
198 .RE
199 .PP
200