reindent-20030715
[openafs.git] / src / des / des_internal.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  * Private include file for the Data Encryption Standard library.
8  */
9
10 /* only do the whole thing once  */
11 #ifndef DES_INTERNAL_DEFS
12 #define DES_INTERNAL_DEFS
13
14 #include "conf.h"
15
16 /*
17  * number of iterations of the inner
18  * loop of the DES algorithm.  The
19  * standard is 16, but in case that is
20  * too slow, we might do less.  Of
21  * course, less also means less
22  * security.
23  */
24 #define  AUTH_DES_ITER   16
25
26 #ifdef  BITS32
27 /* these are for 32 bit machines */
28
29 typedef struct {
30     unsigned b0:6;
31     unsigned b1:6;
32     unsigned b2:6;
33     unsigned b3:6;
34     unsigned b4:6;
35     unsigned b5:2;
36 } sbox_in_a;
37
38 typedef struct {
39     unsigned b5:4;
40     unsigned b6:6;
41     unsigned b7:6;
42 } sbox_in_b;
43
44 typedef struct {
45     unsigned b0:4;
46     unsigned b1:4;
47     unsigned b2:4;
48     unsigned b3:4;
49     unsigned b4:4;
50     unsigned b5:4;
51     unsigned b6:4;
52     unsigned b7:4;
53 } sbox_out;
54
55 #else /* BITS32 */
56 /* for sixteen bit machines */
57
58 typedef struct {
59     unsigned b0:6;
60     unsigned b1:6;
61     unsigned b2:4;
62 } sbox_in_16_a;
63
64 typedef struct {
65     unsigned b2:2;
66     unsigned b3:6;
67     unsigned b4:6;
68     unsigned b5:2;
69 } sbox_in_16_b;
70
71 typedef struct {
72     unsigned b5:4;
73     unsigned b6:6;
74     unsigned b7:6;
75 } sbox_in_16_c;
76
77 typedef struct {
78     unsigned b0:4;
79     unsigned b1:4;
80     unsigned b2:4;
81     unsigned b3:4;
82     unsigned b4:4;
83     unsigned b5:4;
84     unsigned b6:4;
85     unsigned b7:4;
86 } sbox_out;
87 #endif /* BITS32 */
88
89
90 #endif /* DES_INTERNAL_DEFS */