rc4.h revision 1.7
1193323Sed/* crypto/rc4/rc4.h */
2193323Sed/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3193323Sed * All rights reserved.
4193323Sed *
5193323Sed * This package is an SSL implementation written
6193323Sed * by Eric Young (eay@cryptsoft.com).
7193323Sed * The implementation was written so as to conform with Netscapes SSL.
8193323Sed *
9193323Sed * This library is free for commercial and non-commercial use as long as
10193323Sed * the following conditions are aheared to.  The following conditions
11193323Sed * apply to all code found in this distribution, be it the RC4, RSA,
12193323Sed * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13193323Sed * included with this distribution is covered by the same copyright terms
14193323Sed * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15193323Sed *
16193323Sed * Copyright remains Eric Young's, and as such any Copyright notices in
17193323Sed * the code are not to be removed.
18193323Sed * If this package is used in a product, Eric Young should be given attribution
19193323Sed * as the author of the parts of the library used.
20193323Sed * This can be in the form of a textual message at program startup or
21193323Sed * in documentation (online or textual) provided with the package.
22193323Sed *
23193323Sed * Redistribution and use in source and binary forms, with or without
24193323Sed * modification, are permitted provided that the following conditions
25193323Sed * are met:
26193323Sed * 1. Redistributions of source code must retain the copyright
27193323Sed *    notice, this list of conditions and the following disclaimer.
28193323Sed * 2. Redistributions in binary form must reproduce the above copyright
29193323Sed *    notice, this list of conditions and the following disclaimer in the
30193323Sed *    documentation and/or other materials provided with the distribution.
31193323Sed * 3. All advertising materials mentioning features or use of this software
32193323Sed *    must display the following acknowledgement:
33193323Sed *    "This product includes cryptographic software written by
34193323Sed *     Eric Young (eay@cryptsoft.com)"
35193323Sed *    The word 'cryptographic' can be left out if the rouines from the library
36198090Srdivacky *    being used are not cryptographic related :-).
37193323Sed * 4. If you include any Windows specific code (or a derivative thereof) from
38218893Sdim *    the apps directory (application code) you must include an acknowledgement:
39218893Sdim *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40218893Sdim *
41193323Sed * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42193323Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43193323Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44193323Sed * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45193323Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46193323Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47193323Sed * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48193323Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49193323Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50193323Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51193323Sed * SUCH DAMAGE.
52193323Sed *
53193323Sed * The licence and distribution terms for any publically available version or
54193323Sed * derivative of this code cannot be changed.  i.e. this code cannot simply be
55193323Sed * copied and put under another distribution licence
56193323Sed * [including the GNU Public Licence.]
57193323Sed */
58193323Sed
59193323Sed#ifndef HEADER_RC4_H
60193323Sed#define HEADER_RC4_H
61212904Sdim
62218893Sdim#include <openssl/opensslconf.h> /* OPENSSL_NO_RC4, RC4_INT */
63193323Sed#ifdef OPENSSL_NO_RC4
64193323Sed#error RC4 is disabled.
65193323Sed#endif
66193323Sed
67193323Sed#ifdef  __cplusplus
68193323Sedextern "C" {
69193323Sed#endif
70193323Sed
71193323Sedtypedef struct rc4_key_st
72193323Sed	{
73193323Sed	RC4_INT x,y;
74193323Sed	RC4_INT data[256];
75218893Sdim	} RC4_KEY;
76218893Sdim
77218893Sdim
78193323Sedconst char *RC4_options(void);
79193323Sedvoid RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
80193323Sedvoid RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
81193323Sed		unsigned char *outdata);
82193323Sed
83193323Sed#ifdef  __cplusplus
84193323Sed}
85193323Sed#endif
86193323Sed
87193323Sed#endif
88218893Sdim