ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 12 | #ifndef D3DES_H |
| 13 | #define D3DES_H 1 |
ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 14 | |
| 15 | /* d3des.h - |
| 16 | * |
| 17 | * Headers and defines for d3des.c |
| 18 | * Graven Imagery, 1992. |
| 19 | * |
| 20 | * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge |
| 21 | * (GEnie : OUTER; CIS : [71755,204]) |
| 22 | */ |
| 23 | |
| 24 | #define EN0 0 /* MODE == encrypt */ |
| 25 | #define DE1 1 /* MODE == decrypt */ |
| 26 | |
Blue Swirl | 64b85a8 | 2011-01-23 16:21:20 +0000 | [diff] [blame] | 27 | void deskey(unsigned char *, int); |
ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 28 | /* hexkey[8] MODE |
| 29 | * Sets the internal key register according to the hexadecimal |
| 30 | * key contained in the 8 bytes of hexkey, according to the DES, |
| 31 | * for encryption or decryption according to MODE. |
| 32 | */ |
| 33 | |
Blue Swirl | 64b85a8 | 2011-01-23 16:21:20 +0000 | [diff] [blame] | 34 | void usekey(unsigned long *); |
ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 35 | /* cookedkey[32] |
| 36 | * Loads the internal key register with the data in cookedkey. |
| 37 | */ |
| 38 | |
Blue Swirl | 64b85a8 | 2011-01-23 16:21:20 +0000 | [diff] [blame] | 39 | void cpkey(unsigned long *); |
ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 40 | /* cookedkey[32] |
| 41 | * Copies the contents of the internal key register into the storage |
| 42 | * located at &cookedkey[0]. |
| 43 | */ |
| 44 | |
Blue Swirl | 64b85a8 | 2011-01-23 16:21:20 +0000 | [diff] [blame] | 45 | void des(unsigned char *, unsigned char *); |
ths | 6fd2740 | 2007-08-25 02:09:50 +0000 | [diff] [blame] | 46 | /* from[8] to[8] |
| 47 | * Encrypts/Decrypts (according to the key currently loaded in the |
| 48 | * internal key register) one block of eight bytes at address 'from' |
| 49 | * into the block at address 'to'. They can be the same. |
| 50 | */ |
| 51 | |
| 52 | /* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery |
| 53 | ********************************************************************/ |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 54 | |
| 55 | #endif |