diff options
author | cvs2svn <admin@example.com> | 1999-03-26 18:24:03 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 1999-03-26 18:24:03 +0000 |
commit | 3fc228fb4c1a39aceaee3d7013365042a6077bd0 (patch) | |
tree | af769f6648929b3b2c1f9e053a3754fa989ce302 /src/lib/libc/crypt/arc4random.3 | |
parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
download | openbsd-OPENBSD_2_5.tar.gz openbsd-OPENBSD_2_5.tar.bz2 openbsd-OPENBSD_2_5.zip |
This commit was manufactured by cvs2git to create branch 'OPENBSD_2_5'.OPENBSD_2_5
Diffstat (limited to 'src/lib/libc/crypt/arc4random.3')
-rw-r--r-- | src/lib/libc/crypt/arc4random.3 | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/lib/libc/crypt/arc4random.3 b/src/lib/libc/crypt/arc4random.3 new file mode 100644 index 0000000000..741965c5ac --- /dev/null +++ b/src/lib/libc/crypt/arc4random.3 | |||
@@ -0,0 +1,83 @@ | |||
1 | .\" $OpenBSD: arc4random.3,v 1.4 1998/09/07 16:44:34 aaron Exp $ | ||
2 | .\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | ||
3 | .\" All rights reserved. | ||
4 | .\" | ||
5 | .\" Redistribution and use in source and binary forms, with or without | ||
6 | .\" modification, are permitted provided that the following conditions | ||
7 | .\" are met: | ||
8 | .\" 1. Redistributions of source code must retain the above copyright | ||
9 | .\" notice, this list of conditions and the following disclaimer. | ||
10 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
11 | .\" notice, this list of conditions and the following disclaimer in the | ||
12 | .\" documentation and/or other materials provided with the distribution. | ||
13 | .\" 3. All advertising materials mentioning features or use of this software | ||
14 | .\" must display the following acknowledgement: | ||
15 | .\" This product includes software developed by Niels Provos. | ||
16 | .\" 4. The name of the author may not be used to endorse or promote products | ||
17 | .\" derived from this software without specific prior written permission. | ||
18 | .\" | ||
19 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
20 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
21 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
22 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
23 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
24 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
25 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
26 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
27 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
28 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
29 | .\" | ||
30 | .\" Manual page, using -mandoc macros | ||
31 | .\" | ||
32 | .Dd April 15, 1997 | ||
33 | .Dt ARC4RANDOM 3 | ||
34 | .Os "OpenBSD 2.0" | ||
35 | .Sh NAME | ||
36 | .Nm arc4random, | ||
37 | .Nm arc4random_stir, | ||
38 | .Nm arc4random_addrandom | ||
39 | .Nd arc4 random number generator. | ||
40 | .Sh SYNOPSIS | ||
41 | .Fd #include <stdlib.h> | ||
42 | .Ft u_int32_t | ||
43 | .Fn arc4random "void" | ||
44 | .Ft void | ||
45 | .Fn arc4random_stir "void" | ||
46 | .Ft void | ||
47 | .Fn arc4random_addrandom "u_char *dat" "int datlen" | ||
48 | .Sh DESCRIPTION | ||
49 | The | ||
50 | .Fn arc4random | ||
51 | function uses the key stream generator employed by the | ||
52 | arc4 cipher, which uses 8*8 8 bit S-Boxes. The S-Boxes | ||
53 | can be in about | ||
54 | .if t 2\u\s71700\s10\d | ||
55 | .if n (2**1700) | ||
56 | states. | ||
57 | .Pp | ||
58 | The | ||
59 | .Fn arc4random_stir | ||
60 | function reads data from | ||
61 | .Pa /dev/arandom | ||
62 | and uses it to permutate the S-Boxes via | ||
63 | .Fn arc4random_addrandom . | ||
64 | .Pp | ||
65 | There is no need to call | ||
66 | .Fn arc4random_stir | ||
67 | before using | ||
68 | .Fn arc4random , | ||
69 | since | ||
70 | .Fn arc4random | ||
71 | automatically initalizes itself. | ||
72 | .Sh SEE ALSO | ||
73 | .Xr rand48 3 , | ||
74 | .Xr rand 3 , | ||
75 | .Xr random 3 | ||
76 | .Sh HISTORY | ||
77 | .Pa RC4 | ||
78 | has been designed by RSA Data Security, Inc. It was posted anonymously | ||
79 | to the USENET and was confirmed to be equivalent by several sources who | ||
80 | had access to the original cipher. Since | ||
81 | .Pa RC4 | ||
82 | used to be a trade secret, the cipher is now referred to as | ||
83 | .Pa ARC4 . | ||