aboutsummaryrefslogtreecommitdiffstats
path: root/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3
blob: e7505bc06afad2c74c27fff3913e953303cf31e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
.TH "hcrypto_rand" 3 "Fri Dec 8 2017" "Version 7.5.0" "Heimdal crypto library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
hcrypto_rand
.SH SYNOPSIS
.br
.PP
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBRAND_seed\fP (const void *indata, size_t size)"
.br
.ti -1c
.RI "int \fBRAND_bytes\fP (void *outdata, size_t size)"
.br
.ti -1c
.RI "void \fBRAND_cleanup\fP (void)"
.br
.ti -1c
.RI "void \fBRAND_add\fP (const void *indata, size_t size, double entropi)"
.br
.ti -1c
.RI "int \fBRAND_pseudo_bytes\fP (void *outdata, size_t size)"
.br
.ti -1c
.RI "int \fBRAND_status\fP (void)"
.br
.ti -1c
.RI "int \fBRAND_set_rand_method\fP (const RAND_METHOD *meth)"
.br
.ti -1c
.RI "const RAND_METHOD * \fBRAND_get_rand_method\fP (void)"
.br
.ti -1c
.RI "int \fBRAND_set_rand_engine\fP (ENGINE *engine)"
.br
.ti -1c
.RI "int \fBRAND_load_file\fP (const char *filename, size_t size)"
.br
.ti -1c
.RI "int \fBRAND_write_file\fP (const char *filename)"
.br
.ti -1c
.RI "const char * \fBRAND_file_name\fP (char *filename, size_t size)"
.br
.in -1c
.SH "Detailed Description"
.PP 
See the \fBRAND - random number\fP for description and examples\&. 
.SH "Function Documentation"
.PP 
.SS "void RAND_add (const void * indata, size_t size, double entropi)"
Seed that random number generator\&. Secret material can securely be feed into the function, they will never be returned\&.
.PP
\fBParameters:\fP
.RS 4
\fIindata\fP the input data\&. 
.br
\fIsize\fP size of in data\&. 
.br
\fIentropi\fP entropi in data\&. 
.RE
.PP

.SS "int RAND_bytes (void * outdata, size_t size)"
Get a random block from the random generator, can be used for key material\&.
.PP
\fBParameters:\fP
.RS 4
\fIoutdata\fP random data 
.br
\fIsize\fP length random data
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure\&. 
.RE
.PP

.SS "void RAND_cleanup (void)"
Reset and free memory used by the random generator\&. 
.SS "const char* RAND_file_name (char * filename, size_t size)"
Return the default random state filename for a user to use for \fBRAND_load_file()\fP, and \fBRAND_write_file()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP buffer to hold file name\&. 
.br
\fIsize\fP size of buffer filename\&.
.RE
.PP
\fBReturns:\fP
.RS 4
the buffer filename or NULL on failure\&. 
.RE
.PP

.SS "const RAND_METHOD* RAND_get_rand_method (void)"
Get the default random method\&.
.PP
\fBReturns:\fP
.RS 4
Returns a RAND_METHOD 
.RE
.PP

.SS "int RAND_load_file (const char * filename, size_t size)"
Load a a file and feed it into \fBRAND_seed()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP name of file to read\&. 
.br
\fIsize\fP minimum size to read\&.
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the number of seed bytes loaded (0 indicates failure) 
.RE
.PP

.SS "int RAND_pseudo_bytes (void * outdata, size_t size)"
Get a random block from the random generator, should NOT be used for key material\&.
.PP
\fBParameters:\fP
.RS 4
\fIoutdata\fP random data 
.br
\fIsize\fP length random data
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure\&. 
.RE
.PP

.SS "void RAND_seed (const void * indata, size_t size)"
Seed that random number generator\&. Secret material can securely be feed into the function, they will never be returned\&.
.PP
\fBParameters:\fP
.RS 4
\fIindata\fP seed data 
.br
\fIsize\fP length seed data 
.RE
.PP

.SS "int RAND_set_rand_engine (ENGINE * engine)"
Set the default random method from engine\&.
.PP
\fBParameters:\fP
.RS 4
\fIengine\fP use engine, if NULL is passed it, old method and engine is cleared\&.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure\&. 
.RE
.PP

.SS "int RAND_set_rand_method (const RAND_METHOD * meth)"
Set the default random method\&.
.PP
\fBParameters:\fP
.RS 4
\fImeth\fP set the new default method\&.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success\&. 
.RE
.PP

.SS "int RAND_status (void)"
Return status of the random generator
.PP
\fBReturns:\fP
.RS 4
1 if the random generator can deliver random data\&. 
.RE
.PP

.SS "int RAND_write_file (const char * filename)"
Write of random numbers to a file to store for later initiation with \fBRAND_load_file()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP name of file to write\&.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success and non-one on failure\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Heimdal crypto library from the source code\&.