Scribus
Open source desktop publishing at your fingertips
rc4.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /*
8  * RC4 functions for HTMLDOC.
9  *
10  * Original code by Rob Earhart
11  * Copyright 1999 by Carnegie Mellon University, All Rights Reserved
12  *
13  * Permission to use, copy, modify, and distribute this software and its
14  * documentation for any purpose and without fee is hereby granted,
15  * provided that the above copyright notice appear in all copies and that
16  * both that copyright notice and this permission notice appear in
17  * supporting documentation, and that the name of Carnegie Mellon
18  * University not be used in advertising or publicity pertaining to
19  * distribution of the software without specific, written prior
20  * permission.
21  *
22  * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
23  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
24  * FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR
25  * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
27  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
28  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29  */
30 
31 #ifndef _RC4_H_
32 # define _RC4_H_
33 
34 #include "scribusapi.h"
35 
36 # ifdef __cplusplus
37 extern "C" {
38 # endif /* __cplusplus */
39 
40 
41 /*
42  * RC4 context...
43  */
44 
45 typedef struct
46 {
47  unsigned char sbox[256]; /* S boxes for encryption */
48  int i, j; /* Current indices into S boxes */
50 
51 
52 /*
53  * Prototypes...
54  */
55 
56 extern void SCRIBUS_API rc4_init(rc4_context_t *context, const unsigned char *key,
57  unsigned keylen);
58 extern void SCRIBUS_API rc4_encrypt(rc4_context_t *context, const unsigned char *input,
59  unsigned char *output, unsigned len);
60 
61 # ifdef __cplusplus
62 }
63 # endif /* __cplusplus */
64 
65 #endif /* !_RC4_H_ */
66 
Definition: rc4.h:45