blob: 73adfadb9191696a0c479c1ec9b71f79b0351457 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/*
2 * This is D3DES (V5.09) by Richard Outerbridge with the double and
3 * triple-length support removed for use in VNC.
4 *
5 * These changes are:
6 * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 */
12
13/* d3des.h -
14 *
15 * Headers and defines for d3des.c
16 * Graven Imagery, 1992.
17 *
18 * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
19 * (GEnie : OUTER; CIS : [71755,204])
20 */
21
Adam Tkacc0b557b2010-06-24 20:01:59 +000022#ifdef __cplusplus
23extern "C" {
24#endif
25
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000026#define EN0 0 /* MODE == encrypt */
27#define DE1 1 /* MODE == decrypt */
28
29extern void deskey(unsigned char *, int);
30/* hexkey[8] MODE
31 * Sets the internal key register according to the hexadecimal
32 * key contained in the 8 bytes of hexkey, according to the DES,
33 * for encryption or decryption according to MODE.
34 */
35
36extern void usekey(unsigned long *);
37/* cookedkey[32]
38 * Loads the internal key register with the data in cookedkey.
39 */
40
41extern void cpkey(unsigned long *);
42/* cookedkey[32]
43 * Copies the contents of the internal key register into the storage
44 * located at &cookedkey[0].
45 */
46
47extern void des(unsigned char *, unsigned char *);
48/* from[8] to[8]
49 * Encrypts/Decrypts (according to the key currently loaded in the
50 * internal key register) one block of eight bytes at address 'from'
51 * into the block at address 'to'. They can be the same.
52 */
53
Adam Tkacc0b557b2010-06-24 20:01:59 +000054#ifdef __cplusplus
55}
56#endif
57
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000058/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
59 ********************************************************************/