arc4random.c (7c478bd9) arc4random.c (a0b85df4)
1/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
2 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
21 */
4 */
5
6#pragma ident "%Z%%M% %I% %E% SMI"
7
22/* $OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $ */
23
24/*
25 * Arc4 random number generator for OpenBSD.
26 * Copyright 1996 David Mazieres <dm@lcs.mit.edu>.
27 *
28 * Modification and redistribution in source and binary forms is
29 * permitted provided that due credit is given to the author and the
30 * OpenBSD project by leaving this copyright notice intact.
31 */
32
33/*
8/* $OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $ */
9
10/*
11 * Arc4 random number generator for OpenBSD.
12 * Copyright 1996 David Mazieres <dm@lcs.mit.edu>.
13 *
14 * Modification and redistribution in source and binary forms is
15 * permitted provided that due credit is given to the author and the
16 * OpenBSD project by leaving this copyright notice intact.
17 */
18
19/*
34 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
35 * Use is subject to license terms.
36 */
37#pragma ident "%Z%%M% %I% %E% SMI"
38
39/*
40 * This code is derived from section 17.1 of Applied Cryptography,
41 * second edition, which describes a stream cipher allegedly
42 * compatible with RSA Labs "RC4" cipher (the actual description of
43 * which is a trade secret). The same algorithm is used as a stream
44 * cipher called "arcfour" in Tatu Ylonen's ssh package.
45 *
46 * Here the stream cipher has been modified always to include the time
47 * when initializing the state. That makes it impossible to

--- 157 unchanged lines hidden ---
20 * This code is derived from section 17.1 of Applied Cryptography,
21 * second edition, which describes a stream cipher allegedly
22 * compatible with RSA Labs "RC4" cipher (the actual description of
23 * which is a trade secret). The same algorithm is used as a stream
24 * cipher called "arcfour" in Tatu Ylonen's ssh package.
25 *
26 * Here the stream cipher has been modified always to include the time
27 * when initializing the state. That makes it impossible to

--- 157 unchanged lines hidden ---