1 /*
2  *  Original code is derived from the authors:
3  *  Vincent Rijment, Antoon Bosselaers, Paulo Barreto
4  */
5 
6 #include <string.h>
7 #include <stdlib.h>
8 #include "rijndael.h"
9 
10 
11 const unsigned char S[256] = {
12   99, 124, 119, 123, 242, 107, 111, 197,
13   48,   1, 103,  43, 254, 215, 171, 118,
14   202, 130, 201, 125, 250,  89,  71, 240,
15   173, 212, 162, 175, 156, 164, 114, 192,
16   183, 253, 147,  38,  54,  63, 247, 204,
17   52, 165, 229, 241, 113, 216,  49,  21,
18   4, 199,  35, 195,  24, 150,   5, 154,
19   7,  18, 128, 226, 235,  39, 178, 117,
20   9, 131,  44,  26,  27, 110,  90, 160,
21   82,  59, 214, 179,  41, 227,  47, 132,
22   83, 209,   0, 237,  32, 252, 177,  91,
23   106, 203, 190,  57,  74,  76,  88, 207,
24   208, 239, 170, 251,  67,  77,  51, 133,
25   69, 249,   2, 127,  80,  60, 159, 168,
26   81, 163,  64, 143, 146, 157,  56, 245,
27   188, 182, 218,  33,  16, 255, 243, 210,
28   205,  12,  19, 236,  95, 151,  68,  23,
29   196, 167, 126,  61, 100,  93,  25, 115,
30   96, 129,  79, 220,  34,  42, 144, 136,
31   70, 238, 184,  20, 222,  94,  11, 219,
32   224,  50,  58,  10,  73,   6,  36,  92,
33   194, 211, 172,  98, 145, 149, 228, 121,
34   231, 200,  55, 109, 141, 213,  78, 169,
35   108,  86, 244, 234, 101, 122, 174,   8,
36   186, 120,  37,  46,  28, 166, 180, 198,
37   232, 221, 116,  31,  75, 189, 139, 138,
38   112,  62, 181, 102,  72,   3, 246,  14,
39   97,  53,  87, 185, 134, 193,  29, 158,
40   225, 248, 152,  17, 105, 217, 142, 148,
41   155,  30, 135, 233, 206,  85,  40, 223,
42   140, 161, 137,  13, 191, 230,  66, 104,
43   65, 153,  45,  15, 176,  84, 187,  22
44 };
45 
46 
47 const unsigned char T1[256][4] = {
48   { 0xc6,0x63,0x63,0xa5 }, { 0xf8,0x7c,0x7c,0x84 },
49   { 0xee,0x77,0x77,0x99 }, { 0xf6,0x7b,0x7b,0x8d },
50   { 0xff,0xf2,0xf2,0x0d }, { 0xd6,0x6b,0x6b,0xbd },
51   { 0xde,0x6f,0x6f,0xb1 }, { 0x91,0xc5,0xc5,0x54 },
52   { 0x60,0x30,0x30,0x50 }, { 0x02,0x01,0x01,0x03 },
53   { 0xce,0x67,0x67,0xa9 }, { 0x56,0x2b,0x2b,0x7d },
54   { 0xe7,0xfe,0xfe,0x19 }, { 0xb5,0xd7,0xd7,0x62 },
55   { 0x4d,0xab,0xab,0xe6 }, { 0xec,0x76,0x76,0x9a },
56   { 0x8f,0xca,0xca,0x45 }, { 0x1f,0x82,0x82,0x9d },
57   { 0x89,0xc9,0xc9,0x40 }, { 0xfa,0x7d,0x7d,0x87 },
58   { 0xef,0xfa,0xfa,0x15 }, { 0xb2,0x59,0x59,0xeb },
59   { 0x8e,0x47,0x47,0xc9 }, { 0xfb,0xf0,0xf0,0x0b },
60   { 0x41,0xad,0xad,0xec }, { 0xb3,0xd4,0xd4,0x67 },
61   { 0x5f,0xa2,0xa2,0xfd }, { 0x45,0xaf,0xaf,0xea },
62   { 0x23,0x9c,0x9c,0xbf }, { 0x53,0xa4,0xa4,0xf7 },
63   { 0xe4,0x72,0x72,0x96 }, { 0x9b,0xc0,0xc0,0x5b },
64   { 0x75,0xb7,0xb7,0xc2 }, { 0xe1,0xfd,0xfd,0x1c },
65   { 0x3d,0x93,0x93,0xae }, { 0x4c,0x26,0x26,0x6a },
66   { 0x6c,0x36,0x36,0x5a }, { 0x7e,0x3f,0x3f,0x41 },
67   { 0xf5,0xf7,0xf7,0x02 }, { 0x83,0xcc,0xcc,0x4f },
68   { 0x68,0x34,0x34,0x5c }, { 0x51,0xa5,0xa5,0xf4 },
69   { 0xd1,0xe5,0xe5,0x34 }, { 0xf9,0xf1,0xf1,0x08 },
70   { 0xe2,0x71,0x71,0x93 }, { 0xab,0xd8,0xd8,0x73 },
71   { 0x62,0x31,0x31,0x53 }, { 0x2a,0x15,0x15,0x3f },
72   { 0x08,0x04,0x04,0x0c }, { 0x95,0xc7,0xc7,0x52 },
73   { 0x46,0x23,0x23,0x65 }, { 0x9d,0xc3,0xc3,0x5e },
74   { 0x30,0x18,0x18,0x28 }, { 0x37,0x96,0x96,0xa1 },
75   { 0x0a,0x05,0x05,0x0f }, { 0x2f,0x9a,0x9a,0xb5 },
76   { 0x0e,0x07,0x07,0x09 }, { 0x24,0x12,0x12,0x36 },
77   { 0x1b,0x80,0x80,0x9b }, { 0xdf,0xe2,0xe2,0x3d },
78   { 0xcd,0xeb,0xeb,0x26 }, { 0x4e,0x27,0x27,0x69 },
79   { 0x7f,0xb2,0xb2,0xcd }, { 0xea,0x75,0x75,0x9f },
80   { 0x12,0x09,0x09,0x1b }, { 0x1d,0x83,0x83,0x9e },
81   { 0x58,0x2c,0x2c,0x74 }, { 0x34,0x1a,0x1a,0x2e },
82   { 0x36,0x1b,0x1b,0x2d }, { 0xdc,0x6e,0x6e,0xb2 },
83   { 0xb4,0x5a,0x5a,0xee }, { 0x5b,0xa0,0xa0,0xfb },
84   { 0xa4,0x52,0x52,0xf6 }, { 0x76,0x3b,0x3b,0x4d },
85   { 0xb7,0xd6,0xd6,0x61 }, { 0x7d,0xb3,0xb3,0xce },
86   { 0x52,0x29,0x29,0x7b }, { 0xdd,0xe3,0xe3,0x3e },
87   { 0x5e,0x2f,0x2f,0x71 }, { 0x13,0x84,0x84,0x97 },
88   { 0xa6,0x53,0x53,0xf5 }, { 0xb9,0xd1,0xd1,0x68 },
89   { 0x00,0x00,0x00,0x00 }, { 0xc1,0xed,0xed,0x2c },
90   { 0x40,0x20,0x20,0x60 }, { 0xe3,0xfc,0xfc,0x1f },
91   { 0x79,0xb1,0xb1,0xc8 }, { 0xb6,0x5b,0x5b,0xed },
92   { 0xd4,0x6a,0x6a,0xbe }, { 0x8d,0xcb,0xcb,0x46 },
93   { 0x67,0xbe,0xbe,0xd9 }, { 0x72,0x39,0x39,0x4b },
94   { 0x94,0x4a,0x4a,0xde }, { 0x98,0x4c,0x4c,0xd4 },
95   { 0xb0,0x58,0x58,0xe8 }, { 0x85,0xcf,0xcf,0x4a },
96   { 0xbb,0xd0,0xd0,0x6b }, { 0xc5,0xef,0xef,0x2a },
97   { 0x4f,0xaa,0xaa,0xe5 }, { 0xed,0xfb,0xfb,0x16 },
98   { 0x86,0x43,0x43,0xc5 }, { 0x9a,0x4d,0x4d,0xd7 },
99   { 0x66,0x33,0x33,0x55 }, { 0x11,0x85,0x85,0x94 },
100   { 0x8a,0x45,0x45,0xcf }, { 0xe9,0xf9,0xf9,0x10 },
101   { 0x04,0x02,0x02,0x06 }, { 0xfe,0x7f,0x7f,0x81 },
102   { 0xa0,0x50,0x50,0xf0 }, { 0x78,0x3c,0x3c,0x44 },
103   { 0x25,0x9f,0x9f,0xba }, { 0x4b,0xa8,0xa8,0xe3 },
104   { 0xa2,0x51,0x51,0xf3 }, { 0x5d,0xa3,0xa3,0xfe },
105   { 0x80,0x40,0x40,0xc0 }, { 0x05,0x8f,0x8f,0x8a },
106   { 0x3f,0x92,0x92,0xad }, { 0x21,0x9d,0x9d,0xbc },
107   { 0x70,0x38,0x38,0x48 }, { 0xf1,0xf5,0xf5,0x04 },
108   { 0x63,0xbc,0xbc,0xdf }, { 0x77,0xb6,0xb6,0xc1 },
109   { 0xaf,0xda,0xda,0x75 }, { 0x42,0x21,0x21,0x63 },
110   { 0x20,0x10,0x10,0x30 }, { 0xe5,0xff,0xff,0x1a },
111   { 0xfd,0xf3,0xf3,0x0e }, { 0xbf,0xd2,0xd2,0x6d },
112   { 0x81,0xcd,0xcd,0x4c }, { 0x18,0x0c,0x0c,0x14 },
113   { 0x26,0x13,0x13,0x35 }, { 0xc3,0xec,0xec,0x2f },
114   { 0xbe,0x5f,0x5f,0xe1 }, { 0x35,0x97,0x97,0xa2 },
115   { 0x88,0x44,0x44,0xcc }, { 0x2e,0x17,0x17,0x39 },
116   { 0x93,0xc4,0xc4,0x57 }, { 0x55,0xa7,0xa7,0xf2 },
117   { 0xfc,0x7e,0x7e,0x82 }, { 0x7a,0x3d,0x3d,0x47 },
118   { 0xc8,0x64,0x64,0xac }, { 0xba,0x5d,0x5d,0xe7 },
119   { 0x32,0x19,0x19,0x2b }, { 0xe6,0x73,0x73,0x95 },
120   { 0xc0,0x60,0x60,0xa0 }, { 0x19,0x81,0x81,0x98 },
121   { 0x9e,0x4f,0x4f,0xd1 }, { 0xa3,0xdc,0xdc,0x7f },
122   { 0x44,0x22,0x22,0x66 }, { 0x54,0x2a,0x2a,0x7e },
123   { 0x3b,0x90,0x90,0xab }, { 0x0b,0x88,0x88,0x83 },
124   { 0x8c,0x46,0x46,0xca }, { 0xc7,0xee,0xee,0x29 },
125   { 0x6b,0xb8,0xb8,0xd3 }, { 0x28,0x14,0x14,0x3c },
126   { 0xa7,0xde,0xde,0x79 }, { 0xbc,0x5e,0x5e,0xe2 },
127   { 0x16,0x0b,0x0b,0x1d }, { 0xad,0xdb,0xdb,0x76 },
128   { 0xdb,0xe0,0xe0,0x3b }, { 0x64,0x32,0x32,0x56 },
129   { 0x74,0x3a,0x3a,0x4e }, { 0x14,0x0a,0x0a,0x1e },
130   { 0x92,0x49,0x49,0xdb }, { 0x0c,0x06,0x06,0x0a },
131   { 0x48,0x24,0x24,0x6c }, { 0xb8,0x5c,0x5c,0xe4 },
132   { 0x9f,0xc2,0xc2,0x5d }, { 0xbd,0xd3,0xd3,0x6e },
133   { 0x43,0xac,0xac,0xef }, { 0xc4,0x62,0x62,0xa6 },
134   { 0x39,0x91,0x91,0xa8 }, { 0x31,0x95,0x95,0xa4 },
135   { 0xd3,0xe4,0xe4,0x37 }, { 0xf2,0x79,0x79,0x8b },
136   { 0xd5,0xe7,0xe7,0x32 }, { 0x8b,0xc8,0xc8,0x43 },
137   { 0x6e,0x37,0x37,0x59 }, { 0xda,0x6d,0x6d,0xb7 },
138   { 0x01,0x8d,0x8d,0x8c }, { 0xb1,0xd5,0xd5,0x64 },
139   { 0x9c,0x4e,0x4e,0xd2 }, { 0x49,0xa9,0xa9,0xe0 },
140   { 0xd8,0x6c,0x6c,0xb4 }, { 0xac,0x56,0x56,0xfa },
141   { 0xf3,0xf4,0xf4,0x07 }, { 0xcf,0xea,0xea,0x25 },
142   { 0xca,0x65,0x65,0xaf }, { 0xf4,0x7a,0x7a,0x8e },
143   { 0x47,0xae,0xae,0xe9 }, { 0x10,0x08,0x08,0x18 },
144   { 0x6f,0xba,0xba,0xd5 }, { 0xf0,0x78,0x78,0x88 },
145   { 0x4a,0x25,0x25,0x6f }, { 0x5c,0x2e,0x2e,0x72 },
146   { 0x38,0x1c,0x1c,0x24 }, { 0x57,0xa6,0xa6,0xf1 },
147   { 0x73,0xb4,0xb4,0xc7 }, { 0x97,0xc6,0xc6,0x51 },
148   { 0xcb,0xe8,0xe8,0x23 }, { 0xa1,0xdd,0xdd,0x7c },
149   { 0xe8,0x74,0x74,0x9c }, { 0x3e,0x1f,0x1f,0x21 },
150   { 0x96,0x4b,0x4b,0xdd }, { 0x61,0xbd,0xbd,0xdc },
151   { 0x0d,0x8b,0x8b,0x86 }, { 0x0f,0x8a,0x8a,0x85 },
152   { 0xe0,0x70,0x70,0x90 }, { 0x7c,0x3e,0x3e,0x42 },
153   { 0x71,0xb5,0xb5,0xc4 }, { 0xcc,0x66,0x66,0xaa },
154   { 0x90,0x48,0x48,0xd8 }, { 0x06,0x03,0x03,0x05 },
155   { 0xf7,0xf6,0xf6,0x01 }, { 0x1c,0x0e,0x0e,0x12 },
156   { 0xc2,0x61,0x61,0xa3 }, { 0x6a,0x35,0x35,0x5f },
157   { 0xae,0x57,0x57,0xf9 }, { 0x69,0xb9,0xb9,0xd0 },
158   { 0x17,0x86,0x86,0x91 }, { 0x99,0xc1,0xc1,0x58 },
159   { 0x3a,0x1d,0x1d,0x27 }, { 0x27,0x9e,0x9e,0xb9 },
160   { 0xd9,0xe1,0xe1,0x38 }, { 0xeb,0xf8,0xf8,0x13 },
161   { 0x2b,0x98,0x98,0xb3 }, { 0x22,0x11,0x11,0x33 },
162   { 0xd2,0x69,0x69,0xbb }, { 0xa9,0xd9,0xd9,0x70 },
163   { 0x07,0x8e,0x8e,0x89 }, { 0x33,0x94,0x94,0xa7 },
164   { 0x2d,0x9b,0x9b,0xb6 }, { 0x3c,0x1e,0x1e,0x22 },
165   { 0x15,0x87,0x87,0x92 }, { 0xc9,0xe9,0xe9,0x20 },
166   { 0x87,0xce,0xce,0x49 }, { 0xaa,0x55,0x55,0xff },
167   { 0x50,0x28,0x28,0x78 }, { 0xa5,0xdf,0xdf,0x7a },
168   { 0x03,0x8c,0x8c,0x8f }, { 0x59,0xa1,0xa1,0xf8 },
169   { 0x09,0x89,0x89,0x80 }, { 0x1a,0x0d,0x0d,0x17 },
170   { 0x65,0xbf,0xbf,0xda }, { 0xd7,0xe6,0xe6,0x31 },
171   { 0x84,0x42,0x42,0xc6 }, { 0xd0,0x68,0x68,0xb8 },
172   { 0x82,0x41,0x41,0xc3 }, { 0x29,0x99,0x99,0xb0 },
173   { 0x5a,0x2d,0x2d,0x77 }, { 0x1e,0x0f,0x0f,0x11 },
174   { 0x7b,0xb0,0xb0,0xcb }, { 0xa8,0x54,0x54,0xfc },
175   { 0x6d,0xbb,0xbb,0xd6 }, { 0x2c,0x16,0x16,0x3a }
176 };
177 
178 const unsigned char T2[256][4] = {
179   { 0xa5,0xc6,0x63,0x63 }, { 0x84,0xf8,0x7c,0x7c },
180   { 0x99,0xee,0x77,0x77 }, { 0x8d,0xf6,0x7b,0x7b },
181   { 0x0d,0xff,0xf2,0xf2 }, { 0xbd,0xd6,0x6b,0x6b },
182   { 0xb1,0xde,0x6f,0x6f }, { 0x54,0x91,0xc5,0xc5 },
183   { 0x50,0x60,0x30,0x30 }, { 0x03,0x02,0x01,0x01 },
184   { 0xa9,0xce,0x67,0x67 }, { 0x7d,0x56,0x2b,0x2b },
185   { 0x19,0xe7,0xfe,0xfe }, { 0x62,0xb5,0xd7,0xd7 },
186   { 0xe6,0x4d,0xab,0xab }, { 0x9a,0xec,0x76,0x76 },
187   { 0x45,0x8f,0xca,0xca }, { 0x9d,0x1f,0x82,0x82 },
188   { 0x40,0x89,0xc9,0xc9 }, { 0x87,0xfa,0x7d,0x7d },
189   { 0x15,0xef,0xfa,0xfa }, { 0xeb,0xb2,0x59,0x59 },
190   { 0xc9,0x8e,0x47,0x47 }, { 0x0b,0xfb,0xf0,0xf0 },
191   { 0xec,0x41,0xad,0xad }, { 0x67,0xb3,0xd4,0xd4 },
192   { 0xfd,0x5f,0xa2,0xa2 }, { 0xea,0x45,0xaf,0xaf },
193   { 0xbf,0x23,0x9c,0x9c }, { 0xf7,0x53,0xa4,0xa4 },
194   { 0x96,0xe4,0x72,0x72 }, { 0x5b,0x9b,0xc0,0xc0 },
195   { 0xc2,0x75,0xb7,0xb7 }, { 0x1c,0xe1,0xfd,0xfd },
196   { 0xae,0x3d,0x93,0x93 }, { 0x6a,0x4c,0x26,0x26 },
197   { 0x5a,0x6c,0x36,0x36 }, { 0x41,0x7e,0x3f,0x3f },
198   { 0x02,0xf5,0xf7,0xf7 }, { 0x4f,0x83,0xcc,0xcc },
199   { 0x5c,0x68,0x34,0x34 }, { 0xf4,0x51,0xa5,0xa5 },
200   { 0x34,0xd1,0xe5,0xe5 }, { 0x08,0xf9,0xf1,0xf1 },
201   { 0x93,0xe2,0x71,0x71 }, { 0x73,0xab,0xd8,0xd8 },
202   { 0x53,0x62,0x31,0x31 }, { 0x3f,0x2a,0x15,0x15 },
203   { 0x0c,0x08,0x04,0x04 }, { 0x52,0x95,0xc7,0xc7 },
204   { 0x65,0x46,0x23,0x23 }, { 0x5e,0x9d,0xc3,0xc3 },
205   { 0x28,0x30,0x18,0x18 }, { 0xa1,0x37,0x96,0x96 },
206   { 0x0f,0x0a,0x05,0x05 }, { 0xb5,0x2f,0x9a,0x9a },
207   { 0x09,0x0e,0x07,0x07 }, { 0x36,0x24,0x12,0x12 },
208   { 0x9b,0x1b,0x80,0x80 }, { 0x3d,0xdf,0xe2,0xe2 },
209   { 0x26,0xcd,0xeb,0xeb }, { 0x69,0x4e,0x27,0x27 },
210   { 0xcd,0x7f,0xb2,0xb2 }, { 0x9f,0xea,0x75,0x75 },
211   { 0x1b,0x12,0x09,0x09 }, { 0x9e,0x1d,0x83,0x83 },
212   { 0x74,0x58,0x2c,0x2c }, { 0x2e,0x34,0x1a,0x1a },
213   { 0x2d,0x36,0x1b,0x1b }, { 0xb2,0xdc,0x6e,0x6e },
214   { 0xee,0xb4,0x5a,0x5a }, { 0xfb,0x5b,0xa0,0xa0 },
215   { 0xf6,0xa4,0x52,0x52 }, { 0x4d,0x76,0x3b,0x3b },
216   { 0x61,0xb7,0xd6,0xd6 }, { 0xce,0x7d,0xb3,0xb3 },
217   { 0x7b,0x52,0x29,0x29 }, { 0x3e,0xdd,0xe3,0xe3 },
218   { 0x71,0x5e,0x2f,0x2f }, { 0x97,0x13,0x84,0x84 },
219   { 0xf5,0xa6,0x53,0x53 }, { 0x68,0xb9,0xd1,0xd1 },
220   { 0x00,0x00,0x00,0x00 }, { 0x2c,0xc1,0xed,0xed },
221   { 0x60,0x40,0x20,0x20 }, { 0x1f,0xe3,0xfc,0xfc },
222   { 0xc8,0x79,0xb1,0xb1 }, { 0xed,0xb6,0x5b,0x5b },
223   { 0xbe,0xd4,0x6a,0x6a }, { 0x46,0x8d,0xcb,0xcb },
224   { 0xd9,0x67,0xbe,0xbe }, { 0x4b,0x72,0x39,0x39 },
225   { 0xde,0x94,0x4a,0x4a }, { 0xd4,0x98,0x4c,0x4c },
226   { 0xe8,0xb0,0x58,0x58 }, { 0x4a,0x85,0xcf,0xcf },
227   { 0x6b,0xbb,0xd0,0xd0 }, { 0x2a,0xc5,0xef,0xef },
228   { 0xe5,0x4f,0xaa,0xaa }, { 0x16,0xed,0xfb,0xfb },
229   { 0xc5,0x86,0x43,0x43 }, { 0xd7,0x9a,0x4d,0x4d },
230   { 0x55,0x66,0x33,0x33 }, { 0x94,0x11,0x85,0x85 },
231   { 0xcf,0x8a,0x45,0x45 }, { 0x10,0xe9,0xf9,0xf9 },
232   { 0x06,0x04,0x02,0x02 }, { 0x81,0xfe,0x7f,0x7f },
233   { 0xf0,0xa0,0x50,0x50 }, { 0x44,0x78,0x3c,0x3c },
234   { 0xba,0x25,0x9f,0x9f }, { 0xe3,0x4b,0xa8,0xa8 },
235   { 0xf3,0xa2,0x51,0x51 }, { 0xfe,0x5d,0xa3,0xa3 },
236   { 0xc0,0x80,0x40,0x40 }, { 0x8a,0x05,0x8f,0x8f },
237   { 0xad,0x3f,0x92,0x92 }, { 0xbc,0x21,0x9d,0x9d },
238   { 0x48,0x70,0x38,0x38 }, { 0x04,0xf1,0xf5,0xf5 },
239   { 0xdf,0x63,0xbc,0xbc }, { 0xc1,0x77,0xb6,0xb6 },
240   { 0x75,0xaf,0xda,0xda }, { 0x63,0x42,0x21,0x21 },
241   { 0x30,0x20,0x10,0x10 }, { 0x1a,0xe5,0xff,0xff },
242   { 0x0e,0xfd,0xf3,0xf3 }, { 0x6d,0xbf,0xd2,0xd2 },
243   { 0x4c,0x81,0xcd,0xcd }, { 0x14,0x18,0x0c,0x0c },
244   { 0x35,0x26,0x13,0x13 }, { 0x2f,0xc3,0xec,0xec },
245   { 0xe1,0xbe,0x5f,0x5f }, { 0xa2,0x35,0x97,0x97 },
246   { 0xcc,0x88,0x44,0x44 }, { 0x39,0x2e,0x17,0x17 },
247   { 0x57,0x93,0xc4,0xc4 }, { 0xf2,0x55,0xa7,0xa7 },
248   { 0x82,0xfc,0x7e,0x7e }, { 0x47,0x7a,0x3d,0x3d },
249   { 0xac,0xc8,0x64,0x64 }, { 0xe7,0xba,0x5d,0x5d },
250   { 0x2b,0x32,0x19,0x19 }, { 0x95,0xe6,0x73,0x73 },
251   { 0xa0,0xc0,0x60,0x60 }, { 0x98,0x19,0x81,0x81 },
252   { 0xd1,0x9e,0x4f,0x4f }, { 0x7f,0xa3,0xdc,0xdc },
253   { 0x66,0x44,0x22,0x22 }, { 0x7e,0x54,0x2a,0x2a },
254   { 0xab,0x3b,0x90,0x90 }, { 0x83,0x0b,0x88,0x88 },
255   { 0xca,0x8c,0x46,0x46 }, { 0x29,0xc7,0xee,0xee },
256   { 0xd3,0x6b,0xb8,0xb8 }, { 0x3c,0x28,0x14,0x14 },
257   { 0x79,0xa7,0xde,0xde }, { 0xe2,0xbc,0x5e,0x5e },
258   { 0x1d,0x16,0x0b,0x0b }, { 0x76,0xad,0xdb,0xdb },
259   { 0x3b,0xdb,0xe0,0xe0 }, { 0x56,0x64,0x32,0x32 },
260   { 0x4e,0x74,0x3a,0x3a }, { 0x1e,0x14,0x0a,0x0a },
261   { 0xdb,0x92,0x49,0x49 }, { 0x0a,0x0c,0x06,0x06 },
262   { 0x6c,0x48,0x24,0x24 }, { 0xe4,0xb8,0x5c,0x5c },
263   { 0x5d,0x9f,0xc2,0xc2 }, { 0x6e,0xbd,0xd3,0xd3 },
264   { 0xef,0x43,0xac,0xac }, { 0xa6,0xc4,0x62,0x62 },
265   { 0xa8,0x39,0x91,0x91 }, { 0xa4,0x31,0x95,0x95 },
266   { 0x37,0xd3,0xe4,0xe4 }, { 0x8b,0xf2,0x79,0x79 },
267   { 0x32,0xd5,0xe7,0xe7 }, { 0x43,0x8b,0xc8,0xc8 },
268   { 0x59,0x6e,0x37,0x37 }, { 0xb7,0xda,0x6d,0x6d },
269   { 0x8c,0x01,0x8d,0x8d }, { 0x64,0xb1,0xd5,0xd5 },
270   { 0xd2,0x9c,0x4e,0x4e }, { 0xe0,0x49,0xa9,0xa9 },
271   { 0xb4,0xd8,0x6c,0x6c }, { 0xfa,0xac,0x56,0x56 },
272   { 0x07,0xf3,0xf4,0xf4 }, { 0x25,0xcf,0xea,0xea },
273   { 0xaf,0xca,0x65,0x65 }, { 0x8e,0xf4,0x7a,0x7a },
274   { 0xe9,0x47,0xae,0xae }, { 0x18,0x10,0x08,0x08 },
275   { 0xd5,0x6f,0xba,0xba }, { 0x88,0xf0,0x78,0x78 },
276   { 0x6f,0x4a,0x25,0x25 }, { 0x72,0x5c,0x2e,0x2e },
277   { 0x24,0x38,0x1c,0x1c }, { 0xf1,0x57,0xa6,0xa6 },
278   { 0xc7,0x73,0xb4,0xb4 }, { 0x51,0x97,0xc6,0xc6 },
279   { 0x23,0xcb,0xe8,0xe8 }, { 0x7c,0xa1,0xdd,0xdd },
280   { 0x9c,0xe8,0x74,0x74 }, { 0x21,0x3e,0x1f,0x1f },
281   { 0xdd,0x96,0x4b,0x4b }, { 0xdc,0x61,0xbd,0xbd },
282   { 0x86,0x0d,0x8b,0x8b }, { 0x85,0x0f,0x8a,0x8a },
283   { 0x90,0xe0,0x70,0x70 }, { 0x42,0x7c,0x3e,0x3e },
284   { 0xc4,0x71,0xb5,0xb5 }, { 0xaa,0xcc,0x66,0x66 },
285   { 0xd8,0x90,0x48,0x48 }, { 0x05,0x06,0x03,0x03 },
286   { 0x01,0xf7,0xf6,0xf6 }, { 0x12,0x1c,0x0e,0x0e },
287   { 0xa3,0xc2,0x61,0x61 }, { 0x5f,0x6a,0x35,0x35 },
288   { 0xf9,0xae,0x57,0x57 }, { 0xd0,0x69,0xb9,0xb9 },
289   { 0x91,0x17,0x86,0x86 }, { 0x58,0x99,0xc1,0xc1 },
290   { 0x27,0x3a,0x1d,0x1d }, { 0xb9,0x27,0x9e,0x9e },
291   { 0x38,0xd9,0xe1,0xe1 }, { 0x13,0xeb,0xf8,0xf8 },
292   { 0xb3,0x2b,0x98,0x98 }, { 0x33,0x22,0x11,0x11 },
293   { 0xbb,0xd2,0x69,0x69 }, { 0x70,0xa9,0xd9,0xd9 },
294   { 0x89,0x07,0x8e,0x8e }, { 0xa7,0x33,0x94,0x94 },
295   { 0xb6,0x2d,0x9b,0x9b }, { 0x22,0x3c,0x1e,0x1e },
296   { 0x92,0x15,0x87,0x87 }, { 0x20,0xc9,0xe9,0xe9 },
297   { 0x49,0x87,0xce,0xce }, { 0xff,0xaa,0x55,0x55 },
298   { 0x78,0x50,0x28,0x28 }, { 0x7a,0xa5,0xdf,0xdf },
299   { 0x8f,0x03,0x8c,0x8c }, { 0xf8,0x59,0xa1,0xa1 },
300   { 0x80,0x09,0x89,0x89 }, { 0x17,0x1a,0x0d,0x0d },
301   { 0xda,0x65,0xbf,0xbf }, { 0x31,0xd7,0xe6,0xe6 },
302   { 0xc6,0x84,0x42,0x42 }, { 0xb8,0xd0,0x68,0x68 },
303   { 0xc3,0x82,0x41,0x41 }, { 0xb0,0x29,0x99,0x99 },
304   { 0x77,0x5a,0x2d,0x2d }, { 0x11,0x1e,0x0f,0x0f },
305   { 0xcb,0x7b,0xb0,0xb0 }, { 0xfc,0xa8,0x54,0x54 },
306   { 0xd6,0x6d,0xbb,0xbb }, { 0x3a,0x2c,0x16,0x16 }
307 };
308 
309 const unsigned char T3[256][4] = {
310   { 0x63,0xa5,0xc6,0x63 }, { 0x7c,0x84,0xf8,0x7c },
311   { 0x77,0x99,0xee,0x77 }, { 0x7b,0x8d,0xf6,0x7b },
312   { 0xf2,0x0d,0xff,0xf2 }, { 0x6b,0xbd,0xd6,0x6b },
313   { 0x6f,0xb1,0xde,0x6f }, { 0xc5,0x54,0x91,0xc5 },
314   { 0x30,0x50,0x60,0x30 }, { 0x01,0x03,0x02,0x01 },
315   { 0x67,0xa9,0xce,0x67 }, { 0x2b,0x7d,0x56,0x2b },
316   { 0xfe,0x19,0xe7,0xfe }, { 0xd7,0x62,0xb5,0xd7 },
317   { 0xab,0xe6,0x4d,0xab }, { 0x76,0x9a,0xec,0x76 },
318   { 0xca,0x45,0x8f,0xca }, { 0x82,0x9d,0x1f,0x82 },
319   { 0xc9,0x40,0x89,0xc9 }, { 0x7d,0x87,0xfa,0x7d },
320   { 0xfa,0x15,0xef,0xfa }, { 0x59,0xeb,0xb2,0x59 },
321   { 0x47,0xc9,0x8e,0x47 }, { 0xf0,0x0b,0xfb,0xf0 },
322   { 0xad,0xec,0x41,0xad }, { 0xd4,0x67,0xb3,0xd4 },
323   { 0xa2,0xfd,0x5f,0xa2 }, { 0xaf,0xea,0x45,0xaf },
324   { 0x9c,0xbf,0x23,0x9c }, { 0xa4,0xf7,0x53,0xa4 },
325   { 0x72,0x96,0xe4,0x72 }, { 0xc0,0x5b,0x9b,0xc0 },
326   { 0xb7,0xc2,0x75,0xb7 }, { 0xfd,0x1c,0xe1,0xfd },
327   { 0x93,0xae,0x3d,0x93 }, { 0x26,0x6a,0x4c,0x26 },
328   { 0x36,0x5a,0x6c,0x36 }, { 0x3f,0x41,0x7e,0x3f },
329   { 0xf7,0x02,0xf5,0xf7 }, { 0xcc,0x4f,0x83,0xcc },
330   { 0x34,0x5c,0x68,0x34 }, { 0xa5,0xf4,0x51,0xa5 },
331   { 0xe5,0x34,0xd1,0xe5 }, { 0xf1,0x08,0xf9,0xf1 },
332   { 0x71,0x93,0xe2,0x71 }, { 0xd8,0x73,0xab,0xd8 },
333   { 0x31,0x53,0x62,0x31 }, { 0x15,0x3f,0x2a,0x15 },
334   { 0x04,0x0c,0x08,0x04 }, { 0xc7,0x52,0x95,0xc7 },
335   { 0x23,0x65,0x46,0x23 }, { 0xc3,0x5e,0x9d,0xc3 },
336   { 0x18,0x28,0x30,0x18 }, { 0x96,0xa1,0x37,0x96 },
337   { 0x05,0x0f,0x0a,0x05 }, { 0x9a,0xb5,0x2f,0x9a },
338   { 0x07,0x09,0x0e,0x07 }, { 0x12,0x36,0x24,0x12 },
339   { 0x80,0x9b,0x1b,0x80 }, { 0xe2,0x3d,0xdf,0xe2 },
340   { 0xeb,0x26,0xcd,0xeb }, { 0x27,0x69,0x4e,0x27 },
341   { 0xb2,0xcd,0x7f,0xb2 }, { 0x75,0x9f,0xea,0x75 },
342   { 0x09,0x1b,0x12,0x09 }, { 0x83,0x9e,0x1d,0x83 },
343   { 0x2c,0x74,0x58,0x2c }, { 0x1a,0x2e,0x34,0x1a },
344   { 0x1b,0x2d,0x36,0x1b }, { 0x6e,0xb2,0xdc,0x6e },
345   { 0x5a,0xee,0xb4,0x5a }, { 0xa0,0xfb,0x5b,0xa0 },
346   { 0x52,0xf6,0xa4,0x52 }, { 0x3b,0x4d,0x76,0x3b },
347   { 0xd6,0x61,0xb7,0xd6 }, { 0xb3,0xce,0x7d,0xb3 },
348   { 0x29,0x7b,0x52,0x29 }, { 0xe3,0x3e,0xdd,0xe3 },
349   { 0x2f,0x71,0x5e,0x2f }, { 0x84,0x97,0x13,0x84 },
350   { 0x53,0xf5,0xa6,0x53 }, { 0xd1,0x68,0xb9,0xd1 },
351   { 0x00,0x00,0x00,0x00 }, { 0xed,0x2c,0xc1,0xed },
352   { 0x20,0x60,0x40,0x20 }, { 0xfc,0x1f,0xe3,0xfc },
353   { 0xb1,0xc8,0x79,0xb1 }, { 0x5b,0xed,0xb6,0x5b },
354   { 0x6a,0xbe,0xd4,0x6a }, { 0xcb,0x46,0x8d,0xcb },
355   { 0xbe,0xd9,0x67,0xbe }, { 0x39,0x4b,0x72,0x39 },
356   { 0x4a,0xde,0x94,0x4a }, { 0x4c,0xd4,0x98,0x4c },
357   { 0x58,0xe8,0xb0,0x58 }, { 0xcf,0x4a,0x85,0xcf },
358   { 0xd0,0x6b,0xbb,0xd0 }, { 0xef,0x2a,0xc5,0xef },
359   { 0xaa,0xe5,0x4f,0xaa }, { 0xfb,0x16,0xed,0xfb },
360   { 0x43,0xc5,0x86,0x43 }, { 0x4d,0xd7,0x9a,0x4d },
361   { 0x33,0x55,0x66,0x33 }, { 0x85,0x94,0x11,0x85 },
362   { 0x45,0xcf,0x8a,0x45 }, { 0xf9,0x10,0xe9,0xf9 },
363   { 0x02,0x06,0x04,0x02 }, { 0x7f,0x81,0xfe,0x7f },
364   { 0x50,0xf0,0xa0,0x50 }, { 0x3c,0x44,0x78,0x3c },
365   { 0x9f,0xba,0x25,0x9f }, { 0xa8,0xe3,0x4b,0xa8 },
366   { 0x51,0xf3,0xa2,0x51 }, { 0xa3,0xfe,0x5d,0xa3 },
367   { 0x40,0xc0,0x80,0x40 }, { 0x8f,0x8a,0x05,0x8f },
368   { 0x92,0xad,0x3f,0x92 }, { 0x9d,0xbc,0x21,0x9d },
369   { 0x38,0x48,0x70,0x38 }, { 0xf5,0x04,0xf1,0xf5 },
370   { 0xbc,0xdf,0x63,0xbc }, { 0xb6,0xc1,0x77,0xb6 },
371   { 0xda,0x75,0xaf,0xda }, { 0x21,0x63,0x42,0x21 },
372   { 0x10,0x30,0x20,0x10 }, { 0xff,0x1a,0xe5,0xff },
373   { 0xf3,0x0e,0xfd,0xf3 }, { 0xd2,0x6d,0xbf,0xd2 },
374   { 0xcd,0x4c,0x81,0xcd }, { 0x0c,0x14,0x18,0x0c },
375   { 0x13,0x35,0x26,0x13 }, { 0xec,0x2f,0xc3,0xec },
376   { 0x5f,0xe1,0xbe,0x5f }, { 0x97,0xa2,0x35,0x97 },
377   { 0x44,0xcc,0x88,0x44 }, { 0x17,0x39,0x2e,0x17 },
378   { 0xc4,0x57,0x93,0xc4 }, { 0xa7,0xf2,0x55,0xa7 },
379   { 0x7e,0x82,0xfc,0x7e }, { 0x3d,0x47,0x7a,0x3d },
380   { 0x64,0xac,0xc8,0x64 }, { 0x5d,0xe7,0xba,0x5d },
381   { 0x19,0x2b,0x32,0x19 }, { 0x73,0x95,0xe6,0x73 },
382   { 0x60,0xa0,0xc0,0x60 }, { 0x81,0x98,0x19,0x81 },
383   { 0x4f,0xd1,0x9e,0x4f }, { 0xdc,0x7f,0xa3,0xdc },
384   { 0x22,0x66,0x44,0x22 }, { 0x2a,0x7e,0x54,0x2a },
385   { 0x90,0xab,0x3b,0x90 }, { 0x88,0x83,0x0b,0x88 },
386   { 0x46,0xca,0x8c,0x46 }, { 0xee,0x29,0xc7,0xee },
387   { 0xb8,0xd3,0x6b,0xb8 }, { 0x14,0x3c,0x28,0x14 },
388   { 0xde,0x79,0xa7,0xde }, { 0x5e,0xe2,0xbc,0x5e },
389   { 0x0b,0x1d,0x16,0x0b }, { 0xdb,0x76,0xad,0xdb },
390   { 0xe0,0x3b,0xdb,0xe0 }, { 0x32,0x56,0x64,0x32 },
391   { 0x3a,0x4e,0x74,0x3a }, { 0x0a,0x1e,0x14,0x0a },
392   { 0x49,0xdb,0x92,0x49 }, { 0x06,0x0a,0x0c,0x06 },
393   { 0x24,0x6c,0x48,0x24 }, { 0x5c,0xe4,0xb8,0x5c },
394   { 0xc2,0x5d,0x9f,0xc2 }, { 0xd3,0x6e,0xbd,0xd3 },
395   { 0xac,0xef,0x43,0xac }, { 0x62,0xa6,0xc4,0x62 },
396   { 0x91,0xa8,0x39,0x91 }, { 0x95,0xa4,0x31,0x95 },
397   { 0xe4,0x37,0xd3,0xe4 }, { 0x79,0x8b,0xf2,0x79 },
398   { 0xe7,0x32,0xd5,0xe7 }, { 0xc8,0x43,0x8b,0xc8 },
399   { 0x37,0x59,0x6e,0x37 }, { 0x6d,0xb7,0xda,0x6d },
400   { 0x8d,0x8c,0x01,0x8d }, { 0xd5,0x64,0xb1,0xd5 },
401   { 0x4e,0xd2,0x9c,0x4e }, { 0xa9,0xe0,0x49,0xa9 },
402   { 0x6c,0xb4,0xd8,0x6c }, { 0x56,0xfa,0xac,0x56 },
403   { 0xf4,0x07,0xf3,0xf4 }, { 0xea,0x25,0xcf,0xea },
404   { 0x65,0xaf,0xca,0x65 }, { 0x7a,0x8e,0xf4,0x7a },
405   { 0xae,0xe9,0x47,0xae }, { 0x08,0x18,0x10,0x08 },
406   { 0xba,0xd5,0x6f,0xba }, { 0x78,0x88,0xf0,0x78 },
407   { 0x25,0x6f,0x4a,0x25 }, { 0x2e,0x72,0x5c,0x2e },
408   { 0x1c,0x24,0x38,0x1c }, { 0xa6,0xf1,0x57,0xa6 },
409   { 0xb4,0xc7,0x73,0xb4 }, { 0xc6,0x51,0x97,0xc6 },
410   { 0xe8,0x23,0xcb,0xe8 }, { 0xdd,0x7c,0xa1,0xdd },
411   { 0x74,0x9c,0xe8,0x74 }, { 0x1f,0x21,0x3e,0x1f },
412   { 0x4b,0xdd,0x96,0x4b }, { 0xbd,0xdc,0x61,0xbd },
413   { 0x8b,0x86,0x0d,0x8b }, { 0x8a,0x85,0x0f,0x8a },
414   { 0x70,0x90,0xe0,0x70 }, { 0x3e,0x42,0x7c,0x3e },
415   { 0xb5,0xc4,0x71,0xb5 }, { 0x66,0xaa,0xcc,0x66 },
416   { 0x48,0xd8,0x90,0x48 }, { 0x03,0x05,0x06,0x03 },
417   { 0xf6,0x01,0xf7,0xf6 }, { 0x0e,0x12,0x1c,0x0e },
418   { 0x61,0xa3,0xc2,0x61 }, { 0x35,0x5f,0x6a,0x35 },
419   { 0x57,0xf9,0xae,0x57 }, { 0xb9,0xd0,0x69,0xb9 },
420   { 0x86,0x91,0x17,0x86 }, { 0xc1,0x58,0x99,0xc1 },
421   { 0x1d,0x27,0x3a,0x1d }, { 0x9e,0xb9,0x27,0x9e },
422   { 0xe1,0x38,0xd9,0xe1 }, { 0xf8,0x13,0xeb,0xf8 },
423   { 0x98,0xb3,0x2b,0x98 }, { 0x11,0x33,0x22,0x11 },
424   { 0x69,0xbb,0xd2,0x69 }, { 0xd9,0x70,0xa9,0xd9 },
425   { 0x8e,0x89,0x07,0x8e }, { 0x94,0xa7,0x33,0x94 },
426   { 0x9b,0xb6,0x2d,0x9b }, { 0x1e,0x22,0x3c,0x1e },
427   { 0x87,0x92,0x15,0x87 }, { 0xe9,0x20,0xc9,0xe9 },
428   { 0xce,0x49,0x87,0xce }, { 0x55,0xff,0xaa,0x55 },
429   { 0x28,0x78,0x50,0x28 }, { 0xdf,0x7a,0xa5,0xdf },
430   { 0x8c,0x8f,0x03,0x8c }, { 0xa1,0xf8,0x59,0xa1 },
431   { 0x89,0x80,0x09,0x89 }, { 0x0d,0x17,0x1a,0x0d },
432   { 0xbf,0xda,0x65,0xbf }, { 0xe6,0x31,0xd7,0xe6 },
433   { 0x42,0xc6,0x84,0x42 }, { 0x68,0xb8,0xd0,0x68 },
434   { 0x41,0xc3,0x82,0x41 }, { 0x99,0xb0,0x29,0x99 },
435   { 0x2d,0x77,0x5a,0x2d }, { 0x0f,0x11,0x1e,0x0f },
436   { 0xb0,0xcb,0x7b,0xb0 }, { 0x54,0xfc,0xa8,0x54 },
437   { 0xbb,0xd6,0x6d,0xbb }, { 0x16,0x3a,0x2c,0x16 }
438 };
439 
440 const unsigned char T4[256][4] = {
441   { 0x63,0x63,0xa5,0xc6 }, { 0x7c,0x7c,0x84,0xf8 },
442   { 0x77,0x77,0x99,0xee }, { 0x7b,0x7b,0x8d,0xf6 },
443   { 0xf2,0xf2,0x0d,0xff }, { 0x6b,0x6b,0xbd,0xd6 },
444   { 0x6f,0x6f,0xb1,0xde }, { 0xc5,0xc5,0x54,0x91 },
445   { 0x30,0x30,0x50,0x60 }, { 0x01,0x01,0x03,0x02 },
446   { 0x67,0x67,0xa9,0xce }, { 0x2b,0x2b,0x7d,0x56 },
447   { 0xfe,0xfe,0x19,0xe7 }, { 0xd7,0xd7,0x62,0xb5 },
448   { 0xab,0xab,0xe6,0x4d }, { 0x76,0x76,0x9a,0xec },
449   { 0xca,0xca,0x45,0x8f }, { 0x82,0x82,0x9d,0x1f },
450   { 0xc9,0xc9,0x40,0x89 }, { 0x7d,0x7d,0x87,0xfa },
451   { 0xfa,0xfa,0x15,0xef }, { 0x59,0x59,0xeb,0xb2 },
452   { 0x47,0x47,0xc9,0x8e }, { 0xf0,0xf0,0x0b,0xfb },
453   { 0xad,0xad,0xec,0x41 }, { 0xd4,0xd4,0x67,0xb3 },
454   { 0xa2,0xa2,0xfd,0x5f }, { 0xaf,0xaf,0xea,0x45 },
455   { 0x9c,0x9c,0xbf,0x23 }, { 0xa4,0xa4,0xf7,0x53 },
456   { 0x72,0x72,0x96,0xe4 }, { 0xc0,0xc0,0x5b,0x9b },
457   { 0xb7,0xb7,0xc2,0x75 }, { 0xfd,0xfd,0x1c,0xe1 },
458   { 0x93,0x93,0xae,0x3d }, { 0x26,0x26,0x6a,0x4c },
459   { 0x36,0x36,0x5a,0x6c }, { 0x3f,0x3f,0x41,0x7e },
460   { 0xf7,0xf7,0x02,0xf5 }, { 0xcc,0xcc,0x4f,0x83 },
461   { 0x34,0x34,0x5c,0x68 }, { 0xa5,0xa5,0xf4,0x51 },
462   { 0xe5,0xe5,0x34,0xd1 }, { 0xf1,0xf1,0x08,0xf9 },
463   { 0x71,0x71,0x93,0xe2 }, { 0xd8,0xd8,0x73,0xab },
464   { 0x31,0x31,0x53,0x62 }, { 0x15,0x15,0x3f,0x2a },
465   { 0x04,0x04,0x0c,0x08 }, { 0xc7,0xc7,0x52,0x95 },
466   { 0x23,0x23,0x65,0x46 }, { 0xc3,0xc3,0x5e,0x9d },
467   { 0x18,0x18,0x28,0x30 }, { 0x96,0x96,0xa1,0x37 },
468   { 0x05,0x05,0x0f,0x0a }, { 0x9a,0x9a,0xb5,0x2f },
469   { 0x07,0x07,0x09,0x0e }, { 0x12,0x12,0x36,0x24 },
470   { 0x80,0x80,0x9b,0x1b }, { 0xe2,0xe2,0x3d,0xdf },
471   { 0xeb,0xeb,0x26,0xcd }, { 0x27,0x27,0x69,0x4e },
472   { 0xb2,0xb2,0xcd,0x7f }, { 0x75,0x75,0x9f,0xea },
473   { 0x09,0x09,0x1b,0x12 }, { 0x83,0x83,0x9e,0x1d },
474   { 0x2c,0x2c,0x74,0x58 }, { 0x1a,0x1a,0x2e,0x34 },
475   { 0x1b,0x1b,0x2d,0x36 }, { 0x6e,0x6e,0xb2,0xdc },
476   { 0x5a,0x5a,0xee,0xb4 }, { 0xa0,0xa0,0xfb,0x5b },
477   { 0x52,0x52,0xf6,0xa4 }, { 0x3b,0x3b,0x4d,0x76 },
478   { 0xd6,0xd6,0x61,0xb7 }, { 0xb3,0xb3,0xce,0x7d },
479   { 0x29,0x29,0x7b,0x52 }, { 0xe3,0xe3,0x3e,0xdd },
480   { 0x2f,0x2f,0x71,0x5e }, { 0x84,0x84,0x97,0x13 },
481   { 0x53,0x53,0xf5,0xa6 }, { 0xd1,0xd1,0x68,0xb9 },
482   { 0x00,0x00,0x00,0x00 }, { 0xed,0xed,0x2c,0xc1 },
483   { 0x20,0x20,0x60,0x40 }, { 0xfc,0xfc,0x1f,0xe3 },
484   { 0xb1,0xb1,0xc8,0x79 }, { 0x5b,0x5b,0xed,0xb6 },
485   { 0x6a,0x6a,0xbe,0xd4 }, { 0xcb,0xcb,0x46,0x8d },
486   { 0xbe,0xbe,0xd9,0x67 }, { 0x39,0x39,0x4b,0x72 },
487   { 0x4a,0x4a,0xde,0x94 }, { 0x4c,0x4c,0xd4,0x98 },
488   { 0x58,0x58,0xe8,0xb0 }, { 0xcf,0xcf,0x4a,0x85 },
489   { 0xd0,0xd0,0x6b,0xbb }, { 0xef,0xef,0x2a,0xc5 },
490   { 0xaa,0xaa,0xe5,0x4f }, { 0xfb,0xfb,0x16,0xed },
491   { 0x43,0x43,0xc5,0x86 }, { 0x4d,0x4d,0xd7,0x9a },
492   { 0x33,0x33,0x55,0x66 }, { 0x85,0x85,0x94,0x11 },
493   { 0x45,0x45,0xcf,0x8a }, { 0xf9,0xf9,0x10,0xe9 },
494   { 0x02,0x02,0x06,0x04 }, { 0x7f,0x7f,0x81,0xfe },
495   { 0x50,0x50,0xf0,0xa0 }, { 0x3c,0x3c,0x44,0x78 },
496   { 0x9f,0x9f,0xba,0x25 }, { 0xa8,0xa8,0xe3,0x4b },
497   { 0x51,0x51,0xf3,0xa2 }, { 0xa3,0xa3,0xfe,0x5d },
498   { 0x40,0x40,0xc0,0x80 }, { 0x8f,0x8f,0x8a,0x05 },
499   { 0x92,0x92,0xad,0x3f }, { 0x9d,0x9d,0xbc,0x21 },
500   { 0x38,0x38,0x48,0x70 }, { 0xf5,0xf5,0x04,0xf1 },
501   { 0xbc,0xbc,0xdf,0x63 }, { 0xb6,0xb6,0xc1,0x77 },
502   { 0xda,0xda,0x75,0xaf }, { 0x21,0x21,0x63,0x42 },
503   { 0x10,0x10,0x30,0x20 }, { 0xff,0xff,0x1a,0xe5 },
504   { 0xf3,0xf3,0x0e,0xfd }, { 0xd2,0xd2,0x6d,0xbf },
505   { 0xcd,0xcd,0x4c,0x81 }, { 0x0c,0x0c,0x14,0x18 },
506   { 0x13,0x13,0x35,0x26 }, { 0xec,0xec,0x2f,0xc3 },
507   { 0x5f,0x5f,0xe1,0xbe }, { 0x97,0x97,0xa2,0x35 },
508   { 0x44,0x44,0xcc,0x88 }, { 0x17,0x17,0x39,0x2e },
509   { 0xc4,0xc4,0x57,0x93 }, { 0xa7,0xa7,0xf2,0x55 },
510   { 0x7e,0x7e,0x82,0xfc }, { 0x3d,0x3d,0x47,0x7a },
511   { 0x64,0x64,0xac,0xc8 }, { 0x5d,0x5d,0xe7,0xba },
512   { 0x19,0x19,0x2b,0x32 }, { 0x73,0x73,0x95,0xe6 },
513   { 0x60,0x60,0xa0,0xc0 }, { 0x81,0x81,0x98,0x19 },
514   { 0x4f,0x4f,0xd1,0x9e }, { 0xdc,0xdc,0x7f,0xa3 },
515   { 0x22,0x22,0x66,0x44 }, { 0x2a,0x2a,0x7e,0x54 },
516   { 0x90,0x90,0xab,0x3b }, { 0x88,0x88,0x83,0x0b },
517   { 0x46,0x46,0xca,0x8c }, { 0xee,0xee,0x29,0xc7 },
518   { 0xb8,0xb8,0xd3,0x6b }, { 0x14,0x14,0x3c,0x28 },
519   { 0xde,0xde,0x79,0xa7 }, { 0x5e,0x5e,0xe2,0xbc },
520   { 0x0b,0x0b,0x1d,0x16 }, { 0xdb,0xdb,0x76,0xad },
521   { 0xe0,0xe0,0x3b,0xdb }, { 0x32,0x32,0x56,0x64 },
522   { 0x3a,0x3a,0x4e,0x74 }, { 0x0a,0x0a,0x1e,0x14 },
523   { 0x49,0x49,0xdb,0x92 }, { 0x06,0x06,0x0a,0x0c },
524   { 0x24,0x24,0x6c,0x48 }, { 0x5c,0x5c,0xe4,0xb8 },
525   { 0xc2,0xc2,0x5d,0x9f }, { 0xd3,0xd3,0x6e,0xbd },
526   { 0xac,0xac,0xef,0x43 }, { 0x62,0x62,0xa6,0xc4 },
527   { 0x91,0x91,0xa8,0x39 }, { 0x95,0x95,0xa4,0x31 },
528   { 0xe4,0xe4,0x37,0xd3 }, { 0x79,0x79,0x8b,0xf2 },
529   { 0xe7,0xe7,0x32,0xd5 }, { 0xc8,0xc8,0x43,0x8b },
530   { 0x37,0x37,0x59,0x6e }, { 0x6d,0x6d,0xb7,0xda },
531   { 0x8d,0x8d,0x8c,0x01 }, { 0xd5,0xd5,0x64,0xb1 },
532   { 0x4e,0x4e,0xd2,0x9c }, { 0xa9,0xa9,0xe0,0x49 },
533   { 0x6c,0x6c,0xb4,0xd8 }, { 0x56,0x56,0xfa,0xac },
534   { 0xf4,0xf4,0x07,0xf3 }, { 0xea,0xea,0x25,0xcf },
535   { 0x65,0x65,0xaf,0xca }, { 0x7a,0x7a,0x8e,0xf4 },
536   { 0xae,0xae,0xe9,0x47 }, { 0x08,0x08,0x18,0x10 },
537   { 0xba,0xba,0xd5,0x6f }, { 0x78,0x78,0x88,0xf0 },
538   { 0x25,0x25,0x6f,0x4a }, { 0x2e,0x2e,0x72,0x5c },
539   { 0x1c,0x1c,0x24,0x38 }, { 0xa6,0xa6,0xf1,0x57 },
540   { 0xb4,0xb4,0xc7,0x73 }, { 0xc6,0xc6,0x51,0x97 },
541   { 0xe8,0xe8,0x23,0xcb }, { 0xdd,0xdd,0x7c,0xa1 },
542   { 0x74,0x74,0x9c,0xe8 }, { 0x1f,0x1f,0x21,0x3e },
543   { 0x4b,0x4b,0xdd,0x96 }, { 0xbd,0xbd,0xdc,0x61 },
544   { 0x8b,0x8b,0x86,0x0d }, { 0x8a,0x8a,0x85,0x0f },
545   { 0x70,0x70,0x90,0xe0 }, { 0x3e,0x3e,0x42,0x7c },
546   { 0xb5,0xb5,0xc4,0x71 }, { 0x66,0x66,0xaa,0xcc },
547   { 0x48,0x48,0xd8,0x90 }, { 0x03,0x03,0x05,0x06 },
548   { 0xf6,0xf6,0x01,0xf7 }, { 0x0e,0x0e,0x12,0x1c },
549   { 0x61,0x61,0xa3,0xc2 }, { 0x35,0x35,0x5f,0x6a },
550   { 0x57,0x57,0xf9,0xae }, { 0xb9,0xb9,0xd0,0x69 },
551   { 0x86,0x86,0x91,0x17 }, { 0xc1,0xc1,0x58,0x99 },
552   { 0x1d,0x1d,0x27,0x3a }, { 0x9e,0x9e,0xb9,0x27 },
553   { 0xe1,0xe1,0x38,0xd9 }, { 0xf8,0xf8,0x13,0xeb },
554   { 0x98,0x98,0xb3,0x2b }, { 0x11,0x11,0x33,0x22 },
555   { 0x69,0x69,0xbb,0xd2 }, { 0xd9,0xd9,0x70,0xa9 },
556   { 0x8e,0x8e,0x89,0x07 }, { 0x94,0x94,0xa7,0x33 },
557   { 0x9b,0x9b,0xb6,0x2d }, { 0x1e,0x1e,0x22,0x3c },
558   { 0x87,0x87,0x92,0x15 }, { 0xe9,0xe9,0x20,0xc9 },
559   { 0xce,0xce,0x49,0x87 }, { 0x55,0x55,0xff,0xaa },
560   { 0x28,0x28,0x78,0x50 }, { 0xdf,0xdf,0x7a,0xa5 },
561   { 0x8c,0x8c,0x8f,0x03 }, { 0xa1,0xa1,0xf8,0x59 },
562   { 0x89,0x89,0x80,0x09 }, { 0x0d,0x0d,0x17,0x1a },
563   { 0xbf,0xbf,0xda,0x65 }, { 0xe6,0xe6,0x31,0xd7 },
564   { 0x42,0x42,0xc6,0x84 }, { 0x68,0x68,0xb8,0xd0 },
565   { 0x41,0x41,0xc3,0x82 }, { 0x99,0x99,0xb0,0x29 },
566   { 0x2d,0x2d,0x77,0x5a }, { 0x0f,0x0f,0x11,0x1e },
567   { 0xb0,0xb0,0xcb,0x7b }, { 0x54,0x54,0xfc,0xa8 },
568   { 0xbb,0xbb,0xd6,0x6d }, { 0x16,0x16,0x3a,0x2c }
569 };
570 
571 const unsigned char T5[256][4] = {
572   { 0x51,0xf4,0xa7,0x50 }, { 0x7e,0x41,0x65,0x53 },
573   { 0x1a,0x17,0xa4,0xc3 }, { 0x3a,0x27,0x5e,0x96 },
574   { 0x3b,0xab,0x6b,0xcb }, { 0x1f,0x9d,0x45,0xf1 },
575   { 0xac,0xfa,0x58,0xab }, { 0x4b,0xe3,0x03,0x93 },
576   { 0x20,0x30,0xfa,0x55 }, { 0xad,0x76,0x6d,0xf6 },
577   { 0x88,0xcc,0x76,0x91 }, { 0xf5,0x02,0x4c,0x25 },
578   { 0x4f,0xe5,0xd7,0xfc }, { 0xc5,0x2a,0xcb,0xd7 },
579   { 0x26,0x35,0x44,0x80 }, { 0xb5,0x62,0xa3,0x8f },
580   { 0xde,0xb1,0x5a,0x49 }, { 0x25,0xba,0x1b,0x67 },
581   { 0x45,0xea,0x0e,0x98 }, { 0x5d,0xfe,0xc0,0xe1 },
582   { 0xc3,0x2f,0x75,0x02 }, { 0x81,0x4c,0xf0,0x12 },
583   { 0x8d,0x46,0x97,0xa3 }, { 0x6b,0xd3,0xf9,0xc6 },
584   { 0x03,0x8f,0x5f,0xe7 }, { 0x15,0x92,0x9c,0x95 },
585   { 0xbf,0x6d,0x7a,0xeb }, { 0x95,0x52,0x59,0xda },
586   { 0xd4,0xbe,0x83,0x2d }, { 0x58,0x74,0x21,0xd3 },
587   { 0x49,0xe0,0x69,0x29 }, { 0x8e,0xc9,0xc8,0x44 },
588   { 0x75,0xc2,0x89,0x6a }, { 0xf4,0x8e,0x79,0x78 },
589   { 0x99,0x58,0x3e,0x6b }, { 0x27,0xb9,0x71,0xdd },
590   { 0xbe,0xe1,0x4f,0xb6 }, { 0xf0,0x88,0xad,0x17 },
591   { 0xc9,0x20,0xac,0x66 }, { 0x7d,0xce,0x3a,0xb4 },
592   { 0x63,0xdf,0x4a,0x18 }, { 0xe5,0x1a,0x31,0x82 },
593   { 0x97,0x51,0x33,0x60 }, { 0x62,0x53,0x7f,0x45 },
594   { 0xb1,0x64,0x77,0xe0 }, { 0xbb,0x6b,0xae,0x84 },
595   { 0xfe,0x81,0xa0,0x1c }, { 0xf9,0x08,0x2b,0x94 },
596   { 0x70,0x48,0x68,0x58 }, { 0x8f,0x45,0xfd,0x19 },
597   { 0x94,0xde,0x6c,0x87 }, { 0x52,0x7b,0xf8,0xb7 },
598   { 0xab,0x73,0xd3,0x23 }, { 0x72,0x4b,0x02,0xe2 },
599   { 0xe3,0x1f,0x8f,0x57 }, { 0x66,0x55,0xab,0x2a },
600   { 0xb2,0xeb,0x28,0x07 }, { 0x2f,0xb5,0xc2,0x03 },
601   { 0x86,0xc5,0x7b,0x9a }, { 0xd3,0x37,0x08,0xa5 },
602   { 0x30,0x28,0x87,0xf2 }, { 0x23,0xbf,0xa5,0xb2 },
603   { 0x02,0x03,0x6a,0xba }, { 0xed,0x16,0x82,0x5c },
604   { 0x8a,0xcf,0x1c,0x2b }, { 0xa7,0x79,0xb4,0x92 },
605   { 0xf3,0x07,0xf2,0xf0 }, { 0x4e,0x69,0xe2,0xa1 },
606   { 0x65,0xda,0xf4,0xcd }, { 0x06,0x05,0xbe,0xd5 },
607   { 0xd1,0x34,0x62,0x1f }, { 0xc4,0xa6,0xfe,0x8a },
608   { 0x34,0x2e,0x53,0x9d }, { 0xa2,0xf3,0x55,0xa0 },
609   { 0x05,0x8a,0xe1,0x32 }, { 0xa4,0xf6,0xeb,0x75 },
610   { 0x0b,0x83,0xec,0x39 }, { 0x40,0x60,0xef,0xaa },
611   { 0x5e,0x71,0x9f,0x06 }, { 0xbd,0x6e,0x10,0x51 },
612   { 0x3e,0x21,0x8a,0xf9 }, { 0x96,0xdd,0x06,0x3d },
613   { 0xdd,0x3e,0x05,0xae }, { 0x4d,0xe6,0xbd,0x46 },
614   { 0x91,0x54,0x8d,0xb5 }, { 0x71,0xc4,0x5d,0x05 },
615   { 0x04,0x06,0xd4,0x6f }, { 0x60,0x50,0x15,0xff },
616   { 0x19,0x98,0xfb,0x24 }, { 0xd6,0xbd,0xe9,0x97 },
617   { 0x89,0x40,0x43,0xcc }, { 0x67,0xd9,0x9e,0x77 },
618   { 0xb0,0xe8,0x42,0xbd }, { 0x07,0x89,0x8b,0x88 },
619   { 0xe7,0x19,0x5b,0x38 }, { 0x79,0xc8,0xee,0xdb },
620   { 0xa1,0x7c,0x0a,0x47 }, { 0x7c,0x42,0x0f,0xe9 },
621   { 0xf8,0x84,0x1e,0xc9 }, { 0x00,0x00,0x00,0x00 },
622   { 0x09,0x80,0x86,0x83 }, { 0x32,0x2b,0xed,0x48 },
623   { 0x1e,0x11,0x70,0xac }, { 0x6c,0x5a,0x72,0x4e },
624   { 0xfd,0x0e,0xff,0xfb }, { 0x0f,0x85,0x38,0x56 },
625   { 0x3d,0xae,0xd5,0x1e }, { 0x36,0x2d,0x39,0x27 },
626   { 0x0a,0x0f,0xd9,0x64 }, { 0x68,0x5c,0xa6,0x21 },
627   { 0x9b,0x5b,0x54,0xd1 }, { 0x24,0x36,0x2e,0x3a },
628   { 0x0c,0x0a,0x67,0xb1 }, { 0x93,0x57,0xe7,0x0f },
629   { 0xb4,0xee,0x96,0xd2 }, { 0x1b,0x9b,0x91,0x9e },
630   { 0x80,0xc0,0xc5,0x4f }, { 0x61,0xdc,0x20,0xa2 },
631   { 0x5a,0x77,0x4b,0x69 }, { 0x1c,0x12,0x1a,0x16 },
632   { 0xe2,0x93,0xba,0x0a }, { 0xc0,0xa0,0x2a,0xe5 },
633   { 0x3c,0x22,0xe0,0x43 }, { 0x12,0x1b,0x17,0x1d },
634   { 0x0e,0x09,0x0d,0x0b }, { 0xf2,0x8b,0xc7,0xad },
635   { 0x2d,0xb6,0xa8,0xb9 }, { 0x14,0x1e,0xa9,0xc8 },
636   { 0x57,0xf1,0x19,0x85 }, { 0xaf,0x75,0x07,0x4c },
637   { 0xee,0x99,0xdd,0xbb }, { 0xa3,0x7f,0x60,0xfd },
638   { 0xf7,0x01,0x26,0x9f }, { 0x5c,0x72,0xf5,0xbc },
639   { 0x44,0x66,0x3b,0xc5 }, { 0x5b,0xfb,0x7e,0x34 },
640   { 0x8b,0x43,0x29,0x76 }, { 0xcb,0x23,0xc6,0xdc },
641   { 0xb6,0xed,0xfc,0x68 }, { 0xb8,0xe4,0xf1,0x63 },
642   { 0xd7,0x31,0xdc,0xca }, { 0x42,0x63,0x85,0x10 },
643   { 0x13,0x97,0x22,0x40 }, { 0x84,0xc6,0x11,0x20 },
644   { 0x85,0x4a,0x24,0x7d }, { 0xd2,0xbb,0x3d,0xf8 },
645   { 0xae,0xf9,0x32,0x11 }, { 0xc7,0x29,0xa1,0x6d },
646   { 0x1d,0x9e,0x2f,0x4b }, { 0xdc,0xb2,0x30,0xf3 },
647   { 0x0d,0x86,0x52,0xec }, { 0x77,0xc1,0xe3,0xd0 },
648   { 0x2b,0xb3,0x16,0x6c }, { 0xa9,0x70,0xb9,0x99 },
649   { 0x11,0x94,0x48,0xfa }, { 0x47,0xe9,0x64,0x22 },
650   { 0xa8,0xfc,0x8c,0xc4 }, { 0xa0,0xf0,0x3f,0x1a },
651   { 0x56,0x7d,0x2c,0xd8 }, { 0x22,0x33,0x90,0xef },
652   { 0x87,0x49,0x4e,0xc7 }, { 0xd9,0x38,0xd1,0xc1 },
653   { 0x8c,0xca,0xa2,0xfe }, { 0x98,0xd4,0x0b,0x36 },
654   { 0xa6,0xf5,0x81,0xcf }, { 0xa5,0x7a,0xde,0x28 },
655   { 0xda,0xb7,0x8e,0x26 }, { 0x3f,0xad,0xbf,0xa4 },
656   { 0x2c,0x3a,0x9d,0xe4 }, { 0x50,0x78,0x92,0x0d },
657   { 0x6a,0x5f,0xcc,0x9b }, { 0x54,0x7e,0x46,0x62 },
658   { 0xf6,0x8d,0x13,0xc2 }, { 0x90,0xd8,0xb8,0xe8 },
659   { 0x2e,0x39,0xf7,0x5e }, { 0x82,0xc3,0xaf,0xf5 },
660   { 0x9f,0x5d,0x80,0xbe }, { 0x69,0xd0,0x93,0x7c },
661   { 0x6f,0xd5,0x2d,0xa9 }, { 0xcf,0x25,0x12,0xb3 },
662   { 0xc8,0xac,0x99,0x3b }, { 0x10,0x18,0x7d,0xa7 },
663   { 0xe8,0x9c,0x63,0x6e }, { 0xdb,0x3b,0xbb,0x7b },
664   { 0xcd,0x26,0x78,0x09 }, { 0x6e,0x59,0x18,0xf4 },
665   { 0xec,0x9a,0xb7,0x01 }, { 0x83,0x4f,0x9a,0xa8 },
666   { 0xe6,0x95,0x6e,0x65 }, { 0xaa,0xff,0xe6,0x7e },
667   { 0x21,0xbc,0xcf,0x08 }, { 0xef,0x15,0xe8,0xe6 },
668   { 0xba,0xe7,0x9b,0xd9 }, { 0x4a,0x6f,0x36,0xce },
669   { 0xea,0x9f,0x09,0xd4 }, { 0x29,0xb0,0x7c,0xd6 },
670   { 0x31,0xa4,0xb2,0xaf }, { 0x2a,0x3f,0x23,0x31 },
671   { 0xc6,0xa5,0x94,0x30 }, { 0x35,0xa2,0x66,0xc0 },
672   { 0x74,0x4e,0xbc,0x37 }, { 0xfc,0x82,0xca,0xa6 },
673   { 0xe0,0x90,0xd0,0xb0 }, { 0x33,0xa7,0xd8,0x15 },
674   { 0xf1,0x04,0x98,0x4a }, { 0x41,0xec,0xda,0xf7 },
675   { 0x7f,0xcd,0x50,0x0e }, { 0x17,0x91,0xf6,0x2f },
676   { 0x76,0x4d,0xd6,0x8d }, { 0x43,0xef,0xb0,0x4d },
677   { 0xcc,0xaa,0x4d,0x54 }, { 0xe4,0x96,0x04,0xdf },
678   { 0x9e,0xd1,0xb5,0xe3 }, { 0x4c,0x6a,0x88,0x1b },
679   { 0xc1,0x2c,0x1f,0xb8 }, { 0x46,0x65,0x51,0x7f },
680   { 0x9d,0x5e,0xea,0x04 }, { 0x01,0x8c,0x35,0x5d },
681   { 0xfa,0x87,0x74,0x73 }, { 0xfb,0x0b,0x41,0x2e },
682   { 0xb3,0x67,0x1d,0x5a }, { 0x92,0xdb,0xd2,0x52 },
683   { 0xe9,0x10,0x56,0x33 }, { 0x6d,0xd6,0x47,0x13 },
684   { 0x9a,0xd7,0x61,0x8c }, { 0x37,0xa1,0x0c,0x7a },
685   { 0x59,0xf8,0x14,0x8e }, { 0xeb,0x13,0x3c,0x89 },
686   { 0xce,0xa9,0x27,0xee }, { 0xb7,0x61,0xc9,0x35 },
687   { 0xe1,0x1c,0xe5,0xed }, { 0x7a,0x47,0xb1,0x3c },
688   { 0x9c,0xd2,0xdf,0x59 }, { 0x55,0xf2,0x73,0x3f },
689   { 0x18,0x14,0xce,0x79 }, { 0x73,0xc7,0x37,0xbf },
690   { 0x53,0xf7,0xcd,0xea }, { 0x5f,0xfd,0xaa,0x5b },
691   { 0xdf,0x3d,0x6f,0x14 }, { 0x78,0x44,0xdb,0x86 },
692   { 0xca,0xaf,0xf3,0x81 }, { 0xb9,0x68,0xc4,0x3e },
693   { 0x38,0x24,0x34,0x2c }, { 0xc2,0xa3,0x40,0x5f },
694   { 0x16,0x1d,0xc3,0x72 }, { 0xbc,0xe2,0x25,0x0c },
695   { 0x28,0x3c,0x49,0x8b }, { 0xff,0x0d,0x95,0x41 },
696   { 0x39,0xa8,0x01,0x71 }, { 0x08,0x0c,0xb3,0xde },
697   { 0xd8,0xb4,0xe4,0x9c }, { 0x64,0x56,0xc1,0x90 },
698   { 0x7b,0xcb,0x84,0x61 }, { 0xd5,0x32,0xb6,0x70 },
699   { 0x48,0x6c,0x5c,0x74 }, { 0xd0,0xb8,0x57,0x42 }
700 };
701 
702 const unsigned char T6[256][4] = {
703   { 0x50,0x51,0xf4,0xa7 }, { 0x53,0x7e,0x41,0x65 },
704   { 0xc3,0x1a,0x17,0xa4 }, { 0x96,0x3a,0x27,0x5e },
705   { 0xcb,0x3b,0xab,0x6b }, { 0xf1,0x1f,0x9d,0x45 },
706   { 0xab,0xac,0xfa,0x58 }, { 0x93,0x4b,0xe3,0x03 },
707   { 0x55,0x20,0x30,0xfa }, { 0xf6,0xad,0x76,0x6d },
708   { 0x91,0x88,0xcc,0x76 }, { 0x25,0xf5,0x02,0x4c },
709   { 0xfc,0x4f,0xe5,0xd7 }, { 0xd7,0xc5,0x2a,0xcb },
710   { 0x80,0x26,0x35,0x44 }, { 0x8f,0xb5,0x62,0xa3 },
711   { 0x49,0xde,0xb1,0x5a }, { 0x67,0x25,0xba,0x1b },
712   { 0x98,0x45,0xea,0x0e }, { 0xe1,0x5d,0xfe,0xc0 },
713   { 0x02,0xc3,0x2f,0x75 }, { 0x12,0x81,0x4c,0xf0 },
714   { 0xa3,0x8d,0x46,0x97 }, { 0xc6,0x6b,0xd3,0xf9 },
715   { 0xe7,0x03,0x8f,0x5f }, { 0x95,0x15,0x92,0x9c },
716   { 0xeb,0xbf,0x6d,0x7a }, { 0xda,0x95,0x52,0x59 },
717   { 0x2d,0xd4,0xbe,0x83 }, { 0xd3,0x58,0x74,0x21 },
718   { 0x29,0x49,0xe0,0x69 }, { 0x44,0x8e,0xc9,0xc8 },
719   { 0x6a,0x75,0xc2,0x89 }, { 0x78,0xf4,0x8e,0x79 },
720   { 0x6b,0x99,0x58,0x3e }, { 0xdd,0x27,0xb9,0x71 },
721   { 0xb6,0xbe,0xe1,0x4f }, { 0x17,0xf0,0x88,0xad },
722   { 0x66,0xc9,0x20,0xac }, { 0xb4,0x7d,0xce,0x3a },
723   { 0x18,0x63,0xdf,0x4a }, { 0x82,0xe5,0x1a,0x31 },
724   { 0x60,0x97,0x51,0x33 }, { 0x45,0x62,0x53,0x7f },
725   { 0xe0,0xb1,0x64,0x77 }, { 0x84,0xbb,0x6b,0xae },
726   { 0x1c,0xfe,0x81,0xa0 }, { 0x94,0xf9,0x08,0x2b },
727   { 0x58,0x70,0x48,0x68 }, { 0x19,0x8f,0x45,0xfd },
728   { 0x87,0x94,0xde,0x6c }, { 0xb7,0x52,0x7b,0xf8 },
729   { 0x23,0xab,0x73,0xd3 }, { 0xe2,0x72,0x4b,0x02 },
730   { 0x57,0xe3,0x1f,0x8f }, { 0x2a,0x66,0x55,0xab },
731   { 0x07,0xb2,0xeb,0x28 }, { 0x03,0x2f,0xb5,0xc2 },
732   { 0x9a,0x86,0xc5,0x7b }, { 0xa5,0xd3,0x37,0x08 },
733   { 0xf2,0x30,0x28,0x87 }, { 0xb2,0x23,0xbf,0xa5 },
734   { 0xba,0x02,0x03,0x6a }, { 0x5c,0xed,0x16,0x82 },
735   { 0x2b,0x8a,0xcf,0x1c }, { 0x92,0xa7,0x79,0xb4 },
736   { 0xf0,0xf3,0x07,0xf2 }, { 0xa1,0x4e,0x69,0xe2 },
737   { 0xcd,0x65,0xda,0xf4 }, { 0xd5,0x06,0x05,0xbe },
738   { 0x1f,0xd1,0x34,0x62 }, { 0x8a,0xc4,0xa6,0xfe },
739   { 0x9d,0x34,0x2e,0x53 }, { 0xa0,0xa2,0xf3,0x55 },
740   { 0x32,0x05,0x8a,0xe1 }, { 0x75,0xa4,0xf6,0xeb },
741   { 0x39,0x0b,0x83,0xec }, { 0xaa,0x40,0x60,0xef },
742   { 0x06,0x5e,0x71,0x9f }, { 0x51,0xbd,0x6e,0x10 },
743   { 0xf9,0x3e,0x21,0x8a }, { 0x3d,0x96,0xdd,0x06 },
744   { 0xae,0xdd,0x3e,0x05 }, { 0x46,0x4d,0xe6,0xbd },
745   { 0xb5,0x91,0x54,0x8d }, { 0x05,0x71,0xc4,0x5d },
746   { 0x6f,0x04,0x06,0xd4 }, { 0xff,0x60,0x50,0x15 },
747   { 0x24,0x19,0x98,0xfb }, { 0x97,0xd6,0xbd,0xe9 },
748   { 0xcc,0x89,0x40,0x43 }, { 0x77,0x67,0xd9,0x9e },
749   { 0xbd,0xb0,0xe8,0x42 }, { 0x88,0x07,0x89,0x8b },
750   { 0x38,0xe7,0x19,0x5b }, { 0xdb,0x79,0xc8,0xee },
751   { 0x47,0xa1,0x7c,0x0a }, { 0xe9,0x7c,0x42,0x0f },
752   { 0xc9,0xf8,0x84,0x1e }, { 0x00,0x00,0x00,0x00 },
753   { 0x83,0x09,0x80,0x86 }, { 0x48,0x32,0x2b,0xed },
754   { 0xac,0x1e,0x11,0x70 }, { 0x4e,0x6c,0x5a,0x72 },
755   { 0xfb,0xfd,0x0e,0xff }, { 0x56,0x0f,0x85,0x38 },
756   { 0x1e,0x3d,0xae,0xd5 }, { 0x27,0x36,0x2d,0x39 },
757   { 0x64,0x0a,0x0f,0xd9 }, { 0x21,0x68,0x5c,0xa6 },
758   { 0xd1,0x9b,0x5b,0x54 }, { 0x3a,0x24,0x36,0x2e },
759   { 0xb1,0x0c,0x0a,0x67 }, { 0x0f,0x93,0x57,0xe7 },
760   { 0xd2,0xb4,0xee,0x96 }, { 0x9e,0x1b,0x9b,0x91 },
761   { 0x4f,0x80,0xc0,0xc5 }, { 0xa2,0x61,0xdc,0x20 },
762   { 0x69,0x5a,0x77,0x4b }, { 0x16,0x1c,0x12,0x1a },
763   { 0x0a,0xe2,0x93,0xba }, { 0xe5,0xc0,0xa0,0x2a },
764   { 0x43,0x3c,0x22,0xe0 }, { 0x1d,0x12,0x1b,0x17 },
765   { 0x0b,0x0e,0x09,0x0d }, { 0xad,0xf2,0x8b,0xc7 },
766   { 0xb9,0x2d,0xb6,0xa8 }, { 0xc8,0x14,0x1e,0xa9 },
767   { 0x85,0x57,0xf1,0x19 }, { 0x4c,0xaf,0x75,0x07 },
768   { 0xbb,0xee,0x99,0xdd }, { 0xfd,0xa3,0x7f,0x60 },
769   { 0x9f,0xf7,0x01,0x26 }, { 0xbc,0x5c,0x72,0xf5 },
770   { 0xc5,0x44,0x66,0x3b }, { 0x34,0x5b,0xfb,0x7e },
771   { 0x76,0x8b,0x43,0x29 }, { 0xdc,0xcb,0x23,0xc6 },
772   { 0x68,0xb6,0xed,0xfc }, { 0x63,0xb8,0xe4,0xf1 },
773   { 0xca,0xd7,0x31,0xdc }, { 0x10,0x42,0x63,0x85 },
774   { 0x40,0x13,0x97,0x22 }, { 0x20,0x84,0xc6,0x11 },
775   { 0x7d,0x85,0x4a,0x24 }, { 0xf8,0xd2,0xbb,0x3d },
776   { 0x11,0xae,0xf9,0x32 }, { 0x6d,0xc7,0x29,0xa1 },
777   { 0x4b,0x1d,0x9e,0x2f }, { 0xf3,0xdc,0xb2,0x30 },
778   { 0xec,0x0d,0x86,0x52 }, { 0xd0,0x77,0xc1,0xe3 },
779   { 0x6c,0x2b,0xb3,0x16 }, { 0x99,0xa9,0x70,0xb9 },
780   { 0xfa,0x11,0x94,0x48 }, { 0x22,0x47,0xe9,0x64 },
781   { 0xc4,0xa8,0xfc,0x8c }, { 0x1a,0xa0,0xf0,0x3f },
782   { 0xd8,0x56,0x7d,0x2c }, { 0xef,0x22,0x33,0x90 },
783   { 0xc7,0x87,0x49,0x4e }, { 0xc1,0xd9,0x38,0xd1 },
784   { 0xfe,0x8c,0xca,0xa2 }, { 0x36,0x98,0xd4,0x0b },
785   { 0xcf,0xa6,0xf5,0x81 }, { 0x28,0xa5,0x7a,0xde },
786   { 0x26,0xda,0xb7,0x8e }, { 0xa4,0x3f,0xad,0xbf },
787   { 0xe4,0x2c,0x3a,0x9d }, { 0x0d,0x50,0x78,0x92 },
788   { 0x9b,0x6a,0x5f,0xcc }, { 0x62,0x54,0x7e,0x46 },
789   { 0xc2,0xf6,0x8d,0x13 }, { 0xe8,0x90,0xd8,0xb8 },
790   { 0x5e,0x2e,0x39,0xf7 }, { 0xf5,0x82,0xc3,0xaf },
791   { 0xbe,0x9f,0x5d,0x80 }, { 0x7c,0x69,0xd0,0x93 },
792   { 0xa9,0x6f,0xd5,0x2d }, { 0xb3,0xcf,0x25,0x12 },
793   { 0x3b,0xc8,0xac,0x99 }, { 0xa7,0x10,0x18,0x7d },
794   { 0x6e,0xe8,0x9c,0x63 }, { 0x7b,0xdb,0x3b,0xbb },
795   { 0x09,0xcd,0x26,0x78 }, { 0xf4,0x6e,0x59,0x18 },
796   { 0x01,0xec,0x9a,0xb7 }, { 0xa8,0x83,0x4f,0x9a },
797   { 0x65,0xe6,0x95,0x6e }, { 0x7e,0xaa,0xff,0xe6 },
798   { 0x08,0x21,0xbc,0xcf }, { 0xe6,0xef,0x15,0xe8 },
799   { 0xd9,0xba,0xe7,0x9b }, { 0xce,0x4a,0x6f,0x36 },
800   { 0xd4,0xea,0x9f,0x09 }, { 0xd6,0x29,0xb0,0x7c },
801   { 0xaf,0x31,0xa4,0xb2 }, { 0x31,0x2a,0x3f,0x23 },
802   { 0x30,0xc6,0xa5,0x94 }, { 0xc0,0x35,0xa2,0x66 },
803   { 0x37,0x74,0x4e,0xbc }, { 0xa6,0xfc,0x82,0xca },
804   { 0xb0,0xe0,0x90,0xd0 }, { 0x15,0x33,0xa7,0xd8 },
805   { 0x4a,0xf1,0x04,0x98 }, { 0xf7,0x41,0xec,0xda },
806   { 0x0e,0x7f,0xcd,0x50 }, { 0x2f,0x17,0x91,0xf6 },
807   { 0x8d,0x76,0x4d,0xd6 }, { 0x4d,0x43,0xef,0xb0 },
808   { 0x54,0xcc,0xaa,0x4d }, { 0xdf,0xe4,0x96,0x04 },
809   { 0xe3,0x9e,0xd1,0xb5 }, { 0x1b,0x4c,0x6a,0x88 },
810   { 0xb8,0xc1,0x2c,0x1f }, { 0x7f,0x46,0x65,0x51 },
811   { 0x04,0x9d,0x5e,0xea }, { 0x5d,0x01,0x8c,0x35 },
812   { 0x73,0xfa,0x87,0x74 }, { 0x2e,0xfb,0x0b,0x41 },
813   { 0x5a,0xb3,0x67,0x1d }, { 0x52,0x92,0xdb,0xd2 },
814   { 0x33,0xe9,0x10,0x56 }, { 0x13,0x6d,0xd6,0x47 },
815   { 0x8c,0x9a,0xd7,0x61 }, { 0x7a,0x37,0xa1,0x0c },
816   { 0x8e,0x59,0xf8,0x14 }, { 0x89,0xeb,0x13,0x3c },
817   { 0xee,0xce,0xa9,0x27 }, { 0x35,0xb7,0x61,0xc9 },
818   { 0xed,0xe1,0x1c,0xe5 }, { 0x3c,0x7a,0x47,0xb1 },
819   { 0x59,0x9c,0xd2,0xdf }, { 0x3f,0x55,0xf2,0x73 },
820   { 0x79,0x18,0x14,0xce }, { 0xbf,0x73,0xc7,0x37 },
821   { 0xea,0x53,0xf7,0xcd }, { 0x5b,0x5f,0xfd,0xaa },
822   { 0x14,0xdf,0x3d,0x6f }, { 0x86,0x78,0x44,0xdb },
823   { 0x81,0xca,0xaf,0xf3 }, { 0x3e,0xb9,0x68,0xc4 },
824   { 0x2c,0x38,0x24,0x34 }, { 0x5f,0xc2,0xa3,0x40 },
825   { 0x72,0x16,0x1d,0xc3 }, { 0x0c,0xbc,0xe2,0x25 },
826   { 0x8b,0x28,0x3c,0x49 }, { 0x41,0xff,0x0d,0x95 },
827   { 0x71,0x39,0xa8,0x01 }, { 0xde,0x08,0x0c,0xb3 },
828   { 0x9c,0xd8,0xb4,0xe4 }, { 0x90,0x64,0x56,0xc1 },
829   { 0x61,0x7b,0xcb,0x84 }, { 0x70,0xd5,0x32,0xb6 },
830   { 0x74,0x48,0x6c,0x5c }, { 0x42,0xd0,0xb8,0x57 }
831 };
832 
833 const unsigned char T7[256][4] = {
834   { 0xa7,0x50,0x51,0xf4 }, { 0x65,0x53,0x7e,0x41 },
835   { 0xa4,0xc3,0x1a,0x17 }, { 0x5e,0x96,0x3a,0x27 },
836   { 0x6b,0xcb,0x3b,0xab }, { 0x45,0xf1,0x1f,0x9d },
837   { 0x58,0xab,0xac,0xfa }, { 0x03,0x93,0x4b,0xe3 },
838   { 0xfa,0x55,0x20,0x30 }, { 0x6d,0xf6,0xad,0x76 },
839   { 0x76,0x91,0x88,0xcc }, { 0x4c,0x25,0xf5,0x02 },
840   { 0xd7,0xfc,0x4f,0xe5 }, { 0xcb,0xd7,0xc5,0x2a },
841   { 0x44,0x80,0x26,0x35 }, { 0xa3,0x8f,0xb5,0x62 },
842   { 0x5a,0x49,0xde,0xb1 }, { 0x1b,0x67,0x25,0xba },
843   { 0x0e,0x98,0x45,0xea }, { 0xc0,0xe1,0x5d,0xfe },
844   { 0x75,0x02,0xc3,0x2f }, { 0xf0,0x12,0x81,0x4c },
845   { 0x97,0xa3,0x8d,0x46 }, { 0xf9,0xc6,0x6b,0xd3 },
846   { 0x5f,0xe7,0x03,0x8f }, { 0x9c,0x95,0x15,0x92 },
847   { 0x7a,0xeb,0xbf,0x6d }, { 0x59,0xda,0x95,0x52 },
848   { 0x83,0x2d,0xd4,0xbe }, { 0x21,0xd3,0x58,0x74 },
849   { 0x69,0x29,0x49,0xe0 }, { 0xc8,0x44,0x8e,0xc9 },
850   { 0x89,0x6a,0x75,0xc2 }, { 0x79,0x78,0xf4,0x8e },
851   { 0x3e,0x6b,0x99,0x58 }, { 0x71,0xdd,0x27,0xb9 },
852   { 0x4f,0xb6,0xbe,0xe1 }, { 0xad,0x17,0xf0,0x88 },
853   { 0xac,0x66,0xc9,0x20 }, { 0x3a,0xb4,0x7d,0xce },
854   { 0x4a,0x18,0x63,0xdf }, { 0x31,0x82,0xe5,0x1a },
855   { 0x33,0x60,0x97,0x51 }, { 0x7f,0x45,0x62,0x53 },
856   { 0x77,0xe0,0xb1,0x64 }, { 0xae,0x84,0xbb,0x6b },
857   { 0xa0,0x1c,0xfe,0x81 }, { 0x2b,0x94,0xf9,0x08 },
858   { 0x68,0x58,0x70,0x48 }, { 0xfd,0x19,0x8f,0x45 },
859   { 0x6c,0x87,0x94,0xde }, { 0xf8,0xb7,0x52,0x7b },
860   { 0xd3,0x23,0xab,0x73 }, { 0x02,0xe2,0x72,0x4b },
861   { 0x8f,0x57,0xe3,0x1f }, { 0xab,0x2a,0x66,0x55 },
862   { 0x28,0x07,0xb2,0xeb }, { 0xc2,0x03,0x2f,0xb5 },
863   { 0x7b,0x9a,0x86,0xc5 }, { 0x08,0xa5,0xd3,0x37 },
864   { 0x87,0xf2,0x30,0x28 }, { 0xa5,0xb2,0x23,0xbf },
865   { 0x6a,0xba,0x02,0x03 }, { 0x82,0x5c,0xed,0x16 },
866   { 0x1c,0x2b,0x8a,0xcf }, { 0xb4,0x92,0xa7,0x79 },
867   { 0xf2,0xf0,0xf3,0x07 }, { 0xe2,0xa1,0x4e,0x69 },
868   { 0xf4,0xcd,0x65,0xda }, { 0xbe,0xd5,0x06,0x05 },
869   { 0x62,0x1f,0xd1,0x34 }, { 0xfe,0x8a,0xc4,0xa6 },
870   { 0x53,0x9d,0x34,0x2e }, { 0x55,0xa0,0xa2,0xf3 },
871   { 0xe1,0x32,0x05,0x8a }, { 0xeb,0x75,0xa4,0xf6 },
872   { 0xec,0x39,0x0b,0x83 }, { 0xef,0xaa,0x40,0x60 },
873   { 0x9f,0x06,0x5e,0x71 }, { 0x10,0x51,0xbd,0x6e },
874   { 0x8a,0xf9,0x3e,0x21 }, { 0x06,0x3d,0x96,0xdd },
875   { 0x05,0xae,0xdd,0x3e }, { 0xbd,0x46,0x4d,0xe6 },
876   { 0x8d,0xb5,0x91,0x54 }, { 0x5d,0x05,0x71,0xc4 },
877   { 0xd4,0x6f,0x04,0x06 }, { 0x15,0xff,0x60,0x50 },
878   { 0xfb,0x24,0x19,0x98 }, { 0xe9,0x97,0xd6,0xbd },
879   { 0x43,0xcc,0x89,0x40 }, { 0x9e,0x77,0x67,0xd9 },
880   { 0x42,0xbd,0xb0,0xe8 }, { 0x8b,0x88,0x07,0x89 },
881   { 0x5b,0x38,0xe7,0x19 }, { 0xee,0xdb,0x79,0xc8 },
882   { 0x0a,0x47,0xa1,0x7c }, { 0x0f,0xe9,0x7c,0x42 },
883   { 0x1e,0xc9,0xf8,0x84 }, { 0x00,0x00,0x00,0x00 },
884   { 0x86,0x83,0x09,0x80 }, { 0xed,0x48,0x32,0x2b },
885   { 0x70,0xac,0x1e,0x11 }, { 0x72,0x4e,0x6c,0x5a },
886   { 0xff,0xfb,0xfd,0x0e }, { 0x38,0x56,0x0f,0x85 },
887   { 0xd5,0x1e,0x3d,0xae }, { 0x39,0x27,0x36,0x2d },
888   { 0xd9,0x64,0x0a,0x0f }, { 0xa6,0x21,0x68,0x5c },
889   { 0x54,0xd1,0x9b,0x5b }, { 0x2e,0x3a,0x24,0x36 },
890   { 0x67,0xb1,0x0c,0x0a }, { 0xe7,0x0f,0x93,0x57 },
891   { 0x96,0xd2,0xb4,0xee }, { 0x91,0x9e,0x1b,0x9b },
892   { 0xc5,0x4f,0x80,0xc0 }, { 0x20,0xa2,0x61,0xdc },
893   { 0x4b,0x69,0x5a,0x77 }, { 0x1a,0x16,0x1c,0x12 },
894   { 0xba,0x0a,0xe2,0x93 }, { 0x2a,0xe5,0xc0,0xa0 },
895   { 0xe0,0x43,0x3c,0x22 }, { 0x17,0x1d,0x12,0x1b },
896   { 0x0d,0x0b,0x0e,0x09 }, { 0xc7,0xad,0xf2,0x8b },
897   { 0xa8,0xb9,0x2d,0xb6 }, { 0xa9,0xc8,0x14,0x1e },
898   { 0x19,0x85,0x57,0xf1 }, { 0x07,0x4c,0xaf,0x75 },
899   { 0xdd,0xbb,0xee,0x99 }, { 0x60,0xfd,0xa3,0x7f },
900   { 0x26,0x9f,0xf7,0x01 }, { 0xf5,0xbc,0x5c,0x72 },
901   { 0x3b,0xc5,0x44,0x66 }, { 0x7e,0x34,0x5b,0xfb },
902   { 0x29,0x76,0x8b,0x43 }, { 0xc6,0xdc,0xcb,0x23 },
903   { 0xfc,0x68,0xb6,0xed }, { 0xf1,0x63,0xb8,0xe4 },
904   { 0xdc,0xca,0xd7,0x31 }, { 0x85,0x10,0x42,0x63 },
905   { 0x22,0x40,0x13,0x97 }, { 0x11,0x20,0x84,0xc6 },
906   { 0x24,0x7d,0x85,0x4a }, { 0x3d,0xf8,0xd2,0xbb },
907   { 0x32,0x11,0xae,0xf9 }, { 0xa1,0x6d,0xc7,0x29 },
908   { 0x2f,0x4b,0x1d,0x9e }, { 0x30,0xf3,0xdc,0xb2 },
909   { 0x52,0xec,0x0d,0x86 }, { 0xe3,0xd0,0x77,0xc1 },
910   { 0x16,0x6c,0x2b,0xb3 }, { 0xb9,0x99,0xa9,0x70 },
911   { 0x48,0xfa,0x11,0x94 }, { 0x64,0x22,0x47,0xe9 },
912   { 0x8c,0xc4,0xa8,0xfc }, { 0x3f,0x1a,0xa0,0xf0 },
913   { 0x2c,0xd8,0x56,0x7d }, { 0x90,0xef,0x22,0x33 },
914   { 0x4e,0xc7,0x87,0x49 }, { 0xd1,0xc1,0xd9,0x38 },
915   { 0xa2,0xfe,0x8c,0xca }, { 0x0b,0x36,0x98,0xd4 },
916   { 0x81,0xcf,0xa6,0xf5 }, { 0xde,0x28,0xa5,0x7a },
917   { 0x8e,0x26,0xda,0xb7 }, { 0xbf,0xa4,0x3f,0xad },
918   { 0x9d,0xe4,0x2c,0x3a }, { 0x92,0x0d,0x50,0x78 },
919   { 0xcc,0x9b,0x6a,0x5f }, { 0x46,0x62,0x54,0x7e },
920   { 0x13,0xc2,0xf6,0x8d }, { 0xb8,0xe8,0x90,0xd8 },
921   { 0xf7,0x5e,0x2e,0x39 }, { 0xaf,0xf5,0x82,0xc3 },
922   { 0x80,0xbe,0x9f,0x5d }, { 0x93,0x7c,0x69,0xd0 },
923   { 0x2d,0xa9,0x6f,0xd5 }, { 0x12,0xb3,0xcf,0x25 },
924   { 0x99,0x3b,0xc8,0xac }, { 0x7d,0xa7,0x10,0x18 },
925   { 0x63,0x6e,0xe8,0x9c }, { 0xbb,0x7b,0xdb,0x3b },
926   { 0x78,0x09,0xcd,0x26 }, { 0x18,0xf4,0x6e,0x59 },
927   { 0xb7,0x01,0xec,0x9a }, { 0x9a,0xa8,0x83,0x4f },
928   { 0x6e,0x65,0xe6,0x95 }, { 0xe6,0x7e,0xaa,0xff },
929   { 0xcf,0x08,0x21,0xbc }, { 0xe8,0xe6,0xef,0x15 },
930   { 0x9b,0xd9,0xba,0xe7 }, { 0x36,0xce,0x4a,0x6f },
931   { 0x09,0xd4,0xea,0x9f }, { 0x7c,0xd6,0x29,0xb0 },
932   { 0xb2,0xaf,0x31,0xa4 }, { 0x23,0x31,0x2a,0x3f },
933   { 0x94,0x30,0xc6,0xa5 }, { 0x66,0xc0,0x35,0xa2 },
934   { 0xbc,0x37,0x74,0x4e }, { 0xca,0xa6,0xfc,0x82 },
935   { 0xd0,0xb0,0xe0,0x90 }, { 0xd8,0x15,0x33,0xa7 },
936   { 0x98,0x4a,0xf1,0x04 }, { 0xda,0xf7,0x41,0xec },
937   { 0x50,0x0e,0x7f,0xcd }, { 0xf6,0x2f,0x17,0x91 },
938   { 0xd6,0x8d,0x76,0x4d }, { 0xb0,0x4d,0x43,0xef },
939   { 0x4d,0x54,0xcc,0xaa }, { 0x04,0xdf,0xe4,0x96 },
940   { 0xb5,0xe3,0x9e,0xd1 }, { 0x88,0x1b,0x4c,0x6a },
941   { 0x1f,0xb8,0xc1,0x2c }, { 0x51,0x7f,0x46,0x65 },
942   { 0xea,0x04,0x9d,0x5e }, { 0x35,0x5d,0x01,0x8c },
943   { 0x74,0x73,0xfa,0x87 }, { 0x41,0x2e,0xfb,0x0b },
944   { 0x1d,0x5a,0xb3,0x67 }, { 0xd2,0x52,0x92,0xdb },
945   { 0x56,0x33,0xe9,0x10 }, { 0x47,0x13,0x6d,0xd6 },
946   { 0x61,0x8c,0x9a,0xd7 }, { 0x0c,0x7a,0x37,0xa1 },
947   { 0x14,0x8e,0x59,0xf8 }, { 0x3c,0x89,0xeb,0x13 },
948   { 0x27,0xee,0xce,0xa9 }, { 0xc9,0x35,0xb7,0x61 },
949   { 0xe5,0xed,0xe1,0x1c }, { 0xb1,0x3c,0x7a,0x47 },
950   { 0xdf,0x59,0x9c,0xd2 }, { 0x73,0x3f,0x55,0xf2 },
951   { 0xce,0x79,0x18,0x14 }, { 0x37,0xbf,0x73,0xc7 },
952   { 0xcd,0xea,0x53,0xf7 }, { 0xaa,0x5b,0x5f,0xfd },
953   { 0x6f,0x14,0xdf,0x3d }, { 0xdb,0x86,0x78,0x44 },
954   { 0xf3,0x81,0xca,0xaf }, { 0xc4,0x3e,0xb9,0x68 },
955   { 0x34,0x2c,0x38,0x24 }, { 0x40,0x5f,0xc2,0xa3 },
956   { 0xc3,0x72,0x16,0x1d }, { 0x25,0x0c,0xbc,0xe2 },
957   { 0x49,0x8b,0x28,0x3c }, { 0x95,0x41,0xff,0x0d },
958   { 0x01,0x71,0x39,0xa8 }, { 0xb3,0xde,0x08,0x0c },
959   { 0xe4,0x9c,0xd8,0xb4 }, { 0xc1,0x90,0x64,0x56 },
960   { 0x84,0x61,0x7b,0xcb }, { 0xb6,0x70,0xd5,0x32 },
961   { 0x5c,0x74,0x48,0x6c }, { 0x57,0x42,0xd0,0xb8 }
962 };
963 
964 const unsigned char  T8[256][4] = {
965   { 0xf4,0xa7,0x50,0x51 }, { 0x41,0x65,0x53,0x7e },
966   { 0x17,0xa4,0xc3,0x1a }, { 0x27,0x5e,0x96,0x3a },
967   { 0xab,0x6b,0xcb,0x3b }, { 0x9d,0x45,0xf1,0x1f },
968   { 0xfa,0x58,0xab,0xac }, { 0xe3,0x03,0x93,0x4b },
969   { 0x30,0xfa,0x55,0x20 }, { 0x76,0x6d,0xf6,0xad },
970   { 0xcc,0x76,0x91,0x88 }, { 0x02,0x4c,0x25,0xf5 },
971   { 0xe5,0xd7,0xfc,0x4f }, { 0x2a,0xcb,0xd7,0xc5 },
972   { 0x35,0x44,0x80,0x26 }, { 0x62,0xa3,0x8f,0xb5 },
973   { 0xb1,0x5a,0x49,0xde }, { 0xba,0x1b,0x67,0x25 },
974   { 0xea,0x0e,0x98,0x45 }, { 0xfe,0xc0,0xe1,0x5d },
975   { 0x2f,0x75,0x02,0xc3 }, { 0x4c,0xf0,0x12,0x81 },
976   { 0x46,0x97,0xa3,0x8d }, { 0xd3,0xf9,0xc6,0x6b },
977   { 0x8f,0x5f,0xe7,0x03 }, { 0x92,0x9c,0x95,0x15 },
978   { 0x6d,0x7a,0xeb,0xbf }, { 0x52,0x59,0xda,0x95 },
979   { 0xbe,0x83,0x2d,0xd4 }, { 0x74,0x21,0xd3,0x58 },
980   { 0xe0,0x69,0x29,0x49 }, { 0xc9,0xc8,0x44,0x8e },
981   { 0xc2,0x89,0x6a,0x75 }, { 0x8e,0x79,0x78,0xf4 },
982   { 0x58,0x3e,0x6b,0x99 }, { 0xb9,0x71,0xdd,0x27 },
983   { 0xe1,0x4f,0xb6,0xbe }, { 0x88,0xad,0x17,0xf0 },
984   { 0x20,0xac,0x66,0xc9 }, { 0xce,0x3a,0xb4,0x7d },
985   { 0xdf,0x4a,0x18,0x63 }, { 0x1a,0x31,0x82,0xe5 },
986   { 0x51,0x33,0x60,0x97 }, { 0x53,0x7f,0x45,0x62 },
987   { 0x64,0x77,0xe0,0xb1 }, { 0x6b,0xae,0x84,0xbb },
988   { 0x81,0xa0,0x1c,0xfe }, { 0x08,0x2b,0x94,0xf9 },
989   { 0x48,0x68,0x58,0x70 }, { 0x45,0xfd,0x19,0x8f },
990   { 0xde,0x6c,0x87,0x94 }, { 0x7b,0xf8,0xb7,0x52 },
991   { 0x73,0xd3,0x23,0xab }, { 0x4b,0x02,0xe2,0x72 },
992   { 0x1f,0x8f,0x57,0xe3 }, { 0x55,0xab,0x2a,0x66 },
993   { 0xeb,0x28,0x07,0xb2 }, { 0xb5,0xc2,0x03,0x2f },
994   { 0xc5,0x7b,0x9a,0x86 }, { 0x37,0x08,0xa5,0xd3 },
995   { 0x28,0x87,0xf2,0x30 }, { 0xbf,0xa5,0xb2,0x23 },
996   { 0x03,0x6a,0xba,0x02 }, { 0x16,0x82,0x5c,0xed },
997   { 0xcf,0x1c,0x2b,0x8a }, { 0x79,0xb4,0x92,0xa7 },
998   { 0x07,0xf2,0xf0,0xf3 }, { 0x69,0xe2,0xa1,0x4e },
999   { 0xda,0xf4,0xcd,0x65 }, { 0x05,0xbe,0xd5,0x06 },
1000   { 0x34,0x62,0x1f,0xd1 }, { 0xa6,0xfe,0x8a,0xc4 },
1001   { 0x2e,0x53,0x9d,0x34 }, { 0xf3,0x55,0xa0,0xa2 },
1002   { 0x8a,0xe1,0x32,0x05 }, { 0xf6,0xeb,0x75,0xa4 },
1003   { 0x83,0xec,0x39,0x0b }, { 0x60,0xef,0xaa,0x40 },
1004   { 0x71,0x9f,0x06,0x5e }, { 0x6e,0x10,0x51,0xbd },
1005   { 0x21,0x8a,0xf9,0x3e }, { 0xdd,0x06,0x3d,0x96 },
1006   { 0x3e,0x05,0xae,0xdd }, { 0xe6,0xbd,0x46,0x4d },
1007   { 0x54,0x8d,0xb5,0x91 }, { 0xc4,0x5d,0x05,0x71 },
1008   { 0x06,0xd4,0x6f,0x04 }, { 0x50,0x15,0xff,0x60 },
1009   { 0x98,0xfb,0x24,0x19 }, { 0xbd,0xe9,0x97,0xd6 },
1010   { 0x40,0x43,0xcc,0x89 }, { 0xd9,0x9e,0x77,0x67 },
1011   { 0xe8,0x42,0xbd,0xb0 }, { 0x89,0x8b,0x88,0x07 },
1012   { 0x19,0x5b,0x38,0xe7 }, { 0xc8,0xee,0xdb,0x79 },
1013   { 0x7c,0x0a,0x47,0xa1 }, { 0x42,0x0f,0xe9,0x7c },
1014   { 0x84,0x1e,0xc9,0xf8 }, { 0x00,0x00,0x00,0x00 },
1015   { 0x80,0x86,0x83,0x09 }, { 0x2b,0xed,0x48,0x32 },
1016   { 0x11,0x70,0xac,0x1e }, { 0x5a,0x72,0x4e,0x6c },
1017   { 0x0e,0xff,0xfb,0xfd }, { 0x85,0x38,0x56,0x0f },
1018   { 0xae,0xd5,0x1e,0x3d }, { 0x2d,0x39,0x27,0x36 },
1019   { 0x0f,0xd9,0x64,0x0a }, { 0x5c,0xa6,0x21,0x68 },
1020   { 0x5b,0x54,0xd1,0x9b }, { 0x36,0x2e,0x3a,0x24 },
1021   { 0x0a,0x67,0xb1,0x0c }, { 0x57,0xe7,0x0f,0x93 },
1022   { 0xee,0x96,0xd2,0xb4 }, { 0x9b,0x91,0x9e,0x1b },
1023   { 0xc0,0xc5,0x4f,0x80 }, { 0xdc,0x20,0xa2,0x61 },
1024   { 0x77,0x4b,0x69,0x5a }, { 0x12,0x1a,0x16,0x1c },
1025   { 0x93,0xba,0x0a,0xe2 }, { 0xa0,0x2a,0xe5,0xc0 },
1026   { 0x22,0xe0,0x43,0x3c }, { 0x1b,0x17,0x1d,0x12 },
1027   { 0x09,0x0d,0x0b,0x0e }, { 0x8b,0xc7,0xad,0xf2 },
1028   { 0xb6,0xa8,0xb9,0x2d }, { 0x1e,0xa9,0xc8,0x14 },
1029   { 0xf1,0x19,0x85,0x57 }, { 0x75,0x07,0x4c,0xaf },
1030   { 0x99,0xdd,0xbb,0xee }, { 0x7f,0x60,0xfd,0xa3 },
1031   { 0x01,0x26,0x9f,0xf7 }, { 0x72,0xf5,0xbc,0x5c },
1032   { 0x66,0x3b,0xc5,0x44 }, { 0xfb,0x7e,0x34,0x5b },
1033   { 0x43,0x29,0x76,0x8b }, { 0x23,0xc6,0xdc,0xcb },
1034   { 0xed,0xfc,0x68,0xb6 }, { 0xe4,0xf1,0x63,0xb8 },
1035   { 0x31,0xdc,0xca,0xd7 }, { 0x63,0x85,0x10,0x42 },
1036   { 0x97,0x22,0x40,0x13 }, { 0xc6,0x11,0x20,0x84 },
1037   { 0x4a,0x24,0x7d,0x85 }, { 0xbb,0x3d,0xf8,0xd2 },
1038   { 0xf9,0x32,0x11,0xae }, { 0x29,0xa1,0x6d,0xc7 },
1039   { 0x9e,0x2f,0x4b,0x1d }, { 0xb2,0x30,0xf3,0xdc },
1040   { 0x86,0x52,0xec,0x0d }, { 0xc1,0xe3,0xd0,0x77 },
1041   { 0xb3,0x16,0x6c,0x2b }, { 0x70,0xb9,0x99,0xa9 },
1042   { 0x94,0x48,0xfa,0x11 }, { 0xe9,0x64,0x22,0x47 },
1043   { 0xfc,0x8c,0xc4,0xa8 }, { 0xf0,0x3f,0x1a,0xa0 },
1044   { 0x7d,0x2c,0xd8,0x56 }, { 0x33,0x90,0xef,0x22 },
1045   { 0x49,0x4e,0xc7,0x87 }, { 0x38,0xd1,0xc1,0xd9 },
1046   { 0xca,0xa2,0xfe,0x8c }, { 0xd4,0x0b,0x36,0x98 },
1047   { 0xf5,0x81,0xcf,0xa6 }, { 0x7a,0xde,0x28,0xa5 },
1048   { 0xb7,0x8e,0x26,0xda }, { 0xad,0xbf,0xa4,0x3f },
1049   { 0x3a,0x9d,0xe4,0x2c }, { 0x78,0x92,0x0d,0x50 },
1050   { 0x5f,0xcc,0x9b,0x6a }, { 0x7e,0x46,0x62,0x54 },
1051   { 0x8d,0x13,0xc2,0xf6 }, { 0xd8,0xb8,0xe8,0x90 },
1052   { 0x39,0xf7,0x5e,0x2e }, { 0xc3,0xaf,0xf5,0x82 },
1053   { 0x5d,0x80,0xbe,0x9f }, { 0xd0,0x93,0x7c,0x69 },
1054   { 0xd5,0x2d,0xa9,0x6f }, { 0x25,0x12,0xb3,0xcf },
1055   { 0xac,0x99,0x3b,0xc8 }, { 0x18,0x7d,0xa7,0x10 },
1056   { 0x9c,0x63,0x6e,0xe8 }, { 0x3b,0xbb,0x7b,0xdb },
1057   { 0x26,0x78,0x09,0xcd }, { 0x59,0x18,0xf4,0x6e },
1058   { 0x9a,0xb7,0x01,0xec }, { 0x4f,0x9a,0xa8,0x83 },
1059   { 0x95,0x6e,0x65,0xe6 }, { 0xff,0xe6,0x7e,0xaa },
1060   { 0xbc,0xcf,0x08,0x21 }, { 0x15,0xe8,0xe6,0xef },
1061   { 0xe7,0x9b,0xd9,0xba }, { 0x6f,0x36,0xce,0x4a },
1062   { 0x9f,0x09,0xd4,0xea }, { 0xb0,0x7c,0xd6,0x29 },
1063   { 0xa4,0xb2,0xaf,0x31 }, { 0x3f,0x23,0x31,0x2a },
1064   { 0xa5,0x94,0x30,0xc6 }, { 0xa2,0x66,0xc0,0x35 },
1065   { 0x4e,0xbc,0x37,0x74 }, { 0x82,0xca,0xa6,0xfc },
1066   { 0x90,0xd0,0xb0,0xe0 }, { 0xa7,0xd8,0x15,0x33 },
1067   { 0x04,0x98,0x4a,0xf1 }, { 0xec,0xda,0xf7,0x41 },
1068   { 0xcd,0x50,0x0e,0x7f }, { 0x91,0xf6,0x2f,0x17 },
1069   { 0x4d,0xd6,0x8d,0x76 }, { 0xef,0xb0,0x4d,0x43 },
1070   { 0xaa,0x4d,0x54,0xcc }, { 0x96,0x04,0xdf,0xe4 },
1071   { 0xd1,0xb5,0xe3,0x9e }, { 0x6a,0x88,0x1b,0x4c },
1072   { 0x2c,0x1f,0xb8,0xc1 }, { 0x65,0x51,0x7f,0x46 },
1073   { 0x5e,0xea,0x04,0x9d }, { 0x8c,0x35,0x5d,0x01 },
1074   { 0x87,0x74,0x73,0xfa }, { 0x0b,0x41,0x2e,0xfb },
1075   { 0x67,0x1d,0x5a,0xb3 }, { 0xdb,0xd2,0x52,0x92 },
1076   { 0x10,0x56,0x33,0xe9 }, { 0xd6,0x47,0x13,0x6d },
1077   { 0xd7,0x61,0x8c,0x9a }, { 0xa1,0x0c,0x7a,0x37 },
1078   { 0xf8,0x14,0x8e,0x59 }, { 0x13,0x3c,0x89,0xeb },
1079   { 0xa9,0x27,0xee,0xce }, { 0x61,0xc9,0x35,0xb7 },
1080   { 0x1c,0xe5,0xed,0xe1 }, { 0x47,0xb1,0x3c,0x7a },
1081   { 0xd2,0xdf,0x59,0x9c }, { 0xf2,0x73,0x3f,0x55 },
1082   { 0x14,0xce,0x79,0x18 }, { 0xc7,0x37,0xbf,0x73 },
1083   { 0xf7,0xcd,0xea,0x53 }, { 0xfd,0xaa,0x5b,0x5f },
1084   { 0x3d,0x6f,0x14,0xdf }, { 0x44,0xdb,0x86,0x78 },
1085   { 0xaf,0xf3,0x81,0xca }, { 0x68,0xc4,0x3e,0xb9 },
1086   { 0x24,0x34,0x2c,0x38 }, { 0xa3,0x40,0x5f,0xc2 },
1087   { 0x1d,0xc3,0x72,0x16 }, { 0xe2,0x25,0x0c,0xbc },
1088   { 0x3c,0x49,0x8b,0x28 }, { 0x0d,0x95,0x41,0xff },
1089   { 0xa8,0x01,0x71,0x39 }, { 0x0c,0xb3,0xde,0x08 },
1090   { 0xb4,0xe4,0x9c,0xd8 }, { 0x56,0xc1,0x90,0x64 },
1091   { 0xcb,0x84,0x61,0x7b }, { 0x32,0xb6,0x70,0xd5 },
1092   { 0x6c,0x5c,0x74,0x48 }, { 0xb8,0x57,0x42,0xd0 }
1093 };
1094 
1095 const unsigned char S5[256] = {
1096   0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38,
1097   0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb,
1098   0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87,
1099   0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb,
1100   0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d,
1101   0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e,
1102   0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2,
1103   0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25,
1104   0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16,
1105   0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92,
1106   0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda,
1107   0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84,
1108   0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a,
1109   0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06,
1110   0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02,
1111   0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b,
1112   0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea,
1113   0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73,
1114   0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85,
1115   0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e,
1116   0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89,
1117   0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b,
1118   0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20,
1119   0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4,
1120   0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31,
1121   0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f,
1122   0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d,
1123   0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef,
1124   0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0,
1125   0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61,
1126   0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26,
1127   0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
1128 };
1129 
1130 const unsigned char U1[256][4] = {
1131   { 0x00,0x00,0x00,0x00 }, { 0x0e,0x09,0x0d,0x0b },
1132   { 0x1c,0x12,0x1a,0x16 }, { 0x12,0x1b,0x17,0x1d },
1133   { 0x38,0x24,0x34,0x2c }, { 0x36,0x2d,0x39,0x27 },
1134   { 0x24,0x36,0x2e,0x3a }, { 0x2a,0x3f,0x23,0x31 },
1135   { 0x70,0x48,0x68,0x58 }, { 0x7e,0x41,0x65,0x53 },
1136   { 0x6c,0x5a,0x72,0x4e }, { 0x62,0x53,0x7f,0x45 },
1137   { 0x48,0x6c,0x5c,0x74 }, { 0x46,0x65,0x51,0x7f },
1138   { 0x54,0x7e,0x46,0x62 }, { 0x5a,0x77,0x4b,0x69 },
1139   { 0xe0,0x90,0xd0,0xb0 }, { 0xee,0x99,0xdd,0xbb },
1140   { 0xfc,0x82,0xca,0xa6 }, { 0xf2,0x8b,0xc7,0xad },
1141   { 0xd8,0xb4,0xe4,0x9c }, { 0xd6,0xbd,0xe9,0x97 },
1142   { 0xc4,0xa6,0xfe,0x8a }, { 0xca,0xaf,0xf3,0x81 },
1143   { 0x90,0xd8,0xb8,0xe8 }, { 0x9e,0xd1,0xb5,0xe3 },
1144   { 0x8c,0xca,0xa2,0xfe }, { 0x82,0xc3,0xaf,0xf5 },
1145   { 0xa8,0xfc,0x8c,0xc4 }, { 0xa6,0xf5,0x81,0xcf },
1146   { 0xb4,0xee,0x96,0xd2 }, { 0xba,0xe7,0x9b,0xd9 },
1147   { 0xdb,0x3b,0xbb,0x7b }, { 0xd5,0x32,0xb6,0x70 },
1148   { 0xc7,0x29,0xa1,0x6d }, { 0xc9,0x20,0xac,0x66 },
1149   { 0xe3,0x1f,0x8f,0x57 }, { 0xed,0x16,0x82,0x5c },
1150   { 0xff,0x0d,0x95,0x41 }, { 0xf1,0x04,0x98,0x4a },
1151   { 0xab,0x73,0xd3,0x23 }, { 0xa5,0x7a,0xde,0x28 },
1152   { 0xb7,0x61,0xc9,0x35 }, { 0xb9,0x68,0xc4,0x3e },
1153   { 0x93,0x57,0xe7,0x0f }, { 0x9d,0x5e,0xea,0x04 },
1154   { 0x8f,0x45,0xfd,0x19 }, { 0x81,0x4c,0xf0,0x12 },
1155   { 0x3b,0xab,0x6b,0xcb }, { 0x35,0xa2,0x66,0xc0 },
1156   { 0x27,0xb9,0x71,0xdd }, { 0x29,0xb0,0x7c,0xd6 },
1157   { 0x03,0x8f,0x5f,0xe7 }, { 0x0d,0x86,0x52,0xec },
1158   { 0x1f,0x9d,0x45,0xf1 }, { 0x11,0x94,0x48,0xfa },
1159   { 0x4b,0xe3,0x03,0x93 }, { 0x45,0xea,0x0e,0x98 },
1160   { 0x57,0xf1,0x19,0x85 }, { 0x59,0xf8,0x14,0x8e },
1161   { 0x73,0xc7,0x37,0xbf }, { 0x7d,0xce,0x3a,0xb4 },
1162   { 0x6f,0xd5,0x2d,0xa9 }, { 0x61,0xdc,0x20,0xa2 },
1163   { 0xad,0x76,0x6d,0xf6 }, { 0xa3,0x7f,0x60,0xfd },
1164   { 0xb1,0x64,0x77,0xe0 }, { 0xbf,0x6d,0x7a,0xeb },
1165   { 0x95,0x52,0x59,0xda }, { 0x9b,0x5b,0x54,0xd1 },
1166   { 0x89,0x40,0x43,0xcc }, { 0x87,0x49,0x4e,0xc7 },
1167   { 0xdd,0x3e,0x05,0xae }, { 0xd3,0x37,0x08,0xa5 },
1168   { 0xc1,0x2c,0x1f,0xb8 }, { 0xcf,0x25,0x12,0xb3 },
1169   { 0xe5,0x1a,0x31,0x82 }, { 0xeb,0x13,0x3c,0x89 },
1170   { 0xf9,0x08,0x2b,0x94 }, { 0xf7,0x01,0x26,0x9f },
1171   { 0x4d,0xe6,0xbd,0x46 }, { 0x43,0xef,0xb0,0x4d },
1172   { 0x51,0xf4,0xa7,0x50 }, { 0x5f,0xfd,0xaa,0x5b },
1173   { 0x75,0xc2,0x89,0x6a }, { 0x7b,0xcb,0x84,0x61 },
1174   { 0x69,0xd0,0x93,0x7c }, { 0x67,0xd9,0x9e,0x77 },
1175   { 0x3d,0xae,0xd5,0x1e }, { 0x33,0xa7,0xd8,0x15 },
1176   { 0x21,0xbc,0xcf,0x08 }, { 0x2f,0xb5,0xc2,0x03 },
1177   { 0x05,0x8a,0xe1,0x32 }, { 0x0b,0x83,0xec,0x39 },
1178   { 0x19,0x98,0xfb,0x24 }, { 0x17,0x91,0xf6,0x2f },
1179   { 0x76,0x4d,0xd6,0x8d }, { 0x78,0x44,0xdb,0x86 },
1180   { 0x6a,0x5f,0xcc,0x9b }, { 0x64,0x56,0xc1,0x90 },
1181   { 0x4e,0x69,0xe2,0xa1 }, { 0x40,0x60,0xef,0xaa },
1182   { 0x52,0x7b,0xf8,0xb7 }, { 0x5c,0x72,0xf5,0xbc },
1183   { 0x06,0x05,0xbe,0xd5 }, { 0x08,0x0c,0xb3,0xde },
1184   { 0x1a,0x17,0xa4,0xc3 }, { 0x14,0x1e,0xa9,0xc8 },
1185   { 0x3e,0x21,0x8a,0xf9 }, { 0x30,0x28,0x87,0xf2 },
1186   { 0x22,0x33,0x90,0xef }, { 0x2c,0x3a,0x9d,0xe4 },
1187   { 0x96,0xdd,0x06,0x3d }, { 0x98,0xd4,0x0b,0x36 },
1188   { 0x8a,0xcf,0x1c,0x2b }, { 0x84,0xc6,0x11,0x20 },
1189   { 0xae,0xf9,0x32,0x11 }, { 0xa0,0xf0,0x3f,0x1a },
1190   { 0xb2,0xeb,0x28,0x07 }, { 0xbc,0xe2,0x25,0x0c },
1191   { 0xe6,0x95,0x6e,0x65 }, { 0xe8,0x9c,0x63,0x6e },
1192   { 0xfa,0x87,0x74,0x73 }, { 0xf4,0x8e,0x79,0x78 },
1193   { 0xde,0xb1,0x5a,0x49 }, { 0xd0,0xb8,0x57,0x42 },
1194   { 0xc2,0xa3,0x40,0x5f }, { 0xcc,0xaa,0x4d,0x54 },
1195   { 0x41,0xec,0xda,0xf7 }, { 0x4f,0xe5,0xd7,0xfc },
1196   { 0x5d,0xfe,0xc0,0xe1 }, { 0x53,0xf7,0xcd,0xea },
1197   { 0x79,0xc8,0xee,0xdb }, { 0x77,0xc1,0xe3,0xd0 },
1198   { 0x65,0xda,0xf4,0xcd }, { 0x6b,0xd3,0xf9,0xc6 },
1199   { 0x31,0xa4,0xb2,0xaf }, { 0x3f,0xad,0xbf,0xa4 },
1200   { 0x2d,0xb6,0xa8,0xb9 }, { 0x23,0xbf,0xa5,0xb2 },
1201   { 0x09,0x80,0x86,0x83 }, { 0x07,0x89,0x8b,0x88 },
1202   { 0x15,0x92,0x9c,0x95 }, { 0x1b,0x9b,0x91,0x9e },
1203   { 0xa1,0x7c,0x0a,0x47 }, { 0xaf,0x75,0x07,0x4c },
1204   { 0xbd,0x6e,0x10,0x51 }, { 0xb3,0x67,0x1d,0x5a },
1205   { 0x99,0x58,0x3e,0x6b }, { 0x97,0x51,0x33,0x60 },
1206   { 0x85,0x4a,0x24,0x7d }, { 0x8b,0x43,0x29,0x76 },
1207   { 0xd1,0x34,0x62,0x1f }, { 0xdf,0x3d,0x6f,0x14 },
1208   { 0xcd,0x26,0x78,0x09 }, { 0xc3,0x2f,0x75,0x02 },
1209   { 0xe9,0x10,0x56,0x33 }, { 0xe7,0x19,0x5b,0x38 },
1210   { 0xf5,0x02,0x4c,0x25 }, { 0xfb,0x0b,0x41,0x2e },
1211   { 0x9a,0xd7,0x61,0x8c }, { 0x94,0xde,0x6c,0x87 },
1212   { 0x86,0xc5,0x7b,0x9a }, { 0x88,0xcc,0x76,0x91 },
1213   { 0xa2,0xf3,0x55,0xa0 }, { 0xac,0xfa,0x58,0xab },
1214   { 0xbe,0xe1,0x4f,0xb6 }, { 0xb0,0xe8,0x42,0xbd },
1215   { 0xea,0x9f,0x09,0xd4 }, { 0xe4,0x96,0x04,0xdf },
1216   { 0xf6,0x8d,0x13,0xc2 }, { 0xf8,0x84,0x1e,0xc9 },
1217   { 0xd2,0xbb,0x3d,0xf8 }, { 0xdc,0xb2,0x30,0xf3 },
1218   { 0xce,0xa9,0x27,0xee }, { 0xc0,0xa0,0x2a,0xe5 },
1219   { 0x7a,0x47,0xb1,0x3c }, { 0x74,0x4e,0xbc,0x37 },
1220   { 0x66,0x55,0xab,0x2a }, { 0x68,0x5c,0xa6,0x21 },
1221   { 0x42,0x63,0x85,0x10 }, { 0x4c,0x6a,0x88,0x1b },
1222   { 0x5e,0x71,0x9f,0x06 }, { 0x50,0x78,0x92,0x0d },
1223   { 0x0a,0x0f,0xd9,0x64 }, { 0x04,0x06,0xd4,0x6f },
1224   { 0x16,0x1d,0xc3,0x72 }, { 0x18,0x14,0xce,0x79 },
1225   { 0x32,0x2b,0xed,0x48 }, { 0x3c,0x22,0xe0,0x43 },
1226   { 0x2e,0x39,0xf7,0x5e }, { 0x20,0x30,0xfa,0x55 },
1227   { 0xec,0x9a,0xb7,0x01 }, { 0xe2,0x93,0xba,0x0a },
1228   { 0xf0,0x88,0xad,0x17 }, { 0xfe,0x81,0xa0,0x1c },
1229   { 0xd4,0xbe,0x83,0x2d }, { 0xda,0xb7,0x8e,0x26 },
1230   { 0xc8,0xac,0x99,0x3b }, { 0xc6,0xa5,0x94,0x30 },
1231   { 0x9c,0xd2,0xdf,0x59 }, { 0x92,0xdb,0xd2,0x52 },
1232   { 0x80,0xc0,0xc5,0x4f }, { 0x8e,0xc9,0xc8,0x44 },
1233   { 0xa4,0xf6,0xeb,0x75 }, { 0xaa,0xff,0xe6,0x7e },
1234   { 0xb8,0xe4,0xf1,0x63 }, { 0xb6,0xed,0xfc,0x68 },
1235   { 0x0c,0x0a,0x67,0xb1 }, { 0x02,0x03,0x6a,0xba },
1236   { 0x10,0x18,0x7d,0xa7 }, { 0x1e,0x11,0x70,0xac },
1237   { 0x34,0x2e,0x53,0x9d }, { 0x3a,0x27,0x5e,0x96 },
1238   { 0x28,0x3c,0x49,0x8b }, { 0x26,0x35,0x44,0x80 },
1239   { 0x7c,0x42,0x0f,0xe9 }, { 0x72,0x4b,0x02,0xe2 },
1240   { 0x60,0x50,0x15,0xff }, { 0x6e,0x59,0x18,0xf4 },
1241   { 0x44,0x66,0x3b,0xc5 }, { 0x4a,0x6f,0x36,0xce },
1242   { 0x58,0x74,0x21,0xd3 }, { 0x56,0x7d,0x2c,0xd8 },
1243   { 0x37,0xa1,0x0c,0x7a }, { 0x39,0xa8,0x01,0x71 },
1244   { 0x2b,0xb3,0x16,0x6c }, { 0x25,0xba,0x1b,0x67 },
1245   { 0x0f,0x85,0x38,0x56 }, { 0x01,0x8c,0x35,0x5d },
1246   { 0x13,0x97,0x22,0x40 }, { 0x1d,0x9e,0x2f,0x4b },
1247   { 0x47,0xe9,0x64,0x22 }, { 0x49,0xe0,0x69,0x29 },
1248   { 0x5b,0xfb,0x7e,0x34 }, { 0x55,0xf2,0x73,0x3f },
1249   { 0x7f,0xcd,0x50,0x0e }, { 0x71,0xc4,0x5d,0x05 },
1250   { 0x63,0xdf,0x4a,0x18 }, { 0x6d,0xd6,0x47,0x13 },
1251   { 0xd7,0x31,0xdc,0xca }, { 0xd9,0x38,0xd1,0xc1 },
1252   { 0xcb,0x23,0xc6,0xdc }, { 0xc5,0x2a,0xcb,0xd7 },
1253   { 0xef,0x15,0xe8,0xe6 }, { 0xe1,0x1c,0xe5,0xed },
1254   { 0xf3,0x07,0xf2,0xf0 }, { 0xfd,0x0e,0xff,0xfb },
1255   { 0xa7,0x79,0xb4,0x92 }, { 0xa9,0x70,0xb9,0x99 },
1256   { 0xbb,0x6b,0xae,0x84 }, { 0xb5,0x62,0xa3,0x8f },
1257   { 0x9f,0x5d,0x80,0xbe }, { 0x91,0x54,0x8d,0xb5 },
1258   { 0x83,0x4f,0x9a,0xa8 }, { 0x8d,0x46,0x97,0xa3 }
1259 };
1260 
1261 const unsigned char U2[256][4] = {
1262   { 0x00,0x00,0x00,0x00 }, { 0x0b,0x0e,0x09,0x0d },
1263   { 0x16,0x1c,0x12,0x1a }, { 0x1d,0x12,0x1b,0x17 },
1264   { 0x2c,0x38,0x24,0x34 }, { 0x27,0x36,0x2d,0x39 },
1265   { 0x3a,0x24,0x36,0x2e }, { 0x31,0x2a,0x3f,0x23 },
1266   { 0x58,0x70,0x48,0x68 }, { 0x53,0x7e,0x41,0x65 },
1267   { 0x4e,0x6c,0x5a,0x72 }, { 0x45,0x62,0x53,0x7f },
1268   { 0x74,0x48,0x6c,0x5c }, { 0x7f,0x46,0x65,0x51 },
1269   { 0x62,0x54,0x7e,0x46 }, { 0x69,0x5a,0x77,0x4b },
1270   { 0xb0,0xe0,0x90,0xd0 }, { 0xbb,0xee,0x99,0xdd },
1271   { 0xa6,0xfc,0x82,0xca }, { 0xad,0xf2,0x8b,0xc7 },
1272   { 0x9c,0xd8,0xb4,0xe4 }, { 0x97,0xd6,0xbd,0xe9 },
1273   { 0x8a,0xc4,0xa6,0xfe }, { 0x81,0xca,0xaf,0xf3 },
1274   { 0xe8,0x90,0xd8,0xb8 }, { 0xe3,0x9e,0xd1,0xb5 },
1275   { 0xfe,0x8c,0xca,0xa2 }, { 0xf5,0x82,0xc3,0xaf },
1276   { 0xc4,0xa8,0xfc,0x8c }, { 0xcf,0xa6,0xf5,0x81 },
1277   { 0xd2,0xb4,0xee,0x96 }, { 0xd9,0xba,0xe7,0x9b },
1278   { 0x7b,0xdb,0x3b,0xbb }, { 0x70,0xd5,0x32,0xb6 },
1279   { 0x6d,0xc7,0x29,0xa1 }, { 0x66,0xc9,0x20,0xac },
1280   { 0x57,0xe3,0x1f,0x8f }, { 0x5c,0xed,0x16,0x82 },
1281   { 0x41,0xff,0x0d,0x95 }, { 0x4a,0xf1,0x04,0x98 },
1282   { 0x23,0xab,0x73,0xd3 }, { 0x28,0xa5,0x7a,0xde },
1283   { 0x35,0xb7,0x61,0xc9 }, { 0x3e,0xb9,0x68,0xc4 },
1284   { 0x0f,0x93,0x57,0xe7 }, { 0x04,0x9d,0x5e,0xea },
1285   { 0x19,0x8f,0x45,0xfd }, { 0x12,0x81,0x4c,0xf0 },
1286   { 0xcb,0x3b,0xab,0x6b }, { 0xc0,0x35,0xa2,0x66 },
1287   { 0xdd,0x27,0xb9,0x71 }, { 0xd6,0x29,0xb0,0x7c },
1288   { 0xe7,0x03,0x8f,0x5f }, { 0xec,0x0d,0x86,0x52 },
1289   { 0xf1,0x1f,0x9d,0x45 }, { 0xfa,0x11,0x94,0x48 },
1290   { 0x93,0x4b,0xe3,0x03 }, { 0x98,0x45,0xea,0x0e },
1291   { 0x85,0x57,0xf1,0x19 }, { 0x8e,0x59,0xf8,0x14 },
1292   { 0xbf,0x73,0xc7,0x37 }, { 0xb4,0x7d,0xce,0x3a },
1293   { 0xa9,0x6f,0xd5,0x2d }, { 0xa2,0x61,0xdc,0x20 },
1294   { 0xf6,0xad,0x76,0x6d }, { 0xfd,0xa3,0x7f,0x60 },
1295   { 0xe0,0xb1,0x64,0x77 }, { 0xeb,0xbf,0x6d,0x7a },
1296   { 0xda,0x95,0x52,0x59 }, { 0xd1,0x9b,0x5b,0x54 },
1297   { 0xcc,0x89,0x40,0x43 }, { 0xc7,0x87,0x49,0x4e },
1298   { 0xae,0xdd,0x3e,0x05 }, { 0xa5,0xd3,0x37,0x08 },
1299   { 0xb8,0xc1,0x2c,0x1f }, { 0xb3,0xcf,0x25,0x12 },
1300   { 0x82,0xe5,0x1a,0x31 }, { 0x89,0xeb,0x13,0x3c },
1301   { 0x94,0xf9,0x08,0x2b }, { 0x9f,0xf7,0x01,0x26 },
1302   { 0x46,0x4d,0xe6,0xbd }, { 0x4d,0x43,0xef,0xb0 },
1303   { 0x50,0x51,0xf4,0xa7 }, { 0x5b,0x5f,0xfd,0xaa },
1304   { 0x6a,0x75,0xc2,0x89 }, { 0x61,0x7b,0xcb,0x84 },
1305   { 0x7c,0x69,0xd0,0x93 }, { 0x77,0x67,0xd9,0x9e },
1306   { 0x1e,0x3d,0xae,0xd5 }, { 0x15,0x33,0xa7,0xd8 },
1307   { 0x08,0x21,0xbc,0xcf }, { 0x03,0x2f,0xb5,0xc2 },
1308   { 0x32,0x05,0x8a,0xe1 }, { 0x39,0x0b,0x83,0xec },
1309   { 0x24,0x19,0x98,0xfb }, { 0x2f,0x17,0x91,0xf6 },
1310   { 0x8d,0x76,0x4d,0xd6 }, { 0x86,0x78,0x44,0xdb },
1311   { 0x9b,0x6a,0x5f,0xcc }, { 0x90,0x64,0x56,0xc1 },
1312   { 0xa1,0x4e,0x69,0xe2 }, { 0xaa,0x40,0x60,0xef },
1313   { 0xb7,0x52,0x7b,0xf8 }, { 0xbc,0x5c,0x72,0xf5 },
1314   { 0xd5,0x06,0x05,0xbe }, { 0xde,0x08,0x0c,0xb3 },
1315   { 0xc3,0x1a,0x17,0xa4 }, { 0xc8,0x14,0x1e,0xa9 },
1316   { 0xf9,0x3e,0x21,0x8a }, { 0xf2,0x30,0x28,0x87 },
1317   { 0xef,0x22,0x33,0x90 }, { 0xe4,0x2c,0x3a,0x9d },
1318   { 0x3d,0x96,0xdd,0x06 }, { 0x36,0x98,0xd4,0x0b },
1319   { 0x2b,0x8a,0xcf,0x1c }, { 0x20,0x84,0xc6,0x11 },
1320   { 0x11,0xae,0xf9,0x32 }, { 0x1a,0xa0,0xf0,0x3f },
1321   { 0x07,0xb2,0xeb,0x28 }, { 0x0c,0xbc,0xe2,0x25 },
1322   { 0x65,0xe6,0x95,0x6e }, { 0x6e,0xe8,0x9c,0x63 },
1323   { 0x73,0xfa,0x87,0x74 }, { 0x78,0xf4,0x8e,0x79 },
1324   { 0x49,0xde,0xb1,0x5a }, { 0x42,0xd0,0xb8,0x57 },
1325   { 0x5f,0xc2,0xa3,0x40 }, { 0x54,0xcc,0xaa,0x4d },
1326   { 0xf7,0x41,0xec,0xda }, { 0xfc,0x4f,0xe5,0xd7 },
1327   { 0xe1,0x5d,0xfe,0xc0 }, { 0xea,0x53,0xf7,0xcd },
1328   { 0xdb,0x79,0xc8,0xee }, { 0xd0,0x77,0xc1,0xe3 },
1329   { 0xcd,0x65,0xda,0xf4 }, { 0xc6,0x6b,0xd3,0xf9 },
1330   { 0xaf,0x31,0xa4,0xb2 }, { 0xa4,0x3f,0xad,0xbf },
1331   { 0xb9,0x2d,0xb6,0xa8 }, { 0xb2,0x23,0xbf,0xa5 },
1332   { 0x83,0x09,0x80,0x86 }, { 0x88,0x07,0x89,0x8b },
1333   { 0x95,0x15,0x92,0x9c }, { 0x9e,0x1b,0x9b,0x91 },
1334   { 0x47,0xa1,0x7c,0x0a }, { 0x4c,0xaf,0x75,0x07 },
1335   { 0x51,0xbd,0x6e,0x10 }, { 0x5a,0xb3,0x67,0x1d },
1336   { 0x6b,0x99,0x58,0x3e }, { 0x60,0x97,0x51,0x33 },
1337   { 0x7d,0x85,0x4a,0x24 }, { 0x76,0x8b,0x43,0x29 },
1338   { 0x1f,0xd1,0x34,0x62 }, { 0x14,0xdf,0x3d,0x6f },
1339   { 0x09,0xcd,0x26,0x78 }, { 0x02,0xc3,0x2f,0x75 },
1340   { 0x33,0xe9,0x10,0x56 }, { 0x38,0xe7,0x19,0x5b },
1341   { 0x25,0xf5,0x02,0x4c }, { 0x2e,0xfb,0x0b,0x41 },
1342   { 0x8c,0x9a,0xd7,0x61 }, { 0x87,0x94,0xde,0x6c },
1343   { 0x9a,0x86,0xc5,0x7b }, { 0x91,0x88,0xcc,0x76 },
1344   { 0xa0,0xa2,0xf3,0x55 }, { 0xab,0xac,0xfa,0x58 },
1345   { 0xb6,0xbe,0xe1,0x4f }, { 0xbd,0xb0,0xe8,0x42 },
1346   { 0xd4,0xea,0x9f,0x09 }, { 0xdf,0xe4,0x96,0x04 },
1347   { 0xc2,0xf6,0x8d,0x13 }, { 0xc9,0xf8,0x84,0x1e },
1348   { 0xf8,0xd2,0xbb,0x3d }, { 0xf3,0xdc,0xb2,0x30 },
1349   { 0xee,0xce,0xa9,0x27 }, { 0xe5,0xc0,0xa0,0x2a },
1350   { 0x3c,0x7a,0x47,0xb1 }, { 0x37,0x74,0x4e,0xbc },
1351   { 0x2a,0x66,0x55,0xab }, { 0x21,0x68,0x5c,0xa6 },
1352   { 0x10,0x42,0x63,0x85 }, { 0x1b,0x4c,0x6a,0x88 },
1353   { 0x06,0x5e,0x71,0x9f }, { 0x0d,0x50,0x78,0x92 },
1354   { 0x64,0x0a,0x0f,0xd9 }, { 0x6f,0x04,0x06,0xd4 },
1355   { 0x72,0x16,0x1d,0xc3 }, { 0x79,0x18,0x14,0xce },
1356   { 0x48,0x32,0x2b,0xed }, { 0x43,0x3c,0x22,0xe0 },
1357   { 0x5e,0x2e,0x39,0xf7 }, { 0x55,0x20,0x30,0xfa },
1358   { 0x01,0xec,0x9a,0xb7 }, { 0x0a,0xe2,0x93,0xba },
1359   { 0x17,0xf0,0x88,0xad }, { 0x1c,0xfe,0x81,0xa0 },
1360   { 0x2d,0xd4,0xbe,0x83 }, { 0x26,0xda,0xb7,0x8e },
1361   { 0x3b,0xc8,0xac,0x99 }, { 0x30,0xc6,0xa5,0x94 },
1362   { 0x59,0x9c,0xd2,0xdf }, { 0x52,0x92,0xdb,0xd2 },
1363   { 0x4f,0x80,0xc0,0xc5 }, { 0x44,0x8e,0xc9,0xc8 },
1364   { 0x75,0xa4,0xf6,0xeb }, { 0x7e,0xaa,0xff,0xe6 },
1365   { 0x63,0xb8,0xe4,0xf1 }, { 0x68,0xb6,0xed,0xfc },
1366   { 0xb1,0x0c,0x0a,0x67 }, { 0xba,0x02,0x03,0x6a },
1367   { 0xa7,0x10,0x18,0x7d }, { 0xac,0x1e,0x11,0x70 },
1368   { 0x9d,0x34,0x2e,0x53 }, { 0x96,0x3a,0x27,0x5e },
1369   { 0x8b,0x28,0x3c,0x49 }, { 0x80,0x26,0x35,0x44 },
1370   { 0xe9,0x7c,0x42,0x0f }, { 0xe2,0x72,0x4b,0x02 },
1371   { 0xff,0x60,0x50,0x15 }, { 0xf4,0x6e,0x59,0x18 },
1372   { 0xc5,0x44,0x66,0x3b }, { 0xce,0x4a,0x6f,0x36 },
1373   { 0xd3,0x58,0x74,0x21 }, { 0xd8,0x56,0x7d,0x2c },
1374   { 0x7a,0x37,0xa1,0x0c }, { 0x71,0x39,0xa8,0x01 },
1375   { 0x6c,0x2b,0xb3,0x16 }, { 0x67,0x25,0xba,0x1b },
1376   { 0x56,0x0f,0x85,0x38 }, { 0x5d,0x01,0x8c,0x35 },
1377   { 0x40,0x13,0x97,0x22 }, { 0x4b,0x1d,0x9e,0x2f },
1378   { 0x22,0x47,0xe9,0x64 }, { 0x29,0x49,0xe0,0x69 },
1379   { 0x34,0x5b,0xfb,0x7e }, { 0x3f,0x55,0xf2,0x73 },
1380   { 0x0e,0x7f,0xcd,0x50 }, { 0x05,0x71,0xc4,0x5d },
1381   { 0x18,0x63,0xdf,0x4a }, { 0x13,0x6d,0xd6,0x47 },
1382   { 0xca,0xd7,0x31,0xdc }, { 0xc1,0xd9,0x38,0xd1 },
1383   { 0xdc,0xcb,0x23,0xc6 }, { 0xd7,0xc5,0x2a,0xcb },
1384   { 0xe6,0xef,0x15,0xe8 }, { 0xed,0xe1,0x1c,0xe5 },
1385   { 0xf0,0xf3,0x07,0xf2 }, { 0xfb,0xfd,0x0e,0xff },
1386   { 0x92,0xa7,0x79,0xb4 }, { 0x99,0xa9,0x70,0xb9 },
1387   { 0x84,0xbb,0x6b,0xae }, { 0x8f,0xb5,0x62,0xa3 },
1388   { 0xbe,0x9f,0x5d,0x80 }, { 0xb5,0x91,0x54,0x8d },
1389   { 0xa8,0x83,0x4f,0x9a }, { 0xa3,0x8d,0x46,0x97 }
1390 };
1391 
1392 const unsigned char U3[256][4] = {
1393   { 0x00,0x00,0x00,0x00 }, { 0x0d,0x0b,0x0e,0x09 },
1394   { 0x1a,0x16,0x1c,0x12 }, { 0x17,0x1d,0x12,0x1b },
1395   { 0x34,0x2c,0x38,0x24 }, { 0x39,0x27,0x36,0x2d },
1396   { 0x2e,0x3a,0x24,0x36 }, { 0x23,0x31,0x2a,0x3f },
1397   { 0x68,0x58,0x70,0x48 }, { 0x65,0x53,0x7e,0x41 },
1398   { 0x72,0x4e,0x6c,0x5a }, { 0x7f,0x45,0x62,0x53 },
1399   { 0x5c,0x74,0x48,0x6c }, { 0x51,0x7f,0x46,0x65 },
1400   { 0x46,0x62,0x54,0x7e }, { 0x4b,0x69,0x5a,0x77 },
1401   { 0xd0,0xb0,0xe0,0x90 }, { 0xdd,0xbb,0xee,0x99 },
1402   { 0xca,0xa6,0xfc,0x82 }, { 0xc7,0xad,0xf2,0x8b },
1403   { 0xe4,0x9c,0xd8,0xb4 }, { 0xe9,0x97,0xd6,0xbd },
1404   { 0xfe,0x8a,0xc4,0xa6 }, { 0xf3,0x81,0xca,0xaf },
1405   { 0xb8,0xe8,0x90,0xd8 }, { 0xb5,0xe3,0x9e,0xd1 },
1406   { 0xa2,0xfe,0x8c,0xca }, { 0xaf,0xf5,0x82,0xc3 },
1407   { 0x8c,0xc4,0xa8,0xfc }, { 0x81,0xcf,0xa6,0xf5 },
1408   { 0x96,0xd2,0xb4,0xee }, { 0x9b,0xd9,0xba,0xe7 },
1409   { 0xbb,0x7b,0xdb,0x3b }, { 0xb6,0x70,0xd5,0x32 },
1410   { 0xa1,0x6d,0xc7,0x29 }, { 0xac,0x66,0xc9,0x20 },
1411   { 0x8f,0x57,0xe3,0x1f }, { 0x82,0x5c,0xed,0x16 },
1412   { 0x95,0x41,0xff,0x0d }, { 0x98,0x4a,0xf1,0x04 },
1413   { 0xd3,0x23,0xab,0x73 }, { 0xde,0x28,0xa5,0x7a },
1414   { 0xc9,0x35,0xb7,0x61 }, { 0xc4,0x3e,0xb9,0x68 },
1415   { 0xe7,0x0f,0x93,0x57 }, { 0xea,0x04,0x9d,0x5e },
1416   { 0xfd,0x19,0x8f,0x45 }, { 0xf0,0x12,0x81,0x4c },
1417   { 0x6b,0xcb,0x3b,0xab }, { 0x66,0xc0,0x35,0xa2 },
1418   { 0x71,0xdd,0x27,0xb9 }, { 0x7c,0xd6,0x29,0xb0 },
1419   { 0x5f,0xe7,0x03,0x8f }, { 0x52,0xec,0x0d,0x86 },
1420   { 0x45,0xf1,0x1f,0x9d }, { 0x48,0xfa,0x11,0x94 },
1421   { 0x03,0x93,0x4b,0xe3 }, { 0x0e,0x98,0x45,0xea },
1422   { 0x19,0x85,0x57,0xf1 }, { 0x14,0x8e,0x59,0xf8 },
1423   { 0x37,0xbf,0x73,0xc7 }, { 0x3a,0xb4,0x7d,0xce },
1424   { 0x2d,0xa9,0x6f,0xd5 }, { 0x20,0xa2,0x61,0xdc },
1425   { 0x6d,0xf6,0xad,0x76 }, { 0x60,0xfd,0xa3,0x7f },
1426   { 0x77,0xe0,0xb1,0x64 }, { 0x7a,0xeb,0xbf,0x6d },
1427   { 0x59,0xda,0x95,0x52 }, { 0x54,0xd1,0x9b,0x5b },
1428   { 0x43,0xcc,0x89,0x40 }, { 0x4e,0xc7,0x87,0x49 },
1429   { 0x05,0xae,0xdd,0x3e }, { 0x08,0xa5,0xd3,0x37 },
1430   { 0x1f,0xb8,0xc1,0x2c }, { 0x12,0xb3,0xcf,0x25 },
1431   { 0x31,0x82,0xe5,0x1a }, { 0x3c,0x89,0xeb,0x13 },
1432   { 0x2b,0x94,0xf9,0x08 }, { 0x26,0x9f,0xf7,0x01 },
1433   { 0xbd,0x46,0x4d,0xe6 }, { 0xb0,0x4d,0x43,0xef },
1434   { 0xa7,0x50,0x51,0xf4 }, { 0xaa,0x5b,0x5f,0xfd },
1435   { 0x89,0x6a,0x75,0xc2 }, { 0x84,0x61,0x7b,0xcb },
1436   { 0x93,0x7c,0x69,0xd0 }, { 0x9e,0x77,0x67,0xd9 },
1437   { 0xd5,0x1e,0x3d,0xae }, { 0xd8,0x15,0x33,0xa7 },
1438   { 0xcf,0x08,0x21,0xbc }, { 0xc2,0x03,0x2f,0xb5 },
1439   { 0xe1,0x32,0x05,0x8a }, { 0xec,0x39,0x0b,0x83 },
1440   { 0xfb,0x24,0x19,0x98 }, { 0xf6,0x2f,0x17,0x91 },
1441   { 0xd6,0x8d,0x76,0x4d }, { 0xdb,0x86,0x78,0x44 },
1442   { 0xcc,0x9b,0x6a,0x5f }, { 0xc1,0x90,0x64,0x56 },
1443   { 0xe2,0xa1,0x4e,0x69 }, { 0xef,0xaa,0x40,0x60 },
1444   { 0xf8,0xb7,0x52,0x7b }, { 0xf5,0xbc,0x5c,0x72 },
1445   { 0xbe,0xd5,0x06,0x05 }, { 0xb3,0xde,0x08,0x0c },
1446   { 0xa4,0xc3,0x1a,0x17 }, { 0xa9,0xc8,0x14,0x1e },
1447   { 0x8a,0xf9,0x3e,0x21 }, { 0x87,0xf2,0x30,0x28 },
1448   { 0x90,0xef,0x22,0x33 }, { 0x9d,0xe4,0x2c,0x3a },
1449   { 0x06,0x3d,0x96,0xdd }, { 0x0b,0x36,0x98,0xd4 },
1450   { 0x1c,0x2b,0x8a,0xcf }, { 0x11,0x20,0x84,0xc6 },
1451   { 0x32,0x11,0xae,0xf9 }, { 0x3f,0x1a,0xa0,0xf0 },
1452   { 0x28,0x07,0xb2,0xeb }, { 0x25,0x0c,0xbc,0xe2 },
1453   { 0x6e,0x65,0xe6,0x95 }, { 0x63,0x6e,0xe8,0x9c },
1454   { 0x74,0x73,0xfa,0x87 }, { 0x79,0x78,0xf4,0x8e },
1455   { 0x5a,0x49,0xde,0xb1 }, { 0x57,0x42,0xd0,0xb8 },
1456   { 0x40,0x5f,0xc2,0xa3 }, { 0x4d,0x54,0xcc,0xaa },
1457   { 0xda,0xf7,0x41,0xec }, { 0xd7,0xfc,0x4f,0xe5 },
1458   { 0xc0,0xe1,0x5d,0xfe }, { 0xcd,0xea,0x53,0xf7 },
1459   { 0xee,0xdb,0x79,0xc8 }, { 0xe3,0xd0,0x77,0xc1 },
1460   { 0xf4,0xcd,0x65,0xda }, { 0xf9,0xc6,0x6b,0xd3 },
1461   { 0xb2,0xaf,0x31,0xa4 }, { 0xbf,0xa4,0x3f,0xad },
1462   { 0xa8,0xb9,0x2d,0xb6 }, { 0xa5,0xb2,0x23,0xbf },
1463   { 0x86,0x83,0x09,0x80 }, { 0x8b,0x88,0x07,0x89 },
1464   { 0x9c,0x95,0x15,0x92 }, { 0x91,0x9e,0x1b,0x9b },
1465   { 0x0a,0x47,0xa1,0x7c }, { 0x07,0x4c,0xaf,0x75 },
1466   { 0x10,0x51,0xbd,0x6e }, { 0x1d,0x5a,0xb3,0x67 },
1467   { 0x3e,0x6b,0x99,0x58 }, { 0x33,0x60,0x97,0x51 },
1468   { 0x24,0x7d,0x85,0x4a }, { 0x29,0x76,0x8b,0x43 },
1469   { 0x62,0x1f,0xd1,0x34 }, { 0x6f,0x14,0xdf,0x3d },
1470   { 0x78,0x09,0xcd,0x26 }, { 0x75,0x02,0xc3,0x2f },
1471   { 0x56,0x33,0xe9,0x10 }, { 0x5b,0x38,0xe7,0x19 },
1472   { 0x4c,0x25,0xf5,0x02 }, { 0x41,0x2e,0xfb,0x0b },
1473   { 0x61,0x8c,0x9a,0xd7 }, { 0x6c,0x87,0x94,0xde },
1474   { 0x7b,0x9a,0x86,0xc5 }, { 0x76,0x91,0x88,0xcc },
1475   { 0x55,0xa0,0xa2,0xf3 }, { 0x58,0xab,0xac,0xfa },
1476   { 0x4f,0xb6,0xbe,0xe1 }, { 0x42,0xbd,0xb0,0xe8 },
1477   { 0x09,0xd4,0xea,0x9f }, { 0x04,0xdf,0xe4,0x96 },
1478   { 0x13,0xc2,0xf6,0x8d }, { 0x1e,0xc9,0xf8,0x84 },
1479   { 0x3d,0xf8,0xd2,0xbb }, { 0x30,0xf3,0xdc,0xb2 },
1480   { 0x27,0xee,0xce,0xa9 }, { 0x2a,0xe5,0xc0,0xa0 },
1481   { 0xb1,0x3c,0x7a,0x47 }, { 0xbc,0x37,0x74,0x4e },
1482   { 0xab,0x2a,0x66,0x55 }, { 0xa6,0x21,0x68,0x5c },
1483   { 0x85,0x10,0x42,0x63 }, { 0x88,0x1b,0x4c,0x6a },
1484   { 0x9f,0x06,0x5e,0x71 }, { 0x92,0x0d,0x50,0x78 },
1485   { 0xd9,0x64,0x0a,0x0f }, { 0xd4,0x6f,0x04,0x06 },
1486   { 0xc3,0x72,0x16,0x1d }, { 0xce,0x79,0x18,0x14 },
1487   { 0xed,0x48,0x32,0x2b }, { 0xe0,0x43,0x3c,0x22 },
1488   { 0xf7,0x5e,0x2e,0x39 }, { 0xfa,0x55,0x20,0x30 },
1489   { 0xb7,0x01,0xec,0x9a }, { 0xba,0x0a,0xe2,0x93 },
1490   { 0xad,0x17,0xf0,0x88 }, { 0xa0,0x1c,0xfe,0x81 },
1491   { 0x83,0x2d,0xd4,0xbe }, { 0x8e,0x26,0xda,0xb7 },
1492   { 0x99,0x3b,0xc8,0xac }, { 0x94,0x30,0xc6,0xa5 },
1493   { 0xdf,0x59,0x9c,0xd2 }, { 0xd2,0x52,0x92,0xdb },
1494   { 0xc5,0x4f,0x80,0xc0 }, { 0xc8,0x44,0x8e,0xc9 },
1495   { 0xeb,0x75,0xa4,0xf6 }, { 0xe6,0x7e,0xaa,0xff },
1496   { 0xf1,0x63,0xb8,0xe4 }, { 0xfc,0x68,0xb6,0xed },
1497   { 0x67,0xb1,0x0c,0x0a }, { 0x6a,0xba,0x02,0x03 },
1498   { 0x7d,0xa7,0x10,0x18 }, { 0x70,0xac,0x1e,0x11 },
1499   { 0x53,0x9d,0x34,0x2e }, { 0x5e,0x96,0x3a,0x27 },
1500   { 0x49,0x8b,0x28,0x3c }, { 0x44,0x80,0x26,0x35 },
1501   { 0x0f,0xe9,0x7c,0x42 }, { 0x02,0xe2,0x72,0x4b },
1502   { 0x15,0xff,0x60,0x50 }, { 0x18,0xf4,0x6e,0x59 },
1503   { 0x3b,0xc5,0x44,0x66 }, { 0x36,0xce,0x4a,0x6f },
1504   { 0x21,0xd3,0x58,0x74 }, { 0x2c,0xd8,0x56,0x7d },
1505   { 0x0c,0x7a,0x37,0xa1 }, { 0x01,0x71,0x39,0xa8 },
1506   { 0x16,0x6c,0x2b,0xb3 }, { 0x1b,0x67,0x25,0xba },
1507   { 0x38,0x56,0x0f,0x85 }, { 0x35,0x5d,0x01,0x8c },
1508   { 0x22,0x40,0x13,0x97 }, { 0x2f,0x4b,0x1d,0x9e },
1509   { 0x64,0x22,0x47,0xe9 }, { 0x69,0x29,0x49,0xe0 },
1510   { 0x7e,0x34,0x5b,0xfb }, { 0x73,0x3f,0x55,0xf2 },
1511   { 0x50,0x0e,0x7f,0xcd }, { 0x5d,0x05,0x71,0xc4 },
1512   { 0x4a,0x18,0x63,0xdf }, { 0x47,0x13,0x6d,0xd6 },
1513   { 0xdc,0xca,0xd7,0x31 }, { 0xd1,0xc1,0xd9,0x38 },
1514   { 0xc6,0xdc,0xcb,0x23 }, { 0xcb,0xd7,0xc5,0x2a },
1515   { 0xe8,0xe6,0xef,0x15 }, { 0xe5,0xed,0xe1,0x1c },
1516   { 0xf2,0xf0,0xf3,0x07 }, { 0xff,0xfb,0xfd,0x0e },
1517   { 0xb4,0x92,0xa7,0x79 }, { 0xb9,0x99,0xa9,0x70 },
1518   { 0xae,0x84,0xbb,0x6b }, { 0xa3,0x8f,0xb5,0x62 },
1519   { 0x80,0xbe,0x9f,0x5d }, { 0x8d,0xb5,0x91,0x54 },
1520   { 0x9a,0xa8,0x83,0x4f }, { 0x97,0xa3,0x8d,0x46 }
1521 };
1522 
1523 const unsigned char U4[256][4] = {
1524   { 0x00,0x00,0x00,0x00 }, { 0x09,0x0d,0x0b,0x0e },
1525   { 0x12,0x1a,0x16,0x1c }, { 0x1b,0x17,0x1d,0x12 },
1526   { 0x24,0x34,0x2c,0x38 }, { 0x2d,0x39,0x27,0x36 },
1527   { 0x36,0x2e,0x3a,0x24 }, { 0x3f,0x23,0x31,0x2a },
1528   { 0x48,0x68,0x58,0x70 }, { 0x41,0x65,0x53,0x7e },
1529   { 0x5a,0x72,0x4e,0x6c }, { 0x53,0x7f,0x45,0x62 },
1530   { 0x6c,0x5c,0x74,0x48 }, { 0x65,0x51,0x7f,0x46 },
1531   { 0x7e,0x46,0x62,0x54 }, { 0x77,0x4b,0x69,0x5a },
1532   { 0x90,0xd0,0xb0,0xe0 }, { 0x99,0xdd,0xbb,0xee },
1533   { 0x82,0xca,0xa6,0xfc }, { 0x8b,0xc7,0xad,0xf2 },
1534   { 0xb4,0xe4,0x9c,0xd8 }, { 0xbd,0xe9,0x97,0xd6 },
1535   { 0xa6,0xfe,0x8a,0xc4 }, { 0xaf,0xf3,0x81,0xca },
1536   { 0xd8,0xb8,0xe8,0x90 }, { 0xd1,0xb5,0xe3,0x9e },
1537   { 0xca,0xa2,0xfe,0x8c }, { 0xc3,0xaf,0xf5,0x82 },
1538   { 0xfc,0x8c,0xc4,0xa8 }, { 0xf5,0x81,0xcf,0xa6 },
1539   { 0xee,0x96,0xd2,0xb4 }, { 0xe7,0x9b,0xd9,0xba },
1540   { 0x3b,0xbb,0x7b,0xdb }, { 0x32,0xb6,0x70,0xd5 },
1541   { 0x29,0xa1,0x6d,0xc7 }, { 0x20,0xac,0x66,0xc9 },
1542   { 0x1f,0x8f,0x57,0xe3 }, { 0x16,0x82,0x5c,0xed },
1543   { 0x0d,0x95,0x41,0xff }, { 0x04,0x98,0x4a,0xf1 },
1544   { 0x73,0xd3,0x23,0xab }, { 0x7a,0xde,0x28,0xa5 },
1545   { 0x61,0xc9,0x35,0xb7 }, { 0x68,0xc4,0x3e,0xb9 },
1546   { 0x57,0xe7,0x0f,0x93 }, { 0x5e,0xea,0x04,0x9d },
1547   { 0x45,0xfd,0x19,0x8f }, { 0x4c,0xf0,0x12,0x81 },
1548   { 0xab,0x6b,0xcb,0x3b }, { 0xa2,0x66,0xc0,0x35 },
1549   { 0xb9,0x71,0xdd,0x27 }, { 0xb0,0x7c,0xd6,0x29 },
1550   { 0x8f,0x5f,0xe7,0x03 }, { 0x86,0x52,0xec,0x0d },
1551   { 0x9d,0x45,0xf1,0x1f }, { 0x94,0x48,0xfa,0x11 },
1552   { 0xe3,0x03,0x93,0x4b }, { 0xea,0x0e,0x98,0x45 },
1553   { 0xf1,0x19,0x85,0x57 }, { 0xf8,0x14,0x8e,0x59 },
1554   { 0xc7,0x37,0xbf,0x73 }, { 0xce,0x3a,0xb4,0x7d },
1555   { 0xd5,0x2d,0xa9,0x6f }, { 0xdc,0x20,0xa2,0x61 },
1556   { 0x76,0x6d,0xf6,0xad }, { 0x7f,0x60,0xfd,0xa3 },
1557   { 0x64,0x77,0xe0,0xb1 }, { 0x6d,0x7a,0xeb,0xbf },
1558   { 0x52,0x59,0xda,0x95 }, { 0x5b,0x54,0xd1,0x9b },
1559   { 0x40,0x43,0xcc,0x89 }, { 0x49,0x4e,0xc7,0x87 },
1560   { 0x3e,0x05,0xae,0xdd }, { 0x37,0x08,0xa5,0xd3 },
1561   { 0x2c,0x1f,0xb8,0xc1 }, { 0x25,0x12,0xb3,0xcf },
1562   { 0x1a,0x31,0x82,0xe5 }, { 0x13,0x3c,0x89,0xeb },
1563   { 0x08,0x2b,0x94,0xf9 }, { 0x01,0x26,0x9f,0xf7 },
1564   { 0xe6,0xbd,0x46,0x4d }, { 0xef,0xb0,0x4d,0x43 },
1565   { 0xf4,0xa7,0x50,0x51 }, { 0xfd,0xaa,0x5b,0x5f },
1566   { 0xc2,0x89,0x6a,0x75 }, { 0xcb,0x84,0x61,0x7b },
1567   { 0xd0,0x93,0x7c,0x69 }, { 0xd9,0x9e,0x77,0x67 },
1568   { 0xae,0xd5,0x1e,0x3d }, { 0xa7,0xd8,0x15,0x33 },
1569   { 0xbc,0xcf,0x08,0x21 }, { 0xb5,0xc2,0x03,0x2f },
1570   { 0x8a,0xe1,0x32,0x05 }, { 0x83,0xec,0x39,0x0b },
1571   { 0x98,0xfb,0x24,0x19 }, { 0x91,0xf6,0x2f,0x17 },
1572   { 0x4d,0xd6,0x8d,0x76 }, { 0x44,0xdb,0x86,0x78 },
1573   { 0x5f,0xcc,0x9b,0x6a }, { 0x56,0xc1,0x90,0x64 },
1574   { 0x69,0xe2,0xa1,0x4e }, { 0x60,0xef,0xaa,0x40 },
1575   { 0x7b,0xf8,0xb7,0x52 }, { 0x72,0xf5,0xbc,0x5c },
1576   { 0x05,0xbe,0xd5,0x06 }, { 0x0c,0xb3,0xde,0x08 },
1577   { 0x17,0xa4,0xc3,0x1a }, { 0x1e,0xa9,0xc8,0x14 },
1578   { 0x21,0x8a,0xf9,0x3e }, { 0x28,0x87,0xf2,0x30 },
1579   { 0x33,0x90,0xef,0x22 }, { 0x3a,0x9d,0xe4,0x2c },
1580   { 0xdd,0x06,0x3d,0x96 }, { 0xd4,0x0b,0x36,0x98 },
1581   { 0xcf,0x1c,0x2b,0x8a }, { 0xc6,0x11,0x20,0x84 },
1582   { 0xf9,0x32,0x11,0xae }, { 0xf0,0x3f,0x1a,0xa0 },
1583   { 0xeb,0x28,0x07,0xb2 }, { 0xe2,0x25,0x0c,0xbc },
1584   { 0x95,0x6e,0x65,0xe6 }, { 0x9c,0x63,0x6e,0xe8 },
1585   { 0x87,0x74,0x73,0xfa }, { 0x8e,0x79,0x78,0xf4 },
1586   { 0xb1,0x5a,0x49,0xde }, { 0xb8,0x57,0x42,0xd0 },
1587   { 0xa3,0x40,0x5f,0xc2 }, { 0xaa,0x4d,0x54,0xcc },
1588   { 0xec,0xda,0xf7,0x41 }, { 0xe5,0xd7,0xfc,0x4f },
1589   { 0xfe,0xc0,0xe1,0x5d }, { 0xf7,0xcd,0xea,0x53 },
1590   { 0xc8,0xee,0xdb,0x79 }, { 0xc1,0xe3,0xd0,0x77 },
1591   { 0xda,0xf4,0xcd,0x65 }, { 0xd3,0xf9,0xc6,0x6b },
1592   { 0xa4,0xb2,0xaf,0x31 }, { 0xad,0xbf,0xa4,0x3f },
1593   { 0xb6,0xa8,0xb9,0x2d }, { 0xbf,0xa5,0xb2,0x23 },
1594   { 0x80,0x86,0x83,0x09 }, { 0x89,0x8b,0x88,0x07 },
1595   { 0x92,0x9c,0x95,0x15 }, { 0x9b,0x91,0x9e,0x1b },
1596   { 0x7c,0x0a,0x47,0xa1 }, { 0x75,0x07,0x4c,0xaf },
1597   { 0x6e,0x10,0x51,0xbd }, { 0x67,0x1d,0x5a,0xb3 },
1598   { 0x58,0x3e,0x6b,0x99 }, { 0x51,0x33,0x60,0x97 },
1599   { 0x4a,0x24,0x7d,0x85 }, { 0x43,0x29,0x76,0x8b },
1600   { 0x34,0x62,0x1f,0xd1 }, { 0x3d,0x6f,0x14,0xdf },
1601   { 0x26,0x78,0x09,0xcd }, { 0x2f,0x75,0x02,0xc3 },
1602   { 0x10,0x56,0x33,0xe9 }, { 0x19,0x5b,0x38,0xe7 },
1603   { 0x02,0x4c,0x25,0xf5 }, { 0x0b,0x41,0x2e,0xfb },
1604   { 0xd7,0x61,0x8c,0x9a }, { 0xde,0x6c,0x87,0x94 },
1605   { 0xc5,0x7b,0x9a,0x86 }, { 0xcc,0x76,0x91,0x88 },
1606   { 0xf3,0x55,0xa0,0xa2 }, { 0xfa,0x58,0xab,0xac },
1607   { 0xe1,0x4f,0xb6,0xbe }, { 0xe8,0x42,0xbd,0xb0 },
1608   { 0x9f,0x09,0xd4,0xea }, { 0x96,0x04,0xdf,0xe4 },
1609   { 0x8d,0x13,0xc2,0xf6 }, { 0x84,0x1e,0xc9,0xf8 },
1610   { 0xbb,0x3d,0xf8,0xd2 }, { 0xb2,0x30,0xf3,0xdc },
1611   { 0xa9,0x27,0xee,0xce }, { 0xa0,0x2a,0xe5,0xc0 },
1612   { 0x47,0xb1,0x3c,0x7a }, { 0x4e,0xbc,0x37,0x74 },
1613   { 0x55,0xab,0x2a,0x66 }, { 0x5c,0xa6,0x21,0x68 },
1614   { 0x63,0x85,0x10,0x42 }, { 0x6a,0x88,0x1b,0x4c },
1615   { 0x71,0x9f,0x06,0x5e }, { 0x78,0x92,0x0d,0x50 },
1616   { 0x0f,0xd9,0x64,0x0a }, { 0x06,0xd4,0x6f,0x04 },
1617   { 0x1d,0xc3,0x72,0x16 }, { 0x14,0xce,0x79,0x18 },
1618   { 0x2b,0xed,0x48,0x32 }, { 0x22,0xe0,0x43,0x3c },
1619   { 0x39,0xf7,0x5e,0x2e }, { 0x30,0xfa,0x55,0x20 },
1620   { 0x9a,0xb7,0x01,0xec }, { 0x93,0xba,0x0a,0xe2 },
1621   { 0x88,0xad,0x17,0xf0 }, { 0x81,0xa0,0x1c,0xfe },
1622   { 0xbe,0x83,0x2d,0xd4 }, { 0xb7,0x8e,0x26,0xda },
1623   { 0xac,0x99,0x3b,0xc8 }, { 0xa5,0x94,0x30,0xc6 },
1624   { 0xd2,0xdf,0x59,0x9c }, { 0xdb,0xd2,0x52,0x92 },
1625   { 0xc0,0xc5,0x4f,0x80 }, { 0xc9,0xc8,0x44,0x8e },
1626   { 0xf6,0xeb,0x75,0xa4 }, { 0xff,0xe6,0x7e,0xaa },
1627   { 0xe4,0xf1,0x63,0xb8 }, { 0xed,0xfc,0x68,0xb6 },
1628   { 0x0a,0x67,0xb1,0x0c }, { 0x03,0x6a,0xba,0x02 },
1629   { 0x18,0x7d,0xa7,0x10 }, { 0x11,0x70,0xac,0x1e },
1630   { 0x2e,0x53,0x9d,0x34 }, { 0x27,0x5e,0x96,0x3a },
1631   { 0x3c,0x49,0x8b,0x28 }, { 0x35,0x44,0x80,0x26 },
1632   { 0x42,0x0f,0xe9,0x7c }, { 0x4b,0x02,0xe2,0x72 },
1633   { 0x50,0x15,0xff,0x60 }, { 0x59,0x18,0xf4,0x6e },
1634   { 0x66,0x3b,0xc5,0x44 }, { 0x6f,0x36,0xce,0x4a },
1635   { 0x74,0x21,0xd3,0x58 }, { 0x7d,0x2c,0xd8,0x56 },
1636   { 0xa1,0x0c,0x7a,0x37 }, { 0xa8,0x01,0x71,0x39 },
1637   { 0xb3,0x16,0x6c,0x2b }, { 0xba,0x1b,0x67,0x25 },
1638   { 0x85,0x38,0x56,0x0f }, { 0x8c,0x35,0x5d,0x01 },
1639   { 0x97,0x22,0x40,0x13 }, { 0x9e,0x2f,0x4b,0x1d },
1640   { 0xe9,0x64,0x22,0x47 }, { 0xe0,0x69,0x29,0x49 },
1641   { 0xfb,0x7e,0x34,0x5b }, { 0xf2,0x73,0x3f,0x55 },
1642   { 0xcd,0x50,0x0e,0x7f }, { 0xc4,0x5d,0x05,0x71 },
1643   { 0xdf,0x4a,0x18,0x63 }, { 0xd6,0x47,0x13,0x6d },
1644   { 0x31,0xdc,0xca,0xd7 }, { 0x38,0xd1,0xc1,0xd9 },
1645   { 0x23,0xc6,0xdc,0xcb }, { 0x2a,0xcb,0xd7,0xc5 },
1646   { 0x15,0xe8,0xe6,0xef }, { 0x1c,0xe5,0xed,0xe1 },
1647   { 0x07,0xf2,0xf0,0xf3 }, { 0x0e,0xff,0xfb,0xfd },
1648   { 0x79,0xb4,0x92,0xa7 }, { 0x70,0xb9,0x99,0xa9 },
1649   { 0x6b,0xae,0x84,0xbb }, { 0x62,0xa3,0x8f,0xb5 },
1650   { 0x5d,0x80,0xbe,0x9f }, { 0x54,0x8d,0xb5,0x91 },
1651   { 0x4f,0x9a,0xa8,0x83 }, { 0x46,0x97,0xa3,0x8d }
1652 };
1653 
1654 const unsigned int rcon[30] = {
1655   0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
1656   0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35,
1657   0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91
1658 };
1659 
1660 bool
set_key(struct cfb_aes_context * ctx,const unsigned char * key,const size_t len)1661 set_key(struct cfb_aes_context *ctx,
1662 	const unsigned char *key,
1663 	const size_t len)
1664 {
1665 
1666   int ROUNDS;
1667   unsigned char k[MAXKC][4];
1668   int i,j, r, t, rconpointer = 0;
1669   unsigned char tk[MAXKC][4];
1670   int KC;
1671 
1672   if(!ctx || !key)
1673     return false;
1674 
1675   if( len == 128/8 ) {
1676     ROUNDS = 10;
1677     KC = 4;
1678   }
1679   else if ( len == 192/8 ) {
1680     ROUNDS = 12;
1681     KC = 6;
1682   }
1683   else if ( len == 256/8 ) {
1684     ROUNDS = 14;
1685     KC = 8;
1686   }
1687   else
1688     return false;
1689 
1690   ctx->c.ROUNDS = ROUNDS;
1691 
1692   for (i = 0; i < (int)len; i++) {
1693     k[i >> 2][i & 3] = key[i];
1694   }
1695 #define W (ctx->c.keySched)
1696 
1697   for (j = KC-1; j >= 0; j--) {
1698     *((unsigned int*)tk[j]) = *((unsigned int*)k[j]);
1699   }
1700   r = 0;
1701   t = 0;
1702   /* copy values into round key array */
1703   for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
1704     for (; (j < KC) && (t < 4); j++, t++) {
1705       *((unsigned int*)W[r][t]) = *((unsigned int*)tk[j]);
1706     }
1707     if (t == 4) {
1708       r++;
1709       t = 0;
1710     }
1711   }
1712 
1713   while (r < ROUNDS + 1) {
1714     /* while not enough round key material calculated */
1715     /* calculate new values */
1716     tk[0][0] ^= S[tk[KC-1][1]];
1717     tk[0][1] ^= S[tk[KC-1][2]];
1718     tk[0][2] ^= S[tk[KC-1][3]];
1719     tk[0][3] ^= S[tk[KC-1][0]];
1720     tk[0][0] ^= rcon[rconpointer++];
1721 
1722     if (KC != 8) {
1723       for (j = 1; j < KC; j++) {
1724 	*((unsigned int*)tk[j]) ^= *((unsigned int*)tk[j-1]);
1725       }
1726     } else {
1727       for (j = 1; j < KC/2; j++) {
1728 	*((unsigned int*)tk[j]) ^= *((unsigned int*)tk[j-1]);
1729       }
1730       tk[KC/2][0] ^= S[tk[KC/2 - 1][0]];
1731       tk[KC/2][1] ^= S[tk[KC/2 - 1][1]];
1732       tk[KC/2][2] ^= S[tk[KC/2 - 1][2]];
1733       tk[KC/2][3] ^= S[tk[KC/2 - 1][3]];
1734       for (j = KC/2 + 1; j < KC; j++) {
1735 	*((unsigned int*)tk[j]) ^= *((unsigned int*)tk[j-1]);
1736       }
1737     }
1738     /* copy values into round key array */
1739     for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
1740       for (; (j < KC) && (t < 4); j++, t++) {
1741 	*((unsigned int*)W[r][t]) = *((unsigned int*)tk[j]);
1742       }
1743       if (t == 4) {
1744 	r++;
1745 	t = 0;
1746       }
1747     }
1748   }
1749 
1750 #undef W
1751   return true;
1752 }
1753 
1754 
1755 /* make a decryption  key from an encryption key */
1756 bool
prepare_decryption(struct cfb_aes_context * ctx)1757 prepare_decryption(struct cfb_aes_context *ctx)
1758 {
1759   int r;
1760   unsigned char *w;
1761 
1762   if(!ctx)
1763     return false;
1764 
1765   for (r=0; r < MAXROUNDS+1; r++ ) {
1766     *((unsigned int*)ctx->c.keySched2[r][0]) = *((unsigned int*)ctx->c.keySched[r][0]);
1767     *((unsigned int*)ctx->c.keySched2[r][1]) = *((unsigned int*)ctx->c.keySched[r][1]);
1768     *((unsigned int*)ctx->c.keySched2[r][2]) = *((unsigned int*)ctx->c.keySched[r][2]);
1769     *((unsigned int*)ctx->c.keySched2[r][3]) = *((unsigned int*)ctx->c.keySched[r][3]);
1770   }
1771 #define W (ctx->c.keySched2)
1772   for (r = 1; r < ctx->c.ROUNDS; r++) {
1773     w = W[r][0];
1774     *((unsigned int*)w) = *((unsigned int*)U1[w[0]]) ^ *((unsigned int*)U2[w[1]])
1775       ^ *((unsigned int*)U3[w[2]]) ^ *((unsigned int*)U4[w[3]]);
1776 
1777     w = W[r][1];
1778     *((unsigned int*)w) = *((unsigned int*)U1[w[0]]) ^ *((unsigned int*)U2[w[1]])
1779       ^ *((unsigned int*)U3[w[2]]) ^ *((unsigned int*)U4[w[3]]);
1780 
1781     w = W[r][2];
1782     *((unsigned int*)w) = *((unsigned int*)U1[w[0]]) ^ *((unsigned int*)U2[w[1]])
1783       ^ *((unsigned int*)U3[w[2]]) ^ *((unsigned int*)U4[w[3]]);
1784 
1785     w = W[r][3];
1786     *((unsigned int*)w) = *((unsigned int*)U1[w[0]]) ^ *((unsigned int*)U2[w[1]])
1787       ^ *((unsigned int*)U3[w[2]]) ^ *((unsigned int*)U4[w[3]]);
1788   }
1789 #undef W
1790   return true;
1791 }
1792 
1793 /* Encrypt one block.  A and B may be the same. */
1794 void
encrypt_block(struct cfb_aes_context * ctx,unsigned char * b,const unsigned char * a)1795 encrypt_block (struct cfb_aes_context *ctx,
1796 	       unsigned char *b,
1797 	       const unsigned char *a)
1798 {
1799   int r;
1800   unsigned char temp[4][4];
1801   int ROUNDS = ctx->c.ROUNDS;
1802 #define rk (ctx->c.keySched)
1803 
1804   *((unsigned int*)temp[0]) = *((unsigned int*)(a   )) ^ *((unsigned int*)rk[0][0]);
1805   *((unsigned int*)temp[1]) = *((unsigned int*)(a+ 4)) ^ *((unsigned int*)rk[0][1]);
1806   *((unsigned int*)temp[2]) = *((unsigned int*)(a+ 8)) ^ *((unsigned int*)rk[0][2]);
1807   *((unsigned int*)temp[3]) = *((unsigned int*)(a+12)) ^ *((unsigned int*)rk[0][3]);
1808   *((unsigned int*)(b    )) = *((unsigned int*)T1[temp[0][0]])
1809     ^ *((unsigned int*)T2[temp[1][1]])
1810     ^ *((unsigned int*)T3[temp[2][2]])
1811     ^ *((unsigned int*)T4[temp[3][3]]);
1812   *((unsigned int*)(b + 4)) = *((unsigned int*)T1[temp[1][0]])
1813     ^ *((unsigned int*)T2[temp[2][1]])
1814     ^ *((unsigned int*)T3[temp[3][2]])
1815     ^ *((unsigned int*)T4[temp[0][3]]);
1816   *((unsigned int*)(b + 8)) = *((unsigned int*)T1[temp[2][0]])
1817     ^ *((unsigned int*)T2[temp[3][1]])
1818     ^ *((unsigned int*)T3[temp[0][2]])
1819     ^ *((unsigned int*)T4[temp[1][3]]);
1820   *((unsigned int*)(b +12)) = *((unsigned int*)T1[temp[3][0]])
1821     ^ *((unsigned int*)T2[temp[0][1]])
1822     ^ *((unsigned int*)T3[temp[1][2]])
1823     ^ *((unsigned int*)T4[temp[2][3]]);
1824   for (r = 1; r < ROUNDS-1; r++) {
1825     *((unsigned int*)temp[0])= *((unsigned int*)(b   )) ^ *((unsigned int*)rk[r][0]);
1826     *((unsigned int*)temp[1])= *((unsigned int*)(b+ 4)) ^ *((unsigned int*)rk[r][1]);
1827     *((unsigned int*)temp[2])= *((unsigned int*)(b+ 8)) ^ *((unsigned int*)rk[r][2]);
1828     *((unsigned int*)temp[3])= *((unsigned int*)(b+12)) ^ *((unsigned int*)rk[r][3]);
1829 
1830     *((unsigned int*)(b    )) = *((unsigned int*)T1[temp[0][0]])
1831       ^ *((unsigned int*)T2[temp[1][1]])
1832       ^ *((unsigned int*)T3[temp[2][2]])
1833       ^ *((unsigned int*)T4[temp[3][3]]);
1834     *((unsigned int*)(b + 4)) = *((unsigned int*)T1[temp[1][0]])
1835       ^ *((unsigned int*)T2[temp[2][1]])
1836       ^ *((unsigned int*)T3[temp[3][2]])
1837       ^ *((unsigned int*)T4[temp[0][3]]);
1838     *((unsigned int*)(b + 8)) = *((unsigned int*)T1[temp[2][0]])
1839       ^ *((unsigned int*)T2[temp[3][1]])
1840       ^ *((unsigned int*)T3[temp[0][2]])
1841       ^ *((unsigned int*)T4[temp[1][3]]);
1842     *((unsigned int*)(b +12)) = *((unsigned int*)T1[temp[3][0]])
1843       ^ *((unsigned int*)T2[temp[0][1]])
1844       ^ *((unsigned int*)T3[temp[1][2]])
1845       ^ *((unsigned int*)T4[temp[2][3]]);
1846   }
1847   /* last round is special */
1848   *((unsigned int*)temp[0])=
1849     *((unsigned int*)(b   ))^*((unsigned int*)rk[ROUNDS-1][0]);
1850   *((unsigned int*)temp[1])=
1851     *((unsigned int*)(b+ 4))^*((unsigned int*)rk[ROUNDS-1][1]);
1852   *((unsigned int*)temp[2])=
1853     *((unsigned int*)(b+ 8))^*((unsigned int*)rk[ROUNDS-1][2]);
1854   *((unsigned int*)temp[3])=
1855     *((unsigned int*)(b+12))^*((unsigned int*)rk[ROUNDS-1][3]);
1856   b[ 0] = T1[temp[0][0]][1];
1857   b[ 1] = T1[temp[1][1]][1];
1858   b[ 2] = T1[temp[2][2]][1];
1859   b[ 3] = T1[temp[3][3]][1];
1860   b[ 4] = T1[temp[1][0]][1];
1861   b[ 5] = T1[temp[2][1]][1];
1862   b[ 6] = T1[temp[3][2]][1];
1863   b[ 7] = T1[temp[0][3]][1];
1864   b[ 8] = T1[temp[2][0]][1];
1865   b[ 9] = T1[temp[3][1]][1];
1866   b[10] = T1[temp[0][2]][1];
1867   b[11] = T1[temp[1][3]][1];
1868   b[12] = T1[temp[3][0]][1];
1869   b[13] = T1[temp[0][1]][1];
1870   b[14] = T1[temp[1][2]][1];
1871   b[15] = T1[temp[2][3]][1];
1872   *((unsigned int*)(b   )) ^= *((unsigned int*)rk[ROUNDS][0]);
1873   *((unsigned int*)(b+ 4)) ^= *((unsigned int*)rk[ROUNDS][1]);
1874   *((unsigned int*)(b+ 8)) ^= *((unsigned int*)rk[ROUNDS][2]);
1875   *((unsigned int*)(b+12)) ^= *((unsigned int*)rk[ROUNDS][3]);
1876 #undef rk
1877 }
1878 
1879 
1880 /* Decrypt one block.  a and b may be the same. */
1881 void
decrypt_block(struct cfb_aes_context * ctx,unsigned char * b,const unsigned char * a)1882 decrypt_block (struct cfb_aes_context *ctx,
1883 	       unsigned char *b,
1884 	       const unsigned char *a)
1885 {
1886 #define rk  (ctx->c.keySched2)
1887   int ROUNDS = ctx->c.ROUNDS;
1888   int r;
1889   unsigned char temp[4][4];
1890 
1891   *((unsigned int*)temp[0]) =
1892     *((unsigned int*)(a   )) ^ *((unsigned int*)rk[ROUNDS][0]);
1893   *((unsigned int*)temp[1]) =
1894     *((unsigned int*)(a+ 4)) ^ *((unsigned int*)rk[ROUNDS][1]);
1895   *((unsigned int*)temp[2]) =
1896     *((unsigned int*)(a+ 8)) ^ *((unsigned int*)rk[ROUNDS][2]);
1897   *((unsigned int*)temp[3]) =
1898     *((unsigned int*)(a+12)) ^ *((unsigned int*)rk[ROUNDS][3]);
1899 
1900   *((unsigned int*)(b   )) = *((unsigned int*)T5[temp[0][0]])
1901     ^ *((unsigned int*)T6[temp[3][1]])
1902     ^ *((unsigned int*)T7[temp[2][2]])
1903     ^ *((unsigned int*)T8[temp[1][3]]);
1904   *((unsigned int*)(b+ 4)) = *((unsigned int*)T5[temp[1][0]])
1905     ^ *((unsigned int*)T6[temp[0][1]])
1906     ^ *((unsigned int*)T7[temp[3][2]])
1907     ^ *((unsigned int*)T8[temp[2][3]]);
1908   *((unsigned int*)(b+ 8)) = *((unsigned int*)T5[temp[2][0]])
1909     ^ *((unsigned int*)T6[temp[1][1]])
1910     ^ *((unsigned int*)T7[temp[0][2]])
1911     ^ *((unsigned int*)T8[temp[3][3]]);
1912   *((unsigned int*)(b+12)) = *((unsigned int*)T5[temp[3][0]])
1913     ^ *((unsigned int*)T6[temp[2][1]])
1914     ^ *((unsigned int*)T7[temp[1][2]])
1915     ^ *((unsigned int*)T8[temp[0][3]]);
1916   for (r = ROUNDS-1; r > 1; r--) {
1917     *((unsigned int*)temp[0]) =
1918       *((unsigned int*)(b   )) ^ *((unsigned int*)rk[r][0]);
1919     *((unsigned int*)temp[1]) =
1920       *((unsigned int*)(b+ 4)) ^ *((unsigned int*)rk[r][1]);
1921     *((unsigned int*)temp[2]) =
1922       *((unsigned int*)(b+ 8)) ^ *((unsigned int*)rk[r][2]);
1923     *((unsigned int*)temp[3]) =
1924       *((unsigned int*)(b+12)) ^ *((unsigned int*)rk[r][3]);
1925     *((unsigned int*)(b   )) = *((unsigned int*)T5[temp[0][0]])
1926       ^ *((unsigned int*)T6[temp[3][1]])
1927       ^ *((unsigned int*)T7[temp[2][2]])
1928       ^ *((unsigned int*)T8[temp[1][3]]);
1929     *((unsigned int*)(b+ 4)) = *((unsigned int*)T5[temp[1][0]])
1930       ^ *((unsigned int*)T6[temp[0][1]])
1931       ^ *((unsigned int*)T7[temp[3][2]])
1932       ^ *((unsigned int*)T8[temp[2][3]]);
1933     *((unsigned int*)(b+ 8)) = *((unsigned int*)T5[temp[2][0]])
1934       ^ *((unsigned int*)T6[temp[1][1]])
1935       ^ *((unsigned int*)T7[temp[0][2]])
1936       ^ *((unsigned int*)T8[temp[3][3]]);
1937     *((unsigned int*)(b+12)) = *((unsigned int*)T5[temp[3][0]])
1938       ^ *((unsigned int*)T6[temp[2][1]])
1939       ^ *((unsigned int*)T7[temp[1][2]])
1940       ^ *((unsigned int*)T8[temp[0][3]]);
1941   }
1942   /* last round is special */
1943   *((unsigned int*)temp[0]) = *((unsigned int*)(b   )) ^ *((unsigned int*)rk[1][0]);
1944   *((unsigned int*)temp[1]) = *((unsigned int*)(b+ 4)) ^ *((unsigned int*)rk[1][1]);
1945   *((unsigned int*)temp[2]) = *((unsigned int*)(b+ 8)) ^ *((unsigned int*)rk[1][2]);
1946   *((unsigned int*)temp[3]) = *((unsigned int*)(b+12)) ^ *((unsigned int*)rk[1][3]);
1947   b[ 0] = S5[temp[0][0]];
1948   b[ 1] = S5[temp[3][1]];
1949   b[ 2] = S5[temp[2][2]];
1950   b[ 3] = S5[temp[1][3]];
1951   b[ 4] = S5[temp[1][0]];
1952   b[ 5] = S5[temp[0][1]];
1953   b[ 6] = S5[temp[3][2]];
1954   b[ 7] = S5[temp[2][3]];
1955   b[ 8] = S5[temp[2][0]];
1956   b[ 9] = S5[temp[1][1]];
1957   b[10] = S5[temp[0][2]];
1958   b[11] = S5[temp[3][3]];
1959   b[12] = S5[temp[3][0]];
1960   b[13] = S5[temp[2][1]];
1961   b[14] = S5[temp[1][2]];
1962   b[15] = S5[temp[0][3]];
1963   *((unsigned int*)(b   )) ^= *((unsigned int*)rk[0][0]);
1964   *((unsigned int*)(b+ 4)) ^= *((unsigned int*)rk[0][1]);
1965   *((unsigned int*)(b+ 8)) ^= *((unsigned int*)rk[0][2]);
1966   *((unsigned int*)(b+12)) ^= *((unsigned int*)rk[0][3]);
1967 #undef rk
1968 }
1969 
1970 /* inteface implementation */
1971 struct cfb_aes_context*
init(const unsigned char * key,const size_t len)1972 init(const unsigned char *key,
1973      const size_t len)
1974 {
1975   struct cfb_aes_context *ctx=0;
1976 
1977   if( 0 != (ctx = (struct cfb_aes_context *)malloc(sizeof(struct cfb_aes_context)))) {
1978     memset(ctx->iv, 0x00, RIJNDAEL_BLOCKSIZE);
1979     ctx->unused = 0;
1980     /* set the key for encryption */
1981     if(!set_key(ctx, key, len)) {
1982       free(ctx);
1983       ctx = 0;
1984       return ctx;
1985     };
1986     /* set the key for decryption */
1987     if(!prepare_decryption(ctx)) {
1988       free(ctx);
1989       ctx = 0;
1990       return ctx;
1991     };
1992   }
1993 
1994   return ctx;
1995 }
1996 
1997 void
clear_ctx(struct cfb_aes_context * ctx)1998 clear_ctx(struct cfb_aes_context *ctx)
1999 {
2000   if(ctx)
2001     free(ctx);
2002 }
2003 
2004 
2005 bool
cfb_encrypt(struct cfb_aes_context * ctx,unsigned char * outbuf,const unsigned char * inbuf,size_t len)2006 cfb_encrypt(struct cfb_aes_context *ctx,
2007 	    unsigned char *outbuf,
2008 	    const unsigned char *inbuf,
2009 	    size_t len)
2010 {
2011 
2012   unsigned char *ivp;
2013 
2014 
2015   if(!ctx || !outbuf || !inbuf)
2016     return false;
2017 
2018   if( len <= ctx->unused ) {
2019     /* short enough to be encoded by the remaining XOR mask */
2020     /* XOR the input with the IV and store input into IV */
2021     for(ivp=ctx->iv+ RIJNDAEL_BLOCKSIZE - ctx->unused; len; len--, ctx->unused-- )
2022       *outbuf++ = (*ivp++ ^= *inbuf++);
2023     return true;
2024   }
2025 
2026   if( ctx->unused ) {
2027     /* XOR the input with the IV and store input into IV */
2028     len -= ctx->unused;
2029     for(ivp=ctx->iv+RIJNDAEL_BLOCKSIZE - ctx->unused; ctx->unused; ctx->unused-- )
2030       *outbuf++ = (*ivp++ ^= *inbuf++);
2031   }
2032 
2033   /* now we can process complete blocks */
2034   while( len >= RIJNDAEL_BLOCKSIZE ) {
2035     size_t i;
2036     /* encrypt the IV (and save the current one) */
2037     encrypt_block(ctx,  ctx->iv, ctx->iv);
2038     /* XOR the input with the IV and store input into IV */
2039     for(ivp=ctx->iv,i=0; i < RIJNDAEL_BLOCKSIZE; i++ )
2040       *outbuf++ = (*ivp++ ^= *inbuf++);
2041     len -= RIJNDAEL_BLOCKSIZE;
2042   }
2043 
2044   if( len ) { /* process the remaining unsigned chars */
2045     /* encrypt the IV (and save the current one) */
2046     encrypt_block(ctx,ctx->iv, ctx->iv);
2047     ctx->unused = RIJNDAEL_BLOCKSIZE;
2048     /* and apply the xor */
2049     ctx->unused -= len;
2050     for(ivp=ctx->iv; len; len-- )
2051       *outbuf++ = (*ivp++ ^= *inbuf++);
2052   }
2053   return true;
2054 }
2055 
2056 
2057 bool
cfb_decrypt(struct cfb_aes_context * ctx,unsigned char * outbuf,const unsigned char * inbuf,size_t len)2058 cfb_decrypt(struct cfb_aes_context *ctx,
2059 	    unsigned char *outbuf,
2060 	    const unsigned char *inbuf,
2061 	    size_t len)
2062 {
2063   unsigned char *ivp;
2064   unsigned long temp;
2065 
2066   if(!ctx || !outbuf || !inbuf)
2067     return false;
2068 
2069   if( len <= ctx->unused ) {
2070     /* short enough to be encoded by the remaining XOR mask */
2071     /* XOR the input with the IV and store input into IV */
2072     for(ivp= ctx->iv+RIJNDAEL_BLOCKSIZE - ctx->unused; len; len--, ctx->unused--){
2073       temp = *inbuf++;
2074       *outbuf++ = *ivp ^ temp;
2075       *ivp++ = temp;
2076     }
2077     return true;
2078   }
2079 
2080   if( ctx->unused ) {
2081     /* XOR the input with the IV and store input into IV */
2082     len -= ctx->unused;
2083     for(ivp=ctx->iv + RIJNDAEL_BLOCKSIZE - ctx->unused; ctx->unused; ctx->unused-- ) {
2084       temp = *inbuf++;
2085       *outbuf++ = *ivp ^ temp;
2086       *ivp++ = temp;
2087     }
2088   }
2089 
2090   /* now we can process complete blocks */
2091   while( len >= RIJNDAEL_BLOCKSIZE ) {
2092     size_t i;
2093     /* encrypt the IV (and save the current one) */
2094     encrypt_block(ctx,ctx->iv, ctx->iv);
2095     /* XOR the input with the IV and store input into IV */
2096     for(ivp=ctx->iv,i=0; i < RIJNDAEL_BLOCKSIZE; i++ ) {
2097       temp = *inbuf++;
2098       *outbuf++ = *ivp ^ temp;
2099       *ivp++ = temp;
2100     }
2101     len -= RIJNDAEL_BLOCKSIZE;
2102   }
2103   if( len ) { /* process the remaining octet_ts */
2104     /* encrypt the IV (and save the current one) */
2105     encrypt_block(ctx, ctx->iv, ctx->iv);
2106     ctx->unused = RIJNDAEL_BLOCKSIZE;
2107     /* and apply the xor */
2108     ctx->unused -= len;
2109     for(ivp=ctx->iv; len; len-- ) {
2110       temp = *inbuf++;
2111       *outbuf++ = *ivp ^ temp;
2112       *ivp++ = temp;
2113     }
2114   }
2115   return true;
2116 }
2117 
2118