Back to index

scribus-ng  1.3.4.dfsg+svn20071115
rc4.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /*
00008  * RC4 functions for HTMLDOC.
00009  *
00010  *   Original code by Rob Earhart
00011  *   Copyright 1999 by Carnegie Mellon University, All Rights Reserved
00012  *
00013  *   Permission to use, copy, modify, and distribute this software and its
00014  *   documentation for any purpose and without fee is hereby granted,
00015  *   provided that the above copyright notice appear in all copies and that
00016  *   both that copyright notice and this permission notice appear in
00017  *   supporting documentation, and that the name of Carnegie Mellon
00018  *   University not be used in advertising or publicity pertaining to
00019  *   distribution of the software without specific, written prior
00020  *   permission.
00021  *
00022  *   CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
00023  *   THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
00024  *   FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR
00025  *   ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00026  *   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00027  *   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
00028  *   OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00029  */
00030 
00031 #ifndef _RC4_H_
00032 #  define _RC4_H_
00033 
00034 #include "scribusapi.h"
00035 
00036 #  ifdef __cplusplus
00037 extern "C" {
00038 #  endif /* __cplusplus */
00039 
00040 
00041 /*
00042  * RC4 context...
00043  */
00044 
00045 typedef struct
00046 {
00047   unsigned char      sbox[256];    /* S boxes for encryption */
00048   int         i, j;         /* Current indices into S boxes */
00049 } rc4_context_t;
00050 
00051 
00052 /*
00053  * Prototypes...
00054  */
00055 
00056 extern void   SCRIBUS_API rc4_init(rc4_context_t *context, const unsigned char *key,
00057                       unsigned keylen);
00058 extern void   SCRIBUS_API rc4_encrypt(rc4_context_t *context, const unsigned char *input,
00059                          unsigned char *output, unsigned len);
00060 
00061 #  ifdef __cplusplus
00062 }
00063 #  endif /* __cplusplus */
00064 
00065 #endif /* !_RC4_H_ */
00066