[CRYPTO] scatterwalk: Move scatterwalk.h to linux/crypto
[linux-2.6] / crypto / tcrypt.h
1 /*
2  * Quick & dirty crypto testing module.
3  *
4  * This will only exist until we have a better testing mechanism
5  * (e.g. a char device).
6  *
7  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
8  * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
9  * Copyright (c) 2007 Nokia Siemens Networks
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU General Public License as published by the Free
13  * Software Foundation; either version 2 of the License, or (at your option)
14  * any later version.
15  *
16  * 2007-11-13 Added GCM tests
17  * 2007-11-13 Added AEAD support
18  * 2006-12-07 Added SHA384 HMAC and SHA512 HMAC tests
19  * 2004-08-09 Cipher speed tests by Reyk Floeter <reyk@vantronix.net>
20  * 2003-09-14 Changes by Kartikey Mahendra Bhatt
21  *
22  */
23 #ifndef _CRYPTO_TCRYPT_H
24 #define _CRYPTO_TCRYPT_H
25
26 #define MAX_DIGEST_SIZE         64
27 #define MAX_TAP                 8
28
29 #define MAX_KEYLEN              56
30 #define MAX_IVLEN               32
31
32 struct hash_testvec {
33         /* only used with keyed hash algorithms */
34         char key[132] __attribute__ ((__aligned__(4)));
35         char plaintext[240];
36         char digest[MAX_DIGEST_SIZE];
37         unsigned char tap[MAX_TAP];
38         unsigned char psize;
39         unsigned char np;
40         unsigned char ksize;
41 };
42
43 struct cipher_testvec {
44         char key[MAX_KEYLEN] __attribute__ ((__aligned__(4)));
45         char iv[MAX_IVLEN];
46         char input[4100];
47         char result[4100];
48         unsigned char tap[MAX_TAP];
49         int np;
50         unsigned char fail;
51         unsigned char wk; /* weak key flag */
52         unsigned char klen;
53         unsigned short ilen;
54         unsigned short rlen;
55 };
56
57 struct aead_testvec {
58         char key[MAX_KEYLEN] __attribute__ ((__aligned__(4)));
59         char iv[MAX_IVLEN];
60         char input[512];
61         char assoc[512];
62         char result[512];
63         unsigned char tap[MAX_TAP];
64         unsigned char atap[MAX_TAP];
65         int np;
66         int anp;
67         unsigned char fail;
68         unsigned char wk; /* weak key flag */
69         unsigned char klen;
70         unsigned short ilen;
71         unsigned short alen;
72         unsigned short rlen;
73 };
74
75 struct cipher_speed {
76         unsigned char klen;
77         unsigned int blen;
78 };
79
80 struct hash_speed {
81         unsigned int blen;      /* buffer length */
82         unsigned int plen;      /* per-update length */
83 };
84
85 /*
86  * MD4 test vectors from RFC1320
87  */
88 #define MD4_TEST_VECTORS        7
89
90 static struct hash_testvec md4_tv_template [] = {
91         {
92                 .plaintext = "",
93                 .digest = { 0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31,
94                             0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0 },
95         }, {
96                 .plaintext = "a",
97                 .psize  = 1,
98                 .digest = { 0xbd, 0xe5, 0x2c, 0xb3, 0x1d, 0xe3, 0x3e, 0x46,
99                             0x24, 0x5e, 0x05, 0xfb, 0xdb, 0xd6, 0xfb, 0x24 },
100         }, {
101                 .plaintext = "abc",
102                 .psize  = 3,
103                 .digest = { 0xa4, 0x48, 0x01, 0x7a, 0xaf, 0x21, 0xd8, 0x52,
104                             0x5f, 0xc1, 0x0a, 0xe8, 0x7a, 0xa6, 0x72, 0x9d },
105         }, {
106                 .plaintext = "message digest",
107                 .psize  = 14,
108                 .digest = { 0xd9, 0x13, 0x0a, 0x81, 0x64, 0x54, 0x9f, 0xe8,
109                             0x18, 0x87, 0x48, 0x06, 0xe1, 0xc7, 0x01, 0x4b },
110         }, {
111                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
112                 .psize  = 26,
113                 .digest = { 0xd7, 0x9e, 0x1c, 0x30, 0x8a, 0xa5, 0xbb, 0xcd,
114                             0xee, 0xa8, 0xed, 0x63, 0xdf, 0x41, 0x2d, 0xa9 },
115                 .np     = 2,
116                 .tap    = { 13, 13 },
117         }, {
118                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
119                 .psize  = 62,
120                 .digest = { 0x04, 0x3f, 0x85, 0x82, 0xf2, 0x41, 0xdb, 0x35,
121                             0x1c, 0xe6, 0x27, 0xe1, 0x53, 0xe7, 0xf0, 0xe4 },
122         }, {
123                 .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
124                              "45678901234567890",
125                 .psize  = 80,
126                 .digest = { 0xe3, 0x3b, 0x4d, 0xdc, 0x9c, 0x38, 0xf2, 0x19,
127                             0x9c, 0x3e, 0x7b, 0x16, 0x4f, 0xcc, 0x05, 0x36 },
128         },
129 };
130
131 /*
132  * MD5 test vectors from RFC1321
133  */
134 #define MD5_TEST_VECTORS        7
135
136 static struct hash_testvec md5_tv_template[] = {
137         {
138                 .digest = { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
139                             0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e },
140         }, {
141                 .plaintext = "a",
142                 .psize  = 1,
143                 .digest = { 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8,
144                             0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 },
145         }, {
146                 .plaintext = "abc",
147                 .psize  = 3,
148                 .digest = { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0,
149                             0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 },
150         }, {
151                 .plaintext = "message digest",
152                 .psize  = 14,
153                 .digest = { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d,
154                             0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 },
155         }, {
156                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
157                 .psize  = 26,
158                 .digest = { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00,
159                             0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b },
160                 .np     = 2,
161                 .tap    = {13, 13}
162         }, {
163                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
164                 .psize  = 62,
165                 .digest = { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5,
166                             0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f },
167         }, {
168                 .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
169                              "345678901234567890",
170                 .psize  = 80,
171                 .digest = { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55,
172                             0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a },
173         }
174 };
175
176 /*
177  * SHA1 test vectors  from from FIPS PUB 180-1
178  */
179 #define SHA1_TEST_VECTORS       2
180
181 static struct hash_testvec sha1_tv_template[] = {
182         {
183                 .plaintext = "abc",
184                 .psize  = 3,
185                 .digest = { 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, 0xba, 0x3e,
186                             0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c, 0x9c, 0xd0, 0xd8, 0x9d },
187         }, {
188                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
189                 .psize  = 56,
190                 .digest = { 0x84, 0x98, 0x3e, 0x44, 0x1c, 0x3b, 0xd2, 0x6e, 0xba, 0xae,
191                             0x4a, 0xa1, 0xf9, 0x51, 0x29, 0xe5, 0xe5, 0x46, 0x70, 0xf1 },
192                 .np     = 2,
193                 .tap    = { 28, 28 }
194         }
195 };
196
197
198 /*
199  * SHA224 test vectors from from FIPS PUB 180-2
200  */
201 #define SHA224_TEST_VECTORS     2
202
203 static struct hash_testvec sha224_tv_template[] = {
204         {
205                 .plaintext = "abc",
206                 .psize  = 3,
207                 .digest = { 0x23, 0x09, 0x7D, 0x22, 0x34, 0x05, 0xD8, 0x22,
208                         0x86, 0x42, 0xA4, 0x77, 0xBD, 0xA2, 0x55, 0xB3,
209                         0x2A, 0xAD, 0xBC, 0xE4, 0xBD, 0xA0, 0xB3, 0xF7,
210                         0xE3, 0x6C, 0x9D, 0xA7},
211         }, {
212                 .plaintext =
213                 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
214                 .psize  = 56,
215                 .digest = { 0x75, 0x38, 0x8B, 0x16, 0x51, 0x27, 0x76, 0xCC,
216                         0x5D, 0xBA, 0x5D, 0xA1, 0xFD, 0x89, 0x01, 0x50,
217                         0xB0, 0xC6, 0x45, 0x5C, 0xB4, 0xF5, 0x8B, 0x19,
218                         0x52, 0x52, 0x25, 0x25 },
219                 .np     = 2,
220                 .tap    = { 28, 28 }
221         }
222 };
223
224 /*
225  * SHA256 test vectors from from NIST
226  */
227 #define SHA256_TEST_VECTORS     2
228
229 static struct hash_testvec sha256_tv_template[] = {
230         {
231                 .plaintext = "abc",
232                 .psize  = 3,
233                 .digest = { 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
234                             0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
235                             0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
236                             0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad },
237         }, {
238                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
239                 .psize  = 56,
240                 .digest = { 0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
241                             0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
242                             0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
243                             0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1 },
244                 .np     = 2,
245                 .tap    = { 28, 28 }
246         },
247 };
248
249 /*
250  * SHA384 test vectors from from NIST and kerneli
251  */
252 #define SHA384_TEST_VECTORS     4
253
254 static struct hash_testvec sha384_tv_template[] = {
255         {
256                 .plaintext= "abc",
257                 .psize  = 3,
258                 .digest = { 0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b,
259                             0xb5, 0xa0, 0x3d, 0x69, 0x9a, 0xc6, 0x50, 0x07,
260                             0x27, 0x2c, 0x32, 0xab, 0x0e, 0xde, 0xd1, 0x63,
261                             0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed,
262                             0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23,
263                             0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7 },
264         }, {
265                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
266                 .psize  = 56,
267                 .digest = { 0x33, 0x91, 0xfd, 0xdd, 0xfc, 0x8d, 0xc7, 0x39,
268                             0x37, 0x07, 0xa6, 0x5b, 0x1b, 0x47, 0x09, 0x39,
269                             0x7c, 0xf8, 0xb1, 0xd1, 0x62, 0xaf, 0x05, 0xab,
270                             0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6,
271                             0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f,
272                             0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b},
273         }, {
274                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
275                              "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
276                 .psize  = 112,
277                 .digest = { 0x09, 0x33, 0x0c, 0x33, 0xf7, 0x11, 0x47, 0xe8,
278                             0x3d, 0x19, 0x2f, 0xc7, 0x82, 0xcd, 0x1b, 0x47,
279                             0x53, 0x11, 0x1b, 0x17, 0x3b, 0x3b, 0x05, 0xd2,
280                             0x2f, 0xa0, 0x80, 0x86, 0xe3, 0xb0, 0xf7, 0x12,
281                             0xfc, 0xc7, 0xc7, 0x1a, 0x55, 0x7e, 0x2d, 0xb9,
282                             0x66, 0xc3, 0xe9, 0xfa, 0x91, 0x74, 0x60, 0x39  },
283         }, {
284                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
285                              "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
286                 .psize  = 104,
287                 .digest = { 0x3d, 0x20, 0x89, 0x73, 0xab, 0x35, 0x08, 0xdb,
288                             0xbd, 0x7e, 0x2c, 0x28, 0x62, 0xba, 0x29, 0x0a,
289                             0xd3, 0x01, 0x0e, 0x49, 0x78, 0xc1, 0x98, 0xdc,
290                             0x4d, 0x8f, 0xd0, 0x14, 0xe5, 0x82, 0x82, 0x3a,
291                             0x89, 0xe1, 0x6f, 0x9b, 0x2a, 0x7b, 0xbc, 0x1a,
292                             0xc9, 0x38, 0xe2, 0xd1, 0x99, 0xe8, 0xbe, 0xa4 },
293                 .np     = 4,
294                 .tap    = { 26, 26, 26, 26 }
295         },
296 };
297
298 /*
299  * SHA512 test vectors from from NIST and kerneli
300  */
301 #define SHA512_TEST_VECTORS     4
302
303 static struct hash_testvec sha512_tv_template[] = {
304         {
305                 .plaintext = "abc",
306                 .psize  = 3,
307                 .digest = { 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba,
308                             0xcc, 0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31,
309                             0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9, 0x7e, 0xa2,
310                             0x0a, 0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a,
311                             0x21, 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8,
312                             0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd,
313                             0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e,
314                             0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f },
315         }, {
316                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
317                 .psize  = 56,
318                 .digest = { 0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a,
319                             0x0c, 0xed, 0x7b, 0xeb, 0x8e, 0x08, 0xa4, 0x16,
320                             0x57, 0xc1, 0x6e, 0xf4, 0x68, 0xb2, 0x28, 0xa8,
321                             0x27, 0x9b, 0xe3, 0x31, 0xa7, 0x03, 0xc3, 0x35,
322                             0x96, 0xfd, 0x15, 0xc1, 0x3b, 0x1b, 0x07, 0xf9,
323                             0xaa, 0x1d, 0x3b, 0xea, 0x57, 0x78, 0x9c, 0xa0,
324                             0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03,
325                             0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45 },
326         }, {
327                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
328                              "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
329                 .psize  = 112,
330                 .digest = { 0x8e, 0x95, 0x9b, 0x75, 0xda, 0xe3, 0x13, 0xda,
331                             0x8c, 0xf4, 0xf7, 0x28, 0x14, 0xfc, 0x14, 0x3f,
332                             0x8f, 0x77, 0x79, 0xc6, 0xeb, 0x9f, 0x7f, 0xa1,
333                             0x72, 0x99, 0xae, 0xad, 0xb6, 0x88, 0x90, 0x18,
334                             0x50, 0x1d, 0x28, 0x9e, 0x49, 0x00, 0xf7, 0xe4,
335                             0x33, 0x1b, 0x99, 0xde, 0xc4, 0xb5, 0x43, 0x3a,
336                             0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26, 0x54,
337                             0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09 },
338         }, {
339                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
340                              "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
341                 .psize  = 104,
342                 .digest = { 0x93, 0x0d, 0x0c, 0xef, 0xcb, 0x30, 0xff, 0x11,
343                             0x33, 0xb6, 0x89, 0x81, 0x21, 0xf1, 0xcf, 0x3d,
344                             0x27, 0x57, 0x8a, 0xfc, 0xaf, 0xe8, 0x67, 0x7c,
345                             0x52, 0x57, 0xcf, 0x06, 0x99, 0x11, 0xf7, 0x5d,
346                             0x8f, 0x58, 0x31, 0xb5, 0x6e, 0xbf, 0xda, 0x67,
347                             0xb2, 0x78, 0xe6, 0x6d, 0xff, 0x8b, 0x84, 0xfe,
348                             0x2b, 0x28, 0x70, 0xf7, 0x42, 0xa5, 0x80, 0xd8,
349                             0xed, 0xb4, 0x19, 0x87, 0x23, 0x28, 0x50, 0xc9 },
350                 .np     = 4,
351                 .tap    = { 26, 26, 26, 26 }
352         },
353 };
354
355
356 /*
357  * WHIRLPOOL test vectors from Whirlpool package
358  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
359  * submission
360  */
361 #define WP512_TEST_VECTORS      8
362
363 static struct hash_testvec wp512_tv_template[] = {
364         {
365                 .plaintext = "",
366                 .psize  = 0,
367                 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
368                             0x9B, 0x44, 0xE3, 0x9C, 0x1D, 0x2E, 0x17, 0x26,
369                             0xC5, 0x30, 0x23, 0x21, 0x30, 0xD4, 0x07, 0xF8,
370                             0x9A, 0xFE, 0xE0, 0x96, 0x49, 0x97, 0xF7, 0xA7,
371                             0x3E, 0x83, 0xBE, 0x69, 0x8B, 0x28, 0x8F, 0xEB,
372                             0xCF, 0x88, 0xE3, 0xE0, 0x3C, 0x4F, 0x07, 0x57,
373                             0xEA, 0x89, 0x64, 0xE5, 0x9B, 0x63, 0xD9, 0x37,
374                             0x08, 0xB1, 0x38, 0xCC, 0x42, 0xA6, 0x6E, 0xB3 },
375
376
377         }, {
378                 .plaintext = "a",
379                 .psize  = 1,
380                 .digest = { 0x8A, 0xCA, 0x26, 0x02, 0x79, 0x2A, 0xEC, 0x6F,
381                             0x11, 0xA6, 0x72, 0x06, 0x53, 0x1F, 0xB7, 0xD7,
382                             0xF0, 0xDF, 0xF5, 0x94, 0x13, 0x14, 0x5E, 0x69,
383                             0x73, 0xC4, 0x50, 0x01, 0xD0, 0x08, 0x7B, 0x42,
384                             0xD1, 0x1B, 0xC6, 0x45, 0x41, 0x3A, 0xEF, 0xF6,
385                             0x3A, 0x42, 0x39, 0x1A, 0x39, 0x14, 0x5A, 0x59,
386                             0x1A, 0x92, 0x20, 0x0D, 0x56, 0x01, 0x95, 0xE5,
387                             0x3B, 0x47, 0x85, 0x84, 0xFD, 0xAE, 0x23, 0x1A },
388         }, {
389                 .plaintext = "abc",
390                 .psize  = 3,
391                 .digest = { 0x4E, 0x24, 0x48, 0xA4, 0xC6, 0xF4, 0x86, 0xBB,
392                             0x16, 0xB6, 0x56, 0x2C, 0x73, 0xB4, 0x02, 0x0B,
393                             0xF3, 0x04, 0x3E, 0x3A, 0x73, 0x1B, 0xCE, 0x72,
394                             0x1A, 0xE1, 0xB3, 0x03, 0xD9, 0x7E, 0x6D, 0x4C,
395                             0x71, 0x81, 0xEE, 0xBD, 0xB6, 0xC5, 0x7E, 0x27,
396                             0x7D, 0x0E, 0x34, 0x95, 0x71, 0x14, 0xCB, 0xD6,
397                             0xC7, 0x97, 0xFC, 0x9D, 0x95, 0xD8, 0xB5, 0x82,
398                             0xD2, 0x25, 0x29, 0x20, 0x76, 0xD4, 0xEE, 0xF5 },
399         }, {
400                 .plaintext = "message digest",
401                 .psize  = 14,
402                 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
403                             0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
404                             0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
405                             0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B,
406                             0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1,
407                             0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6,
408                             0x92, 0xED, 0x92, 0x00, 0x52, 0x83, 0x8F, 0x33,
409                             0x62, 0xE8, 0x6D, 0xBD, 0x37, 0xA8, 0x90, 0x3E },
410         }, {
411                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
412                 .psize  = 26,
413                 .digest = { 0xF1, 0xD7, 0x54, 0x66, 0x26, 0x36, 0xFF, 0xE9,
414                             0x2C, 0x82, 0xEB, 0xB9, 0x21, 0x2A, 0x48, 0x4A,
415                             0x8D, 0x38, 0x63, 0x1E, 0xAD, 0x42, 0x38, 0xF5,
416                             0x44, 0x2E, 0xE1, 0x3B, 0x80, 0x54, 0xE4, 0x1B,
417                             0x08, 0xBF, 0x2A, 0x92, 0x51, 0xC3, 0x0B, 0x6A,
418                             0x0B, 0x8A, 0xAE, 0x86, 0x17, 0x7A, 0xB4, 0xA6,
419                             0xF6, 0x8F, 0x67, 0x3E, 0x72, 0x07, 0x86, 0x5D,
420                             0x5D, 0x98, 0x19, 0xA3, 0xDB, 0xA4, 0xEB, 0x3B },
421         }, {
422                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
423                              "abcdefghijklmnopqrstuvwxyz0123456789",
424                 .psize  = 62,
425                 .digest = { 0xDC, 0x37, 0xE0, 0x08, 0xCF, 0x9E, 0xE6, 0x9B,
426                             0xF1, 0x1F, 0x00, 0xED, 0x9A, 0xBA, 0x26, 0x90,
427                             0x1D, 0xD7, 0xC2, 0x8C, 0xDE, 0xC0, 0x66, 0xCC,
428                             0x6A, 0xF4, 0x2E, 0x40, 0xF8, 0x2F, 0x3A, 0x1E,
429                             0x08, 0xEB, 0xA2, 0x66, 0x29, 0x12, 0x9D, 0x8F,
430                             0xB7, 0xCB, 0x57, 0x21, 0x1B, 0x92, 0x81, 0xA6,
431                             0x55, 0x17, 0xCC, 0x87, 0x9D, 0x7B, 0x96, 0x21,
432                             0x42, 0xC6, 0x5F, 0x5A, 0x7A, 0xF0, 0x14, 0x67 },
433         }, {
434                 .plaintext = "1234567890123456789012345678901234567890"
435                              "1234567890123456789012345678901234567890",
436                 .psize  = 80,
437                 .digest = { 0x46, 0x6E, 0xF1, 0x8B, 0xAB, 0xB0, 0x15, 0x4D,
438                             0x25, 0xB9, 0xD3, 0x8A, 0x64, 0x14, 0xF5, 0xC0,
439                             0x87, 0x84, 0x37, 0x2B, 0xCC, 0xB2, 0x04, 0xD6,
440                             0x54, 0x9C, 0x4A, 0xFA, 0xDB, 0x60, 0x14, 0x29,
441                             0x4D, 0x5B, 0xD8, 0xDF, 0x2A, 0x6C, 0x44, 0xE5,
442                             0x38, 0xCD, 0x04, 0x7B, 0x26, 0x81, 0xA5, 0x1A,
443                             0x2C, 0x60, 0x48, 0x1E, 0x88, 0xC5, 0xA2, 0x0B,
444                             0x2C, 0x2A, 0x80, 0xCF, 0x3A, 0x9A, 0x08, 0x3B },
445         }, {
446                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
447                 .psize  = 32,
448                 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
449                             0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
450                             0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
451                             0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69,
452                             0x16, 0xBD, 0xC8, 0x03, 0x1B, 0xC5, 0xBE, 0x1B,
453                             0x7B, 0x94, 0x76, 0x39, 0xFE, 0x05, 0x0B, 0x56,
454                             0x93, 0x9B, 0xAA, 0xA0, 0xAD, 0xFF, 0x9A, 0xE6,
455                             0x74, 0x5B, 0x7B, 0x18, 0x1C, 0x3B, 0xE3, 0xFD },
456         },
457 };
458
459 #define WP384_TEST_VECTORS      8
460
461 static struct hash_testvec wp384_tv_template[] = {
462         {
463                 .plaintext = "",
464                 .psize  = 0,
465                 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
466                             0x9B, 0x44, 0xE3, 0x9C, 0x1D, 0x2E, 0x17, 0x26,
467                             0xC5, 0x30, 0x23, 0x21, 0x30, 0xD4, 0x07, 0xF8,
468                             0x9A, 0xFE, 0xE0, 0x96, 0x49, 0x97, 0xF7, 0xA7,
469                             0x3E, 0x83, 0xBE, 0x69, 0x8B, 0x28, 0x8F, 0xEB,
470                             0xCF, 0x88, 0xE3, 0xE0, 0x3C, 0x4F, 0x07, 0x57 },
471
472
473         }, {
474                 .plaintext = "a",
475                 .psize  = 1,
476                 .digest = { 0x8A, 0xCA, 0x26, 0x02, 0x79, 0x2A, 0xEC, 0x6F,
477                             0x11, 0xA6, 0x72, 0x06, 0x53, 0x1F, 0xB7, 0xD7,
478                             0xF0, 0xDF, 0xF5, 0x94, 0x13, 0x14, 0x5E, 0x69,
479                             0x73, 0xC4, 0x50, 0x01, 0xD0, 0x08, 0x7B, 0x42,
480                             0xD1, 0x1B, 0xC6, 0x45, 0x41, 0x3A, 0xEF, 0xF6,
481                             0x3A, 0x42, 0x39, 0x1A, 0x39, 0x14, 0x5A, 0x59 },
482         }, {
483                 .plaintext = "abc",
484                 .psize  = 3,
485                 .digest = { 0x4E, 0x24, 0x48, 0xA4, 0xC6, 0xF4, 0x86, 0xBB,
486                             0x16, 0xB6, 0x56, 0x2C, 0x73, 0xB4, 0x02, 0x0B,
487                             0xF3, 0x04, 0x3E, 0x3A, 0x73, 0x1B, 0xCE, 0x72,
488                             0x1A, 0xE1, 0xB3, 0x03, 0xD9, 0x7E, 0x6D, 0x4C,
489                             0x71, 0x81, 0xEE, 0xBD, 0xB6, 0xC5, 0x7E, 0x27,
490                             0x7D, 0x0E, 0x34, 0x95, 0x71, 0x14, 0xCB, 0xD6 },
491         }, {
492                 .plaintext = "message digest",
493                 .psize  = 14,
494                 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
495                             0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
496                             0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
497                             0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B,
498                             0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1,
499                             0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6 },
500         }, {
501                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
502                 .psize  = 26,
503                 .digest = { 0xF1, 0xD7, 0x54, 0x66, 0x26, 0x36, 0xFF, 0xE9,
504                             0x2C, 0x82, 0xEB, 0xB9, 0x21, 0x2A, 0x48, 0x4A,
505                             0x8D, 0x38, 0x63, 0x1E, 0xAD, 0x42, 0x38, 0xF5,
506                             0x44, 0x2E, 0xE1, 0x3B, 0x80, 0x54, 0xE4, 0x1B,
507                             0x08, 0xBF, 0x2A, 0x92, 0x51, 0xC3, 0x0B, 0x6A,
508                             0x0B, 0x8A, 0xAE, 0x86, 0x17, 0x7A, 0xB4, 0xA6 },
509         }, {
510                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
511                              "abcdefghijklmnopqrstuvwxyz0123456789",
512                 .psize  = 62,
513                 .digest = { 0xDC, 0x37, 0xE0, 0x08, 0xCF, 0x9E, 0xE6, 0x9B,
514                             0xF1, 0x1F, 0x00, 0xED, 0x9A, 0xBA, 0x26, 0x90,
515                             0x1D, 0xD7, 0xC2, 0x8C, 0xDE, 0xC0, 0x66, 0xCC,
516                             0x6A, 0xF4, 0x2E, 0x40, 0xF8, 0x2F, 0x3A, 0x1E,
517                             0x08, 0xEB, 0xA2, 0x66, 0x29, 0x12, 0x9D, 0x8F,
518                             0xB7, 0xCB, 0x57, 0x21, 0x1B, 0x92, 0x81, 0xA6 },
519         }, {
520                 .plaintext = "1234567890123456789012345678901234567890"
521                              "1234567890123456789012345678901234567890",
522                 .psize  = 80,
523                 .digest = { 0x46, 0x6E, 0xF1, 0x8B, 0xAB, 0xB0, 0x15, 0x4D,
524                             0x25, 0xB9, 0xD3, 0x8A, 0x64, 0x14, 0xF5, 0xC0,
525                             0x87, 0x84, 0x37, 0x2B, 0xCC, 0xB2, 0x04, 0xD6,
526                             0x54, 0x9C, 0x4A, 0xFA, 0xDB, 0x60, 0x14, 0x29,
527                             0x4D, 0x5B, 0xD8, 0xDF, 0x2A, 0x6C, 0x44, 0xE5,
528                             0x38, 0xCD, 0x04, 0x7B, 0x26, 0x81, 0xA5, 0x1A },
529         }, {
530                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
531                 .psize  = 32,
532                 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
533                             0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
534                             0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
535                             0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69,
536                             0x16, 0xBD, 0xC8, 0x03, 0x1B, 0xC5, 0xBE, 0x1B,
537                             0x7B, 0x94, 0x76, 0x39, 0xFE, 0x05, 0x0B, 0x56 },
538         },
539 };
540
541 #define WP256_TEST_VECTORS      8
542
543 static struct hash_testvec wp256_tv_template[] = {
544         {
545                 .plaintext = "",
546                 .psize  = 0,
547                 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
548                             0x9B, 0x44, 0xE3, 0x9C, 0x1D, 0x2E, 0x17, 0x26,
549                             0xC5, 0x30, 0x23, 0x21, 0x30, 0xD4, 0x07, 0xF8,
550                             0x9A, 0xFE, 0xE0, 0x96, 0x49, 0x97, 0xF7, 0xA7 },
551
552
553         }, {
554                 .plaintext = "a",
555                 .psize  = 1,
556                 .digest = { 0x8A, 0xCA, 0x26, 0x02, 0x79, 0x2A, 0xEC, 0x6F,
557                             0x11, 0xA6, 0x72, 0x06, 0x53, 0x1F, 0xB7, 0xD7,
558                             0xF0, 0xDF, 0xF5, 0x94, 0x13, 0x14, 0x5E, 0x69,
559                             0x73, 0xC4, 0x50, 0x01, 0xD0, 0x08, 0x7B, 0x42 },
560         }, {
561                 .plaintext = "abc",
562                 .psize  = 3,
563                 .digest = { 0x4E, 0x24, 0x48, 0xA4, 0xC6, 0xF4, 0x86, 0xBB,
564                             0x16, 0xB6, 0x56, 0x2C, 0x73, 0xB4, 0x02, 0x0B,
565                             0xF3, 0x04, 0x3E, 0x3A, 0x73, 0x1B, 0xCE, 0x72,
566                             0x1A, 0xE1, 0xB3, 0x03, 0xD9, 0x7E, 0x6D, 0x4C },
567         }, {
568                 .plaintext = "message digest",
569                 .psize  = 14,
570                 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
571                             0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
572                             0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
573                             0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B },
574         }, {
575                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
576                 .psize  = 26,
577                 .digest = { 0xF1, 0xD7, 0x54, 0x66, 0x26, 0x36, 0xFF, 0xE9,
578                             0x2C, 0x82, 0xEB, 0xB9, 0x21, 0x2A, 0x48, 0x4A,
579                             0x8D, 0x38, 0x63, 0x1E, 0xAD, 0x42, 0x38, 0xF5,
580                             0x44, 0x2E, 0xE1, 0x3B, 0x80, 0x54, 0xE4, 0x1B },
581         }, {
582                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
583                              "abcdefghijklmnopqrstuvwxyz0123456789",
584                 .psize  = 62,
585                 .digest = { 0xDC, 0x37, 0xE0, 0x08, 0xCF, 0x9E, 0xE6, 0x9B,
586                             0xF1, 0x1F, 0x00, 0xED, 0x9A, 0xBA, 0x26, 0x90,
587                             0x1D, 0xD7, 0xC2, 0x8C, 0xDE, 0xC0, 0x66, 0xCC,
588                             0x6A, 0xF4, 0x2E, 0x40, 0xF8, 0x2F, 0x3A, 0x1E },
589         }, {
590                 .plaintext = "1234567890123456789012345678901234567890"
591                              "1234567890123456789012345678901234567890",
592                 .psize  = 80,
593                 .digest = { 0x46, 0x6E, 0xF1, 0x8B, 0xAB, 0xB0, 0x15, 0x4D,
594                             0x25, 0xB9, 0xD3, 0x8A, 0x64, 0x14, 0xF5, 0xC0,
595                             0x87, 0x84, 0x37, 0x2B, 0xCC, 0xB2, 0x04, 0xD6,
596                             0x54, 0x9C, 0x4A, 0xFA, 0xDB, 0x60, 0x14, 0x29 },
597         }, {
598                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
599                 .psize  = 32,
600                 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
601                             0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
602                             0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
603                             0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69 },
604         },
605 };
606
607 /*
608  * TIGER test vectors from Tiger website
609  */
610 #define TGR192_TEST_VECTORS     6
611
612 static struct hash_testvec tgr192_tv_template[] = {
613         {
614                 .plaintext = "",
615                 .psize  = 0,
616                 .digest = { 0x24, 0xf0, 0x13, 0x0c, 0x63, 0xac, 0x93, 0x32,
617                             0x16, 0x16, 0x6e, 0x76, 0xb1, 0xbb, 0x92, 0x5f,
618                             0xf3, 0x73, 0xde, 0x2d, 0x49, 0x58, 0x4e, 0x7a },
619         }, {
620                 .plaintext = "abc",
621                 .psize  = 3,
622                 .digest = { 0xf2, 0x58, 0xc1, 0xe8, 0x84, 0x14, 0xab, 0x2a,
623                             0x52, 0x7a, 0xb5, 0x41, 0xff, 0xc5, 0xb8, 0xbf,
624                             0x93, 0x5f, 0x7b, 0x95, 0x1c, 0x13, 0x29, 0x51 },
625         }, {
626                 .plaintext = "Tiger",
627                 .psize  = 5,
628                 .digest = { 0x9f, 0x00, 0xf5, 0x99, 0x07, 0x23, 0x00, 0xdd,
629                             0x27, 0x6a, 0xbb, 0x38, 0xc8, 0xeb, 0x6d, 0xec,
630                             0x37, 0x79, 0x0c, 0x11, 0x6f, 0x9d, 0x2b, 0xdf },
631         }, {
632                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
633                 .psize  = 64,
634                 .digest = { 0x87, 0xfb, 0x2a, 0x90, 0x83, 0x85, 0x1c, 0xf7,
635                             0x47, 0x0d, 0x2c, 0xf8, 0x10, 0xe6, 0xdf, 0x9e,
636                             0xb5, 0x86, 0x44, 0x50, 0x34, 0xa5, 0xa3, 0x86 },
637         }, {
638                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
639                 .psize  = 64,
640                 .digest = { 0x46, 0x7d, 0xb8, 0x08, 0x63, 0xeb, 0xce, 0x48,
641                             0x8d, 0xf1, 0xcd, 0x12, 0x61, 0x65, 0x5d, 0xe9,
642                             0x57, 0x89, 0x65, 0x65, 0x97, 0x5f, 0x91, 0x97 },
643         }, {
644                 .plaintext = "Tiger - A Fast New Hash Function, "
645                              "by Ross Anderson and Eli Biham, "
646                              "proceedings of Fast Software Encryption 3, "
647                              "Cambridge, 1996.",
648                 .psize  = 125,
649                 .digest = { 0x3d, 0x9a, 0xeb, 0x03, 0xd1, 0xbd, 0x1a, 0x63,
650                             0x57, 0xb2, 0x77, 0x4d, 0xfd, 0x6d, 0x5b, 0x24,
651                             0xdd, 0x68, 0x15, 0x1d, 0x50, 0x39, 0x74, 0xfc },
652         },
653 };
654
655 #define TGR160_TEST_VECTORS     6
656
657 static struct hash_testvec tgr160_tv_template[] = {
658         {
659                 .plaintext = "",
660                 .psize  = 0,
661                 .digest = { 0x24, 0xf0, 0x13, 0x0c, 0x63, 0xac, 0x93, 0x32,
662                             0x16, 0x16, 0x6e, 0x76, 0xb1, 0xbb, 0x92, 0x5f,
663                             0xf3, 0x73, 0xde, 0x2d },
664         }, {
665                 .plaintext = "abc",
666                 .psize  = 3,
667                 .digest = { 0xf2, 0x58, 0xc1, 0xe8, 0x84, 0x14, 0xab, 0x2a,
668                             0x52, 0x7a, 0xb5, 0x41, 0xff, 0xc5, 0xb8, 0xbf,
669                             0x93, 0x5f, 0x7b, 0x95 },
670         }, {
671                 .plaintext = "Tiger",
672                 .psize  = 5,
673                 .digest = { 0x9f, 0x00, 0xf5, 0x99, 0x07, 0x23, 0x00, 0xdd,
674                             0x27, 0x6a, 0xbb, 0x38, 0xc8, 0xeb, 0x6d, 0xec,
675                             0x37, 0x79, 0x0c, 0x11 },
676         }, {
677                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
678                 .psize  = 64,
679                 .digest = { 0x87, 0xfb, 0x2a, 0x90, 0x83, 0x85, 0x1c, 0xf7,
680                             0x47, 0x0d, 0x2c, 0xf8, 0x10, 0xe6, 0xdf, 0x9e,
681                             0xb5, 0x86, 0x44, 0x50 },
682         }, {
683                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
684                 .psize  = 64,
685                 .digest = { 0x46, 0x7d, 0xb8, 0x08, 0x63, 0xeb, 0xce, 0x48,
686                             0x8d, 0xf1, 0xcd, 0x12, 0x61, 0x65, 0x5d, 0xe9,
687                             0x57, 0x89, 0x65, 0x65 },
688         }, {
689                 .plaintext = "Tiger - A Fast New Hash Function, "
690                              "by Ross Anderson and Eli Biham, "
691                              "proceedings of Fast Software Encryption 3, "
692                              "Cambridge, 1996.",
693                 .psize  = 125,
694                 .digest = { 0x3d, 0x9a, 0xeb, 0x03, 0xd1, 0xbd, 0x1a, 0x63,
695                             0x57, 0xb2, 0x77, 0x4d, 0xfd, 0x6d, 0x5b, 0x24,
696                             0xdd, 0x68, 0x15, 0x1d },
697         },
698 };
699
700 #define TGR128_TEST_VECTORS     6
701
702 static struct hash_testvec tgr128_tv_template[] = {
703         {
704                 .plaintext = "",
705                 .psize  = 0,
706                 .digest = { 0x24, 0xf0, 0x13, 0x0c, 0x63, 0xac, 0x93, 0x32,
707                             0x16, 0x16, 0x6e, 0x76, 0xb1, 0xbb, 0x92, 0x5f },
708         }, {
709                 .plaintext = "abc",
710                 .psize  = 3,
711                 .digest = { 0xf2, 0x58, 0xc1, 0xe8, 0x84, 0x14, 0xab, 0x2a,
712                             0x52, 0x7a, 0xb5, 0x41, 0xff, 0xc5, 0xb8, 0xbf },
713         }, {
714                 .plaintext = "Tiger",
715                 .psize  = 5,
716                 .digest = { 0x9f, 0x00, 0xf5, 0x99, 0x07, 0x23, 0x00, 0xdd,
717                             0x27, 0x6a, 0xbb, 0x38, 0xc8, 0xeb, 0x6d, 0xec },
718         }, {
719                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
720                 .psize  = 64,
721                 .digest = { 0x87, 0xfb, 0x2a, 0x90, 0x83, 0x85, 0x1c, 0xf7,
722                             0x47, 0x0d, 0x2c, 0xf8, 0x10, 0xe6, 0xdf, 0x9e },
723         }, {
724                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
725                 .psize  = 64,
726                 .digest = { 0x46, 0x7d, 0xb8, 0x08, 0x63, 0xeb, 0xce, 0x48,
727                             0x8d, 0xf1, 0xcd, 0x12, 0x61, 0x65, 0x5d, 0xe9 },
728         }, {
729                 .plaintext = "Tiger - A Fast New Hash Function, "
730                              "by Ross Anderson and Eli Biham, "
731                              "proceedings of Fast Software Encryption 3, "
732                              "Cambridge, 1996.",
733                 .psize  = 125,
734                 .digest = { 0x3d, 0x9a, 0xeb, 0x03, 0xd1, 0xbd, 0x1a, 0x63,
735                             0x57, 0xb2, 0x77, 0x4d, 0xfd, 0x6d, 0x5b, 0x24 },
736         },
737 };
738
739 /*
740  * HMAC-MD5 test vectors from RFC2202
741  * (These need to be fixed to not use strlen).
742  */
743 #define HMAC_MD5_TEST_VECTORS   7
744
745 static struct hash_testvec hmac_md5_tv_template[] =
746 {
747         {
748                 .key    = { [0 ... 15] =  0x0b },
749                 .ksize  = 16,
750                 .plaintext = "Hi There",
751                 .psize  = 8,
752                 .digest = { 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c,
753                             0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d },
754         }, {
755                 .key    = { 'J', 'e', 'f', 'e' },
756                 .ksize  = 4,
757                 .plaintext = "what do ya want for nothing?",
758                 .psize  = 28,
759                 .digest = { 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03,
760                             0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38 },
761                 .np     = 2,
762                 .tap    = {14, 14}
763         }, {
764                 .key    = { [0 ... 15] = 0xaa },
765                 .ksize  = 16,
766                 .plaintext = { [0 ... 49] =  0xdd },
767                 .psize  = 50,
768                 .digest = { 0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88,
769                             0xdb, 0xb8, 0xc7, 0x33, 0xf0, 0xe8, 0xb3, 0xf6 },
770         }, {
771                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
772                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
773                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, },
774                 .ksize  = 25,
775                 .plaintext = { [0 ... 49] =  0xcd },
776                 .psize  = 50,
777                 .digest = { 0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea,
778                             0x3a, 0x75, 0x16, 0x47, 0x46, 0xff, 0xaa, 0x79 },
779         }, {
780                 .key    = { [0 ... 15] = 0x0c },
781                 .ksize  = 16,
782                 .plaintext = "Test With Truncation",
783                 .psize  = 20,
784                 .digest = { 0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00,
785                             0xf9, 0xba, 0xb9, 0x95, 0x69, 0x0e, 0xfd, 0x4c },
786         }, {
787                 .key    = { [0 ... 79] =  0xaa },
788                 .ksize  = 80,
789                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
790                 .psize  = 54,
791                 .digest = { 0x6b, 0x1a, 0xb7, 0xfe, 0x4b, 0xd7, 0xbf, 0x8f,
792                             0x0b, 0x62, 0xe6, 0xce, 0x61, 0xb9, 0xd0, 0xcd },
793         }, {
794                 .key    = { [0 ... 79] =  0xaa },
795                 .ksize  = 80,
796                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
797                              "Block-Size Data",
798                 .psize  = 73,
799                 .digest = { 0x6f, 0x63, 0x0f, 0xad, 0x67, 0xcd, 0xa0, 0xee,
800                             0x1f, 0xb1, 0xf5, 0x62, 0xdb, 0x3a, 0xa5, 0x3e },
801         },
802 };
803
804 /*
805  * HMAC-SHA1 test vectors from RFC2202
806  */
807 #define HMAC_SHA1_TEST_VECTORS  7
808
809 static struct hash_testvec hmac_sha1_tv_template[] = {
810         {
811                 .key    = { [0 ... 19] = 0x0b },
812                 .ksize  = 20,
813                 .plaintext = "Hi There",
814                 .psize  = 8,
815                 .digest = { 0xb6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64,
816                             0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, 0xf1,
817                             0x46, 0xbe },
818         }, {
819                 .key    = { 'J', 'e', 'f', 'e' },
820                 .ksize  = 4,
821                 .plaintext = "what do ya want for nothing?",
822                 .psize  = 28,
823                 .digest = { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, 0xd2, 0x74,
824                             0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, 0x25, 0x9a, 0x7c, 0x79 },
825                 .np     = 2,
826                 .tap    = { 14, 14 }
827         }, {
828                 .key    = { [0 ... 19] = 0xaa },
829                 .ksize  = 20,
830                 .plaintext = { [0 ... 49] = 0xdd },
831                 .psize  = 50,
832                 .digest = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd, 0x91, 0xa3,
833                             0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f, 0x63, 0xf1, 0x75, 0xd3 },
834         }, {
835                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
836                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
837                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 },
838                 .ksize  = 25,
839                 .plaintext = { [0 ... 49] = 0xcd },
840                 .psize  = 50,
841                 .digest = { 0x4c, 0x90, 0x07, 0xf4, 0x02, 0x62, 0x50, 0xc6, 0xbc, 0x84,
842                             0x14, 0xf9, 0xbf, 0x50, 0xc8, 0x6c, 0x2d, 0x72, 0x35, 0xda },
843         }, {
844                 .key    = { [0 ... 19] = 0x0c },
845                 .ksize  = 20,
846                 .plaintext = "Test With Truncation",
847                 .psize  = 20,
848                 .digest = { 0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2,
849                             0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04 },
850         }, {
851                 .key    = { [0 ... 79] = 0xaa },
852                 .ksize  = 80,
853                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
854                 .psize  = 54,
855                 .digest = { 0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, 0x95, 0x70,
856                             0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12 },
857         }, {
858                 .key    = { [0 ... 79] = 0xaa },
859                 .ksize  = 80,
860                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
861                              "Block-Size Data",
862                 .psize  = 73,
863                 .digest = { 0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b,
864                             0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91 },
865         },
866 };
867
868
869 /*
870  * SHA224 HMAC test vectors from RFC4231
871  */
872 #define HMAC_SHA224_TEST_VECTORS    4
873
874 static struct hash_testvec hmac_sha224_tv_template[] = {
875         {
876                 .key    = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
877                         0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
878                         0x0b, 0x0b, 0x0b, 0x0b },
879                 .ksize  = 20,
880                 /*  ("Hi There") */
881                 .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65 },
882                 .psize  = 8,
883                 .digest = { 0x89, 0x6f, 0xb1, 0x12, 0x8a, 0xbb, 0xdf, 0x19,
884                         0x68, 0x32, 0x10, 0x7c, 0xd4, 0x9d, 0xf3, 0x3f,
885                         0x47, 0xb4, 0xb1, 0x16, 0x99, 0x12, 0xba, 0x4f,
886                         0x53, 0x68, 0x4b, 0x22},
887         }, {
888                 .key    = { 0x4a, 0x65, 0x66, 0x65 }, /* ("Jefe") */
889                 .ksize  = 4,
890                 /* ("what do ya want for nothing?") */
891                 .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
892                         0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
893                         0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
894                         0x69, 0x6e, 0x67, 0x3f },
895                 .psize  = 28,
896                 .digest = { 0xa3, 0x0e, 0x01, 0x09, 0x8b, 0xc6, 0xdb, 0xbf,
897                         0x45, 0x69, 0x0f, 0x3a, 0x7e, 0x9e, 0x6d, 0x0f,
898                         0x8b, 0xbe, 0xa2, 0xa3, 0x9e, 0x61, 0x48, 0x00,
899                         0x8f, 0xd0, 0x5e, 0x44 },
900                 .np = 4,
901                 .tap    = { 7, 7, 7, 7 }
902         }, {
903                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
904                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
905                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
906                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
907                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
908                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
909                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
910                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
911                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
912                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
913                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
914                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
915                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
916                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
917                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
918                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
919                         0xaa, 0xaa, 0xaa },
920                 .ksize  = 131,
921                 /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
922                 .plaintext = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69,
923                         0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65,
924                         0x72, 0x20, 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42,
925                         0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a,
926                         0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x2d, 0x20,
927                         0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79,
928                         0x20, 0x46, 0x69, 0x72, 0x73, 0x74 },
929                 .psize  = 54,
930                 .digest = { 0x95, 0xe9, 0xa0, 0xdb, 0x96, 0x20, 0x95, 0xad,
931                         0xae, 0xbe, 0x9b, 0x2d, 0x6f, 0x0d, 0xbc, 0xe2,
932                         0xd4, 0x99, 0xf1, 0x12, 0xf2, 0xd2, 0xb7, 0x27,
933                         0x3f, 0xa6, 0x87, 0x0e },
934         }, {
935                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
936                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
937                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
938                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
939                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
940                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
941                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
942                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
943                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
944                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
945                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
946                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
947                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
948                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
949                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
950                         0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
951                         0xaa, 0xaa, 0xaa },
952                 .ksize  = 131,
953                 /* ("This is a test using a larger than block-size key and a")
954                 (" larger than block-size data. The key needs to be")
955                         (" hashed before being used by the HMAC algorithm.") */
956                 .plaintext = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
957                         0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75,
958                         0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6c,
959                         0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, 0x68,
960                         0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
961                         0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6b, 0x65,
962                         0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20,
963                         0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74,
964                         0x68, 0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63,
965                         0x6b, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x64,
966                         0x61, 0x74, 0x61, 0x2e, 0x20, 0x54, 0x68, 0x65,
967                         0x20, 0x6b, 0x65, 0x79, 0x20, 0x6e, 0x65, 0x65,
968                         0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,
969                         0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x20,
970                         0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x62,
971                         0x65, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x65,
972                         0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65,
973                         0x20, 0x48, 0x4d, 0x41, 0x43, 0x20, 0x61, 0x6c,
974                         0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e },
975                 .psize  = 152,
976                 .digest = { 0x3a, 0x85, 0x41, 0x66, 0xac, 0x5d, 0x9f, 0x02,
977                         0x3f, 0x54, 0xd5, 0x17, 0xd0, 0xb3, 0x9d, 0xbd,
978                         0x94, 0x67, 0x70, 0xdb, 0x9c, 0x2b, 0x95, 0xc9,
979                         0xf6, 0xf5, 0x65, 0xd1 },
980         },
981 };
982
983 /*
984  * HMAC-SHA256 test vectors from
985  * draft-ietf-ipsec-ciph-sha-256-01.txt
986  */
987 #define HMAC_SHA256_TEST_VECTORS        10
988
989 static struct hash_testvec hmac_sha256_tv_template[] = {
990         {
991                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
992                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
993                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
994                             0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20},
995                 .ksize  = 32,
996                 .plaintext = "abc",
997                 .psize  = 3,
998                 .digest = { 0xa2, 0x1b, 0x1f, 0x5d, 0x4c, 0xf4, 0xf7, 0x3a,
999                             0x4d, 0xd9, 0x39, 0x75, 0x0f, 0x7a, 0x06, 0x6a,
1000                             0x7f, 0x98, 0xcc, 0x13, 0x1c, 0xb1, 0x6a, 0x66,
1001                             0x92, 0x75, 0x90, 0x21, 0xcf, 0xab, 0x81, 0x81 },
1002         }, {
1003                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
1004                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
1005                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
1006                             0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 },
1007                 .ksize  = 32,
1008                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1009                 .psize  = 56,
1010                 .digest = { 0x10, 0x4f, 0xdc, 0x12, 0x57, 0x32, 0x8f, 0x08,
1011                             0x18, 0x4b, 0xa7, 0x31, 0x31, 0xc5, 0x3c, 0xae,
1012                             0xe6, 0x98, 0xe3, 0x61, 0x19, 0x42, 0x11, 0x49,
1013                             0xea, 0x8c, 0x71, 0x24, 0x56, 0x69, 0x7d, 0x30 },
1014         }, {
1015                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
1016                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
1017                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
1018                             0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 },
1019                 .ksize  = 32,
1020                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
1021                              "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1022                 .psize  = 112,
1023                 .digest = { 0x47, 0x03, 0x05, 0xfc, 0x7e, 0x40, 0xfe, 0x34,
1024                             0xd3, 0xee, 0xb3, 0xe7, 0x73, 0xd9, 0x5a, 0xab,
1025                             0x73, 0xac, 0xf0, 0xfd, 0x06, 0x04, 0x47, 0xa5,
1026                             0xeb, 0x45, 0x95, 0xbf, 0x33, 0xa9, 0xd1, 0xa3 },
1027         }, {
1028                 .key    = { [0 ... 31] = 0x0b },
1029                 .ksize  = 32,
1030                 .plaintext = "Hi There",
1031                 .psize  = 8,
1032                 .digest = { 0x19, 0x8a, 0x60, 0x7e, 0xb4, 0x4b, 0xfb, 0xc6,
1033                             0x99, 0x03, 0xa0, 0xf1, 0xcf, 0x2b, 0xbd, 0xc5,
1034                             0xba, 0x0a, 0xa3, 0xf3, 0xd9, 0xae, 0x3c, 0x1c,
1035                             0x7a, 0x3b, 0x16, 0x96, 0xa0, 0xb6, 0x8c, 0xf7 },
1036         }, {
1037                 .key    = "Jefe",
1038                 .ksize  = 4,
1039                 .plaintext = "what do ya want for nothing?",
1040                 .psize  = 28,
1041                 .digest = { 0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e,
1042                             0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7,
1043                             0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83,
1044                             0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43 },
1045                 .np     = 2,
1046                 .tap    = { 14, 14 }
1047         }, {
1048                 .key    = { [0 ... 31] = 0xaa },
1049                 .ksize  = 32,
1050                 .plaintext = { [0 ... 49] = 0xdd },
1051                 .psize  = 50,
1052                 .digest = { 0xcd, 0xcb, 0x12, 0x20, 0xd1, 0xec, 0xcc, 0xea,
1053                             0x91, 0xe5, 0x3a, 0xba, 0x30, 0x92, 0xf9, 0x62,
1054                             0xe5, 0x49, 0xfe, 0x6c, 0xe9, 0xed, 0x7f, 0xdc,
1055                             0x43, 0x19, 0x1f, 0xbd, 0xe4, 0x5c, 0x30, 0xb0 },
1056         }, {
1057                 .key    = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
1058                             0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
1059                             0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
1060                             0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
1061                             0x21, 0x22, 0x23, 0x24, 0x25 },
1062                 .ksize  = 37,
1063                 .plaintext = { [0 ... 49] = 0xcd },
1064                 .psize  = 50,
1065                 .digest = { 0xd4, 0x63, 0x3c, 0x17, 0xf6, 0xfb, 0x8d, 0x74,
1066                             0x4c, 0x66, 0xde, 0xe0, 0xf8, 0xf0, 0x74, 0x55,
1067                             0x6e, 0xc4, 0xaf, 0x55, 0xef, 0x07, 0x99, 0x85,
1068                             0x41, 0x46, 0x8e, 0xb4, 0x9b, 0xd2, 0xe9, 0x17 },
1069         }, {
1070                 .key    = { [0 ... 31] = 0x0c },
1071                 .ksize  = 32,
1072                 .plaintext = "Test With Truncation",
1073                 .psize  = 20,
1074                 .digest = { 0x75, 0x46, 0xaf, 0x01, 0x84, 0x1f, 0xc0, 0x9b,
1075                             0x1a, 0xb9, 0xc3, 0x74, 0x9a, 0x5f, 0x1c, 0x17,
1076                             0xd4, 0xf5, 0x89, 0x66, 0x8a, 0x58, 0x7b, 0x27,
1077                             0x00, 0xa9, 0xc9, 0x7c, 0x11, 0x93, 0xcf, 0x42 },
1078         }, {
1079                 .key    = { [0 ... 79] = 0xaa },
1080                 .ksize  = 80,
1081                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1082                 .psize  = 54,
1083                 .digest = { 0x69, 0x53, 0x02, 0x5e, 0xd9, 0x6f, 0x0c, 0x09,
1084                             0xf8, 0x0a, 0x96, 0xf7, 0x8e, 0x65, 0x38, 0xdb,
1085                             0xe2, 0xe7, 0xb8, 0x20, 0xe3, 0xdd, 0x97, 0x0e,
1086                             0x7d, 0xdd, 0x39, 0x09, 0x1b, 0x32, 0x35, 0x2f },
1087         }, {
1088                 .key    = { [0 ... 79] = 0xaa },
1089                 .ksize  = 80,
1090                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
1091                              "One Block-Size Data",
1092                 .psize  = 73,
1093                 .digest = { 0x63, 0x55, 0xac, 0x22, 0xe8, 0x90, 0xd0, 0xa3,
1094                             0xc8, 0x48, 0x1a, 0x5c, 0xa4, 0x82, 0x5b, 0xc8,
1095                             0x84, 0xd3, 0xe7, 0xa1, 0xff, 0x98, 0xa2, 0xfc,
1096                             0x2a, 0xc7, 0xd8, 0xe0, 0x64, 0xc3, 0xb2, 0xe6 },
1097         },
1098 };
1099
1100 #define XCBC_AES_TEST_VECTORS 6
1101
1102 static struct hash_testvec aes_xcbc128_tv_template[] = {
1103         {
1104                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1105                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1106                 .plaintext = { [0 ... 15] = 0 },
1107                 .digest = { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c,
1108                             0x45, 0x73, 0xdf, 0xd5, 0x84, 0xd7, 0x9f, 0x29 },
1109                 .psize  = 0,
1110                 .ksize  = 16,
1111         }, {
1112                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1113                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1114                 .plaintext = { 0x00, 0x01, 0x02 },
1115                 .digest = { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f, 0x19, 0xaf,
1116                             0xe7, 0x21, 0x9c, 0xee, 0xf1, 0x72, 0x75, 0x6f },
1117                 .psize  = 3,
1118                 .ksize  = 16,
1119         } , {
1120                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1121                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1122                 .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1123                                0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1124                 .digest = { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b, 0x68, 0xa7,
1125                             0x99, 0x98, 0xa4, 0x39, 0x4f, 0xf7, 0xa2, 0x63 },
1126                 .psize  = 16,
1127                 .ksize  = 16,
1128         }, {
1129                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1130                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1131                 .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1132                                0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1133                                0x10, 0x11, 0x12, 0x13 },
1134                 .digest = { 0x47, 0xf5, 0x1b, 0x45, 0x64, 0x96, 0x62, 0x15,
1135                             0xb8, 0x98, 0x5c, 0x63, 0x05, 0x5e, 0xd3, 0x08 },
1136                 .tap    = { 10, 10 },
1137                 .psize  = 20,
1138                 .np     = 2,
1139                 .ksize  = 16,
1140         }, {
1141                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1142                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1143                 .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1144                                0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1145                                0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1146                                0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
1147                 .digest = { 0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9, 0xf3, 0xd3,
1148                             0x68, 0x07, 0x73, 0x4b, 0xd5, 0x28, 0x3f, 0xd4 },
1149                 .psize  = 32,
1150                 .ksize  = 16,
1151         }, {
1152                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1153                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1154                 .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1155                                0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1156                                0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1157                                0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
1158                                0x20, 0x21 },
1159                 .digest = { 0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5, 0x18, 0xa3,
1160                             0x06, 0x77, 0xd5, 0x48, 0x1f, 0xb6, 0xb4, 0xd8 },
1161                 .tap    = { 17, 17 },
1162                 .psize  = 34,
1163                 .np     = 2,
1164                 .ksize  = 16,
1165         }
1166 };
1167
1168 /*
1169  * SHA384 HMAC test vectors from RFC4231
1170  */
1171
1172 #define HMAC_SHA384_TEST_VECTORS        4
1173
1174 static struct hash_testvec hmac_sha384_tv_template[] = {
1175         {
1176                 .key    = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
1177                             0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
1178                             0x0b, 0x0b, 0x0b, 0x0b }, // (20 bytes)
1179                 .ksize  = 20,
1180                 .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65 }, // ("Hi There")
1181                 .psize  = 8,
1182                 .digest = { 0xaf, 0xd0, 0x39, 0x44, 0xd8, 0x48, 0x95, 0x62,
1183                             0x6b, 0x08, 0x25, 0xf4, 0xab, 0x46, 0x90, 0x7f,
1184                             0x15, 0xf9, 0xda, 0xdb, 0xe4, 0x10, 0x1e, 0xc6,
1185                             0x82, 0xaa, 0x03, 0x4c, 0x7c, 0xeb, 0xc5, 0x9c,
1186                             0xfa, 0xea, 0x9e, 0xa9, 0x07, 0x6e, 0xde, 0x7f,
1187                             0x4a, 0xf1, 0x52, 0xe8, 0xb2, 0xfa, 0x9c, 0xb6 },
1188         }, {
1189                 .key    = { 0x4a, 0x65, 0x66, 0x65 }, // ("Jefe")
1190                 .ksize  = 4,
1191                 .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
1192                                0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, // ("what do ya want ")
1193                                0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
1194                                0x69, 0x6e, 0x67, 0x3f }, // ("for nothing?")
1195                 .psize  = 28,
1196                 .digest = { 0xaf, 0x45, 0xd2, 0xe3, 0x76, 0x48, 0x40, 0x31,
1197                             0x61, 0x7f, 0x78, 0xd2, 0xb5, 0x8a, 0x6b, 0x1b,
1198                             0x9c, 0x7e, 0xf4, 0x64, 0xf5, 0xa0, 0x1b, 0x47,
1199                             0xe4, 0x2e, 0xc3, 0x73, 0x63, 0x22, 0x44, 0x5e,
1200                             0x8e, 0x22, 0x40, 0xca, 0x5e, 0x69, 0xe2, 0xc7,
1201                             0x8b, 0x32, 0x39, 0xec, 0xfa, 0xb2, 0x16, 0x49 },
1202                 .np     = 4,
1203                 .tap    = { 7, 7, 7, 7 }
1204         }, {
1205                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1206                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1207                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1208                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1209                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1210                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1211                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1212                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1213                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1214                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1215                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1216                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1217                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1218                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1219                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1220                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1221                             0xaa, 0xaa, 0xaa }, // (131 bytes)
1222                 .ksize  = 131,
1223                 .plaintext = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69,
1224                                0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65, // ("Test Using Large")
1225                                0x72, 0x20, 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42,
1226                                0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a, // ("r Than Block-Siz")
1227                                0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x2d, 0x20,
1228                                0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79, // ("e Key - Hash Key")
1229                                0x20, 0x46, 0x69, 0x72, 0x73, 0x74 }, // (" First")
1230                 .psize  = 54,
1231                 .digest = { 0x4e, 0xce, 0x08, 0x44, 0x85, 0x81, 0x3e, 0x90,
1232                             0x88, 0xd2, 0xc6, 0x3a, 0x04, 0x1b, 0xc5, 0xb4,
1233                             0x4f, 0x9e, 0xf1, 0x01, 0x2a, 0x2b, 0x58, 0x8f,
1234                             0x3c, 0xd1, 0x1f, 0x05, 0x03, 0x3a, 0xc4, 0xc6,
1235                             0x0c, 0x2e, 0xf6, 0xab, 0x40, 0x30, 0xfe, 0x82,
1236                             0x96, 0x24, 0x8d, 0xf1, 0x63, 0xf4, 0x49, 0x52 },
1237         }, {
1238                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1239                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1240                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1241                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1242                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1243                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1244                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1245                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1246                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1247                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1248                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1249                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1250                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1251                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1252                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1253                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1254                             0xaa, 0xaa, 0xaa }, // (131 bytes)
1255                 .ksize  = 131,
1256                 .plaintext = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
1257                                0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, // ("This is a test u")
1258                                0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6c,
1259                                0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, 0x68, // ("sing a larger th")
1260                                0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
1261                                0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6b, 0x65, // ("an block-size ke")
1262                                0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20,
1263                                0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, // ("y and a larger t")
1264                                0x68, 0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63,
1265                                0x6b, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x64, // ("han block-size d")
1266                                0x61, 0x74, 0x61, 0x2e, 0x20, 0x54, 0x68, 0x65,
1267                                0x20, 0x6b, 0x65, 0x79, 0x20, 0x6e, 0x65, 0x65, // ("ata. The key nee")
1268                                0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,
1269                                0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x20, // ("ds to be hashed ")
1270                                0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x62,
1271                                0x65, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x65, // ("before being use")
1272                                0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65,
1273                                0x20, 0x48, 0x4d, 0x41, 0x43, 0x20, 0x61, 0x6c, // ("d by the HMAC al")
1274                                0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e }, // ("gorithm.")
1275                 .psize  = 152,
1276                 .digest = { 0x66, 0x17, 0x17, 0x8e, 0x94, 0x1f, 0x02, 0x0d,
1277                             0x35, 0x1e, 0x2f, 0x25, 0x4e, 0x8f, 0xd3, 0x2c,
1278                             0x60, 0x24, 0x20, 0xfe, 0xb0, 0xb8, 0xfb, 0x9a,
1279                             0xdc, 0xce, 0xbb, 0x82, 0x46, 0x1e, 0x99, 0xc5,
1280                             0xa6, 0x78, 0xcc, 0x31, 0xe7, 0x99, 0x17, 0x6d,
1281                             0x38, 0x60, 0xe6, 0x11, 0x0c, 0x46, 0x52, 0x3e },
1282         },
1283 };
1284
1285 /*
1286  * SHA512 HMAC test vectors from RFC4231
1287  */
1288
1289 #define HMAC_SHA512_TEST_VECTORS        4
1290
1291 static struct hash_testvec hmac_sha512_tv_template[] = {
1292         {
1293                 .key    = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
1294                             0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
1295                             0x0b, 0x0b, 0x0b, 0x0b }, // (20 bytes)
1296                 .ksize  = 20,
1297                 .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65 }, // ("Hi There")
1298                 .psize  = 8,
1299                 .digest = { 0x87, 0xaa, 0x7c, 0xde, 0xa5, 0xef, 0x61, 0x9d,
1300                             0x4f, 0xf0, 0xb4, 0x24, 0x1a, 0x1d, 0x6c, 0xb0,
1301                             0x23, 0x79, 0xf4, 0xe2, 0xce, 0x4e, 0xc2, 0x78,
1302                             0x7a, 0xd0, 0xb3, 0x05, 0x45, 0xe1, 0x7c, 0xde,
1303                             0xda, 0xa8, 0x33, 0xb7, 0xd6, 0xb8, 0xa7, 0x02,
1304                             0x03, 0x8b, 0x27, 0x4e, 0xae, 0xa3, 0xf4, 0xe4,
1305                             0xbe, 0x9d, 0x91, 0x4e, 0xeb, 0x61, 0xf1, 0x70,
1306                             0x2e, 0x69, 0x6c, 0x20, 0x3a, 0x12, 0x68, 0x54 },
1307         }, {
1308                 .key    = { 0x4a, 0x65, 0x66, 0x65 }, // ("Jefe")
1309                 .ksize  = 4,
1310                 .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
1311                                0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, // ("what do ya want ")
1312                                0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
1313                                0x69, 0x6e, 0x67, 0x3f }, // ("for nothing?")
1314                 .psize  = 28,
1315                 .digest = { 0x16, 0x4b, 0x7a, 0x7b, 0xfc, 0xf8, 0x19, 0xe2,
1316                             0xe3, 0x95, 0xfb, 0xe7, 0x3b, 0x56, 0xe0, 0xa3,
1317                             0x87, 0xbd, 0x64, 0x22, 0x2e, 0x83, 0x1f, 0xd6,
1318                             0x10, 0x27, 0x0c, 0xd7, 0xea, 0x25, 0x05, 0x54,
1319                             0x97, 0x58, 0xbf, 0x75, 0xc0, 0x5a, 0x99, 0x4a,
1320                             0x6d, 0x03, 0x4f, 0x65, 0xf8, 0xf0, 0xe6, 0xfd,
1321                             0xca, 0xea, 0xb1, 0xa3, 0x4d, 0x4a, 0x6b, 0x4b,
1322                             0x63, 0x6e, 0x07, 0x0a, 0x38, 0xbc, 0xe7, 0x37 },
1323                 .np     = 4,
1324                 .tap    = { 7, 7, 7, 7 }
1325         }, {
1326                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1327                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1328                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1329                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1330                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1331                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1332                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1333                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1334                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1335                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1336                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1337                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1338                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1339                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1340                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1341                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1342                             0xaa, 0xaa, 0xaa }, // (131 bytes)
1343                 .ksize  = 131,
1344                 .plaintext = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69,
1345                                0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65, // ("Test Using Large")
1346                                0x72, 0x20, 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42,
1347                                0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a, // ("r Than Block-Siz")
1348                                0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x2d, 0x20,
1349                                0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79, // ("e Key - Hash Key")
1350                                0x20, 0x46, 0x69, 0x72, 0x73, 0x74 }, // (" First")
1351                 .psize  = 54,
1352                 .digest = { 0x80, 0xb2, 0x42, 0x63, 0xc7, 0xc1, 0xa3, 0xeb,
1353                             0xb7, 0x14, 0x93, 0xc1, 0xdd, 0x7b, 0xe8, 0xb4,
1354                             0x9b, 0x46, 0xd1, 0xf4, 0x1b, 0x4a, 0xee, 0xc1,
1355                             0x12, 0x1b, 0x01, 0x37, 0x83, 0xf8, 0xf3, 0x52,
1356                             0x6b, 0x56, 0xd0, 0x37, 0xe0, 0x5f, 0x25, 0x98,
1357                             0xbd, 0x0f, 0xd2, 0x21, 0x5d, 0x6a, 0x1e, 0x52,
1358                             0x95, 0xe6, 0x4f, 0x73, 0xf6, 0x3f, 0x0a, 0xec,
1359                             0x8b, 0x91, 0x5a, 0x98, 0x5d, 0x78, 0x65, 0x98 },
1360         }, {
1361                 .key    = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1362                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1363                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1364                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1365                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1366                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1367                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1368                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1369                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1370                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1371                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1372                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1373                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1374                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1375                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1376                             0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
1377                             0xaa, 0xaa, 0xaa }, // (131 bytes)
1378                 .ksize  = 131,
1379                 .plaintext = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
1380                                0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, // ("This is a test u")
1381                                0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6c,
1382                                0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, 0x68, // ("sing a larger th")
1383                                0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
1384                                0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6b, 0x65, // ("an block-size ke")
1385                                0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20,
1386                                0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, // ("y and a larger t")
1387                                0x68, 0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63,
1388                                0x6b, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x64, // ("han block-size d")
1389                                0x61, 0x74, 0x61, 0x2e, 0x20, 0x54, 0x68, 0x65,
1390                                0x20, 0x6b, 0x65, 0x79, 0x20, 0x6e, 0x65, 0x65, // ("ata. The key nee")
1391                                0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,
1392                                0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x20, // ("ds to be hashed ")
1393                                0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x62,
1394                                0x65, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x65, // ("before being use")
1395                                0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65,
1396                                0x20, 0x48, 0x4d, 0x41, 0x43, 0x20, 0x61, 0x6c, // ("d by the HMAC al")
1397                                0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e }, // ("gorithm.")
1398                 .psize  = 152,
1399                 .digest = { 0xe3, 0x7b, 0x6a, 0x77, 0x5d, 0xc8, 0x7d, 0xba,
1400                             0xa4, 0xdf, 0xa9, 0xf9, 0x6e, 0x5e, 0x3f, 0xfd,
1401                             0xde, 0xbd, 0x71, 0xf8, 0x86, 0x72, 0x89, 0x86,
1402                             0x5d, 0xf5, 0xa3, 0x2d, 0x20, 0xcd, 0xc9, 0x44,
1403                             0xb6, 0x02, 0x2c, 0xac, 0x3c, 0x49, 0x82, 0xb1,
1404                             0x0d, 0x5e, 0xeb, 0x55, 0xc3, 0xe4, 0xde, 0x15,
1405                             0x13, 0x46, 0x76, 0xfb, 0x6d, 0xe0, 0x44, 0x60,
1406                             0x65, 0xc9, 0x74, 0x40, 0xfa, 0x8c, 0x6a, 0x58 },
1407         },
1408 };
1409
1410 /*
1411  * DES test vectors.
1412  */
1413 #define DES_ENC_TEST_VECTORS            10
1414 #define DES_DEC_TEST_VECTORS            4
1415 #define DES_CBC_ENC_TEST_VECTORS        5
1416 #define DES_CBC_DEC_TEST_VECTORS        4
1417 #define DES3_EDE_ENC_TEST_VECTORS       3
1418 #define DES3_EDE_DEC_TEST_VECTORS       3
1419
1420 static struct cipher_testvec des_enc_tv_template[] = {
1421         { /* From Applied Cryptography */
1422                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1423                 .klen   = 8,
1424                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 },
1425                 .ilen   = 8,
1426                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d },
1427                 .rlen   = 8,
1428         }, { /* Same key, different plaintext block */
1429                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1430                 .klen   = 8,
1431                 .input  = { 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 },
1432                 .ilen   = 8,
1433                 .result = { 0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1434                 .rlen   = 8,
1435         }, { /* Sbox test from NBS */
1436                 .key    = { 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57 },
1437                 .klen   = 8,
1438                 .input  = { 0x01, 0xa1, 0xd6, 0xd0, 0x39, 0x77, 0x67, 0x42 },
1439                 .ilen   = 8,
1440                 .result = { 0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b },
1441                 .rlen   = 8,
1442         }, { /* Three blocks */
1443                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1444                 .klen   = 8,
1445                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1446                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
1447                             0xca, 0xfe, 0xba, 0xbe, 0xfe, 0xed, 0xbe, 0xef },
1448                 .ilen   = 24,
1449                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1450                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b,
1451                             0xb4, 0x99, 0x26, 0xf7, 0x1f, 0xe1, 0xd4, 0x90 },
1452                 .rlen   = 24,
1453         }, { /* Weak key */
1454                 .fail   = 1,
1455                 .wk     = 1,
1456                 .key    = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
1457                 .klen   = 8,
1458                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 },
1459                 .ilen   = 8,
1460                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d },
1461                 .rlen   = 8,
1462         }, { /* Two blocks -- for testing encryption across pages */
1463                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1464                 .klen   = 8,
1465                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1466                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 },
1467                 .ilen   = 16,
1468                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1469                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1470                 .rlen   = 16,
1471                 .np     = 2,
1472                 .tap    = { 8, 8 }
1473         }, { /* Four blocks -- for testing encryption with chunking */
1474                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1475                 .klen   = 8,
1476                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1477                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
1478                             0xca, 0xfe, 0xba, 0xbe, 0xfe, 0xed, 0xbe, 0xef,
1479                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 },
1480                 .ilen   = 32,
1481                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1482                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b,
1483                             0xb4, 0x99, 0x26, 0xf7, 0x1f, 0xe1, 0xd4, 0x90,
1484                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1485                 .rlen   = 32,
1486                 .np     = 3,
1487                 .tap    = { 14, 10, 8 }
1488         }, {
1489                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1490                 .klen   = 8,
1491                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1492                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
1493                             0xca, 0xfe, 0xba, 0xbe, 0xfe, 0xed, 0xbe, 0xef },
1494                 .ilen   = 24,
1495                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1496                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b,
1497                             0xb4, 0x99, 0x26, 0xf7, 0x1f, 0xe1, 0xd4, 0x90 },
1498                 .rlen   = 24,
1499                 .np     = 4,
1500                 .tap    = { 2, 1, 3, 18 }
1501         }, {
1502                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1503                 .klen   = 8,
1504                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1505                             0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 },
1506                 .ilen   = 16,
1507                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1508                             0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1509                 .rlen   = 16,
1510                 .np     = 5,
1511                 .tap    = { 2, 2, 2, 2, 8 }
1512         }, {
1513                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1514                 .klen   = 8,
1515                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 },
1516                 .ilen   = 8,
1517                 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d },
1518                 .rlen   = 8,
1519                 .np     = 8,
1520                 .tap    = { 1, 1, 1, 1, 1, 1, 1, 1 }
1521         },
1522 };
1523
1524 static struct cipher_testvec des_dec_tv_template[] = {
1525         { /* From Applied Cryptography */
1526                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1527                 .klen   = 8,
1528                 .input  = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d },
1529                 .ilen   = 8,
1530                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 },
1531                 .rlen   = 8,
1532         }, { /* Sbox test from NBS */
1533                 .key    = { 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57 },
1534                 .klen   = 8,
1535                 .input  = { 0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b },
1536                 .ilen   = 8,
1537                 .result = { 0x01, 0xa1, 0xd6, 0xd0, 0x39, 0x77, 0x67, 0x42 },
1538                 .rlen   = 8,
1539         }, { /* Two blocks, for chunking test */
1540                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1541                 .klen   = 8,
1542                 .input  = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1543                             0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b },
1544                 .ilen   = 16,
1545                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1546                             0xa3, 0x99, 0x7b, 0xca, 0xaf, 0x69, 0xa0, 0xf5 },
1547                 .rlen   = 16,
1548                 .np     = 2,
1549                 .tap    = { 8, 8 }
1550         }, {
1551                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1552                 .klen   = 8,
1553                 .input  = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d,
1554                             0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b },
1555                 .ilen   = 16,
1556                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7,
1557                             0xa3, 0x99, 0x7b, 0xca, 0xaf, 0x69, 0xa0, 0xf5 },
1558                 .rlen   = 16,
1559                 .np     = 3,
1560                 .tap    = { 3, 12, 1 }
1561         },
1562 };
1563
1564 static struct cipher_testvec des_cbc_enc_tv_template[] = {
1565         { /* From OpenSSL */
1566                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
1567                 .klen   = 8,
1568                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1569                 .input  = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1570                             0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1571                             0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1572                 .ilen   = 24,
1573                 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
1574                             0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb,
1575                             0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 },
1576                 .rlen   = 24,
1577         }, { /* FIPS Pub 81 */
1578                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1579                 .klen   = 8,
1580                 .iv     = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef },
1581                 .input  = { 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 },
1582                 .ilen   = 8,
1583                 .result = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
1584                 .rlen   = 8,
1585         }, {
1586                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1587                 .klen   = 8,
1588                 .iv     = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
1589                 .input  = { 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1590                 .ilen   = 8,
1591                 .result = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1592                 .rlen   = 8,
1593         }, {
1594                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1595                 .klen   = 8,
1596                 .iv     = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1597                 .input  = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 },
1598                 .ilen   = 8,
1599                 .result = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1600                 .rlen   = 8,
1601         }, { /* Copy of openssl vector for chunk testing */
1602              /* From OpenSSL */
1603                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
1604                 .klen   = 8,
1605                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1606                 .input  = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1607                             0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1608                             0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1609                 .ilen   = 24,
1610                 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
1611                             0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb,
1612                             0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 },
1613                 .rlen   = 24,
1614                 .np     = 2,
1615                 .tap    = { 13, 11 }
1616         },
1617 };
1618
1619 static struct cipher_testvec des_cbc_dec_tv_template[] = {
1620         { /* FIPS Pub 81 */
1621                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1622                 .klen   = 8,
1623                 .iv     = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef },
1624                 .input  = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
1625                 .ilen   = 8,
1626                 .result = { 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 },
1627                 .rlen   = 8,
1628         }, {
1629                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1630                 .klen   = 8,
1631                 .iv     = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
1632                 .input  = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1633                 .ilen   = 8,
1634                 .result = { 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1635                 .rlen   = 8,
1636         }, {
1637                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1638                 .klen   = 8,
1639                 .iv     = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1640                 .input  = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1641                 .ilen   = 8,
1642                 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 },
1643                 .rlen   = 8,
1644         }, { /* Copy of above, for chunk testing */
1645                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1646                 .klen   = 8,
1647                 .iv     = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1648                 .input  = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1649                 .ilen   = 8,
1650                 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 },
1651                 .rlen   = 8,
1652                 .np     = 2,
1653                 .tap    = { 4, 4 }
1654         },
1655 };
1656
1657 /*
1658  * We really need some more test vectors, especially for DES3 CBC.
1659  */
1660 static struct cipher_testvec des3_ede_enc_tv_template[] = {
1661         { /* These are from openssl */
1662                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1663                             0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
1664                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1665                 .klen   = 24,
1666                 .input  = { 0x73, 0x6f, 0x6d, 0x65, 0x64, 0x61, 0x74, 0x61 },
1667                 .ilen   = 8,
1668                 .result = { 0x18, 0xd7, 0x48, 0xe5, 0x63, 0x62, 0x05, 0x72 },
1669                 .rlen   = 8,
1670         }, {
1671                 .key    = { 0x03, 0x52, 0x02, 0x07, 0x67, 0x20, 0x82, 0x17,
1672                             0x86, 0x02, 0x87, 0x66, 0x59, 0x08, 0x21, 0x98,
1673                             0x64, 0x05, 0x6a, 0xbd, 0xfe, 0xa9, 0x34, 0x57 },
1674                 .klen   = 24,
1675                 .input  = { 0x73, 0x71, 0x75, 0x69, 0x67, 0x67, 0x6c, 0x65 },
1676                 .ilen   = 8,
1677                 .result = { 0xc0, 0x7d, 0x2a, 0x0f, 0xa5, 0x66, 0xfa, 0x30 },
1678                 .rlen   = 8,
1679         }, {
1680                 .key    = { 0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20,
1681                             0x91, 0x07, 0xd0, 0x15, 0x89, 0x19, 0x01, 0x01,
1682                             0x19, 0x07, 0x92, 0x10, 0x98, 0x1a, 0x01, 0x01 },
1683                 .klen   = 24,
1684                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1685                 .ilen   = 8,
1686                 .result = { 0xe1, 0xef, 0x62, 0xc3, 0x32, 0xfe, 0x82, 0x5b },
1687                 .rlen   = 8,
1688         },
1689 };
1690
1691 static struct cipher_testvec des3_ede_dec_tv_template[] = {
1692         { /* These are from openssl */
1693                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1694                             0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
1695                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1696                 .klen   = 24,
1697                 .input  = { 0x18, 0xd7, 0x48, 0xe5, 0x63, 0x62, 0x05, 0x72 },
1698                 .ilen   = 8,
1699                 .result = { 0x73, 0x6f, 0x6d, 0x65, 0x64, 0x61, 0x74, 0x61 },
1700                 .rlen   = 8,
1701         }, {
1702                 .key    = { 0x03, 0x52, 0x02, 0x07, 0x67, 0x20, 0x82, 0x17,
1703                             0x86, 0x02, 0x87, 0x66, 0x59, 0x08, 0x21, 0x98,
1704                             0x64, 0x05, 0x6a, 0xbd, 0xfe, 0xa9, 0x34, 0x57 },
1705                 .klen   = 24,
1706                 .input  = { 0xc0, 0x7d, 0x2a, 0x0f, 0xa5, 0x66, 0xfa, 0x30 },
1707                 .ilen   = 8,
1708                 .result = { 0x73, 0x71, 0x75, 0x69, 0x67, 0x67, 0x6c, 0x65 },
1709                 .rlen   = 8,
1710         }, {
1711                 .key    = { 0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20,
1712                             0x91, 0x07, 0xd0, 0x15, 0x89, 0x19, 0x01, 0x01,
1713                             0x19, 0x07, 0x92, 0x10, 0x98, 0x1a, 0x01, 0x01 },
1714                 .klen   = 24,
1715                 .input  = { 0xe1, 0xef, 0x62, 0xc3, 0x32, 0xfe, 0x82, 0x5b },
1716                 .ilen   = 8,
1717                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1718                 .rlen   = 8,
1719         },
1720 };
1721
1722 /*
1723  * Blowfish test vectors.
1724  */
1725 #define BF_ENC_TEST_VECTORS     6
1726 #define BF_DEC_TEST_VECTORS     6
1727 #define BF_CBC_ENC_TEST_VECTORS 1
1728 #define BF_CBC_DEC_TEST_VECTORS 1
1729
1730 static struct cipher_testvec bf_enc_tv_template[] = {
1731         { /* DES test vectors from OpenSSL */
1732                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, },
1733                 .klen   = 8,
1734                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1735                 .ilen   = 8,
1736                 .result = { 0x4e, 0xf9, 0x97, 0x45, 0x61, 0x98, 0xdd, 0x78 },
1737                 .rlen   = 8,
1738         }, {
1739                 .key    = { 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e },
1740                 .klen   = 8,
1741                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1742                 .ilen   = 8,
1743                 .result = { 0xa7, 0x90, 0x79, 0x51, 0x08, 0xea, 0x3c, 0xae },
1744                 .rlen   = 8,
1745         }, {
1746                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1747                 .klen   = 8,
1748                 .input  = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1749                 .ilen   = 8,
1750                 .result = { 0xe8, 0x7a, 0x24, 0x4e, 0x2c, 0xc8, 0x5e, 0x82 },
1751                 .rlen   = 8,
1752         }, { /* Vary the keylength... */
1753                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1754                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f },
1755                 .klen   = 16,
1756                 .input  = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1757                 .ilen   = 8,
1758                 .result = { 0x93, 0x14, 0x28, 0x87, 0xee, 0x3b, 0xe1, 0x5c },
1759                 .rlen   = 8,
1760         }, {
1761                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1762                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1763                             0x00, 0x11, 0x22, 0x33, 0x44 },
1764                 .klen   = 21,
1765                 .input  = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1766                 .ilen   = 8,
1767                 .result = { 0xe6, 0xf5, 0x1e, 0xd7, 0x9b, 0x9d, 0xb2, 0x1f },
1768                 .rlen   = 8,
1769         }, { /* Generated with bf488 */
1770                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1771                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1772                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1773                             0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f,
1774                             0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76,
1775                             0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e,
1776                             0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1777                 .klen   = 56,
1778                 .input  = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1779                 .ilen   = 8,
1780                 .result = { 0xc0, 0x45, 0x04, 0x01, 0x2e, 0x4e, 0x1f, 0x53 },
1781                 .rlen   = 8,
1782         },
1783 };
1784
1785 static struct cipher_testvec bf_dec_tv_template[] = {
1786         { /* DES test vectors from OpenSSL */
1787                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1788                 .klen   = 8,
1789                 .input  = { 0x4e, 0xf9, 0x97, 0x45, 0x61, 0x98, 0xdd, 0x78 },
1790                 .ilen   = 8,
1791                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1792                 .rlen   = 8,
1793         }, {
1794                 .key    = { 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e },
1795                 .klen   = 8,
1796                 .input  = { 0xa7, 0x90, 0x79, 0x51, 0x08, 0xea, 0x3c, 0xae },
1797                 .ilen   = 8,
1798                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1799                 .rlen   = 8,
1800         }, {
1801                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1802                 .klen   = 8,
1803                 .input  = { 0xe8, 0x7a, 0x24, 0x4e, 0x2c, 0xc8, 0x5e, 0x82 },
1804                 .ilen   = 8,
1805                 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1806                 .rlen   = 8,
1807         }, { /* Vary the keylength... */
1808                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1809                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f },
1810                 .klen   = 16,
1811                 .input  = { 0x93, 0x14, 0x28, 0x87, 0xee, 0x3b, 0xe1, 0x5c },
1812                 .ilen   = 8,
1813                 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1814                 .rlen   = 8,
1815         }, {
1816                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1817                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1818                             0x00, 0x11, 0x22, 0x33, 0x44 },
1819                 .klen   = 21,
1820                 .input  = { 0xe6, 0xf5, 0x1e, 0xd7, 0x9b, 0x9d, 0xb2, 0x1f },
1821                 .ilen   = 8,
1822                 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1823                 .rlen   = 8,
1824         }, { /* Generated with bf488, using OpenSSL, Libgcrypt and Nettle */
1825                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1826                             0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1827                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1828                             0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f,
1829                             0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76,
1830                             0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e,
1831                             0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1832                 .klen   = 56,
1833                 .input  = { 0xc0, 0x45, 0x04, 0x01, 0x2e, 0x4e, 0x1f, 0x53 },
1834                 .ilen   = 8,
1835                 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1836                 .rlen   = 8,
1837         },
1838 };
1839
1840 static struct cipher_testvec bf_cbc_enc_tv_template[] = {
1841         { /* From OpenSSL */
1842                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1843                             0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1844                 .klen   = 16,
1845                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1846                 .input  = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1847                             0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1848                             0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
1849                             0x66, 0x6f, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00 },
1850                 .ilen   = 32,
1851                 .result = { 0x6b, 0x77, 0xb4, 0xd6, 0x30, 0x06, 0xde, 0xe6,
1852                             0x05, 0xb1, 0x56, 0xe2, 0x74, 0x03, 0x97, 0x93,
1853                             0x58, 0xde, 0xb9, 0xe7, 0x15, 0x46, 0x16, 0xd9,
1854                             0x59, 0xf1, 0x65, 0x2b, 0xd5, 0xff, 0x92, 0xcc },
1855                 .rlen   = 32,
1856         },
1857 };
1858
1859 static struct cipher_testvec bf_cbc_dec_tv_template[] = {
1860         { /* From OpenSSL */
1861                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1862                             0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1863                 .klen   = 16,
1864                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1865                 .input  = { 0x6b, 0x77, 0xb4, 0xd6, 0x30, 0x06, 0xde, 0xe6,
1866                             0x05, 0xb1, 0x56, 0xe2, 0x74, 0x03, 0x97, 0x93,
1867                             0x58, 0xde, 0xb9, 0xe7, 0x15, 0x46, 0x16, 0xd9,
1868                             0x59, 0xf1, 0x65, 0x2b, 0xd5, 0xff, 0x92, 0xcc },
1869                 .ilen   = 32,
1870                 .result = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1871                             0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1872                             0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
1873                             0x66, 0x6f, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00 },
1874                 .rlen   = 32,
1875         },
1876 };
1877
1878 /*
1879  * Twofish test vectors.
1880  */
1881 #define TF_ENC_TEST_VECTORS             3
1882 #define TF_DEC_TEST_VECTORS             3
1883 #define TF_CBC_ENC_TEST_VECTORS         4
1884 #define TF_CBC_DEC_TEST_VECTORS         4
1885
1886 static struct cipher_testvec tf_enc_tv_template[] = {
1887         {
1888                 .key    = { [0 ... 15] = 0x00 },
1889                 .klen   = 16,
1890                 .input  = { [0 ... 15] = 0x00 },
1891                 .ilen   = 16,
1892                 .result = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1893                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1894                 .rlen   = 16,
1895         }, {
1896                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1897                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
1898                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 },
1899                 .klen   = 24,
1900                 .input  = { [0 ... 15] = 0x00 },
1901                 .ilen   = 16,
1902                 .result = { 0xcf, 0xd1, 0xd2, 0xe5, 0xa9, 0xbe, 0x9c, 0xdf,
1903                             0x50, 0x1f, 0x13, 0xb8, 0x92, 0xbd, 0x22, 0x48 },
1904                 .rlen   = 16,
1905         }, {
1906                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1907                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
1908                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1909                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1910                 .klen   = 32,
1911                 .input  = { [0 ... 15] = 0x00 },
1912                 .ilen   = 16,
1913                 .result = { 0x37, 0x52, 0x7b, 0xe0, 0x05, 0x23, 0x34, 0xb8,
1914                             0x9f, 0x0c, 0xfc, 0xca, 0xe8, 0x7c, 0xfa, 0x20 },
1915                 .rlen   = 16,
1916         },
1917 };
1918
1919 static struct cipher_testvec tf_dec_tv_template[] = {
1920         {
1921                 .key    = { [0 ... 15] = 0x00 },
1922                 .klen   = 16,
1923                 .input  = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1924                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1925                 .ilen   = 16,
1926                 .result = { [0 ... 15] = 0x00 },
1927                 .rlen   = 16,
1928         }, {
1929                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1930                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
1931                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 },
1932                 .klen   = 24,
1933                 .input  = { 0xcf, 0xd1, 0xd2, 0xe5, 0xa9, 0xbe, 0x9c, 0xdf,
1934                             0x50, 0x1f, 0x13, 0xb8, 0x92, 0xbd, 0x22, 0x48 },
1935                 .ilen   = 16,
1936                 .result = { [0 ... 15] = 0x00 },
1937                 .rlen   = 16,
1938         }, {
1939                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1940                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
1941                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1942                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1943                 .klen   = 32,
1944                 .input  = { 0x37, 0x52, 0x7b, 0xe0, 0x05, 0x23, 0x34, 0xb8,
1945                             0x9f, 0x0c, 0xfc, 0xca, 0xe8, 0x7c, 0xfa, 0x20 },
1946                 .ilen   = 16,
1947                 .result = { [0 ... 15] = 0x00 },
1948                 .rlen   = 16,
1949         },
1950 };
1951
1952 static struct cipher_testvec tf_cbc_enc_tv_template[] = {
1953         { /* Generated with Nettle */
1954                 .key    = { [0 ... 15] = 0x00 },
1955                 .klen   = 16,
1956                 .iv     = { [0 ... 15] = 0x00 },
1957                 .input  = { [0 ... 15] = 0x00 },
1958                 .ilen   = 16,
1959                 .result = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1960                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1961                 .rlen   = 16,
1962         }, {
1963                 .key    = { [0 ... 15] = 0x00 },
1964                 .klen   = 16,
1965                 .iv     = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1966                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1967                 .input  = { [0 ... 15] = 0x00 },
1968                 .ilen   = 16,
1969                 .result = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
1970                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19 },
1971                 .rlen   = 16,
1972         }, {
1973                 .key    = { [0 ... 15] = 0x00 },
1974                 .klen   = 16,
1975                 .iv     = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
1976                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19 },
1977                 .input  = { [0 ... 15] = 0x00 },
1978                 .ilen   = 16,
1979                 .result = { 0x05, 0xef, 0x8c, 0x61, 0xa8, 0x11, 0x58, 0x26,
1980                             0x34, 0xba, 0x5c, 0xb7, 0x10, 0x6a, 0xa6, 0x41 },
1981                 .rlen   = 16,
1982         }, {
1983                 .key    = { [0 ... 15] = 0x00 },
1984                 .klen   = 16,
1985                 .iv     = { [0 ... 15] = 0x00 },
1986                 .input  = { [0 ... 47] = 0x00 },
1987                 .ilen   = 48,
1988                 .result = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1989                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a,
1990                             0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
1991                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19,
1992                             0x05, 0xef, 0x8c, 0x61, 0xa8, 0x11, 0x58, 0x26,
1993                             0x34, 0xba, 0x5c, 0xb7, 0x10, 0x6a, 0xa6, 0x41 },
1994                 .rlen   = 48,
1995         },
1996 };
1997
1998 static struct cipher_testvec tf_cbc_dec_tv_template[] = {
1999         { /* Reverse of the first four above */
2000                 .key    = { [0 ... 15] = 0x00 },
2001                 .klen   = 16,
2002                 .iv     = { [0 ... 15] = 0x00 },
2003                 .input  = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
2004                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
2005                 .ilen   = 16,
2006                 .result = { [0 ... 15] = 0x00 },
2007                 .rlen   = 16,
2008         }, {
2009                 .key    = { [0 ... 15] = 0x00 },
2010                 .klen   = 16,
2011                 .iv     = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
2012                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
2013                 .input  = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
2014                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19 },
2015                 .ilen   = 16,
2016                 .result = { [0 ... 15] = 0x00 },
2017                 .rlen   = 16,
2018         }, {
2019                 .key    = { [0 ... 15] = 0x00 },
2020                 .klen   = 16,
2021                 .iv     = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
2022                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19 },
2023                 .input  = { 0x05, 0xef, 0x8c, 0x61, 0xa8, 0x11, 0x58, 0x26,
2024                             0x34, 0xba, 0x5c, 0xb7, 0x10, 0x6a, 0xa6, 0x41 },
2025                 .ilen   = 16,
2026                 .result = { [0 ... 15] = 0x00 },
2027                 .rlen   = 16,
2028         }, {
2029                 .key    = { [0 ... 15] = 0x00 },
2030                 .klen   = 16,
2031                 .iv     = { [0 ... 15] = 0x00 },
2032                 .input  = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
2033                             0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a,
2034                             0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
2035                             0x86, 0xcb, 0x08, 0x6b, 0x78, 0x9f, 0x54, 0x19,
2036                             0x05, 0xef, 0x8c, 0x61, 0xa8, 0x11, 0x58, 0x26,
2037                             0x34, 0xba, 0x5c, 0xb7, 0x10, 0x6a, 0xa6, 0x41 },
2038                 .ilen   = 48,
2039                 .result = { [0 ... 47] = 0x00 },
2040                 .rlen   = 48,
2041         },
2042 };
2043
2044 /*
2045  * Serpent test vectors.  These are backwards because Serpent writes
2046  * octet sequences in right-to-left mode.
2047  */
2048 #define SERPENT_ENC_TEST_VECTORS        4
2049 #define SERPENT_DEC_TEST_VECTORS        4
2050
2051 #define TNEPRES_ENC_TEST_VECTORS        4
2052 #define TNEPRES_DEC_TEST_VECTORS        4
2053
2054 static struct cipher_testvec serpent_enc_tv_template[] = {
2055         {
2056                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2057                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2058                 .ilen   = 16,
2059                 .result = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47,
2060                             0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 },
2061                 .rlen   = 16,
2062         }, {
2063                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2064                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2065                 .klen   = 16,
2066                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2067                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2068                 .ilen   = 16,
2069                 .result = { 0x4c, 0x7d, 0x8a, 0x32, 0x80, 0x72, 0xa2, 0x2c,
2070                             0x82, 0x3e, 0x4a, 0x1f, 0x3a, 0xcd, 0xa1, 0x6d },
2071                 .rlen   = 16,
2072         }, {
2073                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2074                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2075                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2076                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2077                 .klen   = 32,
2078                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2079                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2080                 .ilen   = 16,
2081                 .result = { 0xde, 0x26, 0x9f, 0xf8, 0x33, 0xe4, 0x32, 0xb8,
2082                             0x5b, 0x2e, 0x88, 0xd2, 0x70, 0x1c, 0xe7, 0x5c },
2083                 .rlen   = 16,
2084         }, {
2085                 .key    = { [15] = 0x80 },
2086                 .klen   = 16,
2087                 .input  = { [0 ... 15] = 0x00 },
2088                 .ilen   = 16,
2089                 .result = { 0xdd, 0xd2, 0x6b, 0x98, 0xa5, 0xff, 0xd8, 0x2c,
2090                             0x05, 0x34, 0x5a, 0x9d, 0xad, 0xbf, 0xaf, 0x49},
2091                 .rlen   = 16,
2092         },
2093 };
2094
2095 static struct cipher_testvec tnepres_enc_tv_template[] = {
2096         { /* KeySize=128, PT=0, I=1 */
2097                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2098                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2099                 .key    = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2100                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2101                 .klen   = 16,
2102                 .ilen   = 16,
2103                 .result = { 0x49, 0xaf, 0xbf, 0xad, 0x9d, 0x5a, 0x34, 0x05,
2104                             0x2c, 0xd8, 0xff, 0xa5, 0x98, 0x6b, 0xd2, 0xdd },
2105                 .rlen   = 16,
2106         }, { /* KeySize=192, PT=0, I=1 */
2107                 .key    = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2108                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2109                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2110                 .klen   = 24,
2111                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2112                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2113                 .ilen   = 16,
2114                 .result = { 0xe7, 0x8e, 0x54, 0x02, 0xc7, 0x19, 0x55, 0x68,
2115                             0xac, 0x36, 0x78, 0xf7, 0xa3, 0xf6, 0x0c, 0x66 },
2116                 .rlen   = 16,
2117         }, { /* KeySize=256, PT=0, I=1 */
2118                 .key    = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2119                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2120                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2121                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2122                 .klen   = 32,
2123                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2124                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2125                 .ilen   = 16,
2126                 .result = { 0xab, 0xed, 0x96, 0xe7, 0x66, 0xbf, 0x28, 0xcb,
2127                             0xc0, 0xeb, 0xd2, 0x1a, 0x82, 0xef, 0x08, 0x19 },
2128                 .rlen   = 16,
2129         }, { /* KeySize=256, I=257 */
2130                 .key    = { 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,
2131                             0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
2132                             0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
2133                             0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 },
2134                 .klen   = 32,
2135                 .input  = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
2136                             0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 },
2137                 .ilen   = 16,
2138                 .result = { 0x5c, 0xe7, 0x1c, 0x70, 0xd2, 0x88, 0x2e, 0x5b,
2139                             0xb8, 0x32, 0xe4, 0x33, 0xf8, 0x9f, 0x26, 0xde },
2140                 .rlen   = 16,
2141         },
2142 };
2143
2144
2145 static struct cipher_testvec serpent_dec_tv_template[] = {
2146         {
2147                 .input  = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47,
2148                             0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 },
2149                 .ilen   = 16,
2150                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2151                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2152                 .rlen   = 16,
2153         }, {
2154                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2155                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2156                 .klen   = 16,
2157                 .input  = { 0x4c, 0x7d, 0x8a, 0x32, 0x80, 0x72, 0xa2, 0x2c,
2158                             0x82, 0x3e, 0x4a, 0x1f, 0x3a, 0xcd, 0xa1, 0x6d },
2159                 .ilen   = 16,
2160                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2161                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2162                 .rlen   = 16,
2163         }, {
2164                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2165                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2166                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2167                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2168                 .klen   = 32,
2169                 .input  = { 0xde, 0x26, 0x9f, 0xf8, 0x33, 0xe4, 0x32, 0xb8,
2170                             0x5b, 0x2e, 0x88, 0xd2, 0x70, 0x1c, 0xe7, 0x5c },
2171                 .ilen   = 16,
2172                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2173                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2174                 .rlen   = 16,
2175         }, {
2176                 .key    = { [15] = 0x80 },
2177                 .klen   = 16,
2178                 .input  = { 0xdd, 0xd2, 0x6b, 0x98, 0xa5, 0xff, 0xd8, 0x2c,
2179                             0x05, 0x34, 0x5a, 0x9d, 0xad, 0xbf, 0xaf, 0x49},
2180                 .ilen   = 16,
2181                 .result = { [0 ... 15] = 0x00 },
2182                 .rlen   = 16,
2183         },
2184 };
2185
2186 static struct cipher_testvec tnepres_dec_tv_template[] = {
2187         {
2188                 .input  = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97,
2189                             0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 },
2190                 .ilen   = 16,
2191                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2192                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2193                 .rlen   = 16,
2194         }, {
2195                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2196                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2197                 .klen   = 16,
2198                 .input  = { 0xea, 0xf4, 0xd7, 0xfc, 0xd8, 0x01, 0x34, 0x47,
2199                             0x81, 0x45, 0x0b, 0xfa, 0x0c, 0xd6, 0xad, 0x6e },
2200                 .ilen   = 16,
2201                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2202                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2203                 .rlen   = 16,
2204         }, {
2205                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2206                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2207                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2208                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2209                 .klen   = 32,
2210                 .input  = { 0x64, 0xa9, 0x1a, 0x37, 0xed, 0x9f, 0xe7, 0x49,
2211                             0xa8, 0x4e, 0x76, 0xd6, 0xf5, 0x0d, 0x78, 0xee },
2212                 .ilen   = 16,
2213                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2214                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2215                 .rlen   = 16,
2216         }, { /* KeySize=128, I=121 */
2217                 .key    = { [15] = 0x80 },
2218                 .klen   = 16,
2219                 .input  = { 0x3d, 0xda, 0xbf, 0xc0, 0x06, 0xda, 0xab, 0x06,
2220                             0x46, 0x2a, 0xf4, 0xef, 0x81, 0x54, 0x4e, 0x26 },
2221                 .ilen   = 16,
2222                 .result = { [0 ... 15] = 0x00 },
2223                 .rlen   = 16,
2224         },
2225 };
2226
2227
2228 /* Cast6 test vectors from RFC 2612 */
2229 #define CAST6_ENC_TEST_VECTORS  3
2230 #define CAST6_DEC_TEST_VECTORS  3
2231
2232 static struct cipher_testvec cast6_enc_tv_template[] = {
2233         {
2234                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2235                             0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d },
2236                 .klen   = 16,
2237                 .input  = { [0 ... 15] = 0x00 },
2238                 .ilen   = 16,
2239                 .result = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20,
2240                             0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b },
2241                 .rlen   = 16,
2242         }, {
2243                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2244                             0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
2245                             0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 },
2246                 .klen   = 24,
2247                 .input  = { [0 ... 15] = 0x00 },
2248                 .ilen   = 16,
2249                 .result = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb,
2250                             0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 },
2251                 .rlen   = 16,
2252         }, {
2253                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2254                             0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
2255                             0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46,
2256                             0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 },
2257                 .klen   = 32,
2258                 .input  = { [0 ... 15] = 0x00 },
2259                 .ilen   = 16,
2260                 .result = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9,
2261                             0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa },
2262                 .rlen   = 16,
2263         },
2264 };
2265
2266 static struct cipher_testvec cast6_dec_tv_template[] = {
2267         {
2268                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2269                             0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d },
2270                 .klen   = 16,
2271                 .input  = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20,
2272                             0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b },
2273                 .ilen   = 16,
2274                 .result = { [0 ... 15] = 0x00 },
2275                 .rlen   = 16,
2276         }, {
2277                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2278                             0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
2279                             0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 },
2280                 .klen   = 24,
2281                 .input  = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb,
2282                             0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 },
2283                 .ilen   = 16,
2284                 .result = { [0 ... 15] = 0x00 },
2285                 .rlen   = 16,
2286         }, {
2287                 .key    = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
2288                             0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
2289                             0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46,
2290                             0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 },
2291                 .klen   = 32,
2292                 .input  = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9,
2293                             0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa },
2294                 .ilen   = 16,
2295                 .result = { [0 ... 15] = 0x00 },
2296                 .rlen   = 16,
2297         },
2298 };
2299
2300
2301 /*
2302  * AES test vectors.
2303  */
2304 #define AES_ENC_TEST_VECTORS 3
2305 #define AES_DEC_TEST_VECTORS 3
2306 #define AES_CBC_ENC_TEST_VECTORS 4
2307 #define AES_CBC_DEC_TEST_VECTORS 4
2308 #define AES_LRW_ENC_TEST_VECTORS 8
2309 #define AES_LRW_DEC_TEST_VECTORS 8
2310 #define AES_XTS_ENC_TEST_VECTORS 4
2311 #define AES_XTS_DEC_TEST_VECTORS 4
2312 #define AES_CTR_ENC_TEST_VECTORS 7
2313 #define AES_CTR_DEC_TEST_VECTORS 6
2314 #define AES_GCM_ENC_TEST_VECTORS 9
2315 #define AES_GCM_DEC_TEST_VECTORS 8
2316
2317 static struct cipher_testvec aes_enc_tv_template[] = {
2318         { /* From FIPS-197 */
2319                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2320                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2321                 .klen   = 16,
2322                 .input  = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2323                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2324                 .ilen   = 16,
2325                 .result = { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30,
2326                             0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a },
2327                 .rlen   = 16,
2328         }, {
2329                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2330                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2331                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 },
2332                 .klen   = 24,
2333                 .input  = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2334                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2335                 .ilen   = 16,
2336                 .result = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0,
2337                             0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 },
2338                 .rlen   = 16,
2339         }, {
2340                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2341                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2342                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2343                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2344                 .klen   = 32,
2345                 .input  = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2346                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2347                 .ilen   = 16,
2348                 .result = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf,
2349                             0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 },
2350                 .rlen   = 16,
2351         },
2352 };
2353
2354 static struct cipher_testvec aes_dec_tv_template[] = {
2355         { /* From FIPS-197 */
2356                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2357                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2358                 .klen   = 16,
2359                 .input  = { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30,
2360                             0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a },
2361                 .ilen   = 16,
2362                 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2363                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2364                 .rlen   = 16,
2365         }, {
2366                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2367                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2368                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 },
2369                 .klen   = 24,
2370                 .input  = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0,
2371                             0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 },
2372                 .ilen   = 16,
2373                 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2374                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2375                 .rlen   = 16,
2376         }, {
2377                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2378                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2379                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2380                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2381                 .klen   = 32,
2382                 .input  = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf,
2383                             0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 },
2384                 .ilen   = 16,
2385                 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
2386                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
2387                 .rlen   = 16,
2388         },
2389 };
2390
2391 static struct cipher_testvec aes_cbc_enc_tv_template[] = {
2392         { /* From RFC 3602 */
2393                 .key    = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
2394                             0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 },
2395                 .klen   = 16,
2396                 .iv     = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30,
2397                             0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 },
2398                 .input  = { "Single block msg" },
2399                 .ilen   = 16,
2400                 .result = { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8,
2401                             0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a },
2402                 .rlen   = 16,
2403         }, {
2404                 .key    = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0,
2405                             0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a },
2406                 .klen   = 16,
2407                 .iv     = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28,
2408                             0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 },
2409                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2410                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2411                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2412                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2413                 .ilen   = 32,
2414                 .result = { 0xd2, 0x96, 0xcd, 0x94, 0xc2, 0xcc, 0xcf, 0x8a,
2415                             0x3a, 0x86, 0x30, 0x28, 0xb5, 0xe1, 0xdc, 0x0a,
2416                             0x75, 0x86, 0x60, 0x2d, 0x25, 0x3c, 0xff, 0xf9,
2417                             0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 },
2418                 .rlen   = 32,
2419         }, { /* From NIST SP800-38A */
2420                 .key    = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52,
2421                             0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5,
2422                             0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b },
2423                 .klen   = 24,
2424                 .iv     = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2425                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2426                 .input  = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
2427                             0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
2428                             0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
2429                             0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
2430                             0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
2431                             0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
2432                             0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
2433                             0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
2434                 .ilen   = 64,
2435                 .result = { 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d,
2436                             0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8,
2437                             0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4,
2438                             0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a,
2439                             0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0,
2440                             0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0,
2441                             0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81,
2442                             0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd },
2443                 .rlen   = 64,
2444         }, {
2445                 .key    = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
2446                             0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
2447                             0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
2448                             0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 },
2449                 .klen   = 32,
2450                 .iv     = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2451                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2452                 .input  = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
2453                             0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
2454                             0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
2455                             0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
2456                             0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
2457                             0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
2458                             0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
2459                             0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
2460                 .ilen   = 64,
2461                 .result = { 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba,
2462                             0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6,
2463                             0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d,
2464                             0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d,
2465                             0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf,
2466                             0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61,
2467                             0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc,
2468                             0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b },
2469                 .rlen   = 64,
2470         },
2471 };
2472
2473 static struct cipher_testvec aes_cbc_dec_tv_template[] = {
2474         { /* From RFC 3602 */
2475                 .key    = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
2476                             0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 },
2477                 .klen   = 16,
2478                 .iv     = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30,
2479                             0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 },
2480                 .input  = { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8,
2481                             0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a },
2482                 .ilen   = 16,
2483                 .result = { "Single block msg" },
2484                 .rlen   = 16,
2485         }, {
2486                 .key    = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0,
2487                             0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a },
2488                 .klen   = 16,
2489                 .iv     = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28,
2490                             0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 },
2491                 .input  = { 0xd2, 0x96, 0xcd, 0x94, 0xc2, 0xcc, 0xcf, 0x8a,
2492                             0x3a, 0x86, 0x30, 0x28, 0xb5, 0xe1, 0xdc, 0x0a,
2493                             0x75, 0x86, 0x60, 0x2d, 0x25, 0x3c, 0xff, 0xf9,
2494                             0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 },
2495                 .ilen   = 32,
2496                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2497                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2498                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2499                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
2500                 .rlen   = 32,
2501         }, { /* From NIST SP800-38A */
2502                 .key    = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52,
2503                             0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5,
2504                             0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b },
2505                 .klen   = 24,
2506                 .iv     = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2507                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2508                 .input  = { 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d,
2509                             0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8,
2510                             0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4,
2511                             0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a,
2512                             0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0,
2513                             0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0,
2514                             0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81,
2515                             0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd },
2516                 .ilen   = 64,
2517                 .result = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
2518                             0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
2519                             0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
2520                             0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
2521                             0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
2522                             0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
2523                             0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
2524                             0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
2525                 .rlen   = 64,
2526         }, {
2527                 .key    = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
2528                             0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
2529                             0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
2530                             0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4 },
2531                 .klen   = 32,
2532                 .iv     = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2533                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
2534                 .input  = { 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba,
2535                             0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6,
2536                             0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d,
2537                             0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d,
2538                             0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf,
2539                             0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61,
2540                             0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc,
2541                             0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b },
2542                 .ilen   = 64,
2543                 .result = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
2544                             0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
2545                             0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
2546                             0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
2547                             0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
2548                             0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
2549                             0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
2550                             0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
2551                 .rlen   = 64,
2552         },
2553 };
2554
2555 static struct cipher_testvec aes_lrw_enc_tv_template[] = {
2556         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
2557         { /* LRW-32-AES 1 */
2558                 .key    = { 0x45, 0x62, 0xac, 0x25, 0xf8, 0x28, 0x17, 0x6d,
2559                             0x4c, 0x26, 0x84, 0x14, 0xb5, 0x68, 0x01, 0x85,
2560                             0x25, 0x8e, 0x2a, 0x05, 0xe7, 0x3e, 0x9d, 0x03,
2561                             0xee, 0x5a, 0x83, 0x0c, 0xcc, 0x09, 0x4c, 0x87 },
2562                 .klen   = 32,
2563                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2564                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2565                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2566                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2567                 .ilen   = 16,
2568                 .result = { 0xf1, 0xb2, 0x73, 0xcd, 0x65, 0xa3, 0xdf, 0x5f,
2569                             0xe9, 0x5d, 0x48, 0x92, 0x54, 0x63, 0x4e, 0xb8 },
2570                 .rlen   = 16,
2571         }, { /* LRW-32-AES 2 */
2572                 .key    = { 0x59, 0x70, 0x47, 0x14, 0xf5, 0x57, 0x47, 0x8c,
2573                             0xd7, 0x79, 0xe8, 0x0f, 0x54, 0x88, 0x79, 0x44,
2574                             0x0d, 0x48, 0xf0, 0xb7, 0xb1, 0x5a, 0x53, 0xea,
2575                             0x1c, 0xaa, 0x6b, 0x29, 0xc2, 0xca, 0xfb, 0xaf
2576                 },
2577                 .klen   = 32,
2578                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2579                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 },
2580                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2581                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2582                 .ilen   = 16,
2583                 .result = { 0x00, 0xc8, 0x2b, 0xae, 0x95, 0xbb, 0xcd, 0xe5,
2584                             0x27, 0x4f, 0x07, 0x69, 0xb2, 0x60, 0xe1, 0x36 },
2585                 .rlen   = 16,
2586         }, { /* LRW-32-AES 3 */
2587                 .key    = { 0xd8, 0x2a, 0x91, 0x34, 0xb2, 0x6a, 0x56, 0x50,
2588                             0x30, 0xfe, 0x69, 0xe2, 0x37, 0x7f, 0x98, 0x47,
2589                             0xcd, 0xf9, 0x0b, 0x16, 0x0c, 0x64, 0x8f, 0xb6,
2590                             0xb0, 0x0d, 0x0d, 0x1b, 0xae, 0x85, 0x87, 0x1f },
2591                 .klen   = 32,
2592                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2593                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2594                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2595                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2596                 .ilen   = 16,
2597                 .result = { 0x76, 0x32, 0x21, 0x83, 0xed, 0x8f, 0xf1, 0x82,
2598                             0xf9, 0x59, 0x62, 0x03, 0x69, 0x0e, 0x5e, 0x01 },
2599                 .rlen   = 16,
2600         }, { /* LRW-32-AES 4 */
2601                 .key    = { 0x0f, 0x6a, 0xef, 0xf8, 0xd3, 0xd2, 0xbb, 0x15,
2602                             0x25, 0x83, 0xf7, 0x3c, 0x1f, 0x01, 0x28, 0x74,
2603                             0xca, 0xc6, 0xbc, 0x35, 0x4d, 0x4a, 0x65, 0x54,
2604                             0x90, 0xae, 0x61, 0xcf, 0x7b, 0xae, 0xbd, 0xcc,
2605                             0xad, 0xe4, 0x94, 0xc5, 0x4a, 0x29, 0xae, 0x70 },
2606                 .klen   = 40,
2607                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2608                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2609                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2610                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2611                 .ilen   = 16,
2612                 .result = { 0x9c, 0x0f, 0x15, 0x2f, 0x55, 0xa2, 0xd8, 0xf0,
2613                             0xd6, 0x7b, 0x8f, 0x9e, 0x28, 0x22, 0xbc, 0x41 },
2614                 .rlen   = 16,
2615         }, { /* LRW-32-AES 5 */
2616                 .key    = { 0x8a, 0xd4, 0xee, 0x10, 0x2f, 0xbd, 0x81, 0xff,
2617                             0xf8, 0x86, 0xce, 0xac, 0x93, 0xc5, 0xad, 0xc6,
2618                             0xa0, 0x19, 0x07, 0xc0, 0x9d, 0xf7, 0xbb, 0xdd,
2619                             0x52, 0x13, 0xb2, 0xb7, 0xf0, 0xff, 0x11, 0xd8,
2620                             0xd6, 0x08, 0xd0, 0xcd, 0x2e, 0xb1, 0x17, 0x6f },
2621                 .klen   = 40,
2622                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2623                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2624                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2625                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2626                 .ilen   = 16,
2627                 .result = { 0xd4, 0x27, 0x6a, 0x7f, 0x14, 0x91, 0x3d, 0x65,
2628                             0xc8, 0x60, 0x48, 0x02, 0x87, 0xe3, 0x34, 0x06 },
2629                 .rlen   = 16,
2630         }, { /* LRW-32-AES 6 */
2631                 .key    = { 0xf8, 0xd4, 0x76, 0xff, 0xd6, 0x46, 0xee, 0x6c,
2632                             0x23, 0x84, 0xcb, 0x1c, 0x77, 0xd6, 0x19, 0x5d,
2633                             0xfe, 0xf1, 0xa9, 0xf3, 0x7b, 0xbc, 0x8d, 0x21,
2634                             0xa7, 0x9c, 0x21, 0xf8, 0xcb, 0x90, 0x02, 0x89,
2635                             0xa8, 0x45, 0x34, 0x8e, 0xc8, 0xc5, 0xb5, 0xf1,
2636                             0x26, 0xf5, 0x0e, 0x76, 0xfe, 0xfd, 0x1b, 0x1e },
2637                 .klen   = 48,
2638                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2639                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2640                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2641                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2642                 .ilen   = 16,
2643                 .result = { 0xbd, 0x06, 0xb8, 0xe1, 0xdb, 0x98, 0x89, 0x9e,
2644                             0xc4, 0x98, 0xe4, 0x91, 0xcf, 0x1c, 0x70, 0x2b },
2645                 .rlen   = 16,
2646         }, { /* LRW-32-AES 7 */
2647                 .key    = { 0xfb, 0x76, 0x15, 0xb2, 0x3d, 0x80, 0x89, 0x1d,
2648                             0xd4, 0x70, 0x98, 0x0b, 0xc7, 0x95, 0x84, 0xc8,
2649                             0xb2, 0xfb, 0x64, 0xce, 0x60, 0x97, 0x87, 0x8d,
2650                             0x17, 0xfc, 0xe4, 0x5a, 0x49, 0xe8, 0x30, 0xb7,
2651                             0x6e, 0x78, 0x17, 0xe7, 0x2d, 0x5e, 0x12, 0xd4,
2652                             0x60, 0x64, 0x04, 0x7a, 0xf1, 0x2f, 0x9e, 0x0c },
2653                 .klen   = 48,
2654                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2655                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2656                 .input  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2657                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2658                 .ilen   = 16,
2659                 .result = { 0x5b, 0x90, 0x8e, 0xc1, 0xab, 0xdd, 0x67, 0x5f,
2660                             0x3d, 0x69, 0x8a, 0x95, 0x53, 0xc8, 0x9c, 0xe5 },
2661                 .rlen   = 16,
2662         }, {
2663 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
2664                 .key    = { 0xf8, 0xd4, 0x76, 0xff, 0xd6, 0x46, 0xee, 0x6c,
2665                             0x23, 0x84, 0xcb, 0x1c, 0x77, 0xd6, 0x19, 0x5d,
2666                             0xfe, 0xf1, 0xa9, 0xf3, 0x7b, 0xbc, 0x8d, 0x21,
2667                             0xa7, 0x9c, 0x21, 0xf8, 0xcb, 0x90, 0x02, 0x89,
2668                             0xa8, 0x45, 0x34, 0x8e, 0xc8, 0xc5, 0xb5, 0xf1,
2669                             0x26, 0xf5, 0x0e, 0x76, 0xfe, 0xfd, 0x1b, 0x1e },
2670                 .klen   = 48,
2671                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2672                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2673                 .input  = { 0x05, 0x11, 0xb7, 0x18, 0xab, 0xc6, 0x2d, 0xac,
2674                             0x70, 0x5d, 0xf6, 0x22, 0x94, 0xcd, 0xe5, 0x6c,
2675                             0x17, 0x6b, 0xf6, 0x1c, 0xf0, 0xf3, 0x6e, 0xf8,
2676                             0x50, 0x38, 0x1f, 0x71, 0x49, 0xb6, 0x57, 0xd6,
2677                             0x8f, 0xcb, 0x8d, 0x6b, 0xe3, 0xa6, 0x29, 0x90,
2678                             0xfe, 0x2a, 0x62, 0x82, 0xae, 0x6d, 0x8b, 0xf6,
2679                             0xad, 0x1e, 0x9e, 0x20, 0x5f, 0x38, 0xbe, 0x04,
2680                             0xda, 0x10, 0x8e, 0xed, 0xa2, 0xa4, 0x87, 0xab,
2681                             0xda, 0x6b, 0xb4, 0x0c, 0x75, 0xba, 0xd3, 0x7c,
2682                             0xc9, 0xac, 0x42, 0x31, 0x95, 0x7c, 0xc9, 0x04,
2683                             0xeb, 0xd5, 0x6e, 0x32, 0x69, 0x8a, 0xdb, 0xa6,
2684                             0x15, 0xd7, 0x3f, 0x4f, 0x2f, 0x66, 0x69, 0x03,
2685                             0x9c, 0x1f, 0x54, 0x0f, 0xde, 0x1f, 0xf3, 0x65,
2686                             0x4c, 0x96, 0x12, 0xed, 0x7c, 0x92, 0x03, 0x01,
2687                             0x6f, 0xbc, 0x35, 0x93, 0xac, 0xf1, 0x27, 0xf1,
2688                             0xb4, 0x96, 0x82, 0x5a, 0x5f, 0xb0, 0xa0, 0x50,
2689                             0x89, 0xa4, 0x8e, 0x66, 0x44, 0x85, 0xcc, 0xfd,
2690                             0x33, 0x14, 0x70, 0xe3, 0x96, 0xb2, 0xc3, 0xd3,
2691                             0xbb, 0x54, 0x5a, 0x1a, 0xf9, 0x74, 0xa2, 0xc5,
2692                             0x2d, 0x64, 0x75, 0xdd, 0xb4, 0x54, 0xe6, 0x74,
2693                             0x8c, 0xd3, 0x9d, 0x9e, 0x86, 0xab, 0x51, 0x53,
2694                             0xb7, 0x93, 0x3e, 0x6f, 0xd0, 0x4e, 0x2c, 0x40,
2695                             0xf6, 0xa8, 0x2e, 0x3e, 0x9d, 0xf4, 0x66, 0xa5,
2696                             0x76, 0x12, 0x73, 0x44, 0x1a, 0x56, 0xd7, 0x72,
2697                             0x88, 0xcd, 0x21, 0x8c, 0x4c, 0x0f, 0xfe, 0xda,
2698                             0x95, 0xe0, 0x3a, 0xa6, 0xa5, 0x84, 0x46, 0xcd,
2699                             0xd5, 0x3e, 0x9d, 0x3a, 0xe2, 0x67, 0xe6, 0x60,
2700                             0x1a, 0xe2, 0x70, 0x85, 0x58, 0xc2, 0x1b, 0x09,
2701                             0xe1, 0xd7, 0x2c, 0xca, 0xad, 0xa8, 0x8f, 0xf9,
2702                             0xac, 0xb3, 0x0e, 0xdb, 0xca, 0x2e, 0xe2, 0xb8,
2703                             0x51, 0x71, 0xd9, 0x3c, 0x6c, 0xf1, 0x56, 0xf8,
2704                             0xea, 0x9c, 0xf1, 0xfb, 0x0c, 0xe6, 0xb7, 0x10,
2705                             0x1c, 0xf8, 0xa9, 0x7c, 0xe8, 0x53, 0x35, 0xc1,
2706                             0x90, 0x3e, 0x76, 0x4a, 0x74, 0xa4, 0x21, 0x2c,
2707                             0xf6, 0x2c, 0x4e, 0x0f, 0x94, 0x3a, 0x88, 0x2e,
2708                             0x41, 0x09, 0x6a, 0x33, 0x7d, 0xf6, 0xdd, 0x3f,
2709                             0x8d, 0x23, 0x31, 0x74, 0x84, 0xeb, 0x88, 0x6e,
2710                             0xcc, 0xb9, 0xbc, 0x22, 0x83, 0x19, 0x07, 0x22,
2711                             0xa5, 0x2d, 0xdf, 0xa5, 0xf3, 0x80, 0x85, 0x78,
2712                             0x84, 0x39, 0x6a, 0x6d, 0x6a, 0x99, 0x4f, 0xa5,
2713                             0x15, 0xfe, 0x46, 0xb0, 0xe4, 0x6c, 0xa5, 0x41,
2714                             0x3c, 0xce, 0x8f, 0x42, 0x60, 0x71, 0xa7, 0x75,
2715                             0x08, 0x40, 0x65, 0x8a, 0x82, 0xbf, 0xf5, 0x43,
2716                             0x71, 0x96, 0xa9, 0x4d, 0x44, 0x8a, 0x20, 0xbe,
2717                             0xfa, 0x4d, 0xbb, 0xc0, 0x7d, 0x31, 0x96, 0x65,
2718                             0xe7, 0x75, 0xe5, 0x3e, 0xfd, 0x92, 0x3b, 0xc9,
2719                             0x55, 0xbb, 0x16, 0x7e, 0xf7, 0xc2, 0x8c, 0xa4,
2720                             0x40, 0x1d, 0xe5, 0xef, 0x0e, 0xdf, 0xe4, 0x9a,
2721                             0x62, 0x73, 0x65, 0xfd, 0x46, 0x63, 0x25, 0x3d,
2722                             0x2b, 0xaf, 0xe5, 0x64, 0xfe, 0xa5, 0x5c, 0xcf,
2723                             0x24, 0xf3, 0xb4, 0xac, 0x64, 0xba, 0xdf, 0x4b,
2724                             0xc6, 0x96, 0x7d, 0x81, 0x2d, 0x8d, 0x97, 0xf7,
2725                             0xc5, 0x68, 0x77, 0x84, 0x32, 0x2b, 0xcc, 0x85,
2726                             0x74, 0x96, 0xf0, 0x12, 0x77, 0x61, 0xb9, 0xeb,
2727                             0x71, 0xaa, 0x82, 0xcb, 0x1c, 0xdb, 0x89, 0xc8,
2728                             0xc6, 0xb5, 0xe3, 0x5c, 0x7d, 0x39, 0x07, 0x24,
2729                             0xda, 0x39, 0x87, 0x45, 0xc0, 0x2b, 0xbb, 0x01,
2730                             0xac, 0xbc, 0x2a, 0x5c, 0x7f, 0xfc, 0xe8, 0xce,
2731                             0x6d, 0x9c, 0x6f, 0xed, 0xd3, 0xc1, 0xa1, 0xd6,
2732                             0xc5, 0x55, 0xa9, 0x66, 0x2f, 0xe1, 0xc8, 0x32,
2733                             0xa6, 0x5d, 0xa4, 0x3a, 0x98, 0x73, 0xe8, 0x45,
2734                             0xa4, 0xc7, 0xa8, 0xb4, 0xf6, 0x13, 0x03, 0xf6,
2735                             0xe9, 0x2e, 0xc4, 0x29, 0x0f, 0x84, 0xdb, 0xc4,
2736                             0x21, 0xc4, 0xc2, 0x75, 0x67, 0x89, 0x37, 0x0a },
2737                 .ilen   = 512,
2738                 .result = { 0x1a, 0x1d, 0xa9, 0x30, 0xad, 0xf9, 0x2f, 0x9b,
2739                             0xb6, 0x1d, 0xae, 0xef, 0xf0, 0x2f, 0xf8, 0x5a,
2740                             0x39, 0x3c, 0xbf, 0x2a, 0xb2, 0x45, 0xb2, 0x23,
2741                             0x1b, 0x63, 0x3c, 0xcf, 0xaa, 0xbe, 0xcf, 0x4e,
2742                             0xfa, 0xe8, 0x29, 0xc2, 0x20, 0x68, 0x2b, 0x3c,
2743                             0x2e, 0x8b, 0xf7, 0x6e, 0x25, 0xbd, 0xe3, 0x3d,
2744                             0x66, 0x27, 0xd6, 0xaf, 0xd6, 0x64, 0x3e, 0xe3,
2745                             0xe8, 0x58, 0x46, 0x97, 0x39, 0x51, 0x07, 0xde,
2746                             0xcb, 0x37, 0xbc, 0xa9, 0xc0, 0x5f, 0x75, 0xc3,
2747                             0x0e, 0x84, 0x23, 0x1d, 0x16, 0xd4, 0x1c, 0x59,
2748                             0x9c, 0x1a, 0x02, 0x55, 0xab, 0x3a, 0x97, 0x1d,
2749                             0xdf, 0xdd, 0xc7, 0x06, 0x51, 0xd7, 0x70, 0xae,
2750                             0x23, 0xc6, 0x8c, 0xf5, 0x1e, 0xa0, 0xe5, 0x82,
2751                             0xb8, 0xb2, 0xbf, 0x04, 0xa0, 0x32, 0x8e, 0x68,
2752                             0xeb, 0xaf, 0x6e, 0x2d, 0x94, 0x22, 0x2f, 0xce,
2753                             0x4c, 0xb5, 0x59, 0xe2, 0xa2, 0x2f, 0xa0, 0x98,
2754                             0x1a, 0x97, 0xc6, 0xd4, 0xb5, 0x00, 0x59, 0xf2,
2755                             0x84, 0x14, 0x72, 0xb1, 0x9a, 0x6e, 0xa3, 0x7f,
2756                             0xea, 0x20, 0xe7, 0xcb, 0x65, 0x77, 0x3a, 0xdf,
2757                             0xc8, 0x97, 0x67, 0x15, 0xc2, 0x2a, 0x27, 0xcc,
2758                             0x18, 0x55, 0xa1, 0x24, 0x0b, 0x24, 0x24, 0xaf,
2759                             0x5b, 0xec, 0x68, 0xb8, 0xc8, 0xf5, 0xba, 0x63,
2760                             0xff, 0xed, 0x89, 0xce, 0xd5, 0x3d, 0x88, 0xf3,
2761                             0x25, 0xef, 0x05, 0x7c, 0x3a, 0xef, 0xeb, 0xd8,
2762                             0x7a, 0x32, 0x0d, 0xd1, 0x1e, 0x58, 0x59, 0x99,
2763                             0x90, 0x25, 0xb5, 0x26, 0xb0, 0xe3, 0x2b, 0x6c,
2764                             0x4c, 0xa9, 0x8b, 0x84, 0x4f, 0x5e, 0x01, 0x50,
2765                             0x41, 0x30, 0x58, 0xc5, 0x62, 0x74, 0x52, 0x1d,
2766                             0x45, 0x24, 0x6a, 0x42, 0x64, 0x4f, 0x97, 0x1c,
2767                             0xa8, 0x66, 0xb5, 0x6d, 0x79, 0xd4, 0x0d, 0x48,
2768                             0xc5, 0x5f, 0xf3, 0x90, 0x32, 0xdd, 0xdd, 0xe1,
2769                             0xe4, 0xa9, 0x9f, 0xfc, 0xc3, 0x52, 0x5a, 0x46,
2770                             0xe4, 0x81, 0x84, 0x95, 0x36, 0x59, 0x7a, 0x6b,
2771                             0xaa, 0xb3, 0x60, 0xad, 0xce, 0x9f, 0x9f, 0x28,
2772                             0xe0, 0x01, 0x75, 0x22, 0xc4, 0x4e, 0xa9, 0x62,
2773                             0x5c, 0x62, 0x0d, 0x00, 0xcb, 0x13, 0xe8, 0x43,
2774                             0x72, 0xd4, 0x2d, 0x53, 0x46, 0xb5, 0xd1, 0x16,
2775                             0x22, 0x18, 0xdf, 0x34, 0x33, 0xf5, 0xd6, 0x1c,
2776                             0xb8, 0x79, 0x78, 0x97, 0x94, 0xff, 0x72, 0x13,
2777                             0x4c, 0x27, 0xfc, 0xcb, 0xbf, 0x01, 0x53, 0xa6,
2778                             0xb4, 0x50, 0x6e, 0xde, 0xdf, 0xb5, 0x43, 0xa4,
2779                             0x59, 0xdf, 0x52, 0xf9, 0x7c, 0xe0, 0x11, 0x6f,
2780                             0x2d, 0x14, 0x8e, 0x24, 0x61, 0x2c, 0xe1, 0x17,
2781                             0xcc, 0xce, 0x51, 0x0c, 0x19, 0x8a, 0x82, 0x30,
2782                             0x94, 0xd5, 0x3d, 0x6a, 0x53, 0x06, 0x5e, 0xbd,
2783                             0xb7, 0xeb, 0xfa, 0xfd, 0x27, 0x51, 0xde, 0x85,
2784                             0x1e, 0x86, 0x53, 0x11, 0x53, 0x94, 0x00, 0xee,
2785                             0x2b, 0x8c, 0x08, 0x2a, 0xbf, 0xdd, 0xae, 0x11,
2786                             0xcb, 0x1e, 0xa2, 0x07, 0x9a, 0x80, 0xcf, 0x62,
2787                             0x9b, 0x09, 0xdc, 0x95, 0x3c, 0x96, 0x8e, 0xb1,
2788                             0x09, 0xbd, 0xe4, 0xeb, 0xdb, 0xca, 0x70, 0x7a,
2789                             0x9e, 0xfa, 0x31, 0x18, 0x45, 0x3c, 0x21, 0x33,
2790                             0xb0, 0xb3, 0x2b, 0xea, 0xf3, 0x71, 0x2d, 0xe1,
2791                             0x03, 0xad, 0x1b, 0x48, 0xd4, 0x67, 0x27, 0xf0,
2792                             0x62, 0xe4, 0x3d, 0xfb, 0x9b, 0x08, 0x76, 0xe7,
2793                             0xdd, 0x2b, 0x01, 0x39, 0x04, 0x5a, 0x58, 0x7a,
2794                             0xf7, 0x11, 0x90, 0xec, 0xbd, 0x51, 0x5c, 0x32,
2795                             0x6b, 0xd7, 0x35, 0x39, 0x02, 0x6b, 0xf2, 0xa6,
2796                             0xd0, 0x0d, 0x07, 0xe1, 0x06, 0xc4, 0x5b, 0x7d,
2797                             0xe4, 0x6a, 0xd7, 0xee, 0x15, 0x1f, 0x83, 0xb4,
2798                             0xa3, 0xa7, 0x5e, 0xc3, 0x90, 0xb7, 0xef, 0xd3,
2799                             0xb7, 0x4f, 0xf8, 0x92, 0x4c, 0xb7, 0x3c, 0x29,
2800                             0xcd, 0x7e, 0x2b, 0x5d, 0x43, 0xea, 0x42, 0xe7,
2801                             0x74, 0x3f, 0x7d, 0x58, 0x88, 0x75, 0xde, 0x3e },
2802                 .rlen   = 512,
2803         }
2804 };
2805
2806 static struct cipher_testvec aes_lrw_dec_tv_template[] = {
2807         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
2808         /* same as enc vectors with input and result reversed */
2809         { /* LRW-32-AES 1 */
2810                 .key    = { 0x45, 0x62, 0xac, 0x25, 0xf8, 0x28, 0x17, 0x6d,
2811                             0x4c, 0x26, 0x84, 0x14, 0xb5, 0x68, 0x01, 0x85,
2812                             0x25, 0x8e, 0x2a, 0x05, 0xe7, 0x3e, 0x9d, 0x03,
2813                             0xee, 0x5a, 0x83, 0x0c, 0xcc, 0x09, 0x4c, 0x87 },
2814                 .klen   = 32,
2815                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2816                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2817                 .input  = { 0xf1, 0xb2, 0x73, 0xcd, 0x65, 0xa3, 0xdf, 0x5f,
2818                             0xe9, 0x5d, 0x48, 0x92, 0x54, 0x63, 0x4e, 0xb8 },
2819                 .ilen   = 16,
2820                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2821                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2822                 .rlen   = 16,
2823         }, { /* LRW-32-AES 2 */
2824                 .key    = { 0x59, 0x70, 0x47, 0x14, 0xf5, 0x57, 0x47, 0x8c,
2825                             0xd7, 0x79, 0xe8, 0x0f, 0x54, 0x88, 0x79, 0x44,
2826                             0x0d, 0x48, 0xf0, 0xb7, 0xb1, 0x5a, 0x53, 0xea,
2827                             0x1c, 0xaa, 0x6b, 0x29, 0xc2, 0xca, 0xfb, 0xaf
2828                 },
2829                 .klen   = 32,
2830                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2831                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 },
2832                 .input  = { 0x00, 0xc8, 0x2b, 0xae, 0x95, 0xbb, 0xcd, 0xe5,
2833                             0x27, 0x4f, 0x07, 0x69, 0xb2, 0x60, 0xe1, 0x36 },
2834                 .ilen   = 16,
2835                 .result  = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2836                              0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2837                 .rlen   = 16,
2838         }, { /* LRW-32-AES 3 */
2839                 .key    = { 0xd8, 0x2a, 0x91, 0x34, 0xb2, 0x6a, 0x56, 0x50,
2840                             0x30, 0xfe, 0x69, 0xe2, 0x37, 0x7f, 0x98, 0x47,
2841                             0xcd, 0xf9, 0x0b, 0x16, 0x0c, 0x64, 0x8f, 0xb6,
2842                             0xb0, 0x0d, 0x0d, 0x1b, 0xae, 0x85, 0x87, 0x1f },
2843                 .klen   = 32,
2844                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2845                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2846                 .input  = { 0x76, 0x32, 0x21, 0x83, 0xed, 0x8f, 0xf1, 0x82,
2847                             0xf9, 0x59, 0x62, 0x03, 0x69, 0x0e, 0x5e, 0x01 },
2848                 .ilen   = 16,
2849                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2850                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2851                 .rlen   = 16,
2852         }, { /* LRW-32-AES 4 */
2853                 .key    = { 0x0f, 0x6a, 0xef, 0xf8, 0xd3, 0xd2, 0xbb, 0x15,
2854                             0x25, 0x83, 0xf7, 0x3c, 0x1f, 0x01, 0x28, 0x74,
2855                             0xca, 0xc6, 0xbc, 0x35, 0x4d, 0x4a, 0x65, 0x54,
2856                             0x90, 0xae, 0x61, 0xcf, 0x7b, 0xae, 0xbd, 0xcc,
2857                             0xad, 0xe4, 0x94, 0xc5, 0x4a, 0x29, 0xae, 0x70 },
2858                 .klen   = 40,
2859                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2860                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2861                 .input  = { 0x9c, 0x0f, 0x15, 0x2f, 0x55, 0xa2, 0xd8, 0xf0,
2862                             0xd6, 0x7b, 0x8f, 0x9e, 0x28, 0x22, 0xbc, 0x41 },
2863                 .ilen   = 16,
2864                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2865                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2866                 .rlen   = 16,
2867         }, { /* LRW-32-AES 5 */
2868                 .key    = { 0x8a, 0xd4, 0xee, 0x10, 0x2f, 0xbd, 0x81, 0xff,
2869                             0xf8, 0x86, 0xce, 0xac, 0x93, 0xc5, 0xad, 0xc6,
2870                             0xa0, 0x19, 0x07, 0xc0, 0x9d, 0xf7, 0xbb, 0xdd,
2871                             0x52, 0x13, 0xb2, 0xb7, 0xf0, 0xff, 0x11, 0xd8,
2872                             0xd6, 0x08, 0xd0, 0xcd, 0x2e, 0xb1, 0x17, 0x6f },
2873                 .klen   = 40,
2874                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2875                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2876                 .input  = { 0xd4, 0x27, 0x6a, 0x7f, 0x14, 0x91, 0x3d, 0x65,
2877                             0xc8, 0x60, 0x48, 0x02, 0x87, 0xe3, 0x34, 0x06 },
2878                 .ilen   = 16,
2879                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2880                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2881                 .rlen   = 16,
2882         }, { /* LRW-32-AES 6 */
2883                 .key    = { 0xf8, 0xd4, 0x76, 0xff, 0xd6, 0x46, 0xee, 0x6c,
2884                             0x23, 0x84, 0xcb, 0x1c, 0x77, 0xd6, 0x19, 0x5d,
2885                             0xfe, 0xf1, 0xa9, 0xf3, 0x7b, 0xbc, 0x8d, 0x21,
2886                             0xa7, 0x9c, 0x21, 0xf8, 0xcb, 0x90, 0x02, 0x89,
2887                             0xa8, 0x45, 0x34, 0x8e, 0xc8, 0xc5, 0xb5, 0xf1,
2888                             0x26, 0xf5, 0x0e, 0x76, 0xfe, 0xfd, 0x1b, 0x1e },
2889                 .klen   = 48,
2890                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2891                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2892                 .input  = { 0xbd, 0x06, 0xb8, 0xe1, 0xdb, 0x98, 0x89, 0x9e,
2893                             0xc4, 0x98, 0xe4, 0x91, 0xcf, 0x1c, 0x70, 0x2b },
2894                 .ilen   = 16,
2895                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2896                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2897                 .rlen   = 16,
2898         }, { /* LRW-32-AES 7 */
2899                 .key    = { 0xfb, 0x76, 0x15, 0xb2, 0x3d, 0x80, 0x89, 0x1d,
2900                             0xd4, 0x70, 0x98, 0x0b, 0xc7, 0x95, 0x84, 0xc8,
2901                             0xb2, 0xfb, 0x64, 0xce, 0x60, 0x97, 0x87, 0x8d,
2902                             0x17, 0xfc, 0xe4, 0x5a, 0x49, 0xe8, 0x30, 0xb7,
2903                             0x6e, 0x78, 0x17, 0xe7, 0x2d, 0x5e, 0x12, 0xd4,
2904                             0x60, 0x64, 0x04, 0x7a, 0xf1, 0x2f, 0x9e, 0x0c },
2905                 .klen   = 48,
2906                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2907                             0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 },
2908                 .input  = { 0x5b, 0x90, 0x8e, 0xc1, 0xab, 0xdd, 0x67, 0x5f,
2909                             0x3d, 0x69, 0x8a, 0x95, 0x53, 0xc8, 0x9c, 0xe5 },
2910                 .ilen   = 16,
2911                 .result = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2912                             0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 },
2913                 .rlen   = 16,
2914         }, {
2915 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
2916                 .key    = { 0xf8, 0xd4, 0x76, 0xff, 0xd6, 0x46, 0xee, 0x6c,
2917                             0x23, 0x84, 0xcb, 0x1c, 0x77, 0xd6, 0x19, 0x5d,
2918                             0xfe, 0xf1, 0xa9, 0xf3, 0x7b, 0xbc, 0x8d, 0x21,
2919                             0xa7, 0x9c, 0x21, 0xf8, 0xcb, 0x90, 0x02, 0x89,
2920                             0xa8, 0x45, 0x34, 0x8e, 0xc8, 0xc5, 0xb5, 0xf1,
2921                             0x26, 0xf5, 0x0e, 0x76, 0xfe, 0xfd, 0x1b, 0x1e },
2922                 .klen   = 48,
2923                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2924                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
2925                 .input  = { 0x1a, 0x1d, 0xa9, 0x30, 0xad, 0xf9, 0x2f, 0x9b,
2926                             0xb6, 0x1d, 0xae, 0xef, 0xf0, 0x2f, 0xf8, 0x5a,
2927                             0x39, 0x3c, 0xbf, 0x2a, 0xb2, 0x45, 0xb2, 0x23,
2928                             0x1b, 0x63, 0x3c, 0xcf, 0xaa, 0xbe, 0xcf, 0x4e,
2929                             0xfa, 0xe8, 0x29, 0xc2, 0x20, 0x68, 0x2b, 0x3c,
2930                             0x2e, 0x8b, 0xf7, 0x6e, 0x25, 0xbd, 0xe3, 0x3d,
2931                             0x66, 0x27, 0xd6, 0xaf, 0xd6, 0x64, 0x3e, 0xe3,
2932                             0xe8, 0x58, 0x46, 0x97, 0x39, 0x51, 0x07, 0xde,
2933                             0xcb, 0x37, 0xbc, 0xa9, 0xc0, 0x5f, 0x75, 0xc3,
2934                             0x0e, 0x84, 0x23, 0x1d, 0x16, 0xd4, 0x1c, 0x59,
2935                             0x9c, 0x1a, 0x02, 0x55, 0xab, 0x3a, 0x97, 0x1d,
2936                             0xdf, 0xdd, 0xc7, 0x06, 0x51, 0xd7, 0x70, 0xae,
2937                             0x23, 0xc6, 0x8c, 0xf5, 0x1e, 0xa0, 0xe5, 0x82,
2938                             0xb8, 0xb2, 0xbf, 0x04, 0xa0, 0x32, 0x8e, 0x68,
2939                             0xeb, 0xaf, 0x6e, 0x2d, 0x94, 0x22, 0x2f, 0xce,
2940                             0x4c, 0xb5, 0x59, 0xe2, 0xa2, 0x2f, 0xa0, 0x98,
2941                             0x1a, 0x97, 0xc6, 0xd4, 0xb5, 0x00, 0x59, 0xf2,
2942                             0x84, 0x14, 0x72, 0xb1, 0x9a, 0x6e, 0xa3, 0x7f,
2943                             0xea, 0x20, 0xe7, 0xcb, 0x65, 0x77, 0x3a, 0xdf,
2944                             0xc8, 0x97, 0x67, 0x15, 0xc2, 0x2a, 0x27, 0xcc,
2945                             0x18, 0x55, 0xa1, 0x24, 0x0b, 0x24, 0x24, 0xaf,
2946                             0x5b, 0xec, 0x68, 0xb8, 0xc8, 0xf5, 0xba, 0x63,
2947                             0xff, 0xed, 0x89, 0xce, 0xd5, 0x3d, 0x88, 0xf3,
2948                             0x25, 0xef, 0x05, 0x7c, 0x3a, 0xef, 0xeb, 0xd8,
2949                             0x7a, 0x32, 0x0d, 0xd1, 0x1e, 0x58, 0x59, 0x99,
2950                             0x90, 0x25, 0xb5, 0x26, 0xb0, 0xe3, 0x2b, 0x6c,
2951                             0x4c, 0xa9, 0x8b, 0x84, 0x4f, 0x5e, 0x01, 0x50,
2952                             0x41, 0x30, 0x58, 0xc5, 0x62, 0x74, 0x52, 0x1d,
2953                             0x45, 0x24, 0x6a, 0x42, 0x64, 0x4f, 0x97, 0x1c,
2954                             0xa8, 0x66, 0xb5, 0x6d, 0x79, 0xd4, 0x0d, 0x48,
2955                             0xc5, 0x5f, 0xf3, 0x90, 0x32, 0xdd, 0xdd, 0xe1,
2956                             0xe4, 0xa9, 0x9f, 0xfc, 0xc3, 0x52, 0x5a, 0x46,
2957                             0xe4, 0x81, 0x84, 0x95, 0x36, 0x59, 0x7a, 0x6b,
2958                             0xaa, 0xb3, 0x60, 0xad, 0xce, 0x9f, 0x9f, 0x28,
2959                             0xe0, 0x01, 0x75, 0x22, 0xc4, 0x4e, 0xa9, 0x62,
2960                             0x5c, 0x62, 0x0d, 0x00, 0xcb, 0x13, 0xe8, 0x43,
2961                             0x72, 0xd4, 0x2d, 0x53, 0x46, 0xb5, 0xd1, 0x16,
2962                             0x22, 0x18, 0xdf, 0x34, 0x33, 0xf5, 0xd6, 0x1c,
2963                             0xb8, 0x79, 0x78, 0x97, 0x94, 0xff, 0x72, 0x13,
2964                             0x4c, 0x27, 0xfc, 0xcb, 0xbf, 0x01, 0x53, 0xa6,
2965                             0xb4, 0x50, 0x6e, 0xde, 0xdf, 0xb5, 0x43, 0xa4,
2966                             0x59, 0xdf, 0x52, 0xf9, 0x7c, 0xe0, 0x11, 0x6f,
2967                             0x2d, 0x14, 0x8e, 0x24, 0x61, 0x2c, 0xe1, 0x17,
2968                             0xcc, 0xce, 0x51, 0x0c, 0x19, 0x8a, 0x82, 0x30,
2969                             0x94, 0xd5, 0x3d, 0x6a, 0x53, 0x06, 0x5e, 0xbd,
2970                             0xb7, 0xeb, 0xfa, 0xfd, 0x27, 0x51, 0xde, 0x85,
2971                             0x1e, 0x86, 0x53, 0x11, 0x53, 0x94, 0x00, 0xee,
2972                             0x2b, 0x8c, 0x08, 0x2a, 0xbf, 0xdd, 0xae, 0x11,
2973                             0xcb, 0x1e, 0xa2, 0x07, 0x9a, 0x80, 0xcf, 0x62,
2974                             0x9b, 0x09, 0xdc, 0x95, 0x3c, 0x96, 0x8e, 0xb1,
2975                             0x09, 0xbd, 0xe4, 0xeb, 0xdb, 0xca, 0x70, 0x7a,
2976                             0x9e, 0xfa, 0x31, 0x18, 0x45, 0x3c, 0x21, 0x33,
2977                             0xb0, 0xb3, 0x2b, 0xea, 0xf3, 0x71, 0x2d, 0xe1,
2978                             0x03, 0xad, 0x1b, 0x48, 0xd4, 0x67, 0x27, 0xf0,
2979                             0x62, 0xe4, 0x3d, 0xfb, 0x9b, 0x08, 0x76, 0xe7,
2980                             0xdd, 0x2b, 0x01, 0x39, 0x04, 0x5a, 0x58, 0x7a,
2981                             0xf7, 0x11, 0x90, 0xec, 0xbd, 0x51, 0x5c, 0x32,
2982                             0x6b, 0xd7, 0x35, 0x39, 0x02, 0x6b, 0xf2, 0xa6,
2983                             0xd0, 0x0d, 0x07, 0xe1, 0x06, 0xc4, 0x5b, 0x7d,
2984                             0xe4, 0x6a, 0xd7, 0xee, 0x15, 0x1f, 0x83, 0xb4,
2985                             0xa3, 0xa7, 0x5e, 0xc3, 0x90, 0xb7, 0xef, 0xd3,
2986                             0xb7, 0x4f, 0xf8, 0x92, 0x4c, 0xb7, 0x3c, 0x29,
2987                             0xcd, 0x7e, 0x2b, 0x5d, 0x43, 0xea, 0x42, 0xe7,
2988                             0x74, 0x3f, 0x7d, 0x58, 0x88, 0x75, 0xde, 0x3e },
2989                 .ilen   = 512,
2990                 .result = { 0x05, 0x11, 0xb7, 0x18, 0xab, 0xc6, 0x2d, 0xac,
2991                             0x70, 0x5d, 0xf6, 0x22, 0x94, 0xcd, 0xe5, 0x6c,
2992                             0x17, 0x6b, 0xf6, 0x1c, 0xf0, 0xf3, 0x6e, 0xf8,
2993                             0x50, 0x38, 0x1f, 0x71, 0x49, 0xb6, 0x57, 0xd6,
2994                             0x8f, 0xcb, 0x8d, 0x6b, 0xe3, 0xa6, 0x29, 0x90,
2995                             0xfe, 0x2a, 0x62, 0x82, 0xae, 0x6d, 0x8b, 0xf6,
2996                             0xad, 0x1e, 0x9e, 0x20, 0x5f, 0x38, 0xbe, 0x04,
2997                             0xda, 0x10, 0x8e, 0xed, 0xa2, 0xa4, 0x87, 0xab,
2998                             0xda, 0x6b, 0xb4, 0x0c, 0x75, 0xba, 0xd3, 0x7c,
2999                             0xc9, 0xac, 0x42, 0x31, 0x95, 0x7c, 0xc9, 0x04,
3000                             0xeb, 0xd5, 0x6e, 0x32, 0x69, 0x8a, 0xdb, 0xa6,
3001                             0x15, 0xd7, 0x3f, 0x4f, 0x2f, 0x66, 0x69, 0x03,
3002                             0x9c, 0x1f, 0x54, 0x0f, 0xde, 0x1f, 0xf3, 0x65,
3003                             0x4c, 0x96, 0x12, 0xed, 0x7c, 0x92, 0x03, 0x01,
3004                             0x6f, 0xbc, 0x35, 0x93, 0xac, 0xf1, 0x27, 0xf1,
3005                             0xb4, 0x96, 0x82, 0x5a, 0x5f, 0xb0, 0xa0, 0x50,
3006                             0x89, 0xa4, 0x8e, 0x66, 0x44, 0x85, 0xcc, 0xfd,
3007                             0x33, 0x14, 0x70, 0xe3, 0x96, 0xb2, 0xc3, 0xd3,
3008                             0xbb, 0x54, 0x5a, 0x1a, 0xf9, 0x74, 0xa2, 0xc5,
3009                             0x2d, 0x64, 0x75, 0xdd, 0xb4, 0x54, 0xe6, 0x74,
3010                             0x8c, 0xd3, 0x9d, 0x9e, 0x86, 0xab, 0x51, 0x53,
3011                             0xb7, 0x93, 0x3e, 0x6f, 0xd0, 0x4e, 0x2c, 0x40,
3012                             0xf6, 0xa8, 0x2e, 0x3e, 0x9d, 0xf4, 0x66, 0xa5,
3013                             0x76, 0x12, 0x73, 0x44, 0x1a, 0x56, 0xd7, 0x72,
3014                             0x88, 0xcd, 0x21, 0x8c, 0x4c, 0x0f, 0xfe, 0xda,
3015                             0x95, 0xe0, 0x3a, 0xa6, 0xa5, 0x84, 0x46, 0xcd,
3016                             0xd5, 0x3e, 0x9d, 0x3a, 0xe2, 0x67, 0xe6, 0x60,
3017                             0x1a, 0xe2, 0x70, 0x85, 0x58, 0xc2, 0x1b, 0x09,
3018                             0xe1, 0xd7, 0x2c, 0xca, 0xad, 0xa8, 0x8f, 0xf9,
3019                             0xac, 0xb3, 0x0e, 0xdb, 0xca, 0x2e, 0xe2, 0xb8,
3020                             0x51, 0x71, 0xd9, 0x3c, 0x6c, 0xf1, 0x56, 0xf8,
3021                             0xea, 0x9c, 0xf1, 0xfb, 0x0c, 0xe6, 0xb7, 0x10,
3022                             0x1c, 0xf8, 0xa9, 0x7c, 0xe8, 0x53, 0x35, 0xc1,
3023                             0x90, 0x3e, 0x76, 0x4a, 0x74, 0xa4, 0x21, 0x2c,
3024                             0xf6, 0x2c, 0x4e, 0x0f, 0x94, 0x3a, 0x88, 0x2e,
3025                             0x41, 0x09, 0x6a, 0x33, 0x7d, 0xf6, 0xdd, 0x3f,
3026                             0x8d, 0x23, 0x31, 0x74, 0x84, 0xeb, 0x88, 0x6e,
3027                             0xcc, 0xb9, 0xbc, 0x22, 0x83, 0x19, 0x07, 0x22,
3028                             0xa5, 0x2d, 0xdf, 0xa5, 0xf3, 0x80, 0x85, 0x78,
3029                             0x84, 0x39, 0x6a, 0x6d, 0x6a, 0x99, 0x4f, 0xa5,
3030                             0x15, 0xfe, 0x46, 0xb0, 0xe4, 0x6c, 0xa5, 0x41,
3031                             0x3c, 0xce, 0x8f, 0x42, 0x60, 0x71, 0xa7, 0x75,
3032                             0x08, 0x40, 0x65, 0x8a, 0x82, 0xbf, 0xf5, 0x43,
3033                             0x71, 0x96, 0xa9, 0x4d, 0x44, 0x8a, 0x20, 0xbe,
3034                             0xfa, 0x4d, 0xbb, 0xc0, 0x7d, 0x31, 0x96, 0x65,
3035                             0xe7, 0x75, 0xe5, 0x3e, 0xfd, 0x92, 0x3b, 0xc9,
3036                             0x55, 0xbb, 0x16, 0x7e, 0xf7, 0xc2, 0x8c, 0xa4,
3037                             0x40, 0x1d, 0xe5, 0xef, 0x0e, 0xdf, 0xe4, 0x9a,
3038                             0x62, 0x73, 0x65, 0xfd, 0x46, 0x63, 0x25, 0x3d,
3039                             0x2b, 0xaf, 0xe5, 0x64, 0xfe, 0xa5, 0x5c, 0xcf,
3040                             0x24, 0xf3, 0xb4, 0xac, 0x64, 0xba, 0xdf, 0x4b,
3041                             0xc6, 0x96, 0x7d, 0x81, 0x2d, 0x8d, 0x97, 0xf7,
3042                             0xc5, 0x68, 0x77, 0x84, 0x32, 0x2b, 0xcc, 0x85,
3043                             0x74, 0x96, 0xf0, 0x12, 0x77, 0x61, 0xb9, 0xeb,
3044                             0x71, 0xaa, 0x82, 0xcb, 0x1c, 0xdb, 0x89, 0xc8,
3045                             0xc6, 0xb5, 0xe3, 0x5c, 0x7d, 0x39, 0x07, 0x24,
3046                             0xda, 0x39, 0x87, 0x45, 0xc0, 0x2b, 0xbb, 0x01,
3047                             0xac, 0xbc, 0x2a, 0x5c, 0x7f, 0xfc, 0xe8, 0xce,
3048                             0x6d, 0x9c, 0x6f, 0xed, 0xd3, 0xc1, 0xa1, 0xd6,
3049                             0xc5, 0x55, 0xa9, 0x66, 0x2f, 0xe1, 0xc8, 0x32,
3050                             0xa6, 0x5d, 0xa4, 0x3a, 0x98, 0x73, 0xe8, 0x45,
3051                             0xa4, 0xc7, 0xa8, 0xb4, 0xf6, 0x13, 0x03, 0xf6,
3052                             0xe9, 0x2e, 0xc4, 0x29, 0x0f, 0x84, 0xdb, 0xc4,
3053                             0x21, 0xc4, 0xc2, 0x75, 0x67, 0x89, 0x37, 0x0a },
3054                 .rlen   = 512,
3055         }
3056 };
3057
3058 static struct cipher_testvec aes_xts_enc_tv_template[] = {
3059         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
3060         { /* XTS-AES 1 */
3061                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3062                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3063                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3064                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3065                 .klen   = 32,
3066                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3067                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3068                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3069                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3070                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3071                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3072                 .ilen   = 32,
3073                 .result = { 0x91, 0x7c, 0xf6, 0x9e, 0xbd, 0x68, 0xb2, 0xec,
3074                             0x9b, 0x9f, 0xe9, 0xa3, 0xea, 0xdd, 0xa6, 0x92,
3075                             0xcd, 0x43, 0xd2, 0xf5, 0x95, 0x98, 0xed, 0x85,
3076                             0x8c, 0x02, 0xc2, 0x65, 0x2f, 0xbf, 0x92, 0x2e },
3077                 .rlen   = 32,
3078         }, { /* XTS-AES 2 */
3079                 .key    = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
3080                             0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
3081                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
3082                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
3083                 .klen   = 32,
3084                 .iv     = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
3085                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3086                 .input  = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3087                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3088                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3089                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
3090                 .ilen   = 32,
3091                 .result = { 0xc4, 0x54, 0x18, 0x5e, 0x6a, 0x16, 0x93, 0x6e,
3092                             0x39, 0x33, 0x40, 0x38, 0xac, 0xef, 0x83, 0x8b,
3093                             0xfb, 0x18, 0x6f, 0xff, 0x74, 0x80, 0xad, 0xc4,
3094                             0x28, 0x93, 0x82, 0xec, 0xd6, 0xd3, 0x94, 0xf0 },
3095                 .rlen   = 32,
3096         }, { /* XTS-AES 3 */
3097                 .key    = { 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
3098                             0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
3099                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
3100                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
3101                 .klen   = 32,
3102                 .iv     = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
3103                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3104                 .input  = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3105                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3106                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3107                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
3108                 .ilen   = 32,
3109                 .result = { 0xaf, 0x85, 0x33, 0x6b, 0x59, 0x7a, 0xfc, 0x1a,
3110                             0x90, 0x0b, 0x2e, 0xb2, 0x1e, 0xc9, 0x49, 0xd2,
3111                             0x92, 0xdf, 0x4c, 0x04, 0x7e, 0x0b, 0x21, 0x53,
3112                             0x21, 0x86, 0xa5, 0x97, 0x1a, 0x22, 0x7a, 0x89 },
3113                 .rlen   = 32,
3114         }, { /* XTS-AES 4 */
3115                 .key    = { 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
3116                             0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
3117                             0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
3118                             0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95 },
3119                 .klen   = 32,
3120                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3121                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3122                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3123                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3124                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3125                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3126                             0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
3127                             0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
3128                             0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3129                             0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
3130                             0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
3131                             0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
3132                             0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
3133                             0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
3134                             0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3135                             0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3136                             0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
3137                             0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
3138                             0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
3139                             0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3140                             0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3141                             0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3142                             0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3143                             0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3144                             0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3145                             0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3146                             0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3147                             0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3148                             0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3149                             0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3150                             0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3151                             0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3152                             0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3153                             0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
3154                             0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3155                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3156                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3157                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3158                             0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
3159                             0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
3160                             0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3161                             0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
3162                             0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
3163                             0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
3164                             0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
3165                             0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
3166                             0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3167                             0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3168                             0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
3169                             0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
3170                             0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
3171                             0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3172                             0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3173                             0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3174                             0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3175                             0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3176                             0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3177                             0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3178                             0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3179                             0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3180                             0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3181                             0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3182                             0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3183                             0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3184                             0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3185                             0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff },
3186                 .ilen   = 512,
3187                 .result = { 0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
3188                             0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
3189                             0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
3190                             0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
3191                             0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
3192                             0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
3193                             0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
3194                             0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
3195                             0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
3196                             0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
3197                             0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0x92, 0xcc,
3198                             0x51, 0x2c, 0x88, 0x66, 0xc7, 0xe8, 0x60, 0xce,
3199                             0x93, 0xfd, 0xf1, 0x66, 0xa2, 0x49, 0x12, 0xb4,
3200                             0x22, 0x97, 0x61, 0x46, 0xae, 0x20, 0xce, 0x84,
3201                             0x6b, 0xb7, 0xdc, 0x9b, 0xa9, 0x4a, 0x76, 0x7a,
3202                             0xae, 0xf2, 0x0c, 0x0d, 0x61, 0xad, 0x02, 0x65,
3203                             0x5e, 0xa9, 0x2d, 0xc4, 0xc4, 0xe4, 0x1a, 0x89,
3204                             0x52, 0xc6, 0x51, 0xd3, 0x31, 0x74, 0xbe, 0x51,
3205                             0xa1, 0x0c, 0x42, 0x11, 0x10, 0xe6, 0xd8, 0x15,
3206                             0x88, 0xed, 0xe8, 0x21, 0x03, 0xa2, 0x52, 0xd8,
3207                             0xa7, 0x50, 0xe8, 0x76, 0x8d, 0xef, 0xff, 0xed,
3208                             0x91, 0x22, 0x81, 0x0a, 0xae, 0xb9, 0x9f, 0x91,
3209                             0x72, 0xaf, 0x82, 0xb6, 0x04, 0xdc, 0x4b, 0x8e,
3210                             0x51, 0xbc, 0xb0, 0x82, 0x35, 0xa6, 0xf4, 0x34,
3211                             0x13, 0x32, 0xe4, 0xca, 0x60, 0x48, 0x2a, 0x4b,
3212                             0xa1, 0xa0, 0x3b, 0x3e, 0x65, 0x00, 0x8f, 0xc5,
3213                             0xda, 0x76, 0xb7, 0x0b, 0xf1, 0x69, 0x0d, 0xb4,
3214                             0xea, 0xe2, 0x9c, 0x5f, 0x1b, 0xad, 0xd0, 0x3c,
3215                             0x5c, 0xcf, 0x2a, 0x55, 0xd7, 0x05, 0xdd, 0xcd,
3216                             0x86, 0xd4, 0x49, 0x51, 0x1c, 0xeb, 0x7e, 0xc3,
3217                             0x0b, 0xf1, 0x2b, 0x1f, 0xa3, 0x5b, 0x91, 0x3f,
3218                             0x9f, 0x74, 0x7a, 0x8a, 0xfd, 0x1b, 0x13, 0x0e,
3219                             0x94, 0xbf, 0xf9, 0x4e, 0xff, 0xd0, 0x1a, 0x91,
3220                             0x73, 0x5c, 0xa1, 0x72, 0x6a, 0xcd, 0x0b, 0x19,
3221                             0x7c, 0x4e, 0x5b, 0x03, 0x39, 0x36, 0x97, 0xe1,
3222                             0x26, 0x82, 0x6f, 0xb6, 0xbb, 0xde, 0x8e, 0xcc,
3223                             0x1e, 0x08, 0x29, 0x85, 0x16, 0xe2, 0xc9, 0xed,
3224                             0x03, 0xff, 0x3c, 0x1b, 0x78, 0x60, 0xf6, 0xde,
3225                             0x76, 0xd4, 0xce, 0xcd, 0x94, 0xc8, 0x11, 0x98,
3226                             0x55, 0xef, 0x52, 0x97, 0xca, 0x67, 0xe9, 0xf3,
3227                             0xe7, 0xff, 0x72, 0xb1, 0xe9, 0x97, 0x85, 0xca,
3228                             0x0a, 0x7e, 0x77, 0x20, 0xc5, 0xb3, 0x6d, 0xc6,
3229                             0xd7, 0x2c, 0xac, 0x95, 0x74, 0xc8, 0xcb, 0xbc,
3230                             0x2f, 0x80, 0x1e, 0x23, 0xe5, 0x6f, 0xd3, 0x44,
3231                             0xb0, 0x7f, 0x22, 0x15, 0x4b, 0xeb, 0xa0, 0xf0,
3232                             0x8c, 0xe8, 0x89, 0x1e, 0x64, 0x3e, 0xd9, 0x95,
3233                             0xc9, 0x4d, 0x9a, 0x69, 0xc9, 0xf1, 0xb5, 0xf4,
3234                             0x99, 0x02, 0x7a, 0x78, 0x57, 0x2a, 0xee, 0xbd,
3235                             0x74, 0xd2, 0x0c, 0xc3, 0x98, 0x81, 0xc2, 0x13,
3236                             0xee, 0x77, 0x0b, 0x10, 0x10, 0xe4, 0xbe, 0xa7,
3237                             0x18, 0x84, 0x69, 0x77, 0xae, 0x11, 0x9f, 0x7a,
3238                             0x02, 0x3a, 0xb5, 0x8c, 0xca, 0x0a, 0xd7, 0x52,
3239                             0xaf, 0xe6, 0x56, 0xbb, 0x3c, 0x17, 0x25, 0x6a,
3240                             0x9f, 0x6e, 0x9b, 0xf1, 0x9f, 0xdd, 0x5a, 0x38,
3241                             0xfc, 0x82, 0xbb, 0xe8, 0x72, 0xc5, 0x53, 0x9e,
3242                             0xdb, 0x60, 0x9e, 0xf4, 0xf7, 0x9c, 0x20, 0x3e,
3243                             0xbb, 0x14, 0x0f, 0x2e, 0x58, 0x3c, 0xb2, 0xad,
3244                             0x15, 0xb4, 0xaa, 0x5b, 0x65, 0x50, 0x16, 0xa8,
3245                             0x44, 0x92, 0x77, 0xdb, 0xd4, 0x77, 0xef, 0x2c,
3246                             0x8d, 0x6c, 0x01, 0x7d, 0xb7, 0x38, 0xb1, 0x8d,
3247                             0xeb, 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
3248                             0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
3249                             0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
3250                             0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68 },
3251                 .rlen   = 512,
3252         }
3253 };
3254
3255 static struct cipher_testvec aes_xts_dec_tv_template[] = {
3256         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
3257         { /* XTS-AES 1 */
3258                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3259                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3260                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3261                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3262                 .klen   = 32,
3263                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3264                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3265                 .input = { 0x91, 0x7c, 0xf6, 0x9e, 0xbd, 0x68, 0xb2, 0xec,
3266                            0x9b, 0x9f, 0xe9, 0xa3, 0xea, 0xdd, 0xa6, 0x92,
3267                            0xcd, 0x43, 0xd2, 0xf5, 0x95, 0x98, 0xed, 0x85,
3268                            0x8c, 0x02, 0xc2, 0x65, 0x2f, 0xbf, 0x92, 0x2e },
3269                 .ilen   = 32,
3270                 .result  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3271                              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3272                              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3273                              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3274                 .rlen   = 32,
3275         }, { /* XTS-AES 2 */
3276                 .key    = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
3277                             0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
3278                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
3279                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
3280                 .klen   = 32,
3281                 .iv     = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
3282                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3283                 .input  = { 0xc4, 0x54, 0x18, 0x5e, 0x6a, 0x16, 0x93, 0x6e,
3284                             0x39, 0x33, 0x40, 0x38, 0xac, 0xef, 0x83, 0x8b,
3285                             0xfb, 0x18, 0x6f, 0xff, 0x74, 0x80, 0xad, 0xc4,
3286                             0x28, 0x93, 0x82, 0xec, 0xd6, 0xd3, 0x94, 0xf0 },
3287                 .ilen   = 32,
3288                 .result = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3289                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3290                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3291                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
3292                 .rlen   = 32,
3293         }, { /* XTS-AES 3 */
3294                 .key    = { 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
3295                             0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
3296                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
3297                             0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 },
3298                 .klen   = 32,
3299                 .iv     = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00,
3300                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3301                 .input = { 0xaf, 0x85, 0x33, 0x6b, 0x59, 0x7a, 0xfc, 0x1a,
3302                             0x90, 0x0b, 0x2e, 0xb2, 0x1e, 0xc9, 0x49, 0xd2,
3303                             0x92, 0xdf, 0x4c, 0x04, 0x7e, 0x0b, 0x21, 0x53,
3304                             0x21, 0x86, 0xa5, 0x97, 0x1a, 0x22, 0x7a, 0x89 },
3305                 .ilen   = 32,
3306                 .result  = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3307                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3308                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
3309                             0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 },
3310                 .rlen   = 32,
3311         }, { /* XTS-AES 4 */
3312                 .key    = { 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
3313                             0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
3314                             0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
3315                             0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95 },
3316                 .klen   = 32,
3317                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3318                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3319                 .input  = { 0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
3320                             0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
3321                             0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
3322                             0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
3323                             0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
3324                             0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
3325                             0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
3326                             0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
3327                             0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
3328                             0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
3329                             0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0x92, 0xcc,
3330                             0x51, 0x2c, 0x88, 0x66, 0xc7, 0xe8, 0x60, 0xce,
3331                             0x93, 0xfd, 0xf1, 0x66, 0xa2, 0x49, 0x12, 0xb4,
3332                             0x22, 0x97, 0x61, 0x46, 0xae, 0x20, 0xce, 0x84,
3333                             0x6b, 0xb7, 0xdc, 0x9b, 0xa9, 0x4a, 0x76, 0x7a,
3334                             0xae, 0xf2, 0x0c, 0x0d, 0x61, 0xad, 0x02, 0x65,
3335                             0x5e, 0xa9, 0x2d, 0xc4, 0xc4, 0xe4, 0x1a, 0x89,
3336                             0x52, 0xc6, 0x51, 0xd3, 0x31, 0x74, 0xbe, 0x51,
3337                             0xa1, 0x0c, 0x42, 0x11, 0x10, 0xe6, 0xd8, 0x15,
3338                             0x88, 0xed, 0xe8, 0x21, 0x03, 0xa2, 0x52, 0xd8,
3339                             0xa7, 0x50, 0xe8, 0x76, 0x8d, 0xef, 0xff, 0xed,
3340                             0x91, 0x22, 0x81, 0x0a, 0xae, 0xb9, 0x9f, 0x91,
3341                             0x72, 0xaf, 0x82, 0xb6, 0x04, 0xdc, 0x4b, 0x8e,
3342                             0x51, 0xbc, 0xb0, 0x82, 0x35, 0xa6, 0xf4, 0x34,
3343                             0x13, 0x32, 0xe4, 0xca, 0x60, 0x48, 0x2a, 0x4b,
3344                             0xa1, 0xa0, 0x3b, 0x3e, 0x65, 0x00, 0x8f, 0xc5,
3345                             0xda, 0x76, 0xb7, 0x0b, 0xf1, 0x69, 0x0d, 0xb4,
3346                             0xea, 0xe2, 0x9c, 0x5f, 0x1b, 0xad, 0xd0, 0x3c,
3347                             0x5c, 0xcf, 0x2a, 0x55, 0xd7, 0x05, 0xdd, 0xcd,
3348                             0x86, 0xd4, 0x49, 0x51, 0x1c, 0xeb, 0x7e, 0xc3,
3349                             0x0b, 0xf1, 0x2b, 0x1f, 0xa3, 0x5b, 0x91, 0x3f,
3350                             0x9f, 0x74, 0x7a, 0x8a, 0xfd, 0x1b, 0x13, 0x0e,
3351                             0x94, 0xbf, 0xf9, 0x4e, 0xff, 0xd0, 0x1a, 0x91,
3352                             0x73, 0x5c, 0xa1, 0x72, 0x6a, 0xcd, 0x0b, 0x19,
3353                             0x7c, 0x4e, 0x5b, 0x03, 0x39, 0x36, 0x97, 0xe1,
3354                             0x26, 0x82, 0x6f, 0xb6, 0xbb, 0xde, 0x8e, 0xcc,
3355                             0x1e, 0x08, 0x29, 0x85, 0x16, 0xe2, 0xc9, 0xed,
3356                             0x03, 0xff, 0x3c, 0x1b, 0x78, 0x60, 0xf6, 0xde,
3357                             0x76, 0xd4, 0xce, 0xcd, 0x94, 0xc8, 0x11, 0x98,
3358                             0x55, 0xef, 0x52, 0x97, 0xca, 0x67, 0xe9, 0xf3,
3359                             0xe7, 0xff, 0x72, 0xb1, 0xe9, 0x97, 0x85, 0xca,
3360                             0x0a, 0x7e, 0x77, 0x20, 0xc5, 0xb3, 0x6d, 0xc6,
3361                             0xd7, 0x2c, 0xac, 0x95, 0x74, 0xc8, 0xcb, 0xbc,
3362                             0x2f, 0x80, 0x1e, 0x23, 0xe5, 0x6f, 0xd3, 0x44,
3363                             0xb0, 0x7f, 0x22, 0x15, 0x4b, 0xeb, 0xa0, 0xf0,
3364                             0x8c, 0xe8, 0x89, 0x1e, 0x64, 0x3e, 0xd9, 0x95,
3365                             0xc9, 0x4d, 0x9a, 0x69, 0xc9, 0xf1, 0xb5, 0xf4,
3366                             0x99, 0x02, 0x7a, 0x78, 0x57, 0x2a, 0xee, 0xbd,
3367                             0x74, 0xd2, 0x0c, 0xc3, 0x98, 0x81, 0xc2, 0x13,
3368                             0xee, 0x77, 0x0b, 0x10, 0x10, 0xe4, 0xbe, 0xa7,
3369                             0x18, 0x84, 0x69, 0x77, 0xae, 0x11, 0x9f, 0x7a,
3370                             0x02, 0x3a, 0xb5, 0x8c, 0xca, 0x0a, 0xd7, 0x52,
3371                             0xaf, 0xe6, 0x56, 0xbb, 0x3c, 0x17, 0x25, 0x6a,
3372                             0x9f, 0x6e, 0x9b, 0xf1, 0x9f, 0xdd, 0x5a, 0x38,
3373                             0xfc, 0x82, 0xbb, 0xe8, 0x72, 0xc5, 0x53, 0x9e,
3374                             0xdb, 0x60, 0x9e, 0xf4, 0xf7, 0x9c, 0x20, 0x3e,
3375                             0xbb, 0x14, 0x0f, 0x2e, 0x58, 0x3c, 0xb2, 0xad,
3376                             0x15, 0xb4, 0xaa, 0x5b, 0x65, 0x50, 0x16, 0xa8,
3377                             0x44, 0x92, 0x77, 0xdb, 0xd4, 0x77, 0xef, 0x2c,
3378                             0x8d, 0x6c, 0x01, 0x7d, 0xb7, 0x38, 0xb1, 0x8d,
3379                             0xeb, 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
3380                             0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
3381                             0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
3382                             0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68 },
3383                 .ilen   = 512,
3384                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3385                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3386                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3387                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3388                             0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
3389                             0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
3390                             0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3391                             0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
3392                             0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
3393                             0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
3394                             0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
3395                             0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
3396                             0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3397                             0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3398                             0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
3399                             0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
3400                             0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
3401                             0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3402                             0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3403                             0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3404                             0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3405                             0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3406                             0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3407                             0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3408                             0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3409                             0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3410                             0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3411                             0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3412                             0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3413                             0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3414                             0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3415                             0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
3416                             0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3417                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3418                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3419                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3420                             0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
3421                             0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
3422                             0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3423                             0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
3424                             0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
3425                             0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
3426                             0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
3427                             0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
3428                             0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3429                             0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3430                             0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
3431                             0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
3432                             0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
3433                             0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3434                             0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3435                             0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3436                             0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3437                             0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3438                             0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3439                             0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3440                             0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3441                             0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3442                             0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3443                             0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3444                             0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3445                             0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3446                             0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3447                             0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff },
3448                 .rlen   = 512,
3449         }
3450 };
3451
3452
3453 static struct cipher_testvec aes_ctr_enc_tv_template[] = {
3454         { /* From RFC 3686 */
3455                 .key    = { 0xae, 0x68, 0x52, 0xf8, 0x12, 0x10, 0x67, 0xcc,
3456                             0x4b, 0xf7, 0xa5, 0x76, 0x55, 0x77, 0xf3, 0x9e,
3457                             0x00, 0x00, 0x00, 0x30 },
3458                 .klen   = 20,
3459                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
3460                 .input  = { "Single block msg" },
3461                 .ilen   = 16,
3462                 .result = { 0xe4, 0x09, 0x5d, 0x4f, 0xb7, 0xa7, 0xb3, 0x79,
3463                             0x2d, 0x61, 0x75, 0xa3, 0x26, 0x13, 0x11, 0xb8 },
3464                 .rlen   = 16,
3465         }, {
3466                 .key    = { 0x7e, 0x24, 0x06, 0x78, 0x17, 0xfa, 0xe0, 0xd7,
3467                             0x43, 0xd6, 0xce, 0x1f, 0x32, 0x53, 0x91, 0x63,
3468                             0x00, 0x6c, 0xb6, 0xdb },
3469                 .klen   = 20,
3470                 .iv     = { 0xc0, 0x54, 0x3b, 0x59, 0xda, 0x48, 0xd9, 0x0b },
3471                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3472                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3473                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3474                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
3475                 .ilen   = 32,
3476                 .result = { 0x51, 0x04, 0xa1, 0x06, 0x16, 0x8a, 0x72, 0xd9,
3477                             0x79, 0x0d, 0x41, 0xee, 0x8e, 0xda, 0xd3, 0x88,
3478                             0xeb, 0x2e, 0x1e, 0xfc, 0x46, 0xda, 0x57, 0xc8,
3479                             0xfc, 0xe6, 0x30, 0xdf, 0x91, 0x41, 0xbe, 0x28 },
3480                 .rlen   = 32,
3481         }, {
3482                 .key    = { 0x16, 0xaf, 0x5b, 0x14, 0x5f, 0xc9, 0xf5, 0x79,
3483                             0xc1, 0x75, 0xf9, 0x3e, 0x3b, 0xfb, 0x0e, 0xed,
3484                             0x86, 0x3d, 0x06, 0xcc, 0xfd, 0xb7, 0x85, 0x15,
3485                             0x00, 0x00, 0x00, 0x48 },
3486                 .klen   = 28,
3487                 .iv     = { 0x36, 0x73, 0x3c, 0x14, 0x7d, 0x6d, 0x93, 0xcb },
3488                 .input  = { "Single block msg" },
3489                 .ilen   = 16,
3490                 .result = { 0x4b, 0x55, 0x38, 0x4f, 0xe2, 0x59, 0xc9, 0xc8,
3491                             0x4e, 0x79, 0x35, 0xa0, 0x03, 0xcb, 0xe9, 0x28 },
3492                 .rlen   = 16,
3493         }, {
3494                 .key    = { 0x7c, 0x5c, 0xb2, 0x40, 0x1b, 0x3d, 0xc3, 0x3c,
3495                             0x19, 0xe7, 0x34, 0x08, 0x19, 0xe0, 0xf6, 0x9c,
3496                             0x67, 0x8c, 0x3d, 0xb8, 0xe6, 0xf6, 0xa9, 0x1a,
3497                             0x00, 0x96, 0xb0, 0x3b },
3498                 .klen   = 28,
3499                 .iv     = { 0x02, 0x0c, 0x6e, 0xad, 0xc2, 0xcb, 0x50, 0x0d },
3500                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3501                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3502                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3503                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
3504                 .ilen   = 32,
3505                 .result = { 0x45, 0x32, 0x43, 0xfc, 0x60, 0x9b, 0x23, 0x32,
3506                             0x7e, 0xdf, 0xaa, 0xfa, 0x71, 0x31, 0xcd, 0x9f,
3507                             0x84, 0x90, 0x70, 0x1c, 0x5a, 0xd4, 0xa7, 0x9c,
3508                             0xfc, 0x1f, 0xe0, 0xff, 0x42, 0xf4, 0xfb, 0x00 },
3509                 .rlen   = 32,
3510         }, {
3511                 .key    = { 0x77, 0x6b, 0xef, 0xf2, 0x85, 0x1d, 0xb0, 0x6f,
3512                             0x4c, 0x8a, 0x05, 0x42, 0xc8, 0x69, 0x6f, 0x6c,
3513                             0x6a, 0x81, 0xaf, 0x1e, 0xec, 0x96, 0xb4, 0xd3,
3514                             0x7f, 0xc1, 0xd6, 0x89, 0xe6, 0xc1, 0xc1, 0x04,
3515                             0x00, 0x00, 0x00, 0x60 },
3516                 .klen   = 36,
3517                 .iv     = { 0xdb, 0x56, 0x72, 0xc9, 0x7a, 0xa8, 0xf0, 0xb2 },
3518                 .input  = { "Single block msg" },
3519                 .ilen   = 16,
3520                 .result = { 0x14, 0x5a, 0xd0, 0x1d, 0xbf, 0x82, 0x4e, 0xc7,
3521                             0x56, 0x08, 0x63, 0xdc, 0x71, 0xe3, 0xe0, 0xc0 },
3522                 .rlen   = 16,
3523         }, {
3524                 .key    = { 0xf6, 0xd6, 0x6d, 0x6b, 0xd5, 0x2d, 0x59, 0xbb,
3525                             0x07, 0x96, 0x36, 0x58, 0x79, 0xef, 0xf8, 0x86,
3526                             0xc6, 0x6d, 0xd5, 0x1a, 0x5b, 0x6a, 0x99, 0x74,
3527                             0x4b, 0x50, 0x59, 0x0c, 0x87, 0xa2, 0x38, 0x84,
3528                             0x00, 0xfa, 0xac, 0x24 },
3529                 .klen   = 36,
3530                 .iv     = { 0xc1, 0x58, 0x5e, 0xf1, 0x5a, 0x43, 0xd8, 0x75 },
3531                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3532                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3533                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3534                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
3535                 .ilen   = 32,
3536                 .result = { 0xf0, 0x5e, 0x23, 0x1b, 0x38, 0x94, 0x61, 0x2c,
3537                             0x49, 0xee, 0x00, 0x0b, 0x80, 0x4e, 0xb2, 0xa9,
3538                             0xb8, 0x30, 0x6b, 0x50, 0x8f, 0x83, 0x9d, 0x6a,
3539                             0x55, 0x30, 0x83, 0x1d, 0x93, 0x44, 0xaf, 0x1c },
3540                 .rlen   = 32,
3541         }, {
3542         // generated using Crypto++
3543                 .key = {
3544                         0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3545                         0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3546                         0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3547                         0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3548                         0x00, 0x00, 0x00, 0x00,
3549                 },
3550                 .klen = 32 + 4,
3551                 .iv = {
3552                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3553                 },
3554                 .input = {
3555                         0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
3556                         0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
3557                         0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3558                         0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
3559                         0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
3560                         0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
3561                         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3562                         0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
3563                         0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
3564                         0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
3565                         0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
3566                         0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
3567                         0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
3568                         0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3569                         0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
3570                         0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
3571                         0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
3572                         0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3573                         0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3574                         0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3575                         0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3576                         0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3577                         0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3578                         0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3579                         0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3580                         0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3581                         0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3582                         0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3583                         0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3584                         0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3585                         0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3586                         0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
3587                         0x00, 0x03, 0x06, 0x09, 0x0c, 0x0f, 0x12, 0x15,
3588                         0x18, 0x1b, 0x1e, 0x21, 0x24, 0x27, 0x2a, 0x2d,
3589                         0x30, 0x33, 0x36, 0x39, 0x3c, 0x3f, 0x42, 0x45,
3590                         0x48, 0x4b, 0x4e, 0x51, 0x54, 0x57, 0x5a, 0x5d,
3591                         0x60, 0x63, 0x66, 0x69, 0x6c, 0x6f, 0x72, 0x75,
3592                         0x78, 0x7b, 0x7e, 0x81, 0x84, 0x87, 0x8a, 0x8d,
3593                         0x90, 0x93, 0x96, 0x99, 0x9c, 0x9f, 0xa2, 0xa5,
3594                         0xa8, 0xab, 0xae, 0xb1, 0xb4, 0xb7, 0xba, 0xbd,
3595                         0xc0, 0xc3, 0xc6, 0xc9, 0xcc, 0xcf, 0xd2, 0xd5,
3596                         0xd8, 0xdb, 0xde, 0xe1, 0xe4, 0xe7, 0xea, 0xed,
3597                         0xf0, 0xf3, 0xf6, 0xf9, 0xfc, 0xff, 0x02, 0x05,
3598                         0x08, 0x0b, 0x0e, 0x11, 0x14, 0x17, 0x1a, 0x1d,
3599                         0x20, 0x23, 0x26, 0x29, 0x2c, 0x2f, 0x32, 0x35,
3600                         0x38, 0x3b, 0x3e, 0x41, 0x44, 0x47, 0x4a, 0x4d,
3601                         0x50, 0x53, 0x56, 0x59, 0x5c, 0x5f, 0x62, 0x65,
3602                         0x68, 0x6b, 0x6e, 0x71, 0x74, 0x77, 0x7a, 0x7d,
3603                         0x80, 0x83, 0x86, 0x89, 0x8c, 0x8f, 0x92, 0x95,
3604                         0x98, 0x9b, 0x9e, 0xa1, 0xa4, 0xa7, 0xaa, 0xad,
3605                         0xb0, 0xb3, 0xb6, 0xb9, 0xbc, 0xbf, 0xc2, 0xc5,
3606                         0xc8, 0xcb, 0xce, 0xd1, 0xd4, 0xd7, 0xda, 0xdd,
3607                         0xe0, 0xe3, 0xe6, 0xe9, 0xec, 0xef, 0xf2, 0xf5,
3608                         0xf8, 0xfb, 0xfe, 0x01, 0x04, 0x07, 0x0a, 0x0d,
3609                         0x10, 0x13, 0x16, 0x19, 0x1c, 0x1f, 0x22, 0x25,
3610                         0x28, 0x2b, 0x2e, 0x31, 0x34, 0x37, 0x3a, 0x3d,
3611                         0x40, 0x43, 0x46, 0x49, 0x4c, 0x4f, 0x52, 0x55,
3612                         0x58, 0x5b, 0x5e, 0x61, 0x64, 0x67, 0x6a, 0x6d,
3613                         0x70, 0x73, 0x76, 0x79, 0x7c, 0x7f, 0x82, 0x85,
3614                         0x88, 0x8b, 0x8e, 0x91, 0x94, 0x97, 0x9a, 0x9d,
3615                         0xa0, 0xa3, 0xa6, 0xa9, 0xac, 0xaf, 0xb2, 0xb5,
3616                         0xb8, 0xbb, 0xbe, 0xc1, 0xc4, 0xc7, 0xca, 0xcd,
3617                         0xd0, 0xd3, 0xd6, 0xd9, 0xdc, 0xdf, 0xe2, 0xe5,
3618                         0xe8, 0xeb, 0xee, 0xf1, 0xf4, 0xf7, 0xfa, 0xfd,
3619                         0x00, 0x05, 0x0a, 0x0f, 0x14, 0x19, 0x1e, 0x23,
3620                         0x28, 0x2d, 0x32, 0x37, 0x3c, 0x41, 0x46, 0x4b,
3621                         0x50, 0x55, 0x5a, 0x5f, 0x64, 0x69, 0x6e, 0x73,
3622                         0x78, 0x7d, 0x82, 0x87, 0x8c, 0x91, 0x96, 0x9b,
3623                         0xa0, 0xa5, 0xaa, 0xaf, 0xb4, 0xb9, 0xbe, 0xc3,
3624                         0xc8, 0xcd, 0xd2, 0xd7, 0xdc, 0xe1, 0xe6, 0xeb,
3625                         0xf0, 0xf5, 0xfa, 0xff, 0x04, 0x09, 0x0e, 0x13,
3626                         0x18, 0x1d, 0x22, 0x27, 0x2c, 0x31, 0x36, 0x3b,
3627                         0x40, 0x45, 0x4a, 0x4f, 0x54, 0x59, 0x5e, 0x63,
3628                         0x68, 0x6d, 0x72, 0x77, 0x7c, 0x81, 0x86, 0x8b,
3629                         0x90, 0x95, 0x9a, 0x9f, 0xa4, 0xa9, 0xae, 0xb3,
3630                         0xb8, 0xbd, 0xc2, 0xc7, 0xcc, 0xd1, 0xd6, 0xdb,
3631                         0xe0, 0xe5, 0xea, 0xef, 0xf4, 0xf9, 0xfe, 0x03,
3632                         0x08, 0x0d, 0x12, 0x17, 0x1c, 0x21, 0x26, 0x2b,
3633                         0x30, 0x35, 0x3a, 0x3f, 0x44, 0x49, 0x4e, 0x53,
3634                         0x58, 0x5d, 0x62, 0x67, 0x6c, 0x71, 0x76, 0x7b,
3635                         0x80, 0x85, 0x8a, 0x8f, 0x94, 0x99, 0x9e, 0xa3,
3636                         0xa8, 0xad, 0xb2, 0xb7, 0xbc, 0xc1, 0xc6, 0xcb,
3637                         0xd0, 0xd5, 0xda, 0xdf, 0xe4, 0xe9, 0xee, 0xf3,
3638                         0xf8, 0xfd, 0x02, 0x07, 0x0c, 0x11, 0x16, 0x1b,
3639                         0x20, 0x25, 0x2a, 0x2f, 0x34, 0x39, 0x3e, 0x43,
3640                         0x48, 0x4d, 0x52, 0x57, 0x5c, 0x61, 0x66, 0x6b,
3641                         0x70, 0x75, 0x7a, 0x7f, 0x84, 0x89, 0x8e, 0x93,
3642                         0x98, 0x9d, 0xa2, 0xa7, 0xac, 0xb1, 0xb6, 0xbb,
3643                         0xc0, 0xc5, 0xca, 0xcf, 0xd4, 0xd9, 0xde, 0xe3,
3644                         0xe8, 0xed, 0xf2, 0xf7, 0xfc, 0x01, 0x06, 0x0b,
3645                         0x10, 0x15, 0x1a, 0x1f, 0x24, 0x29, 0x2e, 0x33,
3646                         0x38, 0x3d, 0x42, 0x47, 0x4c, 0x51, 0x56, 0x5b,
3647                         0x60, 0x65, 0x6a, 0x6f, 0x74, 0x79, 0x7e, 0x83,
3648                         0x88, 0x8d, 0x92, 0x97, 0x9c, 0xa1, 0xa6, 0xab,
3649                         0xb0, 0xb5, 0xba, 0xbf, 0xc4, 0xc9, 0xce, 0xd3,
3650                         0xd8, 0xdd, 0xe2, 0xe7, 0xec, 0xf1, 0xf6, 0xfb,
3651                         0x00, 0x07, 0x0e, 0x15, 0x1c, 0x23, 0x2a, 0x31,
3652                         0x38, 0x3f, 0x46, 0x4d, 0x54, 0x5b, 0x62, 0x69,
3653                         0x70, 0x77, 0x7e, 0x85, 0x8c, 0x93, 0x9a, 0xa1,
3654                         0xa8, 0xaf, 0xb6, 0xbd, 0xc4, 0xcb, 0xd2, 0xd9,
3655                         0xe0, 0xe7, 0xee, 0xf5, 0xfc, 0x03, 0x0a, 0x11,
3656                         0x18, 0x1f, 0x26, 0x2d, 0x34, 0x3b, 0x42, 0x49,
3657                         0x50, 0x57, 0x5e, 0x65, 0x6c, 0x73, 0x7a, 0x81,
3658                         0x88, 0x8f, 0x96, 0x9d, 0xa4, 0xab, 0xb2, 0xb9,
3659                         0xc0, 0xc7, 0xce, 0xd5, 0xdc, 0xe3, 0xea, 0xf1,
3660                         0xf8, 0xff, 0x06, 0x0d, 0x14, 0x1b, 0x22, 0x29,
3661                         0x30, 0x37, 0x3e, 0x45, 0x4c, 0x53, 0x5a, 0x61,
3662                         0x68, 0x6f, 0x76, 0x7d, 0x84, 0x8b, 0x92, 0x99,
3663                         0xa0, 0xa7, 0xae, 0xb5, 0xbc, 0xc3, 0xca, 0xd1,
3664                         0xd8, 0xdf, 0xe6, 0xed, 0xf4, 0xfb, 0x02, 0x09,
3665                         0x10, 0x17, 0x1e, 0x25, 0x2c, 0x33, 0x3a, 0x41,
3666                         0x48, 0x4f, 0x56, 0x5d, 0x64, 0x6b, 0x72, 0x79,
3667                         0x80, 0x87, 0x8e, 0x95, 0x9c, 0xa3, 0xaa, 0xb1,
3668                         0xb8, 0xbf, 0xc6, 0xcd, 0xd4, 0xdb, 0xe2, 0xe9,
3669                         0xf0, 0xf7, 0xfe, 0x05, 0x0c, 0x13, 0x1a, 0x21,
3670                         0x28, 0x2f, 0x36, 0x3d, 0x44, 0x4b, 0x52, 0x59,
3671                         0x60, 0x67, 0x6e, 0x75, 0x7c, 0x83, 0x8a, 0x91,
3672                         0x98, 0x9f, 0xa6, 0xad, 0xb4, 0xbb, 0xc2, 0xc9,
3673                         0xd0, 0xd7, 0xde, 0xe5, 0xec, 0xf3, 0xfa, 0x01,
3674                         0x08, 0x0f, 0x16, 0x1d, 0x24, 0x2b, 0x32, 0x39,
3675                         0x40, 0x47, 0x4e, 0x55, 0x5c, 0x63, 0x6a, 0x71,
3676                         0x78, 0x7f, 0x86, 0x8d, 0x94, 0x9b, 0xa2, 0xa9,
3677                         0xb0, 0xb7, 0xbe, 0xc5, 0xcc, 0xd3, 0xda, 0xe1,
3678                         0xe8, 0xef, 0xf6, 0xfd, 0x04, 0x0b, 0x12, 0x19,
3679                         0x20, 0x27, 0x2e, 0x35, 0x3c, 0x43, 0x4a, 0x51,
3680                         0x58, 0x5f, 0x66, 0x6d, 0x74, 0x7b, 0x82, 0x89,
3681                         0x90, 0x97, 0x9e, 0xa5, 0xac, 0xb3, 0xba, 0xc1,
3682                         0xc8, 0xcf, 0xd6, 0xdd, 0xe4, 0xeb, 0xf2, 0xf9,
3683                         0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f,
3684                         0x48, 0x51, 0x5a, 0x63, 0x6c, 0x75, 0x7e, 0x87,
3685                         0x90, 0x99, 0xa2, 0xab, 0xb4, 0xbd, 0xc6, 0xcf,
3686                         0xd8, 0xe1, 0xea, 0xf3, 0xfc, 0x05, 0x0e, 0x17,
3687                         0x20, 0x29, 0x32, 0x3b, 0x44, 0x4d, 0x56, 0x5f,
3688                         0x68, 0x71, 0x7a, 0x83, 0x8c, 0x95, 0x9e, 0xa7,
3689                         0xb0, 0xb9, 0xc2, 0xcb, 0xd4, 0xdd, 0xe6, 0xef,
3690                         0xf8, 0x01, 0x0a, 0x13, 0x1c, 0x25, 0x2e, 0x37,
3691                         0x40, 0x49, 0x52, 0x5b, 0x64, 0x6d, 0x76, 0x7f,
3692                         0x88, 0x91, 0x9a, 0xa3, 0xac, 0xb5, 0xbe, 0xc7,
3693                         0xd0, 0xd9, 0xe2, 0xeb, 0xf4, 0xfd, 0x06, 0x0f,
3694                         0x18, 0x21, 0x2a, 0x33, 0x3c, 0x45, 0x4e, 0x57,
3695                         0x60, 0x69, 0x72, 0x7b, 0x84, 0x8d, 0x96, 0x9f,
3696                         0xa8, 0xb1, 0xba, 0xc3, 0xcc, 0xd5, 0xde, 0xe7,
3697                         0xf0, 0xf9, 0x02, 0x0b, 0x14, 0x1d, 0x26, 0x2f,
3698                         0x38, 0x41, 0x4a, 0x53, 0x5c, 0x65, 0x6e, 0x77,
3699                         0x80, 0x89, 0x92, 0x9b, 0xa4, 0xad, 0xb6, 0xbf,
3700                         0xc8, 0xd1, 0xda, 0xe3, 0xec, 0xf5, 0xfe, 0x07,
3701                         0x10, 0x19, 0x22, 0x2b, 0x34, 0x3d, 0x46, 0x4f,
3702                         0x58, 0x61, 0x6a, 0x73, 0x7c, 0x85, 0x8e, 0x97,
3703                         0xa0, 0xa9, 0xb2, 0xbb, 0xc4, 0xcd, 0xd6, 0xdf,
3704                         0xe8, 0xf1, 0xfa, 0x03, 0x0c, 0x15, 0x1e, 0x27,
3705                         0x30, 0x39, 0x42, 0x4b, 0x54, 0x5d, 0x66, 0x6f,
3706                         0x78, 0x81, 0x8a, 0x93, 0x9c, 0xa5, 0xae, 0xb7,
3707                         0xc0, 0xc9, 0xd2, 0xdb, 0xe4, 0xed, 0xf6, 0xff,
3708                         0x08, 0x11, 0x1a, 0x23, 0x2c, 0x35, 0x3e, 0x47,
3709                         0x50, 0x59, 0x62, 0x6b, 0x74, 0x7d, 0x86, 0x8f,
3710                         0x98, 0xa1, 0xaa, 0xb3, 0xbc, 0xc5, 0xce, 0xd7,
3711                         0xe0, 0xe9, 0xf2, 0xfb, 0x04, 0x0d, 0x16, 0x1f,
3712                         0x28, 0x31, 0x3a, 0x43, 0x4c, 0x55, 0x5e, 0x67,
3713                         0x70, 0x79, 0x82, 0x8b, 0x94, 0x9d, 0xa6, 0xaf,
3714                         0xb8, 0xc1, 0xca, 0xd3, 0xdc, 0xe5, 0xee, 0xf7,
3715                         0x00, 0x0b, 0x16, 0x21, 0x2c, 0x37, 0x42, 0x4d,
3716                         0x58, 0x63, 0x6e, 0x79, 0x84, 0x8f, 0x9a, 0xa5,
3717                         0xb0, 0xbb, 0xc6, 0xd1, 0xdc, 0xe7, 0xf2, 0xfd,
3718                         0x08, 0x13, 0x1e, 0x29, 0x34, 0x3f, 0x4a, 0x55,
3719                         0x60, 0x6b, 0x76, 0x81, 0x8c, 0x97, 0xa2, 0xad,
3720                         0xb8, 0xc3, 0xce, 0xd9, 0xe4, 0xef, 0xfa, 0x05,
3721                         0x10, 0x1b, 0x26, 0x31, 0x3c, 0x47, 0x52, 0x5d,
3722                         0x68, 0x73, 0x7e, 0x89, 0x94, 0x9f, 0xaa, 0xb5,
3723                         0xc0, 0xcb, 0xd6, 0xe1, 0xec, 0xf7, 0x02, 0x0d,
3724                         0x18, 0x23, 0x2e, 0x39, 0x44, 0x4f, 0x5a, 0x65,
3725                         0x70, 0x7b, 0x86, 0x91, 0x9c, 0xa7, 0xb2, 0xbd,
3726                         0xc8, 0xd3, 0xde, 0xe9, 0xf4, 0xff, 0x0a, 0x15,
3727                         0x20, 0x2b, 0x36, 0x41, 0x4c, 0x57, 0x62, 0x6d,
3728                         0x78, 0x83, 0x8e, 0x99, 0xa4, 0xaf, 0xba, 0xc5,
3729                         0xd0, 0xdb, 0xe6, 0xf1, 0xfc, 0x07, 0x12, 0x1d,
3730                         0x28, 0x33, 0x3e, 0x49, 0x54, 0x5f, 0x6a, 0x75,
3731                         0x80, 0x8b, 0x96, 0xa1, 0xac, 0xb7, 0xc2, 0xcd,
3732                         0xd8, 0xe3, 0xee, 0xf9, 0x04, 0x0f, 0x1a, 0x25,
3733                         0x30, 0x3b, 0x46, 0x51, 0x5c, 0x67, 0x72, 0x7d,
3734                         0x88, 0x93, 0x9e, 0xa9, 0xb4, 0xbf, 0xca, 0xd5,
3735                         0xe0, 0xeb, 0xf6, 0x01, 0x0c, 0x17, 0x22, 0x2d,
3736                         0x38, 0x43, 0x4e, 0x59, 0x64, 0x6f, 0x7a, 0x85,
3737                         0x90, 0x9b, 0xa6, 0xb1, 0xbc, 0xc7, 0xd2, 0xdd,
3738                         0xe8, 0xf3, 0xfe, 0x09, 0x14, 0x1f, 0x2a, 0x35,
3739                         0x40, 0x4b, 0x56, 0x61, 0x6c, 0x77, 0x82, 0x8d,
3740                         0x98, 0xa3, 0xae, 0xb9, 0xc4, 0xcf, 0xda, 0xe5,
3741                         0xf0, 0xfb, 0x06, 0x11, 0x1c, 0x27, 0x32, 0x3d,
3742                         0x48, 0x53, 0x5e, 0x69, 0x74, 0x7f, 0x8a, 0x95,
3743                         0xa0, 0xab, 0xb6, 0xc1, 0xcc, 0xd7, 0xe2, 0xed,
3744                         0xf8, 0x03, 0x0e, 0x19, 0x24, 0x2f, 0x3a, 0x45,
3745                         0x50, 0x5b, 0x66, 0x71, 0x7c, 0x87, 0x92, 0x9d,
3746                         0xa8, 0xb3, 0xbe, 0xc9, 0xd4, 0xdf, 0xea, 0xf5,
3747                         0x00, 0x0d, 0x1a, 0x27, 0x34, 0x41, 0x4e, 0x5b,
3748                         0x68, 0x75, 0x82, 0x8f, 0x9c, 0xa9, 0xb6, 0xc3,
3749                         0xd0, 0xdd, 0xea, 0xf7, 0x04, 0x11, 0x1e, 0x2b,
3750                         0x38, 0x45, 0x52, 0x5f, 0x6c, 0x79, 0x86, 0x93,
3751                         0xa0, 0xad, 0xba, 0xc7, 0xd4, 0xe1, 0xee, 0xfb,
3752                         0x08, 0x15, 0x22, 0x2f, 0x3c, 0x49, 0x56, 0x63,
3753                         0x70, 0x7d, 0x8a, 0x97, 0xa4, 0xb1, 0xbe, 0xcb,
3754                         0xd8, 0xe5, 0xf2, 0xff, 0x0c, 0x19, 0x26, 0x33,
3755                         0x40, 0x4d, 0x5a, 0x67, 0x74, 0x81, 0x8e, 0x9b,
3756                         0xa8, 0xb5, 0xc2, 0xcf, 0xdc, 0xe9, 0xf6, 0x03,
3757                         0x10, 0x1d, 0x2a, 0x37, 0x44, 0x51, 0x5e, 0x6b,
3758                         0x78, 0x85, 0x92, 0x9f, 0xac, 0xb9, 0xc6, 0xd3,
3759                         0xe0, 0xed, 0xfa, 0x07, 0x14, 0x21, 0x2e, 0x3b,
3760                         0x48, 0x55, 0x62, 0x6f, 0x7c, 0x89, 0x96, 0xa3,
3761                         0xb0, 0xbd, 0xca, 0xd7, 0xe4, 0xf1, 0xfe, 0x0b,
3762                         0x18, 0x25, 0x32, 0x3f, 0x4c, 0x59, 0x66, 0x73,
3763                         0x80, 0x8d, 0x9a, 0xa7, 0xb4, 0xc1, 0xce, 0xdb,
3764                         0xe8, 0xf5, 0x02, 0x0f, 0x1c, 0x29, 0x36, 0x43,
3765                         0x50, 0x5d, 0x6a, 0x77, 0x84, 0x91, 0x9e, 0xab,
3766                         0xb8, 0xc5, 0xd2, 0xdf, 0xec, 0xf9, 0x06, 0x13,
3767                         0x20, 0x2d, 0x3a, 0x47, 0x54, 0x61, 0x6e, 0x7b,
3768                         0x88, 0x95, 0xa2, 0xaf, 0xbc, 0xc9, 0xd6, 0xe3,
3769                         0xf0, 0xfd, 0x0a, 0x17, 0x24, 0x31, 0x3e, 0x4b,
3770                         0x58, 0x65, 0x72, 0x7f, 0x8c, 0x99, 0xa6, 0xb3,
3771                         0xc0, 0xcd, 0xda, 0xe7, 0xf4, 0x01, 0x0e, 0x1b,
3772                         0x28, 0x35, 0x42, 0x4f, 0x5c, 0x69, 0x76, 0x83,
3773                         0x90, 0x9d, 0xaa, 0xb7, 0xc4, 0xd1, 0xde, 0xeb,
3774                         0xf8, 0x05, 0x12, 0x1f, 0x2c, 0x39, 0x46, 0x53,
3775                         0x60, 0x6d, 0x7a, 0x87, 0x94, 0xa1, 0xae, 0xbb,
3776                         0xc8, 0xd5, 0xe2, 0xef, 0xfc, 0x09, 0x16, 0x23,
3777                         0x30, 0x3d, 0x4a, 0x57, 0x64, 0x71, 0x7e, 0x8b,
3778                         0x98, 0xa5, 0xb2, 0xbf, 0xcc, 0xd9, 0xe6, 0xf3,
3779                         0x00, 0x0f, 0x1e, 0x2d, 0x3c, 0x4b, 0x5a, 0x69,
3780                         0x78, 0x87, 0x96, 0xa5, 0xb4, 0xc3, 0xd2, 0xe1,
3781                         0xf0, 0xff, 0x0e, 0x1d, 0x2c, 0x3b, 0x4a, 0x59,
3782                         0x68, 0x77, 0x86, 0x95, 0xa4, 0xb3, 0xc2, 0xd1,
3783                         0xe0, 0xef, 0xfe, 0x0d, 0x1c, 0x2b, 0x3a, 0x49,
3784                         0x58, 0x67, 0x76, 0x85, 0x94, 0xa3, 0xb2, 0xc1,
3785                         0xd0, 0xdf, 0xee, 0xfd, 0x0c, 0x1b, 0x2a, 0x39,
3786                         0x48, 0x57, 0x66, 0x75, 0x84, 0x93, 0xa2, 0xb1,
3787                         0xc0, 0xcf, 0xde, 0xed, 0xfc, 0x0b, 0x1a, 0x29,
3788                         0x38, 0x47, 0x56, 0x65, 0x74, 0x83, 0x92, 0xa1,
3789                         0xb0, 0xbf, 0xce, 0xdd, 0xec, 0xfb, 0x0a, 0x19,
3790                         0x28, 0x37, 0x46, 0x55, 0x64, 0x73, 0x82, 0x91,
3791                         0xa0, 0xaf, 0xbe, 0xcd, 0xdc, 0xeb, 0xfa, 0x09,
3792                         0x18, 0x27, 0x36, 0x45, 0x54, 0x63, 0x72, 0x81,
3793                         0x90, 0x9f, 0xae, 0xbd, 0xcc, 0xdb, 0xea, 0xf9,
3794                         0x08, 0x17, 0x26, 0x35, 0x44, 0x53, 0x62, 0x71,
3795                         0x80, 0x8f, 0x9e, 0xad, 0xbc, 0xcb, 0xda, 0xe9,
3796                         0xf8, 0x07, 0x16, 0x25, 0x34, 0x43, 0x52, 0x61,
3797                         0x70, 0x7f, 0x8e, 0x9d, 0xac, 0xbb, 0xca, 0xd9,
3798                         0xe8, 0xf7, 0x06, 0x15, 0x24, 0x33, 0x42, 0x51,
3799                         0x60, 0x6f, 0x7e, 0x8d, 0x9c, 0xab, 0xba, 0xc9,
3800                         0xd8, 0xe7, 0xf6, 0x05, 0x14, 0x23, 0x32, 0x41,
3801                         0x50, 0x5f, 0x6e, 0x7d, 0x8c, 0x9b, 0xaa, 0xb9,
3802                         0xc8, 0xd7, 0xe6, 0xf5, 0x04, 0x13, 0x22, 0x31,
3803                         0x40, 0x4f, 0x5e, 0x6d, 0x7c, 0x8b, 0x9a, 0xa9,
3804                         0xb8, 0xc7, 0xd6, 0xe5, 0xf4, 0x03, 0x12, 0x21,
3805                         0x30, 0x3f, 0x4e, 0x5d, 0x6c, 0x7b, 0x8a, 0x99,
3806                         0xa8, 0xb7, 0xc6, 0xd5, 0xe4, 0xf3, 0x02, 0x11,
3807                         0x20, 0x2f, 0x3e, 0x4d, 0x5c, 0x6b, 0x7a, 0x89,
3808                         0x98, 0xa7, 0xb6, 0xc5, 0xd4, 0xe3, 0xf2, 0x01,
3809                         0x10, 0x1f, 0x2e, 0x3d, 0x4c, 0x5b, 0x6a, 0x79,
3810                         0x88, 0x97, 0xa6, 0xb5, 0xc4, 0xd3, 0xe2, 0xf1,
3811                         0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
3812                         0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
3813                         0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87,
3814                         0x98, 0xa9, 0xba, 0xcb, 0xdc, 0xed, 0xfe, 0x0f,
3815                         0x20, 0x31, 0x42, 0x53, 0x64, 0x75, 0x86, 0x97,
3816                         0xa8, 0xb9, 0xca, 0xdb, 0xec, 0xfd, 0x0e, 0x1f,
3817                         0x30, 0x41, 0x52, 0x63, 0x74, 0x85, 0x96, 0xa7,
3818                         0xb8, 0xc9, 0xda, 0xeb, 0xfc, 0x0d, 0x1e, 0x2f,
3819                         0x40, 0x51, 0x62, 0x73, 0x84, 0x95, 0xa6, 0xb7,
3820                         0xc8, 0xd9, 0xea, 0xfb, 0x0c, 0x1d, 0x2e, 0x3f,
3821                         0x50, 0x61, 0x72, 0x83, 0x94, 0xa5, 0xb6, 0xc7,
3822                         0xd8, 0xe9, 0xfa, 0x0b, 0x1c, 0x2d, 0x3e, 0x4f,
3823                         0x60, 0x71, 0x82, 0x93, 0xa4, 0xb5, 0xc6, 0xd7,
3824                         0xe8, 0xf9, 0x0a, 0x1b, 0x2c, 0x3d, 0x4e, 0x5f,
3825                         0x70, 0x81, 0x92, 0xa3, 0xb4, 0xc5, 0xd6, 0xe7,
3826                         0xf8, 0x09, 0x1a, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f,
3827                         0x80, 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7,
3828                         0x08, 0x19, 0x2a, 0x3b, 0x4c, 0x5d, 0x6e, 0x7f,
3829                         0x90, 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0xf6, 0x07,
3830                         0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x8f,
3831                         0xa0, 0xb1, 0xc2, 0xd3, 0xe4, 0xf5, 0x06, 0x17,
3832                         0x28, 0x39, 0x4a, 0x5b, 0x6c, 0x7d, 0x8e, 0x9f,
3833                         0xb0, 0xc1, 0xd2, 0xe3, 0xf4, 0x05, 0x16, 0x27,
3834                         0x38, 0x49, 0x5a, 0x6b, 0x7c, 0x8d, 0x9e, 0xaf,
3835                         0xc0, 0xd1, 0xe2, 0xf3, 0x04, 0x15, 0x26, 0x37,
3836                         0x48, 0x59, 0x6a, 0x7b, 0x8c, 0x9d, 0xae, 0xbf,
3837                         0xd0, 0xe1, 0xf2, 0x03, 0x14, 0x25, 0x36, 0x47,
3838                         0x58, 0x69, 0x7a, 0x8b, 0x9c, 0xad, 0xbe, 0xcf,
3839                         0xe0, 0xf1, 0x02, 0x13, 0x24, 0x35, 0x46, 0x57,
3840                         0x68, 0x79, 0x8a, 0x9b, 0xac, 0xbd, 0xce, 0xdf,
3841                         0xf0, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67,
3842                         0x78, 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef,
3843                         0x00, 0x13, 0x26, 0x39, 0x4c, 0x5f, 0x72, 0x85,
3844                         0x98, 0xab, 0xbe, 0xd1, 0xe4, 0xf7, 0x0a, 0x1d,
3845                         0x30, 0x43, 0x56, 0x69, 0x7c, 0x8f, 0xa2, 0xb5,
3846                         0xc8, 0xdb, 0xee, 0x01, 0x14, 0x27, 0x3a, 0x4d,
3847                         0x60, 0x73, 0x86, 0x99, 0xac, 0xbf, 0xd2, 0xe5,
3848                         0xf8, 0x0b, 0x1e, 0x31, 0x44, 0x57, 0x6a, 0x7d,
3849                         0x90, 0xa3, 0xb6, 0xc9, 0xdc, 0xef, 0x02, 0x15,
3850                         0x28, 0x3b, 0x4e, 0x61, 0x74, 0x87, 0x9a, 0xad,
3851                         0xc0, 0xd3, 0xe6, 0xf9, 0x0c, 0x1f, 0x32, 0x45,
3852                         0x58, 0x6b, 0x7e, 0x91, 0xa4, 0xb7, 0xca, 0xdd,
3853                         0xf0, 0x03, 0x16, 0x29, 0x3c, 0x4f, 0x62, 0x75,
3854                         0x88, 0x9b, 0xae, 0xc1, 0xd4, 0xe7, 0xfa, 0x0d,
3855                         0x20, 0x33, 0x46, 0x59, 0x6c, 0x7f, 0x92, 0xa5,
3856                         0xb8, 0xcb, 0xde, 0xf1, 0x04, 0x17, 0x2a, 0x3d,
3857                         0x50, 0x63, 0x76, 0x89, 0x9c, 0xaf, 0xc2, 0xd5,
3858                         0xe8, 0xfb, 0x0e, 0x21, 0x34, 0x47, 0x5a, 0x6d,
3859                         0x80, 0x93, 0xa6, 0xb9, 0xcc, 0xdf, 0xf2, 0x05,
3860                         0x18, 0x2b, 0x3e, 0x51, 0x64, 0x77, 0x8a, 0x9d,
3861                         0xb0, 0xc3, 0xd6, 0xe9, 0xfc, 0x0f, 0x22, 0x35,
3862                         0x48, 0x5b, 0x6e, 0x81, 0x94, 0xa7, 0xba, 0xcd,
3863                         0xe0, 0xf3, 0x06, 0x19, 0x2c, 0x3f, 0x52, 0x65,
3864                         0x78, 0x8b, 0x9e, 0xb1, 0xc4, 0xd7, 0xea, 0xfd,
3865                         0x10, 0x23, 0x36, 0x49, 0x5c, 0x6f, 0x82, 0x95,
3866                         0xa8, 0xbb, 0xce, 0xe1, 0xf4, 0x07, 0x1a, 0x2d,
3867                         0x40, 0x53, 0x66, 0x79, 0x8c, 0x9f, 0xb2, 0xc5,
3868                         0xd8, 0xeb, 0xfe, 0x11, 0x24, 0x37, 0x4a, 0x5d,
3869                         0x70, 0x83, 0x96, 0xa9, 0xbc, 0xcf, 0xe2, 0xf5,
3870                         0x08, 0x1b, 0x2e, 0x41, 0x54, 0x67, 0x7a, 0x8d,
3871                         0xa0, 0xb3, 0xc6, 0xd9, 0xec, 0xff, 0x12, 0x25,
3872                         0x38, 0x4b, 0x5e, 0x71, 0x84, 0x97, 0xaa, 0xbd,
3873                         0xd0, 0xe3, 0xf6, 0x09, 0x1c, 0x2f, 0x42, 0x55,
3874                         0x68, 0x7b, 0x8e, 0xa1, 0xb4, 0xc7, 0xda, 0xed,
3875                         0x00, 0x15, 0x2a, 0x3f, 0x54, 0x69, 0x7e, 0x93,
3876                         0xa8, 0xbd, 0xd2, 0xe7, 0xfc, 0x11, 0x26, 0x3b,
3877                         0x50, 0x65, 0x7a, 0x8f, 0xa4, 0xb9, 0xce, 0xe3,
3878                         0xf8, 0x0d, 0x22, 0x37, 0x4c, 0x61, 0x76, 0x8b,
3879                         0xa0, 0xb5, 0xca, 0xdf, 0xf4, 0x09, 0x1e, 0x33,
3880                         0x48, 0x5d, 0x72, 0x87, 0x9c, 0xb1, 0xc6, 0xdb,
3881                         0xf0, 0x05, 0x1a, 0x2f, 0x44, 0x59, 0x6e, 0x83,
3882                         0x98, 0xad, 0xc2, 0xd7, 0xec, 0x01, 0x16, 0x2b,
3883                         0x40, 0x55, 0x6a, 0x7f, 0x94, 0xa9, 0xbe, 0xd3,
3884                         0xe8, 0xfd, 0x12, 0x27, 0x3c, 0x51, 0x66, 0x7b,
3885                         0x90, 0xa5, 0xba, 0xcf, 0xe4, 0xf9, 0x0e, 0x23,
3886                         0x38, 0x4d, 0x62, 0x77, 0x8c, 0xa1, 0xb6, 0xcb,
3887                         0xe0, 0xf5, 0x0a, 0x1f, 0x34, 0x49, 0x5e, 0x73,
3888                         0x88, 0x9d, 0xb2, 0xc7, 0xdc, 0xf1, 0x06, 0x1b,
3889                         0x30, 0x45, 0x5a, 0x6f, 0x84, 0x99, 0xae, 0xc3,
3890                         0xd8, 0xed, 0x02, 0x17, 0x2c, 0x41, 0x56, 0x6b,
3891                         0x80, 0x95, 0xaa, 0xbf, 0xd4, 0xe9, 0xfe, 0x13,
3892                         0x28, 0x3d, 0x52, 0x67, 0x7c, 0x91, 0xa6, 0xbb,
3893                         0xd0, 0xe5, 0xfa, 0x0f, 0x24, 0x39, 0x4e, 0x63,
3894                         0x78, 0x8d, 0xa2, 0xb7, 0xcc, 0xe1, 0xf6, 0x0b,
3895                         0x20, 0x35, 0x4a, 0x5f, 0x74, 0x89, 0x9e, 0xb3,
3896                         0xc8, 0xdd, 0xf2, 0x07, 0x1c, 0x31, 0x46, 0x5b,
3897                         0x70, 0x85, 0x9a, 0xaf, 0xc4, 0xd9, 0xee, 0x03,
3898                         0x18, 0x2d, 0x42, 0x57, 0x6c, 0x81, 0x96, 0xab,
3899                         0xc0, 0xd5, 0xea, 0xff, 0x14, 0x29, 0x3e, 0x53,
3900                         0x68, 0x7d, 0x92, 0xa7, 0xbc, 0xd1, 0xe6, 0xfb,
3901                         0x10, 0x25, 0x3a, 0x4f, 0x64, 0x79, 0x8e, 0xa3,
3902                         0xb8, 0xcd, 0xe2, 0xf7, 0x0c, 0x21, 0x36, 0x4b,
3903                         0x60, 0x75, 0x8a, 0x9f, 0xb4, 0xc9, 0xde, 0xf3,
3904                         0x08, 0x1d, 0x32, 0x47, 0x5c, 0x71, 0x86, 0x9b,
3905                         0xb0, 0xc5, 0xda, 0xef, 0x04, 0x19, 0x2e, 0x43,
3906                         0x58, 0x6d, 0x82, 0x97, 0xac, 0xc1, 0xd6, 0xeb,
3907                         0x00, 0x17, 0x2e, 0x45, 0x5c, 0x73, 0x8a, 0xa1,
3908                         0xb8, 0xcf, 0xe6, 0xfd, 0x14, 0x2b, 0x42, 0x59,
3909                         0x70, 0x87, 0x9e, 0xb5, 0xcc, 0xe3, 0xfa, 0x11,
3910                         0x28, 0x3f, 0x56, 0x6d, 0x84, 0x9b, 0xb2, 0xc9,
3911                         0xe0, 0xf7, 0x0e, 0x25, 0x3c, 0x53, 0x6a, 0x81,
3912                         0x98, 0xaf, 0xc6, 0xdd, 0xf4, 0x0b, 0x22, 0x39,
3913                         0x50, 0x67, 0x7e, 0x95, 0xac, 0xc3, 0xda, 0xf1,
3914                         0x08, 0x1f, 0x36, 0x4d, 0x64, 0x7b, 0x92, 0xa9,
3915                         0xc0, 0xd7, 0xee, 0x05, 0x1c, 0x33, 0x4a, 0x61,
3916                         0x78, 0x8f, 0xa6, 0xbd, 0xd4, 0xeb, 0x02, 0x19,
3917                         0x30, 0x47, 0x5e, 0x75, 0x8c, 0xa3, 0xba, 0xd1,
3918                         0xe8, 0xff, 0x16, 0x2d, 0x44, 0x5b, 0x72, 0x89,
3919                         0xa0, 0xb7, 0xce, 0xe5, 0xfc, 0x13, 0x2a, 0x41,
3920                         0x58, 0x6f, 0x86, 0x9d, 0xb4, 0xcb, 0xe2, 0xf9,
3921                         0x10, 0x27, 0x3e, 0x55, 0x6c, 0x83, 0x9a, 0xb1,
3922                         0xc8, 0xdf, 0xf6, 0x0d, 0x24, 0x3b, 0x52, 0x69,
3923                         0x80, 0x97, 0xae, 0xc5, 0xdc, 0xf3, 0x0a, 0x21,
3924                         0x38, 0x4f, 0x66, 0x7d, 0x94, 0xab, 0xc2, 0xd9,
3925                         0xf0, 0x07, 0x1e, 0x35, 0x4c, 0x63, 0x7a, 0x91,
3926                         0xa8, 0xbf, 0xd6, 0xed, 0x04, 0x1b, 0x32, 0x49,
3927                         0x60, 0x77, 0x8e, 0xa5, 0xbc, 0xd3, 0xea, 0x01,
3928                         0x18, 0x2f, 0x46, 0x5d, 0x74, 0x8b, 0xa2, 0xb9,
3929                         0xd0, 0xe7, 0xfe, 0x15, 0x2c, 0x43, 0x5a, 0x71,
3930                         0x88, 0x9f, 0xb6, 0xcd, 0xe4, 0xfb, 0x12, 0x29,
3931                         0x40, 0x57, 0x6e, 0x85, 0x9c, 0xb3, 0xca, 0xe1,
3932                         0xf8, 0x0f, 0x26, 0x3d, 0x54, 0x6b, 0x82, 0x99,
3933                         0xb0, 0xc7, 0xde, 0xf5, 0x0c, 0x23, 0x3a, 0x51,
3934                         0x68, 0x7f, 0x96, 0xad, 0xc4, 0xdb, 0xf2, 0x09,
3935                         0x20, 0x37, 0x4e, 0x65, 0x7c, 0x93, 0xaa, 0xc1,
3936                         0xd8, 0xef, 0x06, 0x1d, 0x34, 0x4b, 0x62, 0x79,
3937                         0x90, 0xa7, 0xbe, 0xd5, 0xec, 0x03, 0x1a, 0x31,
3938                         0x48, 0x5f, 0x76, 0x8d, 0xa4, 0xbb, 0xd2, 0xe9,
3939                         0x00, 0x19, 0x32, 0x4b, 0x64, 0x7d, 0x96, 0xaf,
3940                         0xc8, 0xe1, 0xfa, 0x13, 0x2c, 0x45, 0x5e, 0x77,
3941                         0x90, 0xa9, 0xc2, 0xdb, 0xf4, 0x0d, 0x26, 0x3f,
3942                         0x58, 0x71, 0x8a, 0xa3, 0xbc, 0xd5, 0xee, 0x07,
3943                         0x20, 0x39, 0x52, 0x6b, 0x84, 0x9d, 0xb6, 0xcf,
3944                         0xe8, 0x01, 0x1a, 0x33, 0x4c, 0x65, 0x7e, 0x97,
3945                         0xb0, 0xc9, 0xe2, 0xfb, 0x14, 0x2d, 0x46, 0x5f,
3946                         0x78, 0x91, 0xaa, 0xc3, 0xdc, 0xf5, 0x0e, 0x27,
3947                         0x40, 0x59, 0x72, 0x8b, 0xa4, 0xbd, 0xd6, 0xef,
3948                         0x08, 0x21, 0x3a, 0x53, 0x6c, 0x85, 0x9e, 0xb7,
3949                         0xd0, 0xe9, 0x02, 0x1b, 0x34, 0x4d, 0x66, 0x7f,
3950                         0x98, 0xb1, 0xca, 0xe3, 0xfc, 0x15, 0x2e, 0x47,
3951                         0x60, 0x79, 0x92, 0xab, 0xc4, 0xdd, 0xf6, 0x0f,
3952                         0x28, 0x41, 0x5a, 0x73, 0x8c, 0xa5, 0xbe, 0xd7,
3953                         0xf0, 0x09, 0x22, 0x3b, 0x54, 0x6d, 0x86, 0x9f,
3954                         0xb8, 0xd1, 0xea, 0x03, 0x1c, 0x35, 0x4e, 0x67,
3955                         0x80, 0x99, 0xb2, 0xcb, 0xe4, 0xfd, 0x16, 0x2f,
3956                         0x48, 0x61, 0x7a, 0x93, 0xac, 0xc5, 0xde, 0xf7,
3957                         0x10, 0x29, 0x42, 0x5b, 0x74, 0x8d, 0xa6, 0xbf,
3958                         0xd8, 0xf1, 0x0a, 0x23, 0x3c, 0x55, 0x6e, 0x87,
3959                         0xa0, 0xb9, 0xd2, 0xeb, 0x04, 0x1d, 0x36, 0x4f,
3960                         0x68, 0x81, 0x9a, 0xb3, 0xcc, 0xe5, 0xfe, 0x17,
3961                         0x30, 0x49, 0x62, 0x7b, 0x94, 0xad, 0xc6, 0xdf,
3962                         0xf8, 0x11, 0x2a, 0x43, 0x5c, 0x75, 0x8e, 0xa7,
3963                         0xc0, 0xd9, 0xf2, 0x0b, 0x24, 0x3d, 0x56, 0x6f,
3964                         0x88, 0xa1, 0xba, 0xd3, 0xec, 0x05, 0x1e, 0x37,
3965                         0x50, 0x69, 0x82, 0x9b, 0xb4, 0xcd, 0xe6, 0xff,
3966                         0x18, 0x31, 0x4a, 0x63, 0x7c, 0x95, 0xae, 0xc7,
3967                         0xe0, 0xf9, 0x12, 0x2b, 0x44, 0x5d, 0x76, 0x8f,
3968                         0xa8, 0xc1, 0xda, 0xf3, 0x0c, 0x25, 0x3e, 0x57,
3969                         0x70, 0x89, 0xa2, 0xbb, 0xd4, 0xed, 0x06, 0x1f,
3970                         0x38, 0x51, 0x6a, 0x83, 0x9c, 0xb5, 0xce, 0xe7,
3971                         0x00, 0x1b, 0x36, 0x51, 0x6c, 0x87, 0xa2, 0xbd,
3972                         0xd8, 0xf3, 0x0e, 0x29, 0x44, 0x5f, 0x7a, 0x95,
3973                         0xb0, 0xcb, 0xe6, 0x01, 0x1c, 0x37, 0x52, 0x6d,
3974                         0x88, 0xa3, 0xbe, 0xd9, 0xf4, 0x0f, 0x2a, 0x45,
3975                         0x60, 0x7b, 0x96, 0xb1, 0xcc, 0xe7, 0x02, 0x1d,
3976                         0x38, 0x53, 0x6e, 0x89, 0xa4, 0xbf, 0xda, 0xf5,
3977                         0x10, 0x2b, 0x46, 0x61, 0x7c, 0x97, 0xb2, 0xcd,
3978                         0xe8, 0x03, 0x1e, 0x39, 0x54, 0x6f, 0x8a, 0xa5,
3979                         0xc0, 0xdb, 0xf6, 0x11, 0x2c, 0x47, 0x62, 0x7d,
3980                         0x98, 0xb3, 0xce, 0xe9, 0x04, 0x1f, 0x3a, 0x55,
3981                         0x70, 0x8b, 0xa6, 0xc1, 0xdc, 0xf7, 0x12, 0x2d,
3982                         0x48, 0x63, 0x7e, 0x99, 0xb4, 0xcf, 0xea, 0x05,
3983                         0x20, 0x3b, 0x56, 0x71, 0x8c, 0xa7, 0xc2, 0xdd,
3984                         0xf8, 0x13, 0x2e, 0x49, 0x64, 0x7f, 0x9a, 0xb5,
3985                         0xd0, 0xeb, 0x06, 0x21, 0x3c, 0x57, 0x72, 0x8d,
3986                         0xa8, 0xc3, 0xde, 0xf9, 0x14, 0x2f, 0x4a, 0x65,
3987                         0x80, 0x9b, 0xb6, 0xd1, 0xec, 0x07, 0x22, 0x3d,
3988                         0x58, 0x73, 0x8e, 0xa9, 0xc4, 0xdf, 0xfa, 0x15,
3989                         0x30, 0x4b, 0x66, 0x81, 0x9c, 0xb7, 0xd2, 0xed,
3990                         0x08, 0x23, 0x3e, 0x59, 0x74, 0x8f, 0xaa, 0xc5,
3991                         0xe0, 0xfb, 0x16, 0x31, 0x4c, 0x67, 0x82, 0x9d,
3992                         0xb8, 0xd3, 0xee, 0x09, 0x24, 0x3f, 0x5a, 0x75,
3993                         0x90, 0xab, 0xc6, 0xe1, 0xfc, 0x17, 0x32, 0x4d,
3994                         0x68, 0x83, 0x9e, 0xb9, 0xd4, 0xef, 0x0a, 0x25,
3995                         0x40, 0x5b, 0x76, 0x91, 0xac, 0xc7, 0xe2, 0xfd,
3996                         0x18, 0x33, 0x4e, 0x69, 0x84, 0x9f, 0xba, 0xd5,
3997                         0xf0, 0x0b, 0x26, 0x41, 0x5c, 0x77, 0x92, 0xad,
3998                         0xc8, 0xe3, 0xfe, 0x19, 0x34, 0x4f, 0x6a, 0x85,
3999                         0xa0, 0xbb, 0xd6, 0xf1, 0x0c, 0x27, 0x42, 0x5d,
4000                         0x78, 0x93, 0xae, 0xc9, 0xe4, 0xff, 0x1a, 0x35,
4001                         0x50, 0x6b, 0x86, 0xa1, 0xbc, 0xd7, 0xf2, 0x0d,
4002                         0x28, 0x43, 0x5e, 0x79, 0x94, 0xaf, 0xca, 0xe5,
4003                         0x00, 0x1d, 0x3a, 0x57, 0x74, 0x91, 0xae, 0xcb,
4004                         0xe8, 0x05, 0x22, 0x3f, 0x5c, 0x79, 0x96, 0xb3,
4005                         0xd0, 0xed, 0x0a, 0x27, 0x44, 0x61, 0x7e, 0x9b,
4006                         0xb8, 0xd5, 0xf2, 0x0f, 0x2c, 0x49, 0x66, 0x83,
4007                         0xa0, 0xbd, 0xda, 0xf7, 0x14, 0x31, 0x4e, 0x6b,
4008                         0x88, 0xa5, 0xc2, 0xdf, 0xfc, 0x19, 0x36, 0x53,
4009                         0x70, 0x8d, 0xaa, 0xc7, 0xe4, 0x01, 0x1e, 0x3b,
4010                         0x58, 0x75, 0x92, 0xaf, 0xcc, 0xe9, 0x06, 0x23,
4011                         0x40, 0x5d, 0x7a, 0x97, 0xb4, 0xd1, 0xee, 0x0b,
4012                         0x28, 0x45, 0x62, 0x7f, 0x9c, 0xb9, 0xd6, 0xf3,
4013                         0x10, 0x2d, 0x4a, 0x67, 0x84, 0xa1, 0xbe, 0xdb,
4014                         0xf8, 0x15, 0x32, 0x4f, 0x6c, 0x89, 0xa6, 0xc3,
4015                         0xe0, 0xfd, 0x1a, 0x37, 0x54, 0x71, 0x8e, 0xab,
4016                         0xc8, 0xe5, 0x02, 0x1f, 0x3c, 0x59, 0x76, 0x93,
4017                         0xb0, 0xcd, 0xea, 0x07, 0x24, 0x41, 0x5e, 0x7b,
4018                         0x98, 0xb5, 0xd2, 0xef, 0x0c, 0x29, 0x46, 0x63,
4019                         0x80, 0x9d, 0xba, 0xd7, 0xf4, 0x11, 0x2e, 0x4b,
4020                         0x68, 0x85, 0xa2, 0xbf, 0xdc, 0xf9, 0x16, 0x33,
4021                         0x50, 0x6d, 0x8a, 0xa7, 0xc4, 0xe1, 0xfe, 0x1b,
4022                         0x38, 0x55, 0x72, 0x8f, 0xac, 0xc9, 0xe6, 0x03,
4023                         0x20, 0x3d, 0x5a, 0x77, 0x94, 0xb1, 0xce, 0xeb,
4024                         0x08, 0x25, 0x42, 0x5f, 0x7c, 0x99, 0xb6, 0xd3,
4025                         0xf0, 0x0d, 0x2a, 0x47, 0x64, 0x81, 0x9e, 0xbb,
4026                         0xd8, 0xf5, 0x12, 0x2f, 0x4c, 0x69, 0x86, 0xa3,
4027                         0xc0, 0xdd, 0xfa, 0x17, 0x34, 0x51, 0x6e, 0x8b,
4028                         0xa8, 0xc5, 0xe2, 0xff, 0x1c, 0x39, 0x56, 0x73,
4029                         0x90, 0xad, 0xca, 0xe7, 0x04, 0x21, 0x3e, 0x5b,
4030                         0x78, 0x95, 0xb2, 0xcf, 0xec, 0x09, 0x26, 0x43,
4031                         0x60, 0x7d, 0x9a, 0xb7, 0xd4, 0xf1, 0x0e, 0x2b,
4032                         0x48, 0x65, 0x82, 0x9f, 0xbc, 0xd9, 0xf6, 0x13,
4033                         0x30, 0x4d, 0x6a, 0x87, 0xa4, 0xc1, 0xde, 0xfb,
4034                         0x18, 0x35, 0x52, 0x6f, 0x8c, 0xa9, 0xc6, 0xe3,
4035                         0x00, 0x1f, 0x3e, 0x5d, 0x7c, 0x9b, 0xba, 0xd9,
4036                         0xf8, 0x17, 0x36, 0x55, 0x74, 0x93, 0xb2, 0xd1,
4037                         0xf0, 0x0f, 0x2e, 0x4d, 0x6c, 0x8b, 0xaa, 0xc9,
4038                         0xe8, 0x07, 0x26, 0x45, 0x64, 0x83, 0xa2, 0xc1,
4039                         0xe0, 0xff, 0x1e, 0x3d, 0x5c, 0x7b, 0x9a, 0xb9,
4040                         0xd8, 0xf7, 0x16, 0x35, 0x54, 0x73, 0x92, 0xb1,
4041                         0xd0, 0xef, 0x0e, 0x2d, 0x4c, 0x6b, 0x8a, 0xa9,
4042                         0xc8, 0xe7, 0x06, 0x25, 0x44, 0x63, 0x82, 0xa1,
4043                         0xc0, 0xdf, 0xfe, 0x1d, 0x3c, 0x5b, 0x7a, 0x99,
4044                         0xb8, 0xd7, 0xf6, 0x15, 0x34, 0x53, 0x72, 0x91,
4045                         0xb0, 0xcf, 0xee, 0x0d, 0x2c, 0x4b, 0x6a, 0x89,
4046                         0xa8, 0xc7, 0xe6, 0x05, 0x24, 0x43, 0x62, 0x81,
4047                         0xa0, 0xbf, 0xde, 0xfd, 0x1c, 0x3b, 0x5a, 0x79,
4048                         0x98, 0xb7, 0xd6, 0xf5, 0x14, 0x33, 0x52, 0x71,
4049                         0x90, 0xaf, 0xce, 0xed, 0x0c, 0x2b, 0x4a, 0x69,
4050                         0x88, 0xa7, 0xc6, 0xe5, 0x04, 0x23, 0x42, 0x61,
4051                         0x80, 0x9f, 0xbe, 0xdd, 0xfc, 0x1b, 0x3a, 0x59,
4052                         0x78, 0x97, 0xb6, 0xd5, 0xf4, 0x13, 0x32, 0x51,
4053                         0x70, 0x8f, 0xae, 0xcd, 0xec, 0x0b, 0x2a, 0x49,
4054                         0x68, 0x87, 0xa6, 0xc5, 0xe4, 0x03, 0x22, 0x41,
4055                         0x60, 0x7f, 0x9e, 0xbd, 0xdc, 0xfb, 0x1a, 0x39,
4056                         0x58, 0x77, 0x96, 0xb5, 0xd4, 0xf3, 0x12, 0x31,
4057                         0x50, 0x6f, 0x8e, 0xad, 0xcc, 0xeb, 0x0a, 0x29,
4058                         0x48, 0x67, 0x86, 0xa5, 0xc4, 0xe3, 0x02, 0x21,
4059                         0x40, 0x5f, 0x7e, 0x9d, 0xbc, 0xdb, 0xfa, 0x19,
4060                         0x38, 0x57, 0x76, 0x95, 0xb4, 0xd3, 0xf2, 0x11,
4061                         0x30, 0x4f, 0x6e, 0x8d, 0xac, 0xcb, 0xea, 0x09,
4062                         0x28, 0x47, 0x66, 0x85, 0xa4, 0xc3, 0xe2, 0x01,
4063                         0x20, 0x3f, 0x5e, 0x7d, 0x9c, 0xbb, 0xda, 0xf9,
4064                         0x18, 0x37, 0x56, 0x75, 0x94, 0xb3, 0xd2, 0xf1,
4065                         0x10, 0x2f, 0x4e, 0x6d, 0x8c, 0xab, 0xca, 0xe9,
4066                         0x08, 0x27, 0x46, 0x65, 0x84, 0xa3, 0xc2, 0xe1,
4067                         0x00, 0x21, 0x42, 0x63,
4068                 },
4069                 .ilen = 4100,
4070                 .result = {
4071                         0xf0, 0x5c, 0x74, 0xad, 0x4e, 0xbc, 0x99, 0xe2,
4072                         0xae, 0xff, 0x91, 0x3a, 0x44, 0xcf, 0x38, 0x32,
4073                         0x1e, 0xad, 0xa7, 0xcd, 0xa1, 0x39, 0x95, 0xaa,
4074                         0x10, 0xb1, 0xb3, 0x2e, 0x04, 0x31, 0x8f, 0x86,
4075                         0xf2, 0x62, 0x74, 0x70, 0x0c, 0xa4, 0x46, 0x08,
4076                         0xa8, 0xb7, 0x99, 0xa8, 0xe9, 0xd2, 0x73, 0x79,
4077                         0x7e, 0x6e, 0xd4, 0x8f, 0x1e, 0xc7, 0x8e, 0x31,
4078                         0x0b, 0xfa, 0x4b, 0xce, 0xfd, 0xf3, 0x57, 0x71,
4079                         0xe9, 0x46, 0x03, 0xa5, 0x3d, 0x34, 0x00, 0xe2,
4080                         0x18, 0xff, 0x75, 0x6d, 0x06, 0x2d, 0x00, 0xab,
4081                         0xb9, 0x3e, 0x6c, 0x59, 0xc5, 0x84, 0x06, 0xb5,
4082                         0x8b, 0xd0, 0x89, 0x9c, 0x4a, 0x79, 0x16, 0xc6,
4083                         0x3d, 0x74, 0x54, 0xfa, 0x44, 0xcd, 0x23, 0x26,
4084                         0x5c, 0xcf, 0x7e, 0x28, 0x92, 0x32, 0xbf, 0xdf,
4085                         0xa7, 0x20, 0x3c, 0x74, 0x58, 0x2a, 0x9a, 0xde,
4086                         0x61, 0x00, 0x1c, 0x4f, 0xff, 0x59, 0xc4, 0x22,
4087                         0xac, 0x3c, 0xd0, 0xe8, 0x6c, 0xf9, 0x97, 0x1b,
4088                         0x58, 0x9b, 0xad, 0x71, 0xe8, 0xa9, 0xb5, 0x0d,
4089                         0xee, 0x2f, 0x04, 0x1f, 0x7f, 0xbc, 0x99, 0xee,
4090                         0x84, 0xff, 0x42, 0x60, 0xdc, 0x3a, 0x18, 0xa5,
4091                         0x81, 0xf9, 0xef, 0xdc, 0x7a, 0x0f, 0x65, 0x41,
4092                         0x2f, 0xa3, 0xd3, 0xf9, 0xc2, 0xcb, 0xc0, 0x4d,
4093                         0x8f, 0xd3, 0x76, 0x96, 0xad, 0x49, 0x6d, 0x38,
4094                         0x3d, 0x39, 0x0b, 0x6c, 0x80, 0xb7, 0x54, 0x69,
4095                         0xf0, 0x2c, 0x90, 0x02, 0x29, 0x0d, 0x1c, 0x12,
4096                         0xad, 0x55, 0xc3, 0x8b, 0x68, 0xd9, 0xcc, 0xb3,
4097                         0xb2, 0x64, 0x33, 0x90, 0x5e, 0xca, 0x4b, 0xe2,
4098                         0xfb, 0x75, 0xdc, 0x63, 0xf7, 0x9f, 0x82, 0x74,
4099                         0xf0, 0xc9, 0xaa, 0x7f, 0xe9, 0x2a, 0x9b, 0x33,
4100                         0xbc, 0x88, 0x00, 0x7f, 0xca, 0xb2, 0x1f, 0x14,
4101                         0xdb, 0xc5, 0x8e, 0x7b, 0x11, 0x3c, 0x3e, 0x08,
4102                         0xf3, 0x83, 0xe8, 0xe0, 0x94, 0x86, 0x2e, 0x92,
4103                         0x78, 0x6b, 0x01, 0xc9, 0xc7, 0x83, 0xba, 0x21,
4104                         0x6a, 0x25, 0x15, 0x33, 0x4e, 0x45, 0x08, 0xec,
4105                         0x35, 0xdb, 0xe0, 0x6e, 0x31, 0x51, 0x79, 0xa9,
4106                         0x42, 0x44, 0x65, 0xc1, 0xa0, 0xf1, 0xf9, 0x2a,
4107                         0x70, 0xd5, 0xb6, 0xc6, 0xc1, 0x8c, 0x39, 0xfc,
4108                         0x25, 0xa6, 0x55, 0xd9, 0xdd, 0x2d, 0x4c, 0xec,
4109                         0x49, 0xc6, 0xeb, 0x0e, 0xa8, 0x25, 0x2a, 0x16,
4110                         0x1b, 0x66, 0x84, 0xda, 0xe2, 0x92, 0xe5, 0xc0,
4111                         0xc8, 0x53, 0x07, 0xaf, 0x80, 0x84, 0xec, 0xfd,
4112                         0xcd, 0xd1, 0x6e, 0xcd, 0x6f, 0x6a, 0xf5, 0x36,
4113                         0xc5, 0x15, 0xe5, 0x25, 0x7d, 0x77, 0xd1, 0x1a,
4114                         0x93, 0x36, 0xa9, 0xcf, 0x7c, 0xa4, 0x54, 0x4a,
4115                         0x06, 0x51, 0x48, 0x4e, 0xf6, 0x59, 0x87, 0xd2,
4116                         0x04, 0x02, 0xef, 0xd3, 0x44, 0xde, 0x76, 0x31,
4117                         0xb3, 0x34, 0x17, 0x1b, 0x9d, 0x66, 0x11, 0x9f,
4118                         0x1e, 0xcc, 0x17, 0xe9, 0xc7, 0x3c, 0x1b, 0xe7,
4119                         0xcb, 0x50, 0x08, 0xfc, 0xdc, 0x2b, 0x24, 0xdb,
4120                         0x65, 0x83, 0xd0, 0x3b, 0xe3, 0x30, 0xea, 0x94,
4121                         0x6c, 0xe7, 0xe8, 0x35, 0x32, 0xc7, 0xdb, 0x64,
4122                         0xb4, 0x01, 0xab, 0x36, 0x2c, 0x77, 0x13, 0xaf,
4123                         0xf8, 0x2b, 0x88, 0x3f, 0x54, 0x39, 0xc4, 0x44,
4124                         0xfe, 0xef, 0x6f, 0x68, 0x34, 0xbe, 0x0f, 0x05,
4125                         0x16, 0x6d, 0xf6, 0x0a, 0x30, 0xe7, 0xe3, 0xed,
4126                         0xc4, 0xde, 0x3c, 0x1b, 0x13, 0xd8, 0xdb, 0xfe,
4127                         0x41, 0x62, 0xe5, 0x28, 0xd4, 0x8d, 0xa3, 0xc7,
4128                         0x93, 0x97, 0xc6, 0x48, 0x45, 0x1d, 0x9f, 0x83,
4129                         0xdf, 0x4b, 0x40, 0x3e, 0x42, 0x25, 0x87, 0x80,
4130                         0x4c, 0x7d, 0xa8, 0xd4, 0x98, 0x23, 0x95, 0x75,
4131                         0x41, 0x8c, 0xda, 0x41, 0x9b, 0xd4, 0xa7, 0x06,
4132                         0xb5, 0xf1, 0x71, 0x09, 0x53, 0xbe, 0xca, 0xbf,
4133                         0x32, 0x03, 0xed, 0xf0, 0x50, 0x1c, 0x56, 0x39,
4134                         0x5b, 0xa4, 0x75, 0x18, 0xf7, 0x9b, 0x58, 0xef,
4135                         0x53, 0xfc, 0x2a, 0x38, 0x23, 0x15, 0x75, 0xcd,
4136                         0x45, 0xe5, 0x5a, 0x82, 0x55, 0xba, 0x21, 0xfa,
4137                         0xd4, 0xbd, 0xc6, 0x94, 0x7c, 0xc5, 0x80, 0x12,
4138                         0xf7, 0x4b, 0x32, 0xc4, 0x9a, 0x82, 0xd8, 0x28,
4139                         0x8f, 0xd9, 0xc2, 0x0f, 0x60, 0x03, 0xbe, 0x5e,
4140                         0x21, 0xd6, 0x5f, 0x58, 0xbf, 0x5c, 0xb1, 0x32,
4141                         0x82, 0x8d, 0xa9, 0xe5, 0xf2, 0x66, 0x1a, 0xc0,
4142                         0xa0, 0xbc, 0x58, 0x2f, 0x71, 0xf5, 0x2f, 0xed,
4143                         0xd1, 0x26, 0xb9, 0xd8, 0x49, 0x5a, 0x07, 0x19,
4144                         0x01, 0x7c, 0x59, 0xb0, 0xf8, 0xa4, 0xb7, 0xd3,
4145                         0x7b, 0x1a, 0x8c, 0x38, 0xf4, 0x50, 0xa4, 0x59,
4146                         0xb0, 0xcc, 0x41, 0x0b, 0x88, 0x7f, 0xe5, 0x31,
4147                         0xb3, 0x42, 0xba, 0xa2, 0x7e, 0xd4, 0x32, 0x71,
4148                         0x45, 0x87, 0x48, 0xa9, 0xc2, 0xf2, 0x89, 0xb3,
4149                         0xe4, 0xa7, 0x7e, 0x52, 0x15, 0x61, 0xfa, 0xfe,
4150                         0xc9, 0xdd, 0x81, 0xeb, 0x13, 0xab, 0xab, 0xc3,
4151                         0x98, 0x59, 0xd8, 0x16, 0x3d, 0x14, 0x7a, 0x1c,
4152                         0x3c, 0x41, 0x9a, 0x16, 0x16, 0x9b, 0xd2, 0xd2,
4153                         0x69, 0x3a, 0x29, 0x23, 0xac, 0x86, 0x32, 0xa5,
4154                         0x48, 0x9c, 0x9e, 0xf3, 0x47, 0x77, 0x81, 0x70,
4155                         0x24, 0xe8, 0x85, 0xd2, 0xf5, 0xb5, 0xfa, 0xff,
4156                         0x59, 0x6a, 0xd3, 0x50, 0x59, 0x43, 0x59, 0xde,
4157                         0xd9, 0xf1, 0x55, 0xa5, 0x0c, 0xc3, 0x1a, 0x1a,
4158                         0x18, 0x34, 0x0d, 0x1a, 0x63, 0x33, 0xed, 0x10,
4159                         0xe0, 0x1d, 0x2a, 0x18, 0xd2, 0xc0, 0x54, 0xa8,
4160                         0xca, 0xb5, 0x9a, 0xd3, 0xdd, 0xca, 0x45, 0x84,
4161                         0x50, 0xe7, 0x0f, 0xfe, 0xa4, 0x99, 0x5a, 0xbe,
4162                         0x43, 0x2d, 0x9a, 0xcb, 0x92, 0x3f, 0x5a, 0x1d,
4163                         0x85, 0xd8, 0xc9, 0xdf, 0x68, 0xc9, 0x12, 0x80,
4164                         0x56, 0x0c, 0xdc, 0x00, 0xdc, 0x3a, 0x7d, 0x9d,
4165                         0xa3, 0xa2, 0xe8, 0x4d, 0xbf, 0xf9, 0x70, 0xa0,
4166                         0xa4, 0x13, 0x4f, 0x6b, 0xaf, 0x0a, 0x89, 0x7f,
4167                         0xda, 0xf0, 0xbf, 0x9b, 0xc8, 0x1d, 0xe5, 0xf8,
4168                         0x2e, 0x8b, 0x07, 0xb5, 0x73, 0x1b, 0xcc, 0xa2,
4169                         0xa6, 0xad, 0x30, 0xbc, 0x78, 0x3c, 0x5b, 0x10,
4170                         0xfa, 0x5e, 0x62, 0x2d, 0x9e, 0x64, 0xb3, 0x33,
4171                         0xce, 0xf9, 0x1f, 0x86, 0xe7, 0x8b, 0xa2, 0xb8,
4172                         0xe8, 0x99, 0x57, 0x8c, 0x11, 0xed, 0x66, 0xd9,
4173                         0x3c, 0x72, 0xb9, 0xc3, 0xe6, 0x4e, 0x17, 0x3a,
4174                         0x6a, 0xcb, 0x42, 0x24, 0x06, 0xed, 0x3e, 0x4e,
4175                         0xa3, 0xe8, 0x6a, 0x94, 0xda, 0x0d, 0x4e, 0xd5,
4176                         0x14, 0x19, 0xcf, 0xb6, 0x26, 0xd8, 0x2e, 0xcc,
4177                         0x64, 0x76, 0x38, 0x49, 0x4d, 0xfe, 0x30, 0x6d,
4178                         0xe4, 0xc8, 0x8c, 0x7b, 0xc4, 0xe0, 0x35, 0xba,
4179                         0x22, 0x6e, 0x76, 0xe1, 0x1a, 0xf2, 0x53, 0xc3,
4180                         0x28, 0xa2, 0x82, 0x1f, 0x61, 0x69, 0xad, 0xc1,
4181                         0x7b, 0x28, 0x4b, 0x1e, 0x6c, 0x85, 0x95, 0x9b,
4182                         0x51, 0xb5, 0x17, 0x7f, 0x12, 0x69, 0x8c, 0x24,
4183                         0xd5, 0xc7, 0x5a, 0x5a, 0x11, 0x54, 0xff, 0x5a,
4184                         0xf7, 0x16, 0xc3, 0x91, 0xa6, 0xf0, 0xdc, 0x0a,
4185                         0xb6, 0xa7, 0x4a, 0x0d, 0x7a, 0x58, 0xfe, 0xa5,
4186                         0xf5, 0xcb, 0x8f, 0x7b, 0x0e, 0xea, 0x57, 0xe7,
4187                         0xbd, 0x79, 0xd6, 0x1c, 0x88, 0x23, 0x6c, 0xf2,
4188                         0x4d, 0x29, 0x77, 0x53, 0x35, 0x6a, 0x00, 0x8d,
4189                         0xcd, 0xa3, 0x58, 0xbe, 0x77, 0x99, 0x18, 0xf8,
4190                         0xe6, 0xe1, 0x8f, 0xe9, 0x37, 0x8f, 0xe3, 0xe2,
4191                         0x5a, 0x8a, 0x93, 0x25, 0xaf, 0xf3, 0x78, 0x80,
4192                         0xbe, 0xa6, 0x1b, 0xc6, 0xac, 0x8b, 0x1c, 0x91,
4193                         0x58, 0xe1, 0x9f, 0x89, 0x35, 0x9d, 0x1d, 0x21,
4194                         0x29, 0x9f, 0xf4, 0x99, 0x02, 0x27, 0x0f, 0xa8,
4195                         0x4f, 0x79, 0x94, 0x2b, 0x33, 0x2c, 0xda, 0xa2,
4196                         0x26, 0x39, 0x83, 0x94, 0xef, 0x27, 0xd8, 0x53,
4197                         0x8f, 0x66, 0x0d, 0xe4, 0x41, 0x7d, 0x34, 0xcd,
4198                         0x43, 0x7c, 0x95, 0x0a, 0x53, 0xef, 0x66, 0xda,
4199                         0x7e, 0x9b, 0xf3, 0x93, 0xaf, 0xd0, 0x73, 0x71,
4200                         0xba, 0x40, 0x9b, 0x74, 0xf8, 0xd7, 0xd7, 0x41,
4201                         0x6d, 0xaf, 0x72, 0x9c, 0x8d, 0x21, 0x87, 0x3c,
4202                         0xfd, 0x0a, 0x90, 0xa9, 0x47, 0x96, 0x9e, 0xd3,
4203                         0x88, 0xee, 0x73, 0xcf, 0x66, 0x2f, 0x52, 0x56,
4204                         0x6d, 0xa9, 0x80, 0x4c, 0xe2, 0x6f, 0x62, 0x88,
4205                         0x3f, 0x0e, 0x54, 0x17, 0x48, 0x80, 0x5d, 0xd3,
4206                         0xc3, 0xda, 0x25, 0x3d, 0xa1, 0xc8, 0xcb, 0x9f,
4207                         0x9b, 0x70, 0xb3, 0xa1, 0xeb, 0x04, 0x52, 0xa1,
4208                         0xf2, 0x22, 0x0f, 0xfc, 0xc8, 0x18, 0xfa, 0xf9,
4209                         0x85, 0x9c, 0xf1, 0xac, 0xeb, 0x0c, 0x02, 0x46,
4210                         0x75, 0xd2, 0xf5, 0x2c, 0xe3, 0xd2, 0x59, 0x94,
4211                         0x12, 0xf3, 0x3c, 0xfc, 0xd7, 0x92, 0xfa, 0x36,
4212                         0xba, 0x61, 0x34, 0x38, 0x7c, 0xda, 0x48, 0x3e,
4213                         0x08, 0xc9, 0x39, 0x23, 0x5e, 0x02, 0x2c, 0x1a,
4214                         0x18, 0x7e, 0xb4, 0xd9, 0xfd, 0x9e, 0x40, 0x02,
4215                         0xb1, 0x33, 0x37, 0x32, 0xe7, 0xde, 0xd6, 0xd0,
4216                         0x7c, 0x58, 0x65, 0x4b, 0xf8, 0x34, 0x27, 0x9c,
4217                         0x44, 0xb4, 0xbd, 0xe9, 0xe9, 0x4c, 0x78, 0x7d,
4218                         0x4b, 0x9f, 0xce, 0xb1, 0xcd, 0x47, 0xa5, 0x37,
4219                         0xe5, 0x6d, 0xbd, 0xb9, 0x43, 0x94, 0x0a, 0xd4,
4220                         0xd6, 0xf9, 0x04, 0x5f, 0xb5, 0x66, 0x6c, 0x1a,
4221                         0x35, 0x12, 0xe3, 0x36, 0x28, 0x27, 0x36, 0x58,
4222                         0x01, 0x2b, 0x79, 0xe4, 0xba, 0x6d, 0x10, 0x7d,
4223                         0x65, 0xdf, 0x84, 0x95, 0xf4, 0xd5, 0xb6, 0x8f,
4224                         0x2b, 0x9f, 0x96, 0x00, 0x86, 0x60, 0xf0, 0x21,
4225                         0x76, 0xa8, 0x6a, 0x8c, 0x28, 0x1c, 0xb3, 0x6b,
4226                         0x97, 0xd7, 0xb6, 0x53, 0x2a, 0xcc, 0xab, 0x40,
4227                         0x9d, 0x62, 0x79, 0x58, 0x52, 0xe6, 0x65, 0xb7,
4228                         0xab, 0x55, 0x67, 0x9c, 0x89, 0x7c, 0x03, 0xb0,
4229                         0x73, 0x59, 0xc5, 0x81, 0xf5, 0x18, 0x17, 0x5c,
4230                         0x89, 0xf3, 0x78, 0x35, 0x44, 0x62, 0x78, 0x72,
4231                         0xd0, 0x96, 0xeb, 0x31, 0xe7, 0x87, 0x77, 0x14,
4232                         0x99, 0x51, 0xf2, 0x59, 0x26, 0x9e, 0xb5, 0xa6,
4233                         0x45, 0xfe, 0x6e, 0xbd, 0x07, 0x4c, 0x94, 0x5a,
4234                         0xa5, 0x7d, 0xfc, 0xf1, 0x2b, 0x77, 0xe2, 0xfe,
4235                         0x17, 0xd4, 0x84, 0xa0, 0xac, 0xb5, 0xc7, 0xda,
4236                         0xa9, 0x1a, 0xb6, 0xf3, 0x74, 0x11, 0xb4, 0x9d,
4237                         0xfb, 0x79, 0x2e, 0x04, 0x2d, 0x50, 0x28, 0x83,
4238                         0xbf, 0xc6, 0x52, 0xd3, 0x34, 0xd6, 0xe8, 0x7a,
4239                         0xb6, 0xea, 0xe7, 0xa8, 0x6c, 0x15, 0x1e, 0x2c,
4240                         0x57, 0xbc, 0x48, 0x4e, 0x5f, 0x5c, 0xb6, 0x92,
4241                         0xd2, 0x49, 0x77, 0x81, 0x6d, 0x90, 0x70, 0xae,
4242                         0x98, 0xa1, 0x03, 0x0d, 0x6b, 0xb9, 0x77, 0x14,
4243                         0xf1, 0x4e, 0x23, 0xd3, 0xf8, 0x68, 0xbd, 0xc2,
4244                         0xfe, 0x04, 0xb7, 0x5c, 0xc5, 0x17, 0x60, 0x8f,
4245                         0x65, 0x54, 0xa4, 0x7a, 0x42, 0xdc, 0x18, 0x0d,
4246                         0xb5, 0xcf, 0x0f, 0xd3, 0xc7, 0x91, 0x66, 0x1b,
4247                         0x45, 0x42, 0x27, 0x75, 0x50, 0xe5, 0xee, 0xb8,
4248                         0x7f, 0x33, 0x2c, 0xba, 0x4a, 0x92, 0x4d, 0x2c,
4249                         0x3c, 0xe3, 0x0d, 0x80, 0x01, 0xba, 0x0d, 0x29,
4250                         0xd8, 0x3c, 0xe9, 0x13, 0x16, 0x57, 0xe6, 0xea,
4251                         0x94, 0x52, 0xe7, 0x00, 0x4d, 0x30, 0xb0, 0x0f,
4252                         0x35, 0xb8, 0xb8, 0xa7, 0xb1, 0xb5, 0x3b, 0x44,
4253                         0xe1, 0x2f, 0xfd, 0x88, 0xed, 0x43, 0xe7, 0x52,
4254                         0x10, 0x93, 0xb3, 0x8a, 0x30, 0x6b, 0x0a, 0xf7,
4255                         0x23, 0xc6, 0x50, 0x9d, 0x4a, 0xb0, 0xde, 0xc3,
4256                         0xdc, 0x9b, 0x2f, 0x01, 0x56, 0x36, 0x09, 0xc5,
4257                         0x2f, 0x6b, 0xfe, 0xf1, 0xd8, 0x27, 0x45, 0x03,
4258                         0x30, 0x5e, 0x5c, 0x5b, 0xb4, 0x62, 0x0e, 0x1a,
4259                         0xa9, 0x21, 0x2b, 0x92, 0x94, 0x87, 0x62, 0x57,
4260                         0x4c, 0x10, 0x74, 0x1a, 0xf1, 0x0a, 0xc5, 0x84,
4261                         0x3b, 0x9e, 0x72, 0x02, 0xd7, 0xcc, 0x09, 0x56,
4262                         0xbd, 0x54, 0xc1, 0xf0, 0xc3, 0xe3, 0xb3, 0xf8,
4263                         0xd2, 0x0d, 0x61, 0xcb, 0xef, 0xce, 0x0d, 0x05,
4264                         0xb0, 0x98, 0xd9, 0x8e, 0x4f, 0xf9, 0xbc, 0x93,
4265                         0xa6, 0xea, 0xc8, 0xcf, 0x10, 0x53, 0x4b, 0xf1,
4266                         0xec, 0xfc, 0x89, 0xf9, 0x64, 0xb0, 0x22, 0xbf,
4267                         0x9e, 0x55, 0x46, 0x9f, 0x7c, 0x50, 0x8e, 0x84,
4268                         0x54, 0x20, 0x98, 0xd7, 0x6c, 0x40, 0x1e, 0xdb,
4269                         0x69, 0x34, 0x78, 0x61, 0x24, 0x21, 0x9c, 0x8a,
4270                         0xb3, 0x62, 0x31, 0x8b, 0x6e, 0xf5, 0x2a, 0x35,
4271                         0x86, 0x13, 0xb1, 0x6c, 0x64, 0x2e, 0x41, 0xa5,
4272                         0x05, 0xf2, 0x42, 0xba, 0xd2, 0x3a, 0x0d, 0x8e,
4273                         0x8a, 0x59, 0x94, 0x3c, 0xcf, 0x36, 0x27, 0x82,
4274                         0xc2, 0x45, 0xee, 0x58, 0xcd, 0x88, 0xb4, 0xec,
4275                         0xde, 0xb2, 0x96, 0x0a, 0xaf, 0x38, 0x6f, 0x88,
4276                         0xd7, 0xd8, 0xe1, 0xdf, 0xb9, 0x96, 0xa9, 0x0a,
4277                         0xb1, 0x95, 0x28, 0x86, 0x20, 0xe9, 0x17, 0x49,
4278                         0xa2, 0x29, 0x38, 0xaa, 0xa5, 0xe9, 0x6e, 0xf1,
4279                         0x19, 0x27, 0xc0, 0xd5, 0x2a, 0x22, 0xc3, 0x0b,
4280                         0xdb, 0x7c, 0x73, 0x10, 0xb9, 0xba, 0x89, 0x76,
4281                         0x54, 0xae, 0x7d, 0x71, 0xb3, 0x93, 0xf6, 0x32,
4282                         0xe6, 0x47, 0x43, 0x55, 0xac, 0xa0, 0x0d, 0xc2,
4283                         0x93, 0x27, 0x4a, 0x8e, 0x0e, 0x74, 0x15, 0xc7,
4284                         0x0b, 0x85, 0xd9, 0x0c, 0xa9, 0x30, 0x7a, 0x3e,
4285                         0xea, 0x8f, 0x85, 0x6d, 0x3a, 0x12, 0x4f, 0x72,
4286                         0x69, 0x58, 0x7a, 0x80, 0xbb, 0xb5, 0x97, 0xf3,
4287                         0xcf, 0x70, 0xd2, 0x5d, 0xdd, 0x4d, 0x21, 0x79,
4288                         0x54, 0x4d, 0xe4, 0x05, 0xe8, 0xbd, 0xc2, 0x62,
4289                         0xb1, 0x3b, 0x77, 0x1c, 0xd6, 0x5c, 0xf3, 0xa0,
4290                         0x79, 0x00, 0xa8, 0x6c, 0x29, 0xd9, 0x18, 0x24,
4291                         0x36, 0xa2, 0x46, 0xc0, 0x96, 0x65, 0x7f, 0xbd,
4292                         0x2a, 0xed, 0x36, 0x16, 0x0c, 0xaa, 0x9f, 0xf4,
4293                         0xc5, 0xb4, 0xe2, 0x12, 0xed, 0x69, 0xed, 0x4f,
4294                         0x26, 0x2c, 0x39, 0x52, 0x89, 0x98, 0xe7, 0x2c,
4295                         0x99, 0xa4, 0x9e, 0xa3, 0x9b, 0x99, 0x46, 0x7a,
4296                         0x3a, 0xdc, 0xa8, 0x59, 0xa3, 0xdb, 0xc3, 0x3b,
4297                         0x95, 0x0d, 0x3b, 0x09, 0x6e, 0xee, 0x83, 0x5d,
4298                         0x32, 0x4d, 0xed, 0xab, 0xfa, 0x98, 0x14, 0x4e,
4299                         0xc3, 0x15, 0x45, 0x53, 0x61, 0xc4, 0x93, 0xbd,
4300                         0x90, 0xf4, 0x99, 0x95, 0x4c, 0xe6, 0x76, 0x92,
4301                         0x29, 0x90, 0x46, 0x30, 0x92, 0x69, 0x7d, 0x13,
4302                         0xf2, 0xa5, 0xcd, 0x69, 0x49, 0x44, 0xb2, 0x0f,
4303                         0x63, 0x40, 0x36, 0x5f, 0x09, 0xe2, 0x78, 0xf8,
4304                         0x91, 0xe3, 0xe2, 0xfa, 0x10, 0xf7, 0xc8, 0x24,
4305                         0xa8, 0x89, 0x32, 0x5c, 0x37, 0x25, 0x1d, 0xb2,
4306                         0xea, 0x17, 0x8a, 0x0a, 0xa9, 0x64, 0xc3, 0x7c,
4307                         0x3c, 0x7c, 0xbd, 0xc6, 0x79, 0x34, 0xe7, 0xe2,
4308                         0x85, 0x8e, 0xbf, 0xf8, 0xde, 0x92, 0xa0, 0xae,
4309                         0x20, 0xc4, 0xf6, 0xbb, 0x1f, 0x38, 0x19, 0x0e,
4310                         0xe8, 0x79, 0x9c, 0xa1, 0x23, 0xe9, 0x54, 0x7e,
4311                         0x37, 0x2f, 0xe2, 0x94, 0x32, 0xaf, 0xa0, 0x23,
4312                         0x49, 0xe4, 0xc0, 0xb3, 0xac, 0x00, 0x8f, 0x36,
4313                         0x05, 0xc4, 0xa6, 0x96, 0xec, 0x05, 0x98, 0x4f,
4314                         0x96, 0x67, 0x57, 0x1f, 0x20, 0x86, 0x1b, 0x2d,
4315                         0x69, 0xe4, 0x29, 0x93, 0x66, 0x5f, 0xaf, 0x6b,
4316                         0x88, 0x26, 0x2c, 0x67, 0x02, 0x4b, 0x52, 0xd0,
4317                         0x83, 0x7a, 0x43, 0x1f, 0xc0, 0x71, 0x15, 0x25,
4318                         0x77, 0x65, 0x08, 0x60, 0x11, 0x76, 0x4c, 0x8d,
4319                         0xed, 0xa9, 0x27, 0xc6, 0xb1, 0x2a, 0x2c, 0x6a,
4320                         0x4a, 0x97, 0xf5, 0xc6, 0xb7, 0x70, 0x42, 0xd3,
4321                         0x03, 0xd1, 0x24, 0x95, 0xec, 0x6d, 0xab, 0x38,
4322                         0x72, 0xce, 0xe2, 0x8b, 0x33, 0xd7, 0x51, 0x09,
4323                         0xdc, 0x45, 0xe0, 0x09, 0x96, 0x32, 0xf3, 0xc4,
4324                         0x84, 0xdc, 0x73, 0x73, 0x2d, 0x1b, 0x11, 0x98,
4325                         0xc5, 0x0e, 0x69, 0x28, 0x94, 0xc7, 0xb5, 0x4d,
4326                         0xc8, 0x8a, 0xd0, 0xaa, 0x13, 0x2e, 0x18, 0x74,
4327                         0xdd, 0xd1, 0x1e, 0xf3, 0x90, 0xe8, 0xfc, 0x9a,
4328                         0x72, 0x4a, 0x0e, 0xd1, 0xe4, 0xfb, 0x0d, 0x96,
4329                         0xd1, 0x0c, 0x79, 0x85, 0x1b, 0x1c, 0xfe, 0xe1,
4330                         0x62, 0x8f, 0x7a, 0x73, 0x32, 0xab, 0xc8, 0x18,
4331                         0x69, 0xe3, 0x34, 0x30, 0xdf, 0x13, 0xa6, 0xe5,
4332                         0xe8, 0x0e, 0x67, 0x7f, 0x81, 0x11, 0xb4, 0x60,
4333                         0xc7, 0xbd, 0x79, 0x65, 0x50, 0xdc, 0xc4, 0x5b,
4334                         0xde, 0x39, 0xa4, 0x01, 0x72, 0x63, 0xf3, 0xd1,
4335                         0x64, 0x4e, 0xdf, 0xfc, 0x27, 0x92, 0x37, 0x0d,
4336                         0x57, 0xcd, 0x11, 0x4f, 0x11, 0x04, 0x8e, 0x1d,
4337                         0x16, 0xf7, 0xcd, 0x92, 0x9a, 0x99, 0x30, 0x14,
4338                         0xf1, 0x7c, 0x67, 0x1b, 0x1f, 0x41, 0x0b, 0xe8,
4339                         0x32, 0xe8, 0xb8, 0xc1, 0x4f, 0x54, 0x86, 0x4f,
4340                         0xe5, 0x79, 0x81, 0x73, 0xcd, 0x43, 0x59, 0x68,
4341                         0x73, 0x02, 0x3b, 0x78, 0x21, 0x72, 0x43, 0x00,
4342                         0x49, 0x17, 0xf7, 0x00, 0xaf, 0x68, 0x24, 0x53,
4343                         0x05, 0x0a, 0xc3, 0x33, 0xe0, 0x33, 0x3f, 0x69,
4344                         0xd2, 0x84, 0x2f, 0x0b, 0xed, 0xde, 0x04, 0xf4,
4345                         0x11, 0x94, 0x13, 0x69, 0x51, 0x09, 0x28, 0xde,
4346                         0x57, 0x5c, 0xef, 0xdc, 0x9a, 0x49, 0x1c, 0x17,
4347                         0x97, 0xf3, 0x96, 0xc1, 0x7f, 0x5d, 0x2e, 0x7d,
4348                         0x55, 0xb8, 0xb3, 0x02, 0x09, 0xb3, 0x1f, 0xe7,
4349                         0xc9, 0x8d, 0xa3, 0x36, 0x34, 0x8a, 0x77, 0x13,
4350                         0x30, 0x63, 0x4c, 0xa5, 0xcd, 0xc3, 0xe0, 0x7e,
4351                         0x05, 0xa1, 0x7b, 0x0c, 0xcb, 0x74, 0x47, 0x31,
4352                         0x62, 0x03, 0x43, 0xf1, 0x87, 0xb4, 0xb0, 0x85,
4353                         0x87, 0x8e, 0x4b, 0x25, 0xc7, 0xcf, 0xae, 0x4b,
4354                         0x36, 0x46, 0x3e, 0x62, 0xbc, 0x6f, 0xeb, 0x5f,
4355                         0x73, 0xac, 0xe6, 0x07, 0xee, 0xc1, 0xa1, 0xd6,
4356                         0xc4, 0xab, 0xc9, 0xd6, 0x89, 0x45, 0xe1, 0xf1,
4357                         0x04, 0x4e, 0x1a, 0x6f, 0xbb, 0x4f, 0x3a, 0xa3,
4358                         0xa0, 0xcb, 0xa3, 0x0a, 0xd8, 0x71, 0x35, 0x55,
4359                         0xe4, 0xbc, 0x2e, 0x04, 0x06, 0xe6, 0xff, 0x5b,
4360                         0x1c, 0xc0, 0x11, 0x7c, 0xc5, 0x17, 0xf3, 0x38,
4361                         0xcf, 0xe9, 0xba, 0x0f, 0x0e, 0xef, 0x02, 0xc2,
4362                         0x8d, 0xc6, 0xbc, 0x4b, 0x67, 0x20, 0x95, 0xd7,
4363                         0x2c, 0x45, 0x5b, 0x86, 0x44, 0x8c, 0x6f, 0x2e,
4364                         0x7e, 0x9f, 0x1c, 0x77, 0xba, 0x6b, 0x0e, 0xa3,
4365                         0x69, 0xdc, 0xab, 0x24, 0x57, 0x60, 0x47, 0xc1,
4366                         0xd1, 0xa5, 0x9d, 0x23, 0xe6, 0xb1, 0x37, 0xfe,
4367                         0x93, 0xd2, 0x4c, 0x46, 0xf9, 0x0c, 0xc6, 0xfb,
4368                         0xd6, 0x9d, 0x99, 0x69, 0xab, 0x7a, 0x07, 0x0c,
4369                         0x65, 0xe7, 0xc4, 0x08, 0x96, 0xe2, 0xa5, 0x01,
4370                         0x3f, 0x46, 0x07, 0x05, 0x7e, 0xe8, 0x9a, 0x90,
4371                         0x50, 0xdc, 0xe9, 0x7a, 0xea, 0xa1, 0x39, 0x6e,
4372                         0x66, 0xe4, 0x6f, 0xa5, 0x5f, 0xb2, 0xd9, 0x5b,
4373                         0xf5, 0xdb, 0x2a, 0x32, 0xf0, 0x11, 0x6f, 0x7c,
4374                         0x26, 0x10, 0x8f, 0x3d, 0x80, 0xe9, 0x58, 0xf7,
4375                         0xe0, 0xa8, 0x57, 0xf8, 0xdb, 0x0e, 0xce, 0x99,
4376                         0x63, 0x19, 0x3d, 0xd5, 0xec, 0x1b, 0x77, 0x69,
4377                         0x98, 0xf6, 0xe4, 0x5f, 0x67, 0x17, 0x4b, 0x09,
4378                         0x85, 0x62, 0x82, 0x70, 0x18, 0xe2, 0x9a, 0x78,
4379                         0xe2, 0x62, 0xbd, 0xb4, 0xf1, 0x42, 0xc6, 0xfb,
4380                         0x08, 0xd0, 0xbd, 0xeb, 0x4e, 0x09, 0xf2, 0xc8,
4381                         0x1e, 0xdc, 0x3d, 0x32, 0x21, 0x56, 0x9c, 0x4f,
4382                         0x35, 0xf3, 0x61, 0x06, 0x72, 0x84, 0xc4, 0x32,
4383                         0xf2, 0xf1, 0xfa, 0x0b, 0x2f, 0xc3, 0xdb, 0x02,
4384                         0x04, 0xc2, 0xde, 0x57, 0x64, 0x60, 0x8d, 0xcf,
4385                         0xcb, 0x86, 0x5d, 0x97, 0x3e, 0xb1, 0x9c, 0x01,
4386                         0xd6, 0x28, 0x8f, 0x99, 0xbc, 0x46, 0xeb, 0x05,
4387                         0xaf, 0x7e, 0xb8, 0x21, 0x2a, 0x56, 0x85, 0x1c,
4388                         0xb3, 0x71, 0xa0, 0xde, 0xca, 0x96, 0xf1, 0x78,
4389                         0x49, 0xa2, 0x99, 0x81, 0x80, 0x5c, 0x01, 0xf5,
4390                         0xa0, 0xa2, 0x56, 0x63, 0xe2, 0x70, 0x07, 0xa5,
4391                         0x95, 0xd6, 0x85, 0xeb, 0x36, 0x9e, 0xa9, 0x51,
4392                         0x66, 0x56, 0x5f, 0x1d, 0x02, 0x19, 0xe2, 0xf6,
4393                         0x4f, 0x73, 0x38, 0x09, 0x75, 0x64, 0x48, 0xe0,
4394                         0xf1, 0x7e, 0x0e, 0xe8, 0x9d, 0xf9, 0xed, 0x94,
4395                         0xfe, 0x16, 0x26, 0x62, 0x49, 0x74, 0xf4, 0xb0,
4396                         0xd4, 0xa9, 0x6c, 0xb0, 0xfd, 0x53, 0xe9, 0x81,
4397                         0xe0, 0x7a, 0xbf, 0xcf, 0xb5, 0xc4, 0x01, 0x81,
4398                         0x79, 0x99, 0x77, 0x01, 0x3b, 0xe9, 0xa2, 0xb6,
4399                         0xe6, 0x6a, 0x8a, 0x9e, 0x56, 0x1c, 0x8d, 0x1e,
4400                         0x8f, 0x06, 0x55, 0x2c, 0x6c, 0xdc, 0x92, 0x87,
4401                         0x64, 0x3b, 0x4b, 0x19, 0xa1, 0x13, 0x64, 0x1d,
4402                         0x4a, 0xe9, 0xc0, 0x00, 0xb8, 0x95, 0xef, 0x6b,
4403                         0x1a, 0x86, 0x6d, 0x37, 0x52, 0x02, 0xc2, 0xe0,
4404                         0xc8, 0xbb, 0x42, 0x0c, 0x02, 0x21, 0x4a, 0xc9,
4405                         0xef, 0xa0, 0x54, 0xe4, 0x5e, 0x16, 0x53, 0x81,
4406                         0x70, 0x62, 0x10, 0xaf, 0xde, 0xb8, 0xb5, 0xd3,
4407                         0xe8, 0x5e, 0x6c, 0xc3, 0x8a, 0x3e, 0x18, 0x07,
4408                         0xf2, 0x2f, 0x7d, 0xa7, 0xe1, 0x3d, 0x4e, 0xb4,
4409                         0x26, 0xa7, 0xa3, 0x93, 0x86, 0xb2, 0x04, 0x1e,
4410                         0x53, 0x5d, 0x86, 0xd6, 0xde, 0x65, 0xca, 0xe3,
4411                         0x4e, 0xc1, 0xcf, 0xef, 0xc8, 0x70, 0x1b, 0x83,
4412                         0x13, 0xdd, 0x18, 0x8b, 0x0d, 0x76, 0xd2, 0xf6,
4413                         0x37, 0x7a, 0x93, 0x7a, 0x50, 0x11, 0x9f, 0x96,
4414                         0x86, 0x25, 0xfd, 0xac, 0xdc, 0xbe, 0x18, 0x93,
4415                         0x19, 0x6b, 0xec, 0x58, 0x4f, 0xb9, 0x75, 0xa7,
4416                         0xdd, 0x3f, 0x2f, 0xec, 0xc8, 0x5a, 0x84, 0xab,
4417                         0xd5, 0xe4, 0x8a, 0x07, 0xf6, 0x4d, 0x23, 0xd6,
4418                         0x03, 0xfb, 0x03, 0x6a, 0xea, 0x66, 0xbf, 0xd4,
4419                         0xb1, 0x34, 0xfb, 0x78, 0xe9, 0x55, 0xdc, 0x7c,
4420                         0x3d, 0x9c, 0xe5, 0x9a, 0xac, 0xc3, 0x7a, 0x80,
4421                         0x24, 0x6d, 0xa0, 0xef, 0x25, 0x7c, 0xb7, 0xea,
4422                         0xce, 0x4d, 0x5f, 0x18, 0x60, 0xce, 0x87, 0x22,
4423                         0x66, 0x2f, 0xd5, 0xdd, 0xdd, 0x02, 0x21, 0x75,
4424                         0x82, 0xa0, 0x1f, 0x58, 0xc6, 0xd3, 0x62, 0xf7,
4425                         0x32, 0xd8, 0xaf, 0x1e, 0x07, 0x77, 0x51, 0x96,
4426                         0xd5, 0x6b, 0x1e, 0x7e, 0x80, 0x02, 0xe8, 0x67,
4427                         0xea, 0x17, 0x0b, 0x10, 0xd2, 0x3f, 0x28, 0x25,
4428                         0x4f, 0x05, 0x77, 0x02, 0x14, 0x69, 0xf0, 0x2c,
4429                         0xbe, 0x0c, 0xf1, 0x74, 0x30, 0xd1, 0xb9, 0x9b,
4430                         0xfc, 0x8c, 0xbb, 0x04, 0x16, 0xd9, 0xba, 0xc3,
4431                         0xbc, 0x91, 0x8a, 0xc4, 0x30, 0xa4, 0xb0, 0x12,
4432                         0x4c, 0x21, 0x87, 0xcb, 0xc9, 0x1d, 0x16, 0x96,
4433                         0x07, 0x6f, 0x23, 0x54, 0xb9, 0x6f, 0x79, 0xe5,
4434                         0x64, 0xc0, 0x64, 0xda, 0xb1, 0xae, 0xdd, 0x60,
4435                         0x6c, 0x1a, 0x9d, 0xd3, 0x04, 0x8e, 0x45, 0xb0,
4436                         0x92, 0x61, 0xd0, 0x48, 0x81, 0xed, 0x5e, 0x1d,
4437                         0xa0, 0xc9, 0xa4, 0x33, 0xc7, 0x13, 0x51, 0x5d,
4438                         0x7f, 0x83, 0x73, 0xb6, 0x70, 0x18, 0x65, 0x3e,
4439                         0x2f, 0x0e, 0x7a, 0x12, 0x39, 0x98, 0xab, 0xd8,
4440                         0x7e, 0x6f, 0xa3, 0xd1, 0xba, 0x56, 0xad, 0xbd,
4441                         0xf0, 0x03, 0x01, 0x1c, 0x85, 0x35, 0x9f, 0xeb,
4442                         0x19, 0x63, 0xa1, 0xaf, 0xfe, 0x2d, 0x35, 0x50,
4443                         0x39, 0xa0, 0x65, 0x7c, 0x95, 0x7e, 0x6b, 0xfe,
4444                         0xc1, 0xac, 0x07, 0x7c, 0x98, 0x4f, 0xbe, 0x57,
4445                         0xa7, 0x22, 0xec, 0xe2, 0x7e, 0x29, 0x09, 0x53,
4446                         0xe8, 0xbf, 0xb4, 0x7e, 0x3f, 0x8f, 0xfc, 0x14,
4447                         0xce, 0x54, 0xf9, 0x18, 0x58, 0xb5, 0xff, 0x44,
4448                         0x05, 0x9d, 0xce, 0x1b, 0xb6, 0x82, 0x23, 0xc8,
4449                         0x2e, 0xbc, 0x69, 0xbb, 0x4a, 0x29, 0x0f, 0x65,
4450                         0x94, 0xf0, 0x63, 0x06, 0x0e, 0xef, 0x8c, 0xbd,
4451                         0xff, 0xfd, 0xb0, 0x21, 0x6e, 0x57, 0x05, 0x75,
4452                         0xda, 0xd5, 0xc4, 0xeb, 0x8d, 0x32, 0xf7, 0x50,
4453                         0xd3, 0x6f, 0x22, 0xed, 0x5f, 0x8e, 0xa2, 0x5b,
4454                         0x80, 0x8c, 0xc8, 0x78, 0x40, 0x24, 0x4b, 0x89,
4455                         0x30, 0xce, 0x7a, 0x97, 0x0e, 0xc4, 0xaf, 0xef,
4456                         0x9b, 0xb4, 0xcd, 0x66, 0x74, 0x14, 0x04, 0x2b,
4457                         0xf7, 0xce, 0x0b, 0x1c, 0x6e, 0xc2, 0x78, 0x8c,
4458                         0xca, 0xc5, 0xd0, 0x1c, 0x95, 0x4a, 0x91, 0x2d,
4459                         0xa7, 0x20, 0xeb, 0x86, 0x52, 0xb7, 0x67, 0xd8,
4460                         0x0c, 0xd6, 0x04, 0x14, 0xde, 0x51, 0x74, 0x75,
4461                         0xe7, 0x11, 0xb4, 0x87, 0xa3, 0x3d, 0x2d, 0xad,
4462                         0x4f, 0xef, 0xa0, 0x0f, 0x70, 0x00, 0x6d, 0x13,
4463                         0x19, 0x1d, 0x41, 0x50, 0xe9, 0xd8, 0xf0, 0x32,
4464                         0x71, 0xbc, 0xd3, 0x11, 0xf2, 0xac, 0xbe, 0xaf,
4465                         0x75, 0x46, 0x65, 0x4e, 0x07, 0x34, 0x37, 0xa3,
4466                         0x89, 0xfe, 0x75, 0xd4, 0x70, 0x4c, 0xc6, 0x3f,
4467                         0x69, 0x24, 0x0e, 0x38, 0x67, 0x43, 0x8c, 0xde,
4468                         0x06, 0xb5, 0xb8, 0xe7, 0xc4, 0xf0, 0x41, 0x8f,
4469                         0xf0, 0xbd, 0x2f, 0x0b, 0xb9, 0x18, 0xf8, 0xde,
4470                         0x64, 0xb1, 0xdb, 0xee, 0x00, 0x50, 0x77, 0xe1,
4471                         0xc7, 0xff, 0xa6, 0xfa, 0xdd, 0x70, 0xf4, 0xe3,
4472                         0x93, 0xe9, 0x77, 0x35, 0x3d, 0x4b, 0x2f, 0x2b,
4473                         0x6d, 0x55, 0xf0, 0xfc, 0x88, 0x54, 0x4e, 0x89,
4474                         0xc1, 0x8a, 0x23, 0x31, 0x2d, 0x14, 0x2a, 0xb8,
4475                         0x1b, 0x15, 0xdd, 0x9e, 0x6e, 0x7b, 0xda, 0x05,
4476                         0x91, 0x7d, 0x62, 0x64, 0x96, 0x72, 0xde, 0xfc,
4477                         0xc1, 0xec, 0xf0, 0x23, 0x51, 0x6f, 0xdb, 0x5b,
4478                         0x1d, 0x08, 0x57, 0xce, 0x09, 0xb8, 0xf6, 0xcd,
4479                         0x8d, 0x95, 0xf2, 0x20, 0xbf, 0x0f, 0x20, 0x57,
4480                         0x98, 0x81, 0x84, 0x4f, 0x15, 0x5c, 0x76, 0xe7,
4481                         0x3e, 0x0a, 0x3a, 0x6c, 0xc4, 0x8a, 0xbe, 0x78,
4482                         0x74, 0x77, 0xc3, 0x09, 0x4b, 0x5d, 0x48, 0xe4,
4483                         0xc8, 0xcb, 0x0b, 0xea, 0x17, 0x28, 0xcf, 0xcf,
4484                         0x31, 0x32, 0x44, 0xa4, 0xe5, 0x0e, 0x1a, 0x98,
4485                         0x94, 0xc4, 0xf0, 0xff, 0xae, 0x3e, 0x44, 0xe8,
4486                         0xa5, 0xb3, 0xb5, 0x37, 0x2f, 0xe8, 0xaf, 0x6f,
4487                         0x28, 0xc1, 0x37, 0x5f, 0x31, 0xd2, 0xb9, 0x33,
4488                         0xb1, 0xb2, 0x52, 0x94, 0x75, 0x2c, 0x29, 0x59,
4489                         0x06, 0xc2, 0x25, 0xe8, 0x71, 0x65, 0x4e, 0xed,
4490                         0xc0, 0x9c, 0xb1, 0xbb, 0x25, 0xdc, 0x6c, 0xe7,
4491                         0x4b, 0xa5, 0x7a, 0x54, 0x7a, 0x60, 0xff, 0x7a,
4492                         0xe0, 0x50, 0x40, 0x96, 0x35, 0x63, 0xe4, 0x0b,
4493                         0x76, 0xbd, 0xa4, 0x65, 0x00, 0x1b, 0x57, 0x88,
4494                         0xae, 0xed, 0x39, 0x88, 0x42, 0x11, 0x3c, 0xed,
4495                         0x85, 0x67, 0x7d, 0xb9, 0x68, 0x82, 0xe9, 0x43,
4496                         0x3c, 0x47, 0x53, 0xfa, 0xe8, 0xf8, 0x9f, 0x1f,
4497                         0x9f, 0xef, 0x0f, 0xf7, 0x30, 0xd9, 0x30, 0x0e,
4498                         0xb9, 0x9f, 0x69, 0x18, 0x2f, 0x7e, 0xf8, 0xf8,
4499                         0xf8, 0x8c, 0x0f, 0xd4, 0x02, 0x4d, 0xea, 0xcd,
4500                         0x0a, 0x9c, 0x6f, 0x71, 0x6d, 0x5a, 0x4c, 0x60,
4501                         0xce, 0x20, 0x56, 0x32, 0xc6, 0xc5, 0x99, 0x1f,
4502                         0x09, 0xe6, 0x4e, 0x18, 0x1a, 0x15, 0x13, 0xa8,
4503                         0x7d, 0xb1, 0x6b, 0xc0, 0xb2, 0x6d, 0xf8, 0x26,
4504                         0x66, 0xf8, 0x3d, 0x18, 0x74, 0x70, 0x66, 0x7a,
4505                         0x34, 0x17, 0xde, 0xba, 0x47, 0xf1, 0x06, 0x18,
4506                         0xcb, 0xaf, 0xeb, 0x4a, 0x1e, 0x8f, 0xa7, 0x77,
4507                         0xe0, 0x3b, 0x78, 0x62, 0x66, 0xc9, 0x10, 0xea,
4508                         0x1f, 0xb7, 0x29, 0x0a, 0x45, 0xa1, 0x1d, 0x1e,
4509                         0x1d, 0xe2, 0x65, 0x61, 0x50, 0x9c, 0xd7, 0x05,
4510                         0xf2, 0x0b, 0x5b, 0x12, 0x61, 0x02, 0xc8, 0xe5,
4511                         0x63, 0x4f, 0x20, 0x0c, 0x07, 0x17, 0x33, 0x5e,
4512                         0x03, 0x9a, 0x53, 0x0f, 0x2e, 0x55, 0xfe, 0x50,
4513                         0x43, 0x7d, 0xd0, 0xb6, 0x7e, 0x5a, 0xda, 0xae,
4514                         0x58, 0xef, 0x15, 0xa9, 0x83, 0xd9, 0x46, 0xb1,
4515                         0x42, 0xaa, 0xf5, 0x02, 0x6c, 0xce, 0x92, 0x06,
4516                         0x1b, 0xdb, 0x66, 0x45, 0x91, 0x79, 0xc2, 0x2d,
4517                         0xe6, 0x53, 0xd3, 0x14, 0xfd, 0xbb, 0x44, 0x63,
4518                         0xc6, 0xd7, 0x3d, 0x7a, 0x0c, 0x75, 0x78, 0x9d,
4519                         0x5c, 0xa6, 0x39, 0xb3, 0xe5, 0x63, 0xca, 0x8b,
4520                         0xfe, 0xd3, 0xef, 0x60, 0x83, 0xf6, 0x8e, 0x70,
4521                         0xb6, 0x67, 0xc7, 0x77, 0xed, 0x23, 0xef, 0x4c,
4522                         0xf0, 0xed, 0x2d, 0x07, 0x59, 0x6f, 0xc1, 0x01,
4523                         0x34, 0x37, 0x08, 0xab, 0xd9, 0x1f, 0x09, 0xb1,
4524                         0xce, 0x5b, 0x17, 0xff, 0x74, 0xf8, 0x9c, 0xd5,
4525                         0x2c, 0x56, 0x39, 0x79, 0x0f, 0x69, 0x44, 0x75,
4526                         0x58, 0x27, 0x01, 0xc4, 0xbf, 0xa7, 0xa1, 0x1d,
4527                         0x90, 0x17, 0x77, 0x86, 0x5a, 0x3f, 0xd9, 0xd1,
4528                         0x0e, 0xa0, 0x10, 0xf8, 0xec, 0x1e, 0xa5, 0x7f,
4529                         0x5e, 0x36, 0xd1, 0xe3, 0x04, 0x2c, 0x70, 0xf7,
4530                         0x8e, 0xc0, 0x98, 0x2f, 0x6c, 0x94, 0x2b, 0x41,
4531                         0xb7, 0x60, 0x00, 0xb7, 0x2e, 0xb8, 0x02, 0x8d,
4532                         0xb8, 0xb0, 0xd3, 0x86, 0xba, 0x1d, 0xd7, 0x90,
4533                         0xd6, 0xb6, 0xe1, 0xfc, 0xd7, 0xd8, 0x28, 0x06,
4534                         0x63, 0x9b, 0xce, 0x61, 0x24, 0x79, 0xc0, 0x70,
4535                         0x52, 0xd0, 0xb6, 0xd4, 0x28, 0x95, 0x24, 0x87,
4536                         0x03, 0x1f, 0xb7, 0x9a, 0xda, 0xa3, 0xfb, 0x52,
4537                         0x5b, 0x68, 0xe7, 0x4c, 0x8c, 0x24, 0xe1, 0x42,
4538                         0xf7, 0xd5, 0xfd, 0xad, 0x06, 0x32, 0x9f, 0xba,
4539                         0xc1, 0xfc, 0xdd, 0xc6, 0xfc, 0xfc, 0xb3, 0x38,
4540                         0x74, 0x56, 0x58, 0x40, 0x02, 0x37, 0x52, 0x2c,
4541                         0x55, 0xcc, 0xb3, 0x9e, 0x7a, 0xe9, 0xd4, 0x38,
4542                         0x41, 0x5e, 0x0c, 0x35, 0xe2, 0x11, 0xd1, 0x13,
4543                         0xf8, 0xb7, 0x8d, 0x72, 0x6b, 0x22, 0x2a, 0xb0,
4544                         0xdb, 0x08, 0xba, 0x35, 0xb9, 0x3f, 0xc8, 0xd3,
4545                         0x24, 0x90, 0xec, 0x58, 0xd2, 0x09, 0xc7, 0x2d,
4546                         0xed, 0x38, 0x80, 0x36, 0x72, 0x43, 0x27, 0x49,
4547                         0x4a, 0x80, 0x8a, 0xa2, 0xe8, 0xd3, 0xda, 0x30,
4548                         0x7d, 0xb6, 0x82, 0x37, 0x86, 0x92, 0x86, 0x3e,
4549                         0x08, 0xb2, 0x28, 0x5a, 0x55, 0x44, 0x24, 0x7d,
4550                         0x40, 0x48, 0x8a, 0xb6, 0x89, 0x58, 0x08, 0xa0,
4551                         0xd6, 0x6d, 0x3a, 0x17, 0xbf, 0xf6, 0x54, 0xa2,
4552                         0xf5, 0xd3, 0x8c, 0x0f, 0x78, 0x12, 0x57, 0x8b,
4553                         0xd5, 0xc2, 0xfd, 0x58, 0x5b, 0x7f, 0x38, 0xe3,
4554                         0xcc, 0xb7, 0x7c, 0x48, 0xb3, 0x20, 0xe8, 0x81,
4555                         0x14, 0x32, 0x45, 0x05, 0xe0, 0xdb, 0x9f, 0x75,
4556                         0x85, 0xb4, 0x6a, 0xfc, 0x95, 0xe3, 0x54, 0x22,
4557                         0x12, 0xee, 0x30, 0xfe, 0xd8, 0x30, 0xef, 0x34,
4558                         0x50, 0xab, 0x46, 0x30, 0x98, 0x2f, 0xb7, 0xc0,
4559                         0x15, 0xa2, 0x83, 0xb6, 0xf2, 0x06, 0x21, 0xa2,
4560                         0xc3, 0x26, 0x37, 0x14, 0xd1, 0x4d, 0xb5, 0x10,
4561                         0x52, 0x76, 0x4d, 0x6a, 0xee, 0xb5, 0x2b, 0x15,
4562                         0xb7, 0xf9, 0x51, 0xe8, 0x2a, 0xaf, 0xc7, 0xfa,
4563                         0x77, 0xaf, 0xb0, 0x05, 0x4d, 0xd1, 0x68, 0x8e,
4564                         0x74, 0x05, 0x9f, 0x9d, 0x93, 0xa5, 0x3e, 0x7f,
4565                         0x4e, 0x5f, 0x9d, 0xcb, 0x09, 0xc7, 0x83, 0xe3,
4566                         0x02, 0x9d, 0x27, 0x1f, 0xef, 0x85, 0x05, 0x8d,
4567                         0xec, 0x55, 0x88, 0x0f, 0x0d, 0x7c, 0x4c, 0xe8,
4568                         0xa1, 0x75, 0xa0, 0xd8, 0x06, 0x47, 0x14, 0xef,
4569                         0xaa, 0x61, 0xcf, 0x26, 0x15, 0xad, 0xd8, 0xa3,
4570                         0xaa, 0x75, 0xf2, 0x78, 0x4a, 0x5a, 0x61, 0xdf,
4571                         0x8b, 0xc7, 0x04, 0xbc, 0xb2, 0x32, 0xd2, 0x7e,
4572                         0x42, 0xee, 0xb4, 0x2f, 0x51, 0xff, 0x7b, 0x2e,
4573                         0xd3, 0x02, 0xe8, 0xdc, 0x5d, 0x0d, 0x50, 0xdc,
4574                         0xae, 0xb7, 0x46, 0xf9, 0xa8, 0xe6, 0xd0, 0x16,
4575                         0xcc, 0xe6, 0x2c, 0x81, 0xc7, 0xad, 0xe9, 0xf0,
4576                         0x05, 0x72, 0x6d, 0x3d, 0x0a, 0x7a, 0xa9, 0x02,
4577                         0xac, 0x82, 0x93, 0x6e, 0xb6, 0x1c, 0x28, 0xfc,
4578                         0x44, 0x12, 0xfb, 0x73, 0x77, 0xd4, 0x13, 0x39,
4579                         0x29, 0x88, 0x8a, 0xf3, 0x5c, 0xa6, 0x36, 0xa0,
4580                         0x2a, 0xed, 0x7e, 0xb1, 0x1d, 0xd6, 0x4c, 0x6b,
4581                         0x41, 0x01, 0x18, 0x5d, 0x5d, 0x07, 0x97, 0xa6,
4582                         0x4b, 0xef, 0x31, 0x18, 0xea, 0xac, 0xb1, 0x84,
4583                         0x21, 0xed, 0xda, 0x86,
4584                 },
4585                 .rlen = 4100,
4586         },
4587 };
4588
4589 static struct cipher_testvec aes_ctr_dec_tv_template[] = {
4590         { /* From RFC 3686 */
4591                 .key    = { 0xae, 0x68, 0x52, 0xf8, 0x12, 0x10, 0x67, 0xcc,
4592                             0x4b, 0xf7, 0xa5, 0x76, 0x55, 0x77, 0xf3, 0x9e,
4593                             0x00, 0x00, 0x00, 0x30 },
4594                 .klen   = 20,
4595                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
4596                 .input  = { 0xe4, 0x09, 0x5d, 0x4f, 0xb7, 0xa7, 0xb3, 0x79,
4597                             0x2d, 0x61, 0x75, 0xa3, 0x26, 0x13, 0x11, 0xb8 },
4598                 .ilen   = 16,
4599                 .result = { "Single block msg" },
4600                 .rlen   = 16,
4601         }, {
4602                 .key    = { 0x7e, 0x24, 0x06, 0x78, 0x17, 0xfa, 0xe0, 0xd7,
4603                             0x43, 0xd6, 0xce, 0x1f, 0x32, 0x53, 0x91, 0x63,
4604                             0x00, 0x6c, 0xb6, 0xdb },
4605                 .klen   = 20,
4606                 .iv     = { 0xc0, 0x54, 0x3b, 0x59, 0xda, 0x48, 0xd9, 0x0b },
4607                 .input  = { 0x51, 0x04, 0xa1, 0x06, 0x16, 0x8a, 0x72, 0xd9,
4608                             0x79, 0x0d, 0x41, 0xee, 0x8e, 0xda, 0xd3, 0x88,
4609                             0xeb, 0x2e, 0x1e, 0xfc, 0x46, 0xda, 0x57, 0xc8,
4610                             0xfc, 0xe6, 0x30, 0xdf, 0x91, 0x41, 0xbe, 0x28 },
4611                 .ilen   = 32,
4612                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
4613                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
4614                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
4615                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
4616                 .rlen   = 32,
4617         }, {
4618                 .key    = { 0x16, 0xaf, 0x5b, 0x14, 0x5f, 0xc9, 0xf5, 0x79,
4619                             0xc1, 0x75, 0xf9, 0x3e, 0x3b, 0xfb, 0x0e, 0xed,
4620                             0x86, 0x3d, 0x06, 0xcc, 0xfd, 0xb7, 0x85, 0x15,
4621                             0x00, 0x00, 0x00, 0x48 },
4622                 .klen   = 28,
4623                 .iv     = { 0x36, 0x73, 0x3c, 0x14, 0x7d, 0x6d, 0x93, 0xcb },
4624                 .input  = { 0x4b, 0x55, 0x38, 0x4f, 0xe2, 0x59, 0xc9, 0xc8,
4625                             0x4e, 0x79, 0x35, 0xa0, 0x03, 0xcb, 0xe9, 0x28 },
4626                 .ilen   = 16,
4627                 .result = { "Single block msg" },
4628                 .rlen   = 16,
4629         }, {
4630                 .key    = { 0x7c, 0x5c, 0xb2, 0x40, 0x1b, 0x3d, 0xc3, 0x3c,
4631                             0x19, 0xe7, 0x34, 0x08, 0x19, 0xe0, 0xf6, 0x9c,
4632                             0x67, 0x8c, 0x3d, 0xb8, 0xe6, 0xf6, 0xa9, 0x1a,
4633                             0x00, 0x96, 0xb0, 0x3b },
4634                 .klen   = 28,
4635                 .iv     = { 0x02, 0x0c, 0x6e, 0xad, 0xc2, 0xcb, 0x50, 0x0d },
4636                 .input  = { 0x45, 0x32, 0x43, 0xfc, 0x60, 0x9b, 0x23, 0x32,
4637                             0x7e, 0xdf, 0xaa, 0xfa, 0x71, 0x31, 0xcd, 0x9f,
4638                             0x84, 0x90, 0x70, 0x1c, 0x5a, 0xd4, 0xa7, 0x9c,
4639                             0xfc, 0x1f, 0xe0, 0xff, 0x42, 0xf4, 0xfb, 0x00 },
4640                 .ilen   = 32,
4641                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
4642                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
4643                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
4644                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
4645                 .rlen   = 32,
4646         }, { 
4647                 .key    = { 0x77, 0x6b, 0xef, 0xf2, 0x85, 0x1d, 0xb0, 0x6f,
4648                             0x4c, 0x8a, 0x05, 0x42, 0xc8, 0x69, 0x6f, 0x6c,
4649                             0x6a, 0x81, 0xaf, 0x1e, 0xec, 0x96, 0xb4, 0xd3,
4650                             0x7f, 0xc1, 0xd6, 0x89, 0xe6, 0xc1, 0xc1, 0x04,
4651                             0x00, 0x00, 0x00, 0x60 },
4652                 .klen   = 36,
4653                 .iv     = { 0xdb, 0x56, 0x72, 0xc9, 0x7a, 0xa8, 0xf0, 0xb2 },
4654                 .input  = { 0x14, 0x5a, 0xd0, 0x1d, 0xbf, 0x82, 0x4e, 0xc7,
4655                             0x56, 0x08, 0x63, 0xdc, 0x71, 0xe3, 0xe0, 0xc0 },
4656                 .ilen   = 16,
4657                 .result = { "Single block msg" },
4658                 .rlen   = 16,
4659         }, {
4660                 .key    = { 0xf6, 0xd6, 0x6d, 0x6b, 0xd5, 0x2d, 0x59, 0xbb,
4661                             0x07, 0x96, 0x36, 0x58, 0x79, 0xef, 0xf8, 0x86,
4662                             0xc6, 0x6d, 0xd5, 0x1a, 0x5b, 0x6a, 0x99, 0x74,
4663                             0x4b, 0x50, 0x59, 0x0c, 0x87, 0xa2, 0x38, 0x84,
4664                             0x00, 0xfa, 0xac, 0x24 },
4665                 .klen   = 36,
4666                 .iv     = { 0xc1, 0x58, 0x5e, 0xf1, 0x5a, 0x43, 0xd8, 0x75 },
4667                 .input  = { 0xf0, 0x5e, 0x23, 0x1b, 0x38, 0x94, 0x61, 0x2c,
4668                             0x49, 0xee, 0x00, 0x0b, 0x80, 0x4e, 0xb2, 0xa9,
4669                             0xb8, 0x30, 0x6b, 0x50, 0x8f, 0x83, 0x9d, 0x6a,
4670                             0x55, 0x30, 0x83, 0x1d, 0x93, 0x44, 0xaf, 0x1c },
4671                 .ilen   = 32,
4672                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
4673                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
4674                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
4675                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
4676                 .rlen   = 32,
4677         },
4678 };
4679
4680 static struct aead_testvec aes_gcm_enc_tv_template[] = {
4681         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
4682                 .klen   = 16,
4683                 .result = { 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61,
4684                             0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a },
4685                 .rlen   = 16,
4686         }, {
4687                 .klen   = 16,
4688                 .ilen   = 16,
4689                 .result = { 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
4690                             0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78,
4691                             0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
4692                             0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf },
4693                 .rlen   = 32,
4694         }, {
4695                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4696                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4697                 .klen   = 16,
4698                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4699                             0xde, 0xca, 0xf8, 0x88 },
4700                 .input  = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4701                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4702                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4703                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4704                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4705                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4706                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4707                             0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
4708                 .ilen   = 64,
4709                 .result = { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
4710                             0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
4711                             0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
4712                             0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
4713                             0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
4714                             0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
4715                             0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
4716                             0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85,
4717                             0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
4718                             0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 },
4719                 .rlen   = 80,
4720         }, {
4721                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4722                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4723                 .klen   = 16,
4724                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4725                             0xde, 0xca, 0xf8, 0x88 },
4726                 .input  = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4727                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4728                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4729                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4730                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4731                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4732                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4733                             0xba, 0x63, 0x7b, 0x39 },
4734                 .ilen   = 60,
4735                 .assoc  = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4736                             0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4737                             0xab, 0xad, 0xda, 0xd2 },
4738                 .alen   = 20,
4739                 .result = { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
4740                             0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
4741                             0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
4742                             0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
4743                             0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
4744                             0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
4745                             0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
4746                             0x3d, 0x58, 0xe0, 0x91,
4747                             0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb,
4748                             0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 },
4749                 .rlen   = 76,
4750         }, {
4751                 .klen   = 24,
4752                 .result = { 0xcd, 0x33, 0xb2, 0x8a, 0xc7, 0x73, 0xf7, 0x4b,
4753                             0xa0, 0x0e, 0xd1, 0xf3, 0x12, 0x57, 0x24, 0x35 },
4754                 .rlen   = 16,
4755         }, {
4756                 .klen   = 24,
4757                 .ilen   = 16,
4758                 .result = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41,
4759                             0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00,
4760                             0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab,
4761                             0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb },
4762                 .rlen   = 32,
4763         }, {
4764                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4765                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
4766                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c },
4767                 .klen   = 24,
4768                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4769                             0xde, 0xca, 0xf8, 0x88 },
4770                 .input  = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4771                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4772                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4773                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4774                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4775                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4776                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4777                             0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
4778                 .ilen   = 64,
4779                 .result = { 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
4780                             0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
4781                             0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
4782                             0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
4783                             0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
4784                             0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
4785                             0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
4786                             0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56,
4787                             0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf,
4788                             0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 },
4789                 .rlen   = 80,
4790         }, {
4791                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4792                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
4793                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c },
4794                 .klen   = 24,
4795                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4796                             0xde, 0xca, 0xf8, 0x88 },
4797                 .input  = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4798                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4799                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4800                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4801                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4802                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4803                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4804                             0xba, 0x63, 0x7b, 0x39 },
4805                 .ilen   = 60,
4806                 .assoc  = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4807                             0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4808                             0xab, 0xad, 0xda, 0xd2 },
4809                 .alen   = 20,
4810                 .result = { 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
4811                             0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
4812                             0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
4813                             0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
4814                             0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
4815                             0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
4816                             0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
4817                             0xcc, 0xda, 0x27, 0x10,
4818                             0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f,
4819                             0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c },
4820                 .rlen   = 76,
4821                 .np     = 2,
4822                 .tap    = { 32, 28 },
4823                 .anp    = 2,
4824                 .atap   = { 8, 12 }
4825         }, {
4826                 .klen   = 32,
4827                 .result = { 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9,
4828                             0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b },
4829                 .rlen   = 16,
4830         }
4831 };
4832
4833 static struct aead_testvec aes_gcm_dec_tv_template[] = {
4834         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
4835                 .klen   = 32,
4836                 .input  = { 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e,
4837                             0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18,
4838                             0xd0, 0xd1, 0xc8, 0xa7, 0x99, 0x99, 0x6b, 0xf0,
4839                             0x26, 0x5b, 0x98, 0xb5, 0xd4, 0x8a, 0xb9, 0x19 },
4840                 .ilen   = 32,
4841                 .rlen   = 16,
4842         }, {
4843                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4844                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
4845                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4846                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4847                 .klen   = 32,
4848                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4849                             0xde, 0xca, 0xf8, 0x88 },
4850                 .input  = { 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07,
4851                             0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d,
4852                             0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9,
4853                             0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa,
4854                             0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d,
4855                             0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38,
4856                             0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a,
4857                             0xbc, 0xc9, 0xf6, 0x62, 0x89, 0x80, 0x15, 0xad,
4858                             0xb0, 0x94, 0xda, 0xc5, 0xd9, 0x34, 0x71, 0xbd,
4859                             0xec, 0x1a, 0x50, 0x22, 0x70, 0xe3, 0xcc, 0x6c },
4860                 .ilen   = 80,
4861                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4862                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4863                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4864                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4865                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4866                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4867                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4868                             0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
4869                 .rlen   = 64,
4870         }, {
4871                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4872                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
4873                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4874                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4875                 .klen   = 32,
4876                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4877                             0xde, 0xca, 0xf8, 0x88 },
4878                 .input  = { 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07,
4879                             0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d,
4880                             0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9,
4881                             0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa,
4882                             0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d,
4883                             0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38,
4884                             0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a,
4885                             0xbc, 0xc9, 0xf6, 0x62,
4886                             0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68,
4887                             0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b },
4888                 .ilen   = 76,
4889                 .assoc  = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4890                             0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4891                             0xab, 0xad, 0xda, 0xd2 },
4892                 .alen   = 20,
4893                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4894                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4895                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4896                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4897                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4898                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4899                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4900                             0xba, 0x63, 0x7b, 0x39 },
4901                 .rlen   = 60,
4902                 .np     = 2,
4903                 .tap    = { 48, 28 },
4904                 .anp    = 3,
4905                 .atap   = { 8, 8, 4 }
4906         }, {
4907                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4908                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4909                 .klen   = 16,
4910                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4911                             0xde, 0xca, 0xf8, 0x88 },
4912                 .input  = { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
4913                             0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
4914                             0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
4915                             0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
4916                             0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
4917                             0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
4918                             0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
4919                             0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85,
4920                             0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
4921                             0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 },
4922                 .ilen   = 80,
4923                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4924                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4925                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4926                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4927                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4928                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4929                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4930                             0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
4931                 .rlen   = 64,
4932         }, {
4933                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4934                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
4935                 .klen   = 16,
4936                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4937                             0xde, 0xca, 0xf8, 0x88 },
4938                 .input  = { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
4939                             0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
4940                             0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
4941                             0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
4942                             0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
4943                             0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
4944                             0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
4945                             0x3d, 0x58, 0xe0, 0x91,
4946                             0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb,
4947                             0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 },
4948                 .ilen   = 76,
4949                 .assoc  = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4950                             0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
4951                             0xab, 0xad, 0xda, 0xd2 },
4952                 .alen   = 20,
4953                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4954                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4955                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4956                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4957                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4958                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4959                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4960                             0xba, 0x63, 0x7b, 0x39 },
4961                 .rlen   = 60,
4962         }, {
4963                 .klen   = 24,
4964                 .input  = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41,
4965                             0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00,
4966                             0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab,
4967                             0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb },
4968                 .ilen   = 32,
4969                 .rlen   = 16,
4970         }, {
4971                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4972                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
4973                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c },
4974                 .klen   = 24,
4975                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
4976                             0xde, 0xca, 0xf8, 0x88 },
4977                 .input  = { 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
4978                             0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
4979                             0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
4980                             0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
4981                             0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
4982                             0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
4983                             0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
4984                             0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56,
4985                             0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf,
4986                             0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 },
4987                 .ilen   = 80,
4988                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
4989                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
4990                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
4991                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
4992                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
4993                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
4994                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
4995                             0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
4996                 .rlen   = 64,
4997         }, {
4998                 .key    = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
4999                             0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
5000                             0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c },
5001                 .klen   = 24,
5002                 .iv     = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
5003                             0xde, 0xca, 0xf8, 0x88 },
5004                 .input  = { 0x39, 0x80, 0xca, 0x0b, 0x3c, 0x00, 0xe8, 0x41,
5005                             0xeb, 0x06, 0xfa, 0xc4, 0x87, 0x2a, 0x27, 0x57,
5006                             0x85, 0x9e, 0x1c, 0xea, 0xa6, 0xef, 0xd9, 0x84,
5007                             0x62, 0x85, 0x93, 0xb4, 0x0c, 0xa1, 0xe1, 0x9c,
5008                             0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25,
5009                             0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47,
5010                             0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9,
5011                             0xcc, 0xda, 0x27, 0x10,
5012                             0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f,
5013                             0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c },
5014                 .ilen   = 76,
5015                 .assoc  = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
5016                             0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
5017                             0xab, 0xad, 0xda, 0xd2 },
5018                 .alen   = 20,
5019                 .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
5020                             0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
5021                             0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
5022                             0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
5023                             0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
5024                             0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
5025                             0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
5026                             0xba, 0x63, 0x7b, 0x39 },
5027                 .rlen   = 60,
5028         }
5029 };
5030
5031 /* Cast5 test vectors from RFC 2144 */
5032 #define CAST5_ENC_TEST_VECTORS  3
5033 #define CAST5_DEC_TEST_VECTORS  3
5034
5035 static struct cipher_testvec cast5_enc_tv_template[] = {
5036         {
5037                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
5038                             0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a },
5039                 .klen   = 16,
5040                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5041                 .ilen   = 8,
5042                 .result = { 0x23, 0x8b, 0x4f, 0xe5, 0x84, 0x7e, 0x44, 0xb2 },
5043                 .rlen   = 8,
5044         }, {
5045                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
5046                             0x23, 0x45 },
5047                 .klen   = 10,
5048                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5049                 .ilen   = 8,
5050                 .result = { 0xeb, 0x6a, 0x71, 0x1a, 0x2c, 0x02, 0x27, 0x1b },
5051                 .rlen   = 8,
5052         }, {
5053                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12 },
5054                 .klen   = 5,
5055                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5056                 .ilen   = 8,
5057                 .result = { 0x7a, 0xc8, 0x16, 0xd1, 0x6e, 0x9b, 0x30, 0x2e },
5058                 .rlen   = 8,
5059         },
5060 };
5061
5062 static struct cipher_testvec cast5_dec_tv_template[] = {
5063         {
5064                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
5065                             0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a },
5066                 .klen   = 16,
5067                 .input  = { 0x23, 0x8b, 0x4f, 0xe5, 0x84, 0x7e, 0x44, 0xb2 },
5068                 .ilen   = 8,
5069                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5070                 .rlen   = 8,
5071         }, {
5072                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
5073                             0x23, 0x45 },
5074                 .klen   = 10,
5075                 .input  = { 0xeb, 0x6a, 0x71, 0x1a, 0x2c, 0x02, 0x27, 0x1b },
5076                 .ilen   = 8,
5077                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5078                 .rlen   = 8,
5079         }, {
5080                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x12 },
5081                 .klen   = 5,
5082                 .input  = { 0x7a, 0xc8, 0x16, 0xd1, 0x6e, 0x9b, 0x30, 0x2e },
5083                 .ilen   = 8,
5084                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5085                 .rlen   = 8,
5086         },
5087 };
5088
5089 /*
5090  * ARC4 test vectors from OpenSSL
5091  */
5092 #define ARC4_ENC_TEST_VECTORS   7
5093 #define ARC4_DEC_TEST_VECTORS   7
5094
5095 static struct cipher_testvec arc4_enc_tv_template[] = {
5096         {
5097                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5098                 .klen   = 8,
5099                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5100                 .ilen   = 8,
5101                 .result = { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 },
5102                 .rlen   = 8,
5103         }, {
5104                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5105                 .klen   = 8,
5106                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5107                 .ilen   = 8,
5108                 .result = { 0x74, 0x94, 0xc2, 0xe7, 0x10, 0x4b, 0x08, 0x79 },
5109                 .rlen   = 8,
5110         }, {
5111                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5112                 .klen   = 8,
5113                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5114                 .ilen   = 8,
5115                 .result = { 0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a },
5116                 .rlen   = 8,
5117         }, {
5118                 .key    = { 0xef, 0x01, 0x23, 0x45},
5119                 .klen   = 4,
5120                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5121                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5122                             0x00, 0x00, 0x00, 0x00 },
5123                 .ilen   = 20,
5124                 .result = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf,
5125                             0xbd, 0x61, 0x5a, 0x11, 0x62, 0xe1, 0xc7, 0xba,
5126                             0x36, 0xb6, 0x78, 0x58 },
5127                 .rlen   = 20,
5128         }, {
5129                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5130                 .klen   = 8,
5131                 .input  = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5132                             0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5133                             0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5134                             0x12, 0x34, 0x56, 0x78 },
5135                 .ilen   = 28,
5136                 .result = { 0x66, 0xa0, 0x94, 0x9f, 0x8a, 0xf7, 0xd6, 0x89,
5137                             0x1f, 0x7f, 0x83, 0x2b, 0xa8, 0x33, 0xc0, 0x0c,
5138                             0x89, 0x2e, 0xbe, 0x30, 0x14, 0x3c, 0xe2, 0x87,
5139                             0x40, 0x01, 0x1e, 0xcf },
5140                 .rlen   = 28,
5141         }, {
5142                 .key    = { 0xef, 0x01, 0x23, 0x45 },
5143                 .klen   = 4,
5144                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5145                             0x00, 0x00 },
5146                 .ilen   = 10,
5147                 .result = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf,
5148                             0xbd, 0x61 },
5149                 .rlen   = 10,
5150         }, {
5151                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
5152                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5153                 .klen   = 16,
5154                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
5155                 .ilen   = 8,
5156                 .result = { 0x69, 0x72, 0x36, 0x59, 0x1B, 0x52, 0x42, 0xB1 },
5157                 .rlen   = 8,
5158         },
5159 };
5160
5161 static struct cipher_testvec arc4_dec_tv_template[] = {
5162         {
5163                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5164                 .klen   = 8,
5165                 .input  = { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 },
5166                 .ilen   = 8,
5167                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5168                 .rlen   = 8,
5169         }, {
5170                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5171                 .klen   = 8,
5172                 .input  = { 0x74, 0x94, 0xc2, 0xe7, 0x10, 0x4b, 0x08, 0x79 },
5173                 .ilen   = 8,
5174                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5175                 .rlen   = 8,
5176         }, {
5177                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5178                 .klen   = 8,
5179                 .input  = { 0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a },
5180                 .ilen   = 8,
5181                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5182                 .rlen   = 8,
5183         }, {
5184                 .key    = { 0xef, 0x01, 0x23, 0x45},
5185                 .klen   = 4,
5186                 .input  = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf,
5187                             0xbd, 0x61, 0x5a, 0x11, 0x62, 0xe1, 0xc7, 0xba,
5188                             0x36, 0xb6, 0x78, 0x58 },
5189                 .ilen   = 20,
5190                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5191                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5192                             0x00, 0x00, 0x00, 0x00 },
5193                 .rlen   = 20,
5194         }, {
5195                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
5196                 .klen   = 8,
5197                 .input  = { 0x66, 0xa0, 0x94, 0x9f, 0x8a, 0xf7, 0xd6, 0x89,
5198                             0x1f, 0x7f, 0x83, 0x2b, 0xa8, 0x33, 0xc0, 0x0c,
5199                             0x89, 0x2e, 0xbe, 0x30, 0x14, 0x3c, 0xe2, 0x87,
5200                             0x40, 0x01, 0x1e, 0xcf },
5201                 .ilen   = 28,
5202                 .result = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5203                             0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5204                             0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
5205                             0x12, 0x34, 0x56, 0x78 },
5206                 .rlen   = 28,
5207         }, {
5208                 .key    = { 0xef, 0x01, 0x23, 0x45 },
5209                 .klen   = 4,
5210                 .input  = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf,
5211                             0xbd, 0x61 },
5212                 .ilen   = 10,
5213                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5214                             0x00, 0x00 },
5215                 .rlen   = 10,
5216         }, {
5217                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
5218                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5219                 .klen   = 16,
5220                 .input  = { 0x69, 0x72, 0x36, 0x59, 0x1B, 0x52, 0x42, 0xB1 },
5221                 .ilen   = 8,
5222                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
5223                 .rlen   = 8,
5224         },
5225 };
5226
5227 /*
5228  * TEA test vectors
5229  */
5230 #define TEA_ENC_TEST_VECTORS    4
5231 #define TEA_DEC_TEST_VECTORS    4
5232
5233 static struct cipher_testvec tea_enc_tv_template[] = {
5234         {
5235                 .key    = { [0 ... 15] = 0x00 },
5236                 .klen   = 16,
5237                 .input  = { [0 ... 8] = 0x00 },
5238                 .ilen   = 8,
5239                 .result = { 0x0a, 0x3a, 0xea, 0x41, 0x40, 0xa9, 0xba, 0x94 },
5240                 .rlen   = 8,
5241         }, {
5242                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5243                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5244                 .klen   = 16,
5245                 .input  = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5246                 .ilen   = 8,
5247                 .result = { 0x77, 0x5d, 0x2a, 0x6a, 0xf6, 0xce, 0x92, 0x09 },
5248                 .rlen   = 8,
5249         }, {
5250                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5251                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5252                 .klen   = 16,
5253                 .input  = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
5254                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5255                 .ilen   = 16,
5256                 .result = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e,
5257                             0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
5258                 .rlen   = 16,
5259         }, {
5260                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5261                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5262                 .klen   = 16,
5263                 .input  = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
5264                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
5265                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
5266                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5267                 .ilen   = 32,
5268                 .result = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47,
5269                             0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8,
5270                             0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a,
5271                             0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
5272                 .rlen   = 32,
5273         }
5274 };
5275
5276 static struct cipher_testvec tea_dec_tv_template[] = {
5277         {
5278                 .key    = { [0 ... 15] = 0x00 },
5279                 .klen   = 16,
5280                 .input  = { 0x0a, 0x3a, 0xea, 0x41, 0x40, 0xa9, 0xba, 0x94 },
5281                 .ilen   = 8,
5282                 .result = { [0 ... 8] = 0x00 },
5283                 .rlen   = 8,
5284         }, {
5285                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5286                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5287                 .klen   = 16,
5288                 .input  = { 0x77, 0x5d, 0x2a, 0x6a, 0xf6, 0xce, 0x92, 0x09 },
5289                 .ilen   = 8,
5290                 .result = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5291                 .rlen   = 8,
5292         }, {
5293                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5294                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5295                 .klen   = 16,
5296                 .input  = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e,
5297                             0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
5298                 .ilen   = 16,
5299                 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
5300                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5301                 .rlen   = 16,
5302         }, {
5303                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5304                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5305                 .klen   = 16,
5306                 .input  = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47,
5307                             0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8,
5308                             0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a,
5309                             0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
5310                 .ilen   = 32,
5311                 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
5312                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
5313                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
5314                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5315                 .rlen   = 32,
5316         }
5317 };
5318
5319 /*
5320  * XTEA test vectors
5321  */
5322 #define XTEA_ENC_TEST_VECTORS   4
5323 #define XTEA_DEC_TEST_VECTORS   4
5324
5325 static struct cipher_testvec xtea_enc_tv_template[] = {
5326         {
5327                 .key    = { [0 ... 15] = 0x00 },
5328                 .klen   = 16,
5329                 .input  = { [0 ... 8] = 0x00 },
5330                 .ilen   = 8,
5331                 .result = { 0xd8, 0xd4, 0xe9, 0xde, 0xd9, 0x1e, 0x13, 0xf7 },
5332                 .rlen   = 8,
5333         }, {
5334                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5335                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5336                 .klen   = 16,
5337                 .input  = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5338                 .ilen   = 8,
5339                 .result = { 0x94, 0xeb, 0xc8, 0x96, 0x84, 0x6a, 0x49, 0xa8 },
5340                 .rlen   = 8,
5341         }, {
5342                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5343                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5344                 .klen   = 16,
5345                 .input  = { 0x3e, 0xce, 0xae, 0x22, 0x60, 0x56, 0xa8, 0x9d,
5346                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5347                 .ilen   = 16,
5348                 .result = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 
5349                             0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
5350                 .rlen   = 16,
5351         }, {
5352                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5353                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5354                 .klen   = 16,
5355                 .input  = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
5356                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
5357                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
5358                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5359                 .ilen   = 32,
5360                 .result = { 0x99, 0x81, 0x9f, 0x5d, 0x6f, 0x4b, 0x31, 0x3a,
5361                             0x86, 0xff, 0x6f, 0xd0, 0xe3, 0x87, 0x70, 0x07,
5362                             0x4d, 0xb8, 0xcf, 0xf3, 0x99, 0x50, 0xb3, 0xd4,
5363                             0x73, 0xa2, 0xfa, 0xc9, 0x16, 0x59, 0x5d, 0x81 },
5364                 .rlen   = 32,
5365         }
5366 };
5367
5368 static struct cipher_testvec xtea_dec_tv_template[] = {
5369         {
5370                 .key    = { [0 ... 15] = 0x00 },
5371                 .klen   = 16,
5372                 .input  = { 0xd8, 0xd4, 0xe9, 0xde, 0xd9, 0x1e, 0x13, 0xf7 },
5373                 .ilen   = 8,
5374                 .result = { [0 ... 8] = 0x00 },
5375                 .rlen   = 8,
5376         }, {
5377                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5378                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5379                 .klen   = 16,
5380                 .input  = { 0x94, 0xeb, 0xc8, 0x96, 0x84, 0x6a, 0x49, 0xa8 },
5381                 .ilen   = 8,
5382                 .result = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5383                 .rlen   = 8,
5384         }, {
5385                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5386                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5387                 .klen   = 16,
5388                 .input  = { 0x3e, 0xce, 0xae, 0x22, 0x60, 0x56, 0xa8, 0x9d,
5389                             0x77, 0x4d, 0xd4, 0xb4, 0x87, 0x24, 0xe3, 0x9a },
5390                 .ilen   = 16,
5391                 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
5392                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5393                 .rlen   = 16,
5394         }, {
5395                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5396                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5397                 .klen   = 16,
5398                 .input  = { 0x99, 0x81, 0x9f, 0x5d, 0x6f, 0x4b, 0x31, 0x3a,
5399                             0x86, 0xff, 0x6f, 0xd0, 0xe3, 0x87, 0x70, 0x07,
5400                             0x4d, 0xb8, 0xcf, 0xf3, 0x99, 0x50, 0xb3, 0xd4,
5401                             0x73, 0xa2, 0xfa, 0xc9, 0x16, 0x59, 0x5d, 0x81 },
5402                 .ilen   = 32,
5403                 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
5404                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
5405                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
5406                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5407                 .rlen   = 32,
5408         }
5409 };
5410
5411 /*
5412  * KHAZAD test vectors.
5413  */
5414 #define KHAZAD_ENC_TEST_VECTORS 5
5415 #define KHAZAD_DEC_TEST_VECTORS 5
5416
5417 static struct cipher_testvec khazad_enc_tv_template[] = {
5418         {
5419                 .key    = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5420                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5421                 .klen   = 16,
5422                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5423                 .ilen   = 8,
5424                 .result = { 0x49, 0xa4, 0xce, 0x32, 0xac, 0x19, 0x0e, 0x3f },
5425                 .rlen   = 8,
5426         }, {
5427                 .key    = { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
5428                             0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
5429                 .klen   = 16,
5430                 .input  = { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
5431                 .ilen   = 8,
5432                 .result = { 0x7e, 0x82, 0x12, 0xa1, 0Xd9, 0X5b, 0Xe4, 0Xf9 },
5433                 .rlen   = 8,
5434         }, {
5435                 .key    = { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2,
5436                             0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
5437                 .klen   = 16,
5438                 .input  = { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
5439                 .ilen   = 8,
5440                 .result = { 0Xaa, 0Xbe, 0Xc1, 0X95, 0Xc5, 0X94, 0X1a, 0X9c },
5441                 .rlen   = 8,
5442         }, {
5443                 .key    = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
5444                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5445                 .klen   = 16,
5446                 .input  = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5447                 .ilen   = 8,
5448                 .result = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
5449                 .rlen   = 8,
5450         }, {
5451                 .key    = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
5452                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5453                 .klen   = 16,
5454                 .input  = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f ,
5455                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5456                 .ilen   = 16,
5457                 .result = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 ,
5458                             0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
5459                 .rlen   = 16,
5460         },
5461 };
5462
5463 static struct cipher_testvec khazad_dec_tv_template[] = {
5464         {
5465                 .key    = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5466                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5467                 .klen   = 16,
5468                 .input  = { 0X49, 0Xa4, 0Xce, 0X32, 0Xac, 0X19, 0X0e, 0X3f },
5469                 .ilen   = 8,
5470                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5471                 .rlen   = 8,
5472         }, {
5473                 .key    = { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
5474                             0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
5475                 .klen   = 16,
5476                 .input  = { 0X7e, 0X82, 0X12, 0Xa1, 0Xd9, 0X5b, 0Xe4, 0Xf9 },
5477                 .ilen   = 8,
5478                 .result = { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
5479                 .rlen   = 8,
5480         }, {
5481                 .key    = { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2,
5482                             0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
5483                 .klen   = 16,
5484                 .input  = { 0Xaa, 0Xbe, 0Xc1, 0X95, 0Xc5, 0X94, 0X1a, 0X9c },
5485                 .ilen   = 8,
5486                 .result = { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
5487                 .rlen   = 8,
5488         }, {
5489                 .key    = { 0x2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
5490                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5491                 .klen   = 16,
5492                 .input = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
5493                 .ilen   = 8,
5494                 .result = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5495                 .rlen   = 8,
5496         }, {
5497                 .key    = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
5498                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5499                 .klen   = 16,
5500                 .input = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 ,
5501                             0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
5502                 .ilen   = 16,
5503                 .result = { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f ,
5504                             0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
5505                 .rlen   = 16,
5506         },
5507 };
5508
5509 /*
5510  * Anubis test vectors.
5511  */
5512
5513 #define ANUBIS_ENC_TEST_VECTORS                 5
5514 #define ANUBIS_DEC_TEST_VECTORS                 5
5515 #define ANUBIS_CBC_ENC_TEST_VECTORS             2
5516 #define ANUBIS_CBC_DEC_TEST_VECTORS             2
5517
5518 static struct cipher_testvec anubis_enc_tv_template[] = {
5519         {
5520                 .key    = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5521                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5522                 .klen   = 16,
5523                 .input  = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5524                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5525                 .ilen   = 16,
5526                 .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f,
5527                             0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 },
5528                 .rlen   = 16,
5529         }, {
5530
5531                 .key    = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5532                             0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5533                             0x03, 0x03, 0x03, 0x03 },
5534                 .klen   = 20,
5535                 .input  = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5536                             0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 },
5537                 .ilen   = 16,
5538                 .result = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49,
5539                             0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae },
5540                 .rlen   = 16,
5541         }, {
5542                 .key    = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5543                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5544                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5545                             0x24, 0x24, 0x24, 0x24 },
5546                 .klen   = 28,
5547                 .input  = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5548                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 },
5549                 .ilen   = 16,
5550                 .result = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d,
5551                             0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde },
5552                 .rlen   = 16,
5553         }, {
5554                 .key    = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5555                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5556                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5557                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 },
5558                 .klen   = 32,
5559                 .input  = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5560                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 },
5561                 .ilen   = 16,
5562                 .result = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4,
5563                             0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe },
5564                 .rlen   = 16,
5565         }, {
5566                 .key    = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5567                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5568                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5569                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5570                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5571                 .klen   = 40,
5572                 .input  = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5573                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5574                 .ilen   = 16,
5575                 .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97,
5576                             0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee },
5577                 .rlen   = 16,
5578         },
5579 };
5580
5581 static struct cipher_testvec anubis_dec_tv_template[] = {
5582         {
5583                 .key    = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5584                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5585                 .klen   = 16,
5586                 .input  = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f,
5587                             0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 },
5588                 .ilen   = 16,
5589                 .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5590                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5591                 .rlen   = 16,
5592         }, {
5593
5594                 .key    = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5595                             0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5596                             0x03, 0x03, 0x03, 0x03 },
5597                 .klen   = 20,
5598                 .input  = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49,
5599                             0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae },
5600                 .ilen   = 16,
5601                 .result = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
5602                             0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 },
5603                 .rlen   = 16,
5604         }, {
5605                 .key    = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5606                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5607                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5608                             0x24, 0x24, 0x24, 0x24 },
5609                 .klen   = 28,
5610                 .input  = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d,
5611                             0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde },
5612                 .ilen   = 16,
5613                 .result = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
5614                             0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 },
5615                 .rlen   = 16,
5616         }, {
5617                 .key    = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5618                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5619                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5620                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 },
5621                 .klen   = 32,
5622                 .input  = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4,
5623                             0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe },
5624                 .ilen   = 16,
5625                 .result = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
5626                             0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 },
5627                 .rlen   = 16,
5628         }, {
5629                 .key    = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5630                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5631                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5632                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5633                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5634                 .input = {  0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97,
5635                             0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee },
5636                 .klen   = 40,
5637                 .ilen   = 16,
5638                 .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5639                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5640                 .rlen   = 16,
5641         },
5642 };
5643
5644 static struct cipher_testvec anubis_cbc_enc_tv_template[] = {
5645         {
5646                 .key    = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5647                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5648                 .klen   = 16,
5649                 .input  = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5650                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5651                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5652                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5653                 .ilen   = 32,
5654                 .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f,
5655                             0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90,
5656                             0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66,
5657                             0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe },
5658                 .rlen   = 32,
5659         }, {
5660                 .key    = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5661                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5662                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5663                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5664                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5665                 .klen   = 40,
5666                 .input  = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5667                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5668                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5669                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5670                 .ilen   = 32,
5671                 .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97,
5672                             0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee,
5673                             0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75,
5674                             0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 },
5675                 .rlen   = 32,
5676         },
5677 };
5678
5679 static struct cipher_testvec anubis_cbc_dec_tv_template[] = {
5680         {
5681                 .key    = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5682                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5683                 .klen   = 16,
5684                 .input  = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f,
5685                             0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90,
5686                             0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66,
5687                             0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe },
5688                 .ilen   = 32,
5689                 .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5690                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5691                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
5692                             0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe },
5693                 .rlen   = 32,
5694         }, {
5695                 .key    = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5696                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5697                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5698                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5699                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5700                 .klen   = 40,
5701                 .input = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97,
5702                             0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee,
5703                             0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75,
5704                             0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 },
5705                 .ilen   = 32,
5706                 .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5707                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5708                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
5709                             0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 },
5710                 .rlen   = 32,
5711         },
5712 };
5713
5714 /* 
5715  * XETA test vectors 
5716  */
5717 #define XETA_ENC_TEST_VECTORS   4
5718 #define XETA_DEC_TEST_VECTORS   4
5719
5720 static struct cipher_testvec xeta_enc_tv_template[] = {
5721         {
5722                 .key    = { [0 ... 15] = 0x00 },
5723                 .klen   = 16,
5724                 .input  = { [0 ... 8] = 0x00 },
5725                 .ilen   = 8,
5726                 .result = { 0xaa, 0x22, 0x96, 0xe5, 0x6c, 0x61, 0xf3, 0x45 },
5727                 .rlen   = 8,
5728         }, {
5729                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5730                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5731                 .klen   = 16,
5732                 .input  = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5733                 .ilen   = 8,
5734                 .result = { 0x82, 0x3e, 0xeb, 0x35, 0xdc, 0xdd, 0xd9, 0xc3 },
5735                 .rlen   = 8,
5736         }, {
5737                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5738                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5739                 .klen   = 16,
5740                 .input  = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
5741                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5742                 .ilen   = 16,
5743                 .result = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 
5744                             0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
5745                 .rlen   = 16,
5746         }, {
5747                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5748                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5749                 .klen   = 16,
5750                 .input  = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
5751                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
5752                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
5753                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5754                 .ilen   = 32,
5755                 .result = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 
5756                             0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 
5757                             0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 
5758                             0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
5759                 .rlen   = 32,
5760         }
5761 };
5762
5763 static struct cipher_testvec xeta_dec_tv_template[] = {
5764         {
5765                 .key    = { [0 ... 15] = 0x00 },
5766                 .klen   = 16,
5767                 .input  = { 0xaa, 0x22, 0x96, 0xe5, 0x6c, 0x61, 0xf3, 0x45 },
5768                 .ilen   = 8,
5769                 .result = { [0 ... 8] = 0x00 },
5770                 .rlen   = 8,
5771         }, {
5772                 .key    = { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
5773                             0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
5774                 .klen   = 16,
5775                 .input  = { 0x82, 0x3e, 0xeb, 0x35, 0xdc, 0xdd, 0xd9, 0xc3 },
5776                 .ilen   = 8,
5777                 .result = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
5778                 .rlen   = 8,
5779         }, {
5780                 .key    = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
5781                             0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
5782                 .klen   = 16,
5783                 .input  = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 
5784                             0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
5785                 .ilen   = 16,
5786                 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
5787                             0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
5788                 .rlen   = 16,
5789         }, {
5790                 .key    = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
5791                             0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
5792                 .klen   = 16,
5793                 .input  = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 
5794                             0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 
5795                             0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 
5796                             0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
5797                 .ilen   = 32,
5798                 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
5799                             0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
5800                             0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
5801                             0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
5802                 .rlen   = 32,
5803         }
5804 };
5805
5806 /* 
5807  * FCrypt test vectors 
5808  */
5809 #define FCRYPT_ENC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_enc_tv_template)
5810 #define FCRYPT_DEC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_dec_tv_template)
5811
5812 static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = {
5813         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
5814                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5815                 .klen   = 8,
5816                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5817                 .input  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5818                 .ilen   = 8,
5819                 .result = { 0x0E, 0x09, 0x00, 0xC7, 0x3E, 0xF7, 0xED, 0x41 },
5820                 .rlen   = 8,
5821         }, {
5822                 .key    = { 0x11, 0x44, 0x77, 0xAA, 0xDD, 0x00, 0x33, 0x66 },
5823                 .klen   = 8,
5824                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5825                 .input  = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0 },
5826                 .ilen   = 8,
5827                 .result = { 0xD8, 0xED, 0x78, 0x74, 0x77, 0xEC, 0x06, 0x80 },
5828                 .rlen   = 8,
5829         }, { /* From Arla */
5830                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5831                 .klen   = 8,
5832                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5833                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
5834                 .ilen   = 48,
5835                 .result = { 0x00, 0xf0, 0xe,  0x11, 0x75, 0xe6, 0x23, 0x82,
5836                             0xee, 0xac, 0x98, 0x62, 0x44, 0x51, 0xe4, 0x84,
5837                             0xc3, 0x59, 0xd8, 0xaa, 0x64, 0x60, 0xae, 0xf7,
5838                             0xd2, 0xd9, 0x13, 0x79, 0x72, 0xa3, 0x45, 0x03,
5839                             0x23, 0xb5, 0x62, 0xd7, 0x0c, 0xf5, 0x27, 0xd1,
5840                             0xf8, 0x91, 0x3c, 0xac, 0x44, 0x22, 0x92, 0xef },
5841                 .rlen   = 48,
5842         }, {
5843                 .key    = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5844                 .klen   = 8,
5845                 .iv     = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5846                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
5847                 .ilen   = 48,
5848                 .result = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c,
5849                             0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d,
5850                             0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58,
5851                             0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0,
5852                             0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94,
5853                             0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f },
5854                 .rlen   = 48,
5855         }, { /* split-page version */
5856                 .key    = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5857                 .klen   = 8,
5858                 .iv     = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5859                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
5860                 .ilen   = 48,
5861                 .result = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c,
5862                             0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d,
5863                             0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58,
5864                             0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0,
5865                             0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94,
5866                             0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f },
5867                 .rlen   = 48,
5868                 .np     = 2,
5869                 .tap    = { 20, 28 },
5870         }
5871 };
5872
5873 static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = {
5874         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
5875                 .key    = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5876                 .klen   = 8,
5877                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5878                 .input  = { 0x0E, 0x09, 0x00, 0xC7, 0x3E, 0xF7, 0xED, 0x41 },
5879                 .ilen   = 8,
5880                 .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5881                 .rlen   = 8,
5882         }, {
5883                 .key    = { 0x11, 0x44, 0x77, 0xAA, 0xDD, 0x00, 0x33, 0x66 },
5884                 .klen   = 8,
5885                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
5886                 .input  = { 0xD8, 0xED, 0x78, 0x74, 0x77, 0xEC, 0x06, 0x80 },
5887                 .ilen   = 8,
5888                 .result = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0 },
5889                 .rlen   = 8,
5890         }, { /* From Arla */
5891                 .key    = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5892                 .klen   = 8,
5893                 .iv     = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5894                 .input  = { 0x00, 0xf0, 0xe,  0x11, 0x75, 0xe6, 0x23, 0x82,
5895                             0xee, 0xac, 0x98, 0x62, 0x44, 0x51, 0xe4, 0x84,
5896                             0xc3, 0x59, 0xd8, 0xaa, 0x64, 0x60, 0xae, 0xf7,
5897                             0xd2, 0xd9, 0x13, 0x79, 0x72, 0xa3, 0x45, 0x03,
5898                             0x23, 0xb5, 0x62, 0xd7, 0x0c, 0xf5, 0x27, 0xd1,
5899                             0xf8, 0x91, 0x3c, 0xac, 0x44, 0x22, 0x92, 0xef },
5900                 .ilen   = 48,
5901                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
5902                 .rlen   = 48,
5903         }, {
5904                 .key    = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5905                 .klen   = 8,
5906                 .iv     = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5907                 .input  = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c,
5908                             0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d,
5909                             0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58,
5910                             0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0,
5911                             0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94,
5912                             0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f },
5913                 .ilen   = 48,
5914                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
5915                 .rlen   = 48,
5916         }, { /* split-page version */
5917                 .key    = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5918                 .klen   = 8,
5919                 .iv     = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
5920                 .input  = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c,
5921                             0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d,
5922                             0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58,
5923                             0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0,
5924                             0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94,
5925                             0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f },
5926                 .ilen   = 48,
5927                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
5928                 .rlen   = 48,
5929                 .np     = 2,
5930                 .tap    = { 20, 28 },
5931         }
5932 };
5933
5934 /*
5935  * CAMELLIA test vectors.
5936  */
5937 #define CAMELLIA_ENC_TEST_VECTORS 3
5938 #define CAMELLIA_DEC_TEST_VECTORS 3
5939 #define CAMELLIA_CBC_ENC_TEST_VECTORS 2
5940 #define CAMELLIA_CBC_DEC_TEST_VECTORS 2
5941
5942 static struct cipher_testvec camellia_enc_tv_template[] = {
5943         {
5944                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5945                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5946                 .klen   = 16,
5947                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5948                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5949                 .ilen   = 16,
5950                 .result = { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73,
5951                             0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 },
5952                 .rlen   = 16,
5953         }, {
5954                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5955                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
5956                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 },
5957                 .klen   = 24,
5958                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5959                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5960                 .ilen   = 16,
5961                 .result = { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8,
5962                             0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 },
5963                 .rlen   = 16,
5964         }, {
5965                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5966                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
5967                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
5968                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
5969                 .klen   = 32,
5970                 .input  = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5971                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5972                 .ilen   = 16,
5973                 .result = { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c,
5974                             0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 },
5975                 .rlen   = 16,
5976         },
5977 };
5978
5979 static struct cipher_testvec camellia_dec_tv_template[] = {
5980         {
5981                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5982                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5983                 .klen   = 16,
5984                 .input  = { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73,
5985                             0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 },
5986                 .ilen   = 16,
5987                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5988                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
5989                 .rlen   = 16,
5990         }, {
5991                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5992                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
5993                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 },
5994                 .klen   = 24,
5995                 .input  = { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8,
5996                             0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 },
5997                 .ilen   = 16,
5998                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
5999                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
6000                 .rlen   = 16,
6001         }, {
6002                 .key    = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
6003                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
6004                             0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
6005                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
6006                 .klen   = 32,
6007                 .input  = { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c,
6008                             0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 },
6009                 .ilen   = 16,
6010                 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
6011                             0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
6012                 .rlen   = 16,
6013         },
6014 };
6015
6016 static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
6017         {
6018                 .key    = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
6019                             0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 },
6020                 .klen   = 16,
6021                 .iv     = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30,
6022                             0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 },
6023                 .input  = { "Single block msg" },
6024                 .ilen   = 16,
6025                 .result = { 0xea, 0x32, 0x12, 0x76, 0x3b, 0x50, 0x10, 0xe7,
6026                             0x18, 0xf6, 0xfd, 0x5d, 0xf6, 0x8f, 0x13, 0x51 },
6027                 .rlen   = 16,
6028         }, {
6029                 .key    = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0,
6030                             0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a },
6031                 .klen   = 16,
6032                 .iv     = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28,
6033                             0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 },
6034                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6035                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
6036                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
6037                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
6038                 .ilen   = 32,
6039                 .result = { 0xa5, 0xdf, 0x6e, 0x50, 0xda, 0x70, 0x6c, 0x01,
6040                             0x4a, 0xab, 0xf3, 0xf2, 0xd6, 0xfc, 0x6c, 0xfd,
6041                             0x19, 0xb4, 0x3e, 0x57, 0x1c, 0x02, 0x5e, 0xa0,
6042                             0x15, 0x78, 0xe0, 0x5e, 0xf2, 0xcb, 0x87, 0x16 },
6043                 .rlen   = 32,
6044         },
6045 };
6046
6047 static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
6048         {
6049                 .key    = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
6050                             0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 },
6051                 .klen   = 16,
6052                 .iv     = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30,
6053                             0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 },
6054                 .input  = { 0xea, 0x32, 0x12, 0x76, 0x3b, 0x50, 0x10, 0xe7,
6055                             0x18, 0xf6, 0xfd, 0x5d, 0xf6, 0x8f, 0x13, 0x51 },
6056                 .ilen   = 16,
6057                 .result = { "Single block msg" },
6058                 .rlen   = 16,
6059         }, {
6060                 .key    = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0,
6061                             0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a },
6062                 .klen   = 16,
6063                 .iv     = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28,
6064                             0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 },
6065                 .input = { 0xa5, 0xdf, 0x6e, 0x50, 0xda, 0x70, 0x6c, 0x01,
6066                             0x4a, 0xab, 0xf3, 0xf2, 0xd6, 0xfc, 0x6c, 0xfd,
6067                             0x19, 0xb4, 0x3e, 0x57, 0x1c, 0x02, 0x5e, 0xa0,
6068                             0x15, 0x78, 0xe0, 0x5e, 0xf2, 0xcb, 0x87, 0x16 },
6069                 .ilen   = 32,
6070                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6071                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
6072                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
6073                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
6074                 .rlen   = 32,
6075         },
6076 };
6077
6078 /*
6079  * SEED test vectors
6080  */
6081 #define SEED_ENC_TEST_VECTORS   4
6082 #define SEED_DEC_TEST_VECTORS   4
6083
6084 static struct cipher_testvec seed_enc_tv_template[] = {
6085         {
6086                 .key    = { [0 ... 15] = 0x00 },
6087                 .klen   = 16,
6088                 .input  = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6089                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
6090                 .ilen   = 16,
6091                 .result = { 0x5e, 0xba, 0xc6, 0xe0, 0x05, 0x4e, 0x16, 0x68,
6092                             0x19, 0xaf, 0xf1, 0xcc, 0x6d, 0x34, 0x6c, 0xdb },
6093                 .rlen   = 16,
6094         }, {
6095                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6096                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
6097                 .klen   = 16,
6098                 .input  = { [0 ... 15] = 0x00 },
6099                 .ilen   = 16,
6100                 .result = { 0xc1, 0x1f, 0x22, 0xf2, 0x01, 0x40, 0x50, 0x50,
6101                             0x84, 0x48, 0x35, 0x97, 0xe4, 0x37, 0x0f, 0x43 },
6102                 .rlen   = 16,
6103         }, {
6104                 .key    = { 0x47, 0x06, 0x48, 0x08, 0x51, 0xe6, 0x1b, 0xe8,
6105                             0x5d, 0x74, 0xbf, 0xb3, 0xfd, 0x95, 0x61, 0x85 },
6106                 .klen   = 16,
6107                 .input  = { 0x83, 0xa2, 0xf8, 0xa2, 0x88, 0x64, 0x1f, 0xb9,
6108                             0xa4, 0xe9, 0xa5, 0xcc, 0x2f, 0x13, 0x1c, 0x7d },
6109                 .ilen   = 16,
6110                 .result = { 0xee, 0x54, 0xd1, 0x3e, 0xbc, 0xae, 0x70, 0x6d,
6111                             0x22, 0x6b, 0xc3, 0x14, 0x2c, 0xd4, 0x0d, 0x4a },
6112                 .rlen   = 16,
6113         }, {
6114                 .key    = { 0x28, 0xdb, 0xc3, 0xbc, 0x49, 0xff, 0xd8, 0x7d,
6115                             0xcf, 0xa5, 0x09, 0xb1, 0x1d, 0x42, 0x2b, 0xe7 },
6116                 .klen   = 16,
6117                 .input  = { 0xb4, 0x1e, 0x6b, 0xe2, 0xeb, 0xa8, 0x4a, 0x14,
6118                             0x8e, 0x2e, 0xed, 0x84, 0x59, 0x3c, 0x5e, 0xc7 },
6119                 .ilen   = 16,
6120                 .result = { 0x9b, 0x9b, 0x7b, 0xfc, 0xd1, 0x81, 0x3c, 0xb9,
6121                             0x5d, 0x0b, 0x36, 0x18, 0xf4, 0x0f, 0x51, 0x22 },
6122                 .rlen   = 16,
6123         }
6124 };
6125
6126 static struct cipher_testvec seed_dec_tv_template[] = {
6127         {
6128                 .key    = { [0 ... 15] = 0x00 },
6129                 .klen   = 16,
6130                 .input  = { 0x5e, 0xba, 0xc6, 0xe0, 0x05, 0x4e, 0x16, 0x68,
6131                             0x19, 0xaf, 0xf1, 0xcc, 0x6d, 0x34, 0x6c, 0xdb },
6132                 .ilen   = 16,
6133                 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6134                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
6135                 .rlen   = 16,
6136         }, {
6137                 .key    = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6138                             0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
6139                 .klen   = 16,
6140                 .input  = { 0xc1, 0x1f, 0x22, 0xf2, 0x01, 0x40, 0x50, 0x50,
6141                             0x84, 0x48, 0x35, 0x97, 0xe4, 0x37, 0x0f, 0x43 },
6142                 .ilen   = 16,
6143                 .result = { [0 ... 15] = 0x00 },
6144                 .rlen   = 16,
6145         }, {
6146                 .key    = { 0x47, 0x06, 0x48, 0x08, 0x51, 0xe6, 0x1b, 0xe8,
6147                             0x5d, 0x74, 0xbf, 0xb3, 0xfd, 0x95, 0x61, 0x85 },
6148                 .klen   = 16,
6149                 .input  = { 0xee, 0x54, 0xd1, 0x3e, 0xbc, 0xae, 0x70, 0x6d,
6150                             0x22, 0x6b, 0xc3, 0x14, 0x2c, 0xd4, 0x0d, 0x4a },
6151                 .ilen   = 16,
6152                 .result = { 0x83, 0xa2, 0xf8, 0xa2, 0x88, 0x64, 0x1f, 0xb9,
6153                             0xa4, 0xe9, 0xa5, 0xcc, 0x2f, 0x13, 0x1c, 0x7d },
6154                 .rlen   = 16,
6155         }, {
6156                 .key    = { 0x28, 0xdb, 0xc3, 0xbc, 0x49, 0xff, 0xd8, 0x7d,
6157                             0xcf, 0xa5, 0x09, 0xb1, 0x1d, 0x42, 0x2b, 0xe7 },
6158                 .klen   = 16,
6159                 .input  = { 0x9b, 0x9b, 0x7b, 0xfc, 0xd1, 0x81, 0x3c, 0xb9,
6160                             0x5d, 0x0b, 0x36, 0x18, 0xf4, 0x0f, 0x51, 0x22 },
6161                 .ilen   = 16,
6162                 .result = { 0xb4, 0x1e, 0x6b, 0xe2, 0xeb, 0xa8, 0x4a, 0x14,
6163                             0x8e, 0x2e, 0xed, 0x84, 0x59, 0x3c, 0x5e, 0xc7 },
6164                 .rlen   = 16,
6165         }
6166 };
6167
6168 #define SALSA20_STREAM_ENC_TEST_VECTORS 4
6169 static struct cipher_testvec salsa20_stream_enc_tv_template[] = {
6170         /*
6171         * Testvectors from verified.test-vectors submitted to ECRYPT.
6172         * They are truncated to size 39, 64, 111, 129 to test a variety
6173         * of input length.
6174         */
6175         { /* Set 3, vector 0 */
6176                 .key    = {
6177                             0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
6178                             0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
6179                           },
6180                 .klen   = 16,
6181                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
6182                 .input  = {
6183                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6184                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6185                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6186                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6187                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6188                           },
6189                 .ilen   = 39,
6190                 .result = {
6191                             0x2D, 0xD5, 0xC3, 0xF7, 0xBA, 0x2B, 0x20, 0xF7,
6192                             0x68, 0x02, 0x41, 0x0C, 0x68, 0x86, 0x88, 0x89,
6193                             0x5A, 0xD8, 0xC1, 0xBD, 0x4E, 0xA6, 0xC9, 0xB1,
6194                             0x40, 0xFB, 0x9B, 0x90, 0xE2, 0x10, 0x49, 0xBF,
6195                             0x58, 0x3F, 0x52, 0x79, 0x70, 0xEB, 0xC1,
6196                         },
6197                 .rlen   = 39,
6198         }, { /* Set 5, vector 0 */
6199                 .key    = {
6200                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6201                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6202                           },
6203                 .klen   = 16,
6204                 .iv     = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
6205                 .input  = {
6206                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6207                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6208                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6209                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6210                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6211                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6212                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6213                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6214                           },
6215                 .ilen   = 64,
6216                 .result = {
6217                             0xB6, 0x6C, 0x1E, 0x44, 0x46, 0xDD, 0x95, 0x57,
6218                             0xE5, 0x78, 0xE2, 0x23, 0xB0, 0xB7, 0x68, 0x01,
6219                             0x7B, 0x23, 0xB2, 0x67, 0xBB, 0x02, 0x34, 0xAE,
6220                             0x46, 0x26, 0xBF, 0x44, 0x3F, 0x21, 0x97, 0x76,
6221                             0x43, 0x6F, 0xB1, 0x9F, 0xD0, 0xE8, 0x86, 0x6F,
6222                             0xCD, 0x0D, 0xE9, 0xA9, 0x53, 0x8F, 0x4A, 0x09,
6223                             0xCA, 0x9A, 0xC0, 0x73, 0x2E, 0x30, 0xBC, 0xF9,
6224                             0x8E, 0x4F, 0x13, 0xE4, 0xB9, 0xE2, 0x01, 0xD9,
6225                           },
6226                 .rlen   = 64,
6227         }, { /* Set 3, vector 27 */
6228                 .key    = {
6229                             0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22,
6230                             0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,
6231                             0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
6232                             0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A
6233                           },
6234                 .klen   = 32,
6235                 .iv     = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
6236                 .input  = {
6237                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6238                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6239                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6240                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6241                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6242                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6243                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6244                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6245
6246                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6247                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6248                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6249                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6250                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6251                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6252                           },
6253                 .ilen   = 111,
6254                 .result = {
6255                             0xAE, 0x39, 0x50, 0x8E, 0xAC, 0x9A, 0xEC, 0xE7,
6256                             0xBF, 0x97, 0xBB, 0x20, 0xB9, 0xDE, 0xE4, 0x1F,
6257                             0x87, 0xD9, 0x47, 0xF8, 0x28, 0x91, 0x35, 0x98,
6258                             0xDB, 0x72, 0xCC, 0x23, 0x29, 0x48, 0x56, 0x5E,
6259                             0x83, 0x7E, 0x0B, 0xF3, 0x7D, 0x5D, 0x38, 0x7B,
6260                             0x2D, 0x71, 0x02, 0xB4, 0x3B, 0xB5, 0xD8, 0x23,
6261                             0xB0, 0x4A, 0xDF, 0x3C, 0xEC, 0xB6, 0xD9, 0x3B,
6262                             0x9B, 0xA7, 0x52, 0xBE, 0xC5, 0xD4, 0x50, 0x59,
6263
6264                             0x15, 0x14, 0xB4, 0x0E, 0x40, 0xE6, 0x53, 0xD1,
6265                             0x83, 0x9C, 0x5B, 0xA0, 0x92, 0x29, 0x6B, 0x5E,
6266                             0x96, 0x5B, 0x1E, 0x2F, 0xD3, 0xAC, 0xC1, 0x92,
6267                             0xB1, 0x41, 0x3F, 0x19, 0x2F, 0xC4, 0x3B, 0xC6,
6268                             0x95, 0x46, 0x45, 0x54, 0xE9, 0x75, 0x03, 0x08,
6269                             0x44, 0xAF, 0xE5, 0x8A, 0x81, 0x12, 0x09,
6270                           },
6271                 .rlen   = 111,
6272
6273         }, { /* Set 5, vector 27 */
6274                 .key    = {
6275                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6276                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6277                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6278                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6279                           },
6280                 .klen   = 32,
6281                 .iv     = { 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00 },
6282                 .input  = {
6283                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6284                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6285                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6286                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6287                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6288                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6289                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6290                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6291
6292                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6293                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6294                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6295                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6296                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6297                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6298                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6299                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6300
6301                             0x00,
6302                           },
6303                 .ilen   = 129,
6304                 .result = {
6305                             0xD2, 0xDB, 0x1A, 0x5C, 0xF1, 0xC1, 0xAC, 0xDB,
6306                             0xE8, 0x1A, 0x7A, 0x43, 0x40, 0xEF, 0x53, 0x43,
6307                             0x5E, 0x7F, 0x4B, 0x1A, 0x50, 0x52, 0x3F, 0x8D,
6308                             0x28, 0x3D, 0xCF, 0x85, 0x1D, 0x69, 0x6E, 0x60,
6309                             0xF2, 0xDE, 0x74, 0x56, 0x18, 0x1B, 0x84, 0x10,
6310                             0xD4, 0x62, 0xBA, 0x60, 0x50, 0xF0, 0x61, 0xF2,
6311                             0x1C, 0x78, 0x7F, 0xC1, 0x24, 0x34, 0xAF, 0x58,
6312                             0xBF, 0x2C, 0x59, 0xCA, 0x90, 0x77, 0xF3, 0xB0,
6313
6314                             0x5B, 0x4A, 0xDF, 0x89, 0xCE, 0x2C, 0x2F, 0xFC,
6315                             0x67, 0xF0, 0xE3, 0x45, 0xE8, 0xB3, 0xB3, 0x75,
6316                             0xA0, 0x95, 0x71, 0xA1, 0x29, 0x39, 0x94, 0xCA,
6317                             0x45, 0x2F, 0xBD, 0xCB, 0x10, 0xB6, 0xBE, 0x9F,
6318                             0x8E, 0xF9, 0xB2, 0x01, 0x0A, 0x5A, 0x0A, 0xB7,
6319                             0x6B, 0x9D, 0x70, 0x8E, 0x4B, 0xD6, 0x2F, 0xCD,
6320                             0x2E, 0x40, 0x48, 0x75, 0xE9, 0xE2, 0x21, 0x45,
6321                             0x0B, 0xC9, 0xB6, 0xB5, 0x66, 0xBC, 0x9A, 0x59,
6322
6323                             0x5A,
6324                           },
6325                 .rlen   = 129,
6326         }
6327 };
6328
6329 /*
6330  * Compression stuff.
6331  */
6332 #define COMP_BUF_SIZE           512
6333
6334 struct comp_testvec {
6335         int inlen, outlen;
6336         char input[COMP_BUF_SIZE];
6337         char output[COMP_BUF_SIZE];
6338 };
6339
6340 /*
6341  * Deflate test vectors (null-terminated strings).
6342  * Params: winbits=11, Z_DEFAULT_COMPRESSION, MAX_MEM_LEVEL.
6343  */
6344 #define DEFLATE_COMP_TEST_VECTORS 2
6345 #define DEFLATE_DECOMP_TEST_VECTORS 2
6346
6347 static struct comp_testvec deflate_comp_tv_template[] = {
6348         {
6349                 .inlen  = 70,
6350                 .outlen = 38,
6351                 .input  = "Join us now and share the software "
6352                           "Join us now and share the software ",
6353                 .output = { 0xf3, 0xca, 0xcf, 0xcc, 0x53, 0x28, 0x2d, 0x56,
6354                             0xc8, 0xcb, 0x2f, 0x57, 0x48, 0xcc, 0x4b, 0x51,
6355                             0x28, 0xce, 0x48, 0x2c, 0x4a, 0x55, 0x28, 0xc9,
6356                             0x48, 0x55, 0x28, 0xce, 0x4f, 0x2b, 0x29, 0x07,
6357                             0x71, 0xbc, 0x08, 0x2b, 0x01, 0x00 },
6358         }, {
6359                 .inlen  = 191,
6360                 .outlen = 122,
6361                 .input  = "This document describes a compression method based on the DEFLATE"
6362                           "compression algorithm.  This document defines the application of "
6363                           "the DEFLATE algorithm to the IP Payload Compression Protocol.",
6364                 .output = { 0x5d, 0x8d, 0x31, 0x0e, 0xc2, 0x30, 0x10, 0x04,
6365                             0xbf, 0xb2, 0x2f, 0xc8, 0x1f, 0x10, 0x04, 0x09,
6366                             0x89, 0xc2, 0x85, 0x3f, 0x70, 0xb1, 0x2f, 0xf8,
6367                             0x24, 0xdb, 0x67, 0xd9, 0x47, 0xc1, 0xef, 0x49,
6368                             0x68, 0x12, 0x51, 0xae, 0x76, 0x67, 0xd6, 0x27,
6369                             0x19, 0x88, 0x1a, 0xde, 0x85, 0xab, 0x21, 0xf2,
6370                             0x08, 0x5d, 0x16, 0x1e, 0x20, 0x04, 0x2d, 0xad,
6371                             0xf3, 0x18, 0xa2, 0x15, 0x85, 0x2d, 0x69, 0xc4,
6372                             0x42, 0x83, 0x23, 0xb6, 0x6c, 0x89, 0x71, 0x9b,
6373                             0xef, 0xcf, 0x8b, 0x9f, 0xcf, 0x33, 0xca, 0x2f,
6374                             0xed, 0x62, 0xa9, 0x4c, 0x80, 0xff, 0x13, 0xaf,
6375                             0x52, 0x37, 0xed, 0x0e, 0x52, 0x6b, 0x59, 0x02,
6376                             0xd9, 0x4e, 0xe8, 0x7a, 0x76, 0x1d, 0x02, 0x98,
6377                             0xfe, 0x8a, 0x87, 0x83, 0xa3, 0x4f, 0x56, 0x8a,
6378                             0xb8, 0x9e, 0x8e, 0x5c, 0x57, 0xd3, 0xa0, 0x79,
6379                             0xfa, 0x02 },
6380         },
6381 };
6382
6383 static struct comp_testvec deflate_decomp_tv_template[] = {
6384         {
6385                 .inlen  = 122,
6386                 .outlen = 191,
6387                 .input  = { 0x5d, 0x8d, 0x31, 0x0e, 0xc2, 0x30, 0x10, 0x04,
6388                             0xbf, 0xb2, 0x2f, 0xc8, 0x1f, 0x10, 0x04, 0x09,
6389                             0x89, 0xc2, 0x85, 0x3f, 0x70, 0xb1, 0x2f, 0xf8,
6390                             0x24, 0xdb, 0x67, 0xd9, 0x47, 0xc1, 0xef, 0x49,
6391                             0x68, 0x12, 0x51, 0xae, 0x76, 0x67, 0xd6, 0x27,
6392                             0x19, 0x88, 0x1a, 0xde, 0x85, 0xab, 0x21, 0xf2,
6393                             0x08, 0x5d, 0x16, 0x1e, 0x20, 0x04, 0x2d, 0xad,
6394                             0xf3, 0x18, 0xa2, 0x15, 0x85, 0x2d, 0x69, 0xc4,
6395                             0x42, 0x83, 0x23, 0xb6, 0x6c, 0x89, 0x71, 0x9b,
6396                             0xef, 0xcf, 0x8b, 0x9f, 0xcf, 0x33, 0xca, 0x2f,
6397                             0xed, 0x62, 0xa9, 0x4c, 0x80, 0xff, 0x13, 0xaf,
6398                             0x52, 0x37, 0xed, 0x0e, 0x52, 0x6b, 0x59, 0x02,
6399                             0xd9, 0x4e, 0xe8, 0x7a, 0x76, 0x1d, 0x02, 0x98,
6400                             0xfe, 0x8a, 0x87, 0x83, 0xa3, 0x4f, 0x56, 0x8a,
6401                             0xb8, 0x9e, 0x8e, 0x5c, 0x57, 0xd3, 0xa0, 0x79,
6402                             0xfa, 0x02 },
6403                 .output = "This document describes a compression method based on the DEFLATE"
6404                           "compression algorithm.  This document defines the application of "
6405                           "the DEFLATE algorithm to the IP Payload Compression Protocol.",
6406         }, {
6407                 .inlen  = 38,
6408                 .outlen = 70,
6409                 .input  = { 0xf3, 0xca, 0xcf, 0xcc, 0x53, 0x28, 0x2d, 0x56,
6410                             0xc8, 0xcb, 0x2f, 0x57, 0x48, 0xcc, 0x4b, 0x51,
6411                             0x28, 0xce, 0x48, 0x2c, 0x4a, 0x55, 0x28, 0xc9,
6412                             0x48, 0x55, 0x28, 0xce, 0x4f, 0x2b, 0x29, 0x07,
6413                             0x71, 0xbc, 0x08, 0x2b, 0x01, 0x00 },
6414                 .output = "Join us now and share the software "
6415                           "Join us now and share the software ",
6416         },
6417 };
6418
6419 /*
6420  * Michael MIC test vectors from IEEE 802.11i
6421  */
6422 #define MICHAEL_MIC_TEST_VECTORS 6
6423
6424 static struct hash_testvec michael_mic_tv_template[] = {
6425         {
6426                 .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
6427                 .ksize = 8,
6428                 .plaintext = { },
6429                 .psize = 0,
6430                 .digest = { 0x82, 0x92, 0x5c, 0x1c, 0xa1, 0xd1, 0x30, 0xb8 }
6431         },
6432         {
6433                 .key = { 0x82, 0x92, 0x5c, 0x1c, 0xa1, 0xd1, 0x30, 0xb8 },
6434                 .ksize = 8,
6435                 .plaintext = { 'M' },
6436                 .psize = 1,
6437                 .digest = { 0x43, 0x47, 0x21, 0xca, 0x40, 0x63, 0x9b, 0x3f }
6438         },
6439         {
6440                 .key = { 0x43, 0x47, 0x21, 0xca, 0x40, 0x63, 0x9b, 0x3f },
6441                 .ksize = 8,
6442                 .plaintext = { 'M', 'i' },
6443                 .psize = 2,
6444                 .digest = { 0xe8, 0xf9, 0xbe, 0xca, 0xe9, 0x7e, 0x5d, 0x29 }
6445         },
6446         {
6447                 .key = { 0xe8, 0xf9, 0xbe, 0xca, 0xe9, 0x7e, 0x5d, 0x29 },
6448                 .ksize = 8,
6449                 .plaintext = { 'M', 'i', 'c' },
6450                 .psize = 3,
6451                 .digest = { 0x90, 0x03, 0x8f, 0xc6, 0xcf, 0x13, 0xc1, 0xdb }
6452         },
6453         {
6454                 .key = { 0x90, 0x03, 0x8f, 0xc6, 0xcf, 0x13, 0xc1, 0xdb },
6455                 .ksize = 8,
6456                 .plaintext = { 'M', 'i', 'c', 'h' },
6457                 .psize = 4,
6458                 .digest = { 0xd5, 0x5e, 0x10, 0x05, 0x10, 0x12, 0x89, 0x86 }
6459         },
6460         {
6461                 .key = { 0xd5, 0x5e, 0x10, 0x05, 0x10, 0x12, 0x89, 0x86 },
6462                 .ksize = 8,
6463                 .plaintext = { 'M', 'i', 'c', 'h', 'a', 'e', 'l' },
6464                 .psize = 7,
6465                 .digest = { 0x0a, 0x94, 0x2b, 0x12, 0x4e, 0xca, 0xa5, 0x46 },
6466         }
6467 };
6468
6469 /*
6470  * CRC32C test vectors
6471  */
6472 #define CRC32C_TEST_VECTORS 14
6473
6474 static struct hash_testvec crc32c_tv_template[] = {
6475         {
6476                 .psize = 0,
6477                 .digest = { 0x00, 0x00, 0x00, 0x00 }
6478         },
6479         {
6480                 .key = { 0x87, 0xa9, 0xcb, 0xed },
6481                 .ksize = 4,
6482                 .psize = 0,
6483                 .digest = { 0x78, 0x56, 0x34, 0x12 },
6484         },
6485         {
6486                 .key = { 0xff, 0xff, 0xff, 0xff },
6487                 .ksize = 4,
6488                 .plaintext = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
6489                                0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
6490                                0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
6491                                0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
6492                                0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28 },
6493                 .psize = 40,
6494                 .digest = { 0x7f, 0x15, 0x2c, 0x0e }
6495         },
6496         {
6497                 .key = { 0xff, 0xff, 0xff, 0xff },
6498                 .ksize = 4,
6499                 .plaintext = { 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
6500                                0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
6501                                0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
6502                                0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
6503                                0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50 },
6504                 .psize = 40,
6505                 .digest = { 0xf6, 0xeb, 0x80, 0xe9 }
6506         },
6507         {
6508                 .key = { 0xff, 0xff, 0xff, 0xff },
6509                 .ksize = 4,
6510                 .plaintext = { 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
6511                                0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
6512                                0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
6513                                0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
6514                                0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78 },
6515                 .psize = 40,
6516                 .digest = { 0xed, 0xbd, 0x74, 0xde }
6517         },
6518         {
6519                 .key = { 0xff, 0xff, 0xff, 0xff },
6520                 .ksize = 4,
6521                 .plaintext = { 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
6522                                0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
6523                                0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
6524                                0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
6525                                0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0 },
6526                 .psize = 40,
6527                 .digest = { 0x62, 0xc8, 0x79, 0xd5 }
6528         },
6529         {
6530                 .key = { 0xff, 0xff, 0xff, 0xff },
6531                 .ksize = 4,
6532                 .plaintext = { 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
6533                                0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
6534                                0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
6535                                0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
6536                                0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8 },
6537                 .psize = 40,
6538                 .digest = { 0xd0, 0x9a, 0x97, 0xba }
6539         },
6540         {
6541                 .key = { 0xff, 0xff, 0xff, 0xff },
6542                 .ksize = 4,
6543                 .plaintext = { 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
6544                                0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
6545                                0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,
6546                                0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
6547                                0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0 },
6548                 .psize = 40,
6549                 .digest = { 0x13, 0xd9, 0x29, 0x2b }
6550         },
6551         {
6552                 .key = { 0x80, 0xea, 0xd3, 0xf1 },
6553                 .ksize = 4,
6554                 .plaintext = { 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
6555                                0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
6556                                0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
6557                                0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
6558                                0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50 },
6559                 .psize = 40,
6560                 .digest = { 0x0c, 0xb5, 0xe2, 0xa2 }
6561         },
6562         {
6563                 .key = { 0xf3, 0x4a, 0x1d, 0x5d },
6564                 .ksize = 4,
6565                 .plaintext = { 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
6566                                0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
6567                                0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
6568                                0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
6569                                0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78 },
6570                 .psize = 40,
6571                 .digest = { 0xd1, 0x7f, 0xfb, 0xa6 }
6572         },
6573         {
6574                 .key = { 0x2e, 0x80, 0x04, 0x59 },
6575                 .ksize = 4,
6576                 .plaintext = { 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
6577                                0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
6578                                0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
6579                                0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
6580                                0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0 },
6581                 .psize = 40,
6582                 .digest = { 0x59, 0x33, 0xe6, 0x7a }
6583         },
6584         {
6585                 .key = { 0xa6, 0xcc, 0x19, 0x85 },
6586                 .ksize = 4,
6587                 .plaintext = { 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
6588                                0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
6589                                0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
6590                                0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
6591                                0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8 },
6592                 .psize = 40,
6593                 .digest = { 0xbe, 0x03, 0x01, 0xd2 }
6594         },
6595         {
6596                 .key = { 0x41, 0xfc, 0xfe, 0x2d },
6597                 .ksize = 4,
6598                 .plaintext = { 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
6599                                0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
6600                                0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,
6601                                0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
6602                                0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0 },
6603                 .psize = 40,
6604                 .digest = { 0x75, 0xd3, 0xc5, 0x24 }
6605         },
6606         {
6607                 .key = { 0xff, 0xff, 0xff, 0xff },
6608                 .ksize = 4,
6609                 .plaintext = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
6610                                0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
6611                                0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
6612                                0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
6613                                0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
6614                                0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
6615                                0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
6616                                0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
6617                                0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
6618                                0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
6619                                0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
6620                                0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
6621                                0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
6622                                0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
6623                                0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
6624                                0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
6625                                0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
6626                                0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
6627                                0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
6628                                0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0,
6629                                0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
6630                                0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
6631                                0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
6632                                0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
6633                                0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,
6634                                0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
6635                                0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
6636                                0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,
6637                                0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
6638                                0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0 },
6639                 .psize = 240,
6640                 .digest = { 0x75, 0xd3, 0xc5, 0x24 },
6641                 .np = 2,
6642                 .tap = { 31, 209 }
6643         },
6644 };
6645
6646 /*
6647  * Cipher speed tests
6648  */
6649 static struct cipher_speed aes_speed_template[] = {
6650         { .klen = 16, .blen = 16, },
6651         { .klen = 16, .blen = 64, },
6652         { .klen = 16, .blen = 256, },
6653         { .klen = 16, .blen = 1024, },
6654         { .klen = 16, .blen = 8192, },
6655         { .klen = 24, .blen = 16, },
6656         { .klen = 24, .blen = 64, },
6657         { .klen = 24, .blen = 256, },
6658         { .klen = 24, .blen = 1024, },
6659         { .klen = 24, .blen = 8192, },
6660         { .klen = 32, .blen = 16, },
6661         { .klen = 32, .blen = 64, },
6662         { .klen = 32, .blen = 256, },
6663         { .klen = 32, .blen = 1024, },
6664         { .klen = 32, .blen = 8192, },
6665
6666         /* End marker */
6667         {  .klen = 0, .blen = 0, }
6668 };
6669
6670 static struct cipher_speed aes_lrw_speed_template[] = {
6671         { .klen = 32, .blen = 16, },
6672         { .klen = 32, .blen = 64, },
6673         { .klen = 32, .blen = 256, },
6674         { .klen = 32, .blen = 1024, },
6675         { .klen = 32, .blen = 8192, },
6676         { .klen = 40, .blen = 16, },
6677         { .klen = 40, .blen = 64, },
6678         { .klen = 40, .blen = 256, },
6679         { .klen = 40, .blen = 1024, },
6680         { .klen = 40, .blen = 8192, },
6681         { .klen = 48, .blen = 16, },
6682         { .klen = 48, .blen = 64, },
6683         { .klen = 48, .blen = 256, },
6684         { .klen = 48, .blen = 1024, },
6685         { .klen = 48, .blen = 8192, },
6686
6687         /* End marker */
6688         {  .klen = 0, .blen = 0, }
6689 };
6690
6691 static struct cipher_speed aes_xts_speed_template[] = {
6692         { .klen = 32, .blen = 16, },
6693         { .klen = 32, .blen = 64, },
6694         { .klen = 32, .blen = 256, },
6695         { .klen = 32, .blen = 1024, },
6696         { .klen = 32, .blen = 8192, },
6697         { .klen = 48, .blen = 16, },
6698         { .klen = 48, .blen = 64, },
6699         { .klen = 48, .blen = 256, },
6700         { .klen = 48, .blen = 1024, },
6701         { .klen = 48, .blen = 8192, },
6702         { .klen = 64, .blen = 16, },
6703         { .klen = 64, .blen = 64, },
6704         { .klen = 64, .blen = 256, },
6705         { .klen = 64, .blen = 1024, },
6706         { .klen = 64, .blen = 8192, },
6707
6708         /* End marker */
6709         {  .klen = 0, .blen = 0, }
6710 };
6711
6712 static struct cipher_speed des3_ede_speed_template[] = {
6713         { .klen = 24, .blen = 16, },
6714         { .klen = 24, .blen = 64, },
6715         { .klen = 24, .blen = 256, },
6716         { .klen = 24, .blen = 1024, },
6717         { .klen = 24, .blen = 8192, },
6718
6719         /* End marker */
6720         {  .klen = 0, .blen = 0, }
6721 };
6722
6723 static struct cipher_speed twofish_speed_template[] = {
6724         { .klen = 16, .blen = 16, },
6725         { .klen = 16, .blen = 64, },
6726         { .klen = 16, .blen = 256, },
6727         { .klen = 16, .blen = 1024, },
6728         { .klen = 16, .blen = 8192, },
6729         { .klen = 24, .blen = 16, },
6730         { .klen = 24, .blen = 64, },
6731         { .klen = 24, .blen = 256, },
6732         { .klen = 24, .blen = 1024, },
6733         { .klen = 24, .blen = 8192, },
6734         { .klen = 32, .blen = 16, },
6735         { .klen = 32, .blen = 64, },
6736         { .klen = 32, .blen = 256, },
6737         { .klen = 32, .blen = 1024, },
6738         { .klen = 32, .blen = 8192, },
6739
6740         /* End marker */
6741         {  .klen = 0, .blen = 0, }
6742 };
6743
6744 static struct cipher_speed blowfish_speed_template[] = {
6745         /* Don't support blowfish keys > 256 bit in this test */
6746         { .klen = 8, .blen = 16, },
6747         { .klen = 8, .blen = 64, },
6748         { .klen = 8, .blen = 256, },
6749         { .klen = 8, .blen = 1024, },
6750         { .klen = 8, .blen = 8192, },
6751         { .klen = 32, .blen = 16, },
6752         { .klen = 32, .blen = 64, },
6753         { .klen = 32, .blen = 256, },
6754         { .klen = 32, .blen = 1024, },
6755         { .klen = 32, .blen = 8192, },
6756
6757         /* End marker */
6758         {  .klen = 0, .blen = 0, }
6759 };
6760
6761 static struct cipher_speed des_speed_template[] = {
6762         { .klen = 8, .blen = 16, },
6763         { .klen = 8, .blen = 64, },
6764         { .klen = 8, .blen = 256, },
6765         { .klen = 8, .blen = 1024, },
6766         { .klen = 8, .blen = 8192, },
6767
6768         /* End marker */
6769         {  .klen = 0, .blen = 0, }
6770 };
6771
6772 /*
6773  * Digest speed tests
6774  */
6775 static struct hash_speed generic_hash_speed_template[] = {
6776         { .blen = 16,   .plen = 16, },
6777         { .blen = 64,   .plen = 16, },
6778         { .blen = 64,   .plen = 64, },
6779         { .blen = 256,  .plen = 16, },
6780         { .blen = 256,  .plen = 64, },
6781         { .blen = 256,  .plen = 256, },
6782         { .blen = 1024, .plen = 16, },
6783         { .blen = 1024, .plen = 256, },
6784         { .blen = 1024, .plen = 1024, },
6785         { .blen = 2048, .plen = 16, },
6786         { .blen = 2048, .plen = 256, },
6787         { .blen = 2048, .plen = 1024, },
6788         { .blen = 2048, .plen = 2048, },
6789         { .blen = 4096, .plen = 16, },
6790         { .blen = 4096, .plen = 256, },
6791         { .blen = 4096, .plen = 1024, },
6792         { .blen = 4096, .plen = 4096, },
6793         { .blen = 8192, .plen = 16, },
6794         { .blen = 8192, .plen = 256, },
6795         { .blen = 8192, .plen = 1024, },
6796         { .blen = 8192, .plen = 4096, },
6797         { .blen = 8192, .plen = 8192, },
6798
6799         /* End marker */
6800         {  .blen = 0,   .plen = 0, }
6801 };
6802
6803 static struct cipher_speed camellia_speed_template[] = {
6804       { .klen = 16, .blen = 16, },
6805       { .klen = 16, .blen = 64, },
6806       { .klen = 16, .blen = 256, },
6807       { .klen = 16, .blen = 1024, },
6808       { .klen = 16, .blen = 8192, },
6809       { .klen = 24, .blen = 16, },
6810       { .klen = 24, .blen = 64, },
6811       { .klen = 24, .blen = 256, },
6812       { .klen = 24, .blen = 1024, },
6813       { .klen = 24, .blen = 8192, },
6814       { .klen = 32, .blen = 16, },
6815       { .klen = 32, .blen = 64, },
6816       { .klen = 32, .blen = 256, },
6817       { .klen = 32, .blen = 1024, },
6818       { .klen = 32, .blen = 8192, },
6819
6820       /* End marker */
6821       {  .klen = 0, .blen = 0, }
6822 };
6823
6824 #endif  /* _CRYPTO_TCRYPT_H */