summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/RAND.pod
diff options
context:
space:
mode:
authormpi <>2014-04-16 09:50:10 +0000
committermpi <>2014-04-16 09:50:10 +0000
commit27c3c9e543412112b877fdf1f01c5fe54d220138 (patch)
tree31806a01d35adccbe3db5ef7b8b8875fdd34c5b8 /src/lib/libcrypto/doc/RAND.pod
parentf07c2e093541aacc69da893d98de5de30830a555 (diff)
downloadopenbsd-27c3c9e543412112b877fdf1f01c5fe54d220138.tar.gz
openbsd-27c3c9e543412112b877fdf1f01c5fe54d220138.tar.bz2
openbsd-27c3c9e543412112b877fdf1f01c5fe54d220138.zip
Sync the list of man pages for libcrypto, explicity rename conflicting
pages instead of doing it in the Makefiles and move a libssl page where it belongs. ok miod@
Diffstat (limited to 'src/lib/libcrypto/doc/RAND.pod')
-rw-r--r--src/lib/libcrypto/doc/RAND.pod74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/lib/libcrypto/doc/RAND.pod b/src/lib/libcrypto/doc/RAND.pod
new file mode 100644
index 0000000000..e987414477
--- /dev/null
+++ b/src/lib/libcrypto/doc/RAND.pod
@@ -0,0 +1,74 @@
1=pod
2
3=head1 NAME
4
5rand - pseudo-random number generator
6
7=head1 SYNOPSIS
8
9 #include <openssl/rand.h>
10
11 int RAND_set_rand_engine(ENGINE *engine);
12
13 int RAND_bytes(unsigned char *buf, int num);
14 int RAND_pseudo_bytes(unsigned char *buf, int num);
15
16 void RAND_seed(const void *buf, int num);
17 void RAND_add(const void *buf, int num, int entropy);
18 int RAND_status(void);
19
20 int RAND_load_file(const char *file, long max_bytes);
21 int RAND_write_file(const char *file);
22 const char *RAND_file_name(char *file, size_t num);
23
24 int RAND_egd(const char *path);
25
26 void RAND_set_rand_method(const RAND_METHOD *meth);
27 const RAND_METHOD *RAND_get_rand_method(void);
28 RAND_METHOD *RAND_SSLeay(void);
29
30 void RAND_cleanup(void);
31
32=head1 DESCRIPTION
33
34Since the introduction of the ENGINE API, the recommended way of controlling
35default implementations is by using the ENGINE API functions. The default
36B<RAND_METHOD>, as set by RAND_set_rand_method() and returned by
37RAND_get_rand_method(), is only used if no ENGINE has been set as the default
38"rand" implementation. Hence, these two functions are no longer the recommened
39way to control defaults.
40
41If an alternative B<RAND_METHOD> implementation is being used (either set
42directly or as provided by an ENGINE module), then it is entirely responsible
43for the generation and management of a cryptographically secure PRNG stream. The
44mechanisms described below relate solely to the software PRNG implementation
45built in to OpenSSL and used by default.
46
47These functions implement a cryptographically secure pseudo-random
48number generator (PRNG). It is used by other library functions for
49example to generate random keys, and applications can use it when they
50need randomness.
51
52A cryptographic PRNG must be seeded with unpredictable data such as
53mouse movements or keys pressed at random by the user. This is
54described in L<RAND_add(3)|RAND_add(3)>. Its state can be saved in a seed file
55(see L<RAND_load_file(3)|RAND_load_file(3)>) to avoid having to go through the
56seeding process whenever the application is started.
57
58L<RAND_bytes(3)|RAND_bytes(3)> describes how to obtain random data from the
59PRNG.
60
61=head1 INTERNALS
62
63The RAND_SSLeay() method implements a PRNG based on the systems'
64L<arc4random_buf(3)> random number generator.
65
66=head1 SEE ALSO
67
68L<BN_rand(3)|BN_rand(3)>, L<RAND_add(3)|RAND_add(3)>,
69L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_egd(3)|RAND_egd(3)>,
70L<RAND_bytes(3)|RAND_bytes(3)>,
71L<RAND_set_rand_method(3)|RAND_set_rand_method(3)>,
72L<RAND_cleanup(3)|RAND_cleanup(3)>
73
74=cut