Replace bits of libutil with libroken
[openafs.git] / src / des / des.h
1 /*
2  * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
3  *
4  * For copying and distribution information, please see the file
5  * <mit-cpyright.h>.
6  *
7  * Include file for the Data Encryption Standard library.
8  */
9
10 /* only do the whole thing once  */
11 #ifndef DES_DEFS
12 #define DES_DEFS
13
14 #include "mit-cpyright.h"
15
16 typedef unsigned char des_cblock[8];    /* crypto-block size */
17 /* Key schedule */
18 typedef struct des_ks_struct {
19     union {
20     afs_uint32 i[2];
21     des_cblock _;
22     } _;
23 } des_key_schedule[16];
24
25 #define DES_KEY_SZ      (sizeof(des_cblock))
26 #define DES_ENCRYPT     1
27 #define DES_DECRYPT     0
28
29 #ifndef NCOMPAT
30 #define C_Block des_cblock
31 #define Key_schedule des_key_schedule
32 #ifndef ENCRYPT
33 #define ENCRYPT DES_ENCRYPT
34 #define DECRYPT DES_DECRYPT
35 #endif
36 #define KEY_SZ DES_KEY_SZ
37 #define string_to_key des_string_to_key
38 #define read_pw_string des_read_pw_string
39 #define random_key des_random_key
40 #define pcbc_encrypt des_pcbc_encrypt
41 #ifdef AFS_DUX40_ENV
42 /* This is done to avoid name space collision with dtlogin and SIA. */
43 #define des_key_sched afs_des_key_sched
44 #endif
45 #define key_sched des_key_sched
46 #define cbc_encrypt des_cbc_encrypt
47 #define ecb_encrypt des_ecb_encrypt
48 #define cbc_cksum des_cbc_cksum
49 #define C_Block_print des_cblock_print
50 #define quad_cksum des_quad_cksum
51 typedef struct des_ks_struct bit_64;
52 #endif
53
54 #define des_cblock_print(x) des_cblock_print_file(x, stdout)
55
56 #endif /* DES_DEFS */