1 /* $NetBSD: des-tables.h,v 1.1.1.1 2011/04/13 18:14:49 elric Exp $ */
3 /* GENERATE FILE from gen-des.pl, do not edit */
5 /* pc1_c_3 bit pattern 5 13 21 */
6 static int pc1_c_3
[8] = {
7 0x00000000, 0x00000010, 0x00001000, 0x00001010,
8 0x00100000, 0x00100010, 0x00101000, 0x00101010
10 /* pc1_c_4 bit pattern 1 9 17 25 */
11 static int pc1_c_4
[16] = {
12 0x00000000, 0x00000001, 0x00000100, 0x00000101,
13 0x00010000, 0x00010001, 0x00010100, 0x00010101,
14 0x01000000, 0x01000001, 0x01000100, 0x01000101,
15 0x01010000, 0x01010001, 0x01010100, 0x01010101
17 /* pc1_d_3 bit pattern 49 41 33 */
18 static int pc1_d_3
[8] = {
19 0x00000000, 0x01000000, 0x00010000, 0x01010000,
20 0x00000100, 0x01000100, 0x00010100, 0x01010100
22 /* pc1_d_4 bit pattern 57 53 45 37 */
23 static int pc1_d_4
[16] = {
24 0x00000000, 0x00100000, 0x00001000, 0x00101000,
25 0x00000010, 0x00100010, 0x00001010, 0x00101010,
26 0x00000001, 0x00100001, 0x00001001, 0x00101001,
27 0x00000011, 0x00100011, 0x00001011, 0x00101011
29 /* pc2_c_1 bit pattern 5 24 7 16 6 10 */
30 static int pc2_c_1
[64] = {
31 0x00000000, 0x00004000, 0x00040000, 0x00044000,
32 0x00000100, 0x00004100, 0x00040100, 0x00044100,
33 0x00020000, 0x00024000, 0x00060000, 0x00064000,
34 0x00020100, 0x00024100, 0x00060100, 0x00064100,
35 0x00000001, 0x00004001, 0x00040001, 0x00044001,
36 0x00000101, 0x00004101, 0x00040101, 0x00044101,
37 0x00020001, 0x00024001, 0x00060001, 0x00064001,
38 0x00020101, 0x00024101, 0x00060101, 0x00064101,
39 0x00080000, 0x00084000, 0x000c0000, 0x000c4000,
40 0x00080100, 0x00084100, 0x000c0100, 0x000c4100,
41 0x000a0000, 0x000a4000, 0x000e0000, 0x000e4000,
42 0x000a0100, 0x000a4100, 0x000e0100, 0x000e4100,
43 0x00080001, 0x00084001, 0x000c0001, 0x000c4001,
44 0x00080101, 0x00084101, 0x000c0101, 0x000c4101,
45 0x000a0001, 0x000a4001, 0x000e0001, 0x000e4001,
46 0x000a0101, 0x000a4101, 0x000e0101, 0x000e4101
48 /* pc2_c_2 bit pattern 20 18 12 3 15 23 */
49 static int pc2_c_2
[64] = {
50 0x00000000, 0x00000002, 0x00000200, 0x00000202,
51 0x00200000, 0x00200002, 0x00200200, 0x00200202,
52 0x00001000, 0x00001002, 0x00001200, 0x00001202,
53 0x00201000, 0x00201002, 0x00201200, 0x00201202,
54 0x00000040, 0x00000042, 0x00000240, 0x00000242,
55 0x00200040, 0x00200042, 0x00200240, 0x00200242,
56 0x00001040, 0x00001042, 0x00001240, 0x00001242,
57 0x00201040, 0x00201042, 0x00201240, 0x00201242,
58 0x00000010, 0x00000012, 0x00000210, 0x00000212,
59 0x00200010, 0x00200012, 0x00200210, 0x00200212,
60 0x00001010, 0x00001012, 0x00001210, 0x00001212,
61 0x00201010, 0x00201012, 0x00201210, 0x00201212,
62 0x00000050, 0x00000052, 0x00000250, 0x00000252,
63 0x00200050, 0x00200052, 0x00200250, 0x00200252,
64 0x00001050, 0x00001052, 0x00001250, 0x00001252,
65 0x00201050, 0x00201052, 0x00201250, 0x00201252
67 /* pc2_c_3 bit pattern 1 9 19 2 14 22 */
68 static int pc2_c_3
[64] = {
69 0x00000000, 0x00000004, 0x00000400, 0x00000404,
70 0x00400000, 0x00400004, 0x00400400, 0x00400404,
71 0x00000020, 0x00000024, 0x00000420, 0x00000424,
72 0x00400020, 0x00400024, 0x00400420, 0x00400424,
73 0x00008000, 0x00008004, 0x00008400, 0x00008404,
74 0x00408000, 0x00408004, 0x00408400, 0x00408404,
75 0x00008020, 0x00008024, 0x00008420, 0x00008424,
76 0x00408020, 0x00408024, 0x00408420, 0x00408424,
77 0x00800000, 0x00800004, 0x00800400, 0x00800404,
78 0x00c00000, 0x00c00004, 0x00c00400, 0x00c00404,
79 0x00800020, 0x00800024, 0x00800420, 0x00800424,
80 0x00c00020, 0x00c00024, 0x00c00420, 0x00c00424,
81 0x00808000, 0x00808004, 0x00808400, 0x00808404,
82 0x00c08000, 0x00c08004, 0x00c08400, 0x00c08404,
83 0x00808020, 0x00808024, 0x00808420, 0x00808424,
84 0x00c08020, 0x00c08024, 0x00c08420, 0x00c08424
86 /* pc2_c_4 bit pattern 11 13 4 17 21 8 */
87 static int pc2_c_4
[64] = {
88 0x00000000, 0x00010000, 0x00000008, 0x00010008,
89 0x00000080, 0x00010080, 0x00000088, 0x00010088,
90 0x00100000, 0x00110000, 0x00100008, 0x00110008,
91 0x00100080, 0x00110080, 0x00100088, 0x00110088,
92 0x00000800, 0x00010800, 0x00000808, 0x00010808,
93 0x00000880, 0x00010880, 0x00000888, 0x00010888,
94 0x00100800, 0x00110800, 0x00100808, 0x00110808,
95 0x00100880, 0x00110880, 0x00100888, 0x00110888,
96 0x00002000, 0x00012000, 0x00002008, 0x00012008,
97 0x00002080, 0x00012080, 0x00002088, 0x00012088,
98 0x00102000, 0x00112000, 0x00102008, 0x00112008,
99 0x00102080, 0x00112080, 0x00102088, 0x00112088,
100 0x00002800, 0x00012800, 0x00002808, 0x00012808,
101 0x00002880, 0x00012880, 0x00002888, 0x00012888,
102 0x00102800, 0x00112800, 0x00102808, 0x00112808,
103 0x00102880, 0x00112880, 0x00102888, 0x00112888
105 /* pc2_d_1 bit pattern 51 35 31 52 39 45 */
106 static int pc2_d_1
[64] = {
107 0x00000000, 0x00000080, 0x00002000, 0x00002080,
108 0x00000001, 0x00000081, 0x00002001, 0x00002081,
109 0x00200000, 0x00200080, 0x00202000, 0x00202080,
110 0x00200001, 0x00200081, 0x00202001, 0x00202081,
111 0x00020000, 0x00020080, 0x00022000, 0x00022080,
112 0x00020001, 0x00020081, 0x00022001, 0x00022081,
113 0x00220000, 0x00220080, 0x00222000, 0x00222080,
114 0x00220001, 0x00220081, 0x00222001, 0x00222081,
115 0x00000002, 0x00000082, 0x00002002, 0x00002082,
116 0x00000003, 0x00000083, 0x00002003, 0x00002083,
117 0x00200002, 0x00200082, 0x00202002, 0x00202082,
118 0x00200003, 0x00200083, 0x00202003, 0x00202083,
119 0x00020002, 0x00020082, 0x00022002, 0x00022082,
120 0x00020003, 0x00020083, 0x00022003, 0x00022083,
121 0x00220002, 0x00220082, 0x00222002, 0x00222082,
122 0x00220003, 0x00220083, 0x00222003, 0x00222083
124 /* pc2_d_2 bit pattern 50 32 43 36 29 48 */
125 static int pc2_d_2
[64] = {
126 0x00000000, 0x00000010, 0x00800000, 0x00800010,
127 0x00010000, 0x00010010, 0x00810000, 0x00810010,
128 0x00000200, 0x00000210, 0x00800200, 0x00800210,
129 0x00010200, 0x00010210, 0x00810200, 0x00810210,
130 0x00100000, 0x00100010, 0x00900000, 0x00900010,
131 0x00110000, 0x00110010, 0x00910000, 0x00910010,
132 0x00100200, 0x00100210, 0x00900200, 0x00900210,
133 0x00110200, 0x00110210, 0x00910200, 0x00910210,
134 0x00000004, 0x00000014, 0x00800004, 0x00800014,
135 0x00010004, 0x00010014, 0x00810004, 0x00810014,
136 0x00000204, 0x00000214, 0x00800204, 0x00800214,
137 0x00010204, 0x00010214, 0x00810204, 0x00810214,
138 0x00100004, 0x00100014, 0x00900004, 0x00900014,
139 0x00110004, 0x00110014, 0x00910004, 0x00910014,
140 0x00100204, 0x00100214, 0x00900204, 0x00900214,
141 0x00110204, 0x00110214, 0x00910204, 0x00910214
143 /* pc2_d_3 bit pattern 41 38 47 33 40 42 */
144 static int pc2_d_3
[64] = {
145 0x00000000, 0x00000400, 0x00001000, 0x00001400,
146 0x00080000, 0x00080400, 0x00081000, 0x00081400,
147 0x00000020, 0x00000420, 0x00001020, 0x00001420,
148 0x00080020, 0x00080420, 0x00081020, 0x00081420,
149 0x00004000, 0x00004400, 0x00005000, 0x00005400,
150 0x00084000, 0x00084400, 0x00085000, 0x00085400,
151 0x00004020, 0x00004420, 0x00005020, 0x00005420,
152 0x00084020, 0x00084420, 0x00085020, 0x00085420,
153 0x00000800, 0x00000c00, 0x00001800, 0x00001c00,
154 0x00080800, 0x00080c00, 0x00081800, 0x00081c00,
155 0x00000820, 0x00000c20, 0x00001820, 0x00001c20,
156 0x00080820, 0x00080c20, 0x00081820, 0x00081c20,
157 0x00004800, 0x00004c00, 0x00005800, 0x00005c00,
158 0x00084800, 0x00084c00, 0x00085800, 0x00085c00,
159 0x00004820, 0x00004c20, 0x00005820, 0x00005c20,
160 0x00084820, 0x00084c20, 0x00085820, 0x00085c20
162 /* pc2_d_4 bit pattern 49 37 30 46 34 44 */
163 static int pc2_d_4
[64] = {
164 0x00000000, 0x00000100, 0x00040000, 0x00040100,
165 0x00000040, 0x00000140, 0x00040040, 0x00040140,
166 0x00400000, 0x00400100, 0x00440000, 0x00440100,
167 0x00400040, 0x00400140, 0x00440040, 0x00440140,
168 0x00008000, 0x00008100, 0x00048000, 0x00048100,
169 0x00008040, 0x00008140, 0x00048040, 0x00048140,
170 0x00408000, 0x00408100, 0x00448000, 0x00448100,
171 0x00408040, 0x00408140, 0x00448040, 0x00448140,
172 0x00000008, 0x00000108, 0x00040008, 0x00040108,
173 0x00000048, 0x00000148, 0x00040048, 0x00040148,
174 0x00400008, 0x00400108, 0x00440008, 0x00440108,
175 0x00400048, 0x00400148, 0x00440048, 0x00440148,
176 0x00008008, 0x00008108, 0x00048008, 0x00048108,
177 0x00008048, 0x00008148, 0x00048048, 0x00048148,
178 0x00408008, 0x00408108, 0x00448008, 0x00448108,
179 0x00408048, 0x00408148, 0x00448048, 0x00448148
181 static unsigned char odd_parity
[256] = {
182 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
183 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
184 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47,
185 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62,
186 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79,
187 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94,
188 97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110,
189 112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127,
190 128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143,
191 145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158,
192 161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174,
193 176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191,
194 193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206,
195 208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223,
196 224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239,
197 241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254,