1 /* header for the des routines that we will use */ 2 /* $FreeBSD$ */ 3 4 typedef unsigned char byte, DesData[ 8], IdeaData[16]; 5 #if 0 6 typedef unsigned long word, DesKeys[32]; 7 #else 8 #define DesKeys des_key_schedule 9 #endif 10 11 #define DES_DECRYPT 0 12 #define DES_ENCRYPT 1 13 14 #if 0 15 extern void des_fixup_key_parity(); /* (DesData *key) */ 16 extern int des_key_sched(); /* (DesData *key, DesKeys *m) */ 17 extern int des_ecb_encrypt(); /* (DesData *src, *dst, DesKeys *m, int mode) */ 18 extern int des_cbc_encrypt(); /* (char *src, *dst, int length, 19 DesKeys *m, DesData *init, int mode) */ 20 #endif 21 22 /* public key routines */ 23 /* functions: 24 genkeys(char *public, char *secret) 25 common_key(char *secret, char *public, desData *deskey) 26 where 27 char public[HEXKEYBYTES + 1]; 28 char secret[HEXKEYBYTES + 1]; 29 */ 30 31 #define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b" 32 #define HEXKEYBYTES 48 33 #define KEYSIZE 192 34 #define KEYBYTES 24 35 #define PROOT 3 36 37 extern void genkeys(char *public, char *secret); 38 extern void common_key(char *secret, char *public, IdeaData *common, 39 DesData *deskey); 40 extern void pk_encode(char *in, char *out, DesData *deskey); 41 extern void pk_decode(char *in, char *out, DesData *deskey); 42 43