summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/RAND_add.pod
diff options
context:
space:
mode:
authorbeck <>2000-03-19 11:13:58 +0000
committerbeck <>2000-03-19 11:13:58 +0000
commit796d609550df3a33fc11468741c5d2f6d3df4c11 (patch)
tree6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/doc/RAND_add.pod
parent5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff)
downloadopenbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/doc/RAND_add.pod')
-rw-r--r--src/lib/libcrypto/doc/RAND_add.pod68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/lib/libcrypto/doc/RAND_add.pod b/src/lib/libcrypto/doc/RAND_add.pod
new file mode 100644
index 0000000000..0a13ec2a92
--- /dev/null
+++ b/src/lib/libcrypto/doc/RAND_add.pod
@@ -0,0 +1,68 @@
1=pod
2
3=head1 NAME
4
5RAND_add, RAND_seed, RAND_screen - add entropy to the PRNG
6
7=head1 SYNOPSIS
8
9 #include <openssl/rand.h>
10
11 void RAND_seed(const void *buf, int num);
12
13 void RAND_add(const void *buf, int num, double entropy);
14
15 int RAND_status(void);
16
17 void RAND_screen(void);
18
19=head1 DESCRIPTION
20
21RAND_add() mixes the B<num> bytes at B<buf> into the PRNG state. Thus,
22if the data at B<buf> are unpredictable to an adversary, this
23increases the uncertainty about the state and makes the PRNG output
24less predictable. Suitable input comes from user interaction (random
25key presses, mouse movements) and certain hardware events. The
26B<entropy> argument is (the lower bound of) an estimate of how much
27randomness is contained in B<buf>, measured in bytes. Details about
28sources of randomness and how to estimate their entropy can be found
29in the literature, e.g. RFC 1750.
30
31RAND_add() may be called with sensitive data such as user entered
32passwords. The seed values cannot be recovered from the PRNG output.
33
34OpenSSL makes sure that the PRNG state is unique for each thread. On
35systems that provide C</dev/urandom>, the randomness device is used
36to seed the PRNG transparently. However, on all other systems, the
37application is responsible for seeding the PRNG by calling RAND_add(),
38L<RAND_egd(3)|RAND_egd(3)>
39or L<RAND_load_file(3)|RAND_load_file(3)>.
40
41RAND_seed() is equivalent to RAND_add() when B<num == entropy>.
42
43The RAND_screen() function is available for the convenience of Windows
44programmers. It adds the current contents of the screen to the PRNG.
45For applications that can catch Windows events, seeding the PRNG with
46the parameters of B<WM_MOUSEMOVE> events is a significantly better
47source of randomness. It should be noted that both methods cannot be
48used on servers that run without user interaction.
49
50=head1 RETURN VALUES
51
52RAND_status() returns 1 if the PRNG has been seeded with enough data,
530 otherwise.
54
55The other functions do not return values.
56
57=head1 SEE ALSO
58
59L<rand(3)|rand(3)>, L<RAND_egd(3)|RAND_egd(3)>,
60L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)>
61
62=head1 HISTORY
63
64RAND_seed() and RAND_screen() are available in all versions of SSLeay
65and OpenSSL. RAND_add() and RAND_status() have been added in OpenSSL
660.9.5.
67
68=cut