1#ifndef ZOIDBERG_DES_H
2#define ZOIDBERG_DES_H
3/* DES - encryption algorithm, removed double and triple DES
4**
5** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
6*/
7
8/* des.h - adapted from d3des.h:
9 *
10 *	Headers and defines for d3des.c
11 *	Graven Imagery, 1992.
12 *
13 * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
14 *	(GEnie : OUTER; CIS : [71755,204])
15 */
16
17#define DES_ENCRYPT	0	/* MODE == encrypt */
18#define DES_DECRYPT	1	/* MODE == decrypt */
19
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25extern void des_setkey(unsigned char *, short);
26/*		      hexkey[8]     MODE
27 * Sets the internal key register according to the hexadecimal
28 * key contained in the 8 bytes of hexkey, according to the DES,
29 * for encryption or decryption according to MODE.
30 */
31
32extern void des_usekey(unsigned long *);
33/*		    cookedkey[32]
34 * Loads the internal key register with the data in cookedkey.
35 */
36
37extern void des_cpkey(unsigned long *);
38/*		   cookedkey[32]
39 * Copies the contents of the internal key register into the storage
40 * located at &cookedkey[0].
41 */
42
43extern void des_crypt(unsigned char *, unsigned char *);
44/*		    from[8]	      to[8]
45 * Encrypts/Decrypts (according to the key currently loaded in the
46 * internal key register) one block of eight bytes at address 'from'
47 * into the block at address 'to'.  They can be the same.
48 */
49
50extern void des_encrypt(char *from,char *to);
51extern void des_decrypt(char *from,int fromLength,char *to);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif	/* ZOIDBERG_DES_H */
58