]> Pileus Git - ~andy/linux/blob - crypto/testmgr.h
crypto: testmgr - allow non-multi page and multi page skcipher tests from same test...
[~andy/linux] / crypto / testmgr.h
1 /*
2  * Algorithm testing framework and tests.
3  *
4  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
5  * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
6  * Copyright (c) 2007 Nokia Siemens Networks
7  * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
8  *
9  * Updated RFC4106 AES-GCM testing. Some test vectors were taken from
10  * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
11  * gcm/gcm-test-vectors.tar.gz
12  *     Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
13  *              Adrian Hoban <adrian.hoban@intel.com>
14  *              Gabriele Paoloni <gabriele.paoloni@intel.com>
15  *              Tadeusz Struk (tadeusz.struk@intel.com)
16  *     Copyright (c) 2010, Intel Corporation.
17  *
18  * This program is free software; you can redistribute it and/or modify it
19  * under the terms of the GNU General Public License as published by the Free
20  * Software Foundation; either version 2 of the License, or (at your option)
21  * any later version.
22  *
23  */
24 #ifndef _CRYPTO_TESTMGR_H
25 #define _CRYPTO_TESTMGR_H
26
27 #include <linux/netlink.h>
28 #include <linux/zlib.h>
29
30 #include <crypto/compress.h>
31
32 #define MAX_DIGEST_SIZE         64
33 #define MAX_TAP                 8
34
35 #define MAX_KEYLEN              56
36 #define MAX_IVLEN               32
37
38 struct hash_testvec {
39         /* only used with keyed hash algorithms */
40         char *key;
41         char *plaintext;
42         char *digest;
43         unsigned char tap[MAX_TAP];
44         unsigned char psize;
45         unsigned char np;
46         unsigned char ksize;
47 };
48
49 struct cipher_testvec {
50         char *key;
51         char *iv;
52         char *input;
53         char *result;
54         unsigned short tap[MAX_TAP];
55         int np;
56         unsigned char also_non_np;
57         unsigned char fail;
58         unsigned char wk; /* weak key flag */
59         unsigned char klen;
60         unsigned short ilen;
61         unsigned short rlen;
62 };
63
64 struct aead_testvec {
65         char *key;
66         char *iv;
67         char *input;
68         char *assoc;
69         char *result;
70         unsigned char tap[MAX_TAP];
71         unsigned char atap[MAX_TAP];
72         int np;
73         int anp;
74         unsigned char fail;
75         unsigned char novrfy;   /* ccm dec verification failure expected */
76         unsigned char wk; /* weak key flag */
77         unsigned char klen;
78         unsigned short ilen;
79         unsigned short alen;
80         unsigned short rlen;
81 };
82
83 struct cprng_testvec {
84         char *key;
85         char *dt;
86         char *v;
87         char *result;
88         unsigned char klen;
89         unsigned short dtlen;
90         unsigned short vlen;
91         unsigned short rlen;
92         unsigned short loops;
93 };
94
95 static char zeroed_string[48];
96
97 /*
98  * MD4 test vectors from RFC1320
99  */
100 #define MD4_TEST_VECTORS        7
101
102 static struct hash_testvec md4_tv_template [] = {
103         {
104                 .plaintext = "",
105                 .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
106                           "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
107         }, {
108                 .plaintext = "a",
109                 .psize  = 1,
110                 .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
111                           "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
112         }, {
113                 .plaintext = "abc",
114                 .psize  = 3,
115                 .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
116                           "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
117         }, {
118                 .plaintext = "message digest",
119                 .psize  = 14,
120                 .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
121                         "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
122         }, {
123                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
124                 .psize  = 26,
125                 .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
126                           "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
127                 .np     = 2,
128                 .tap    = { 13, 13 },
129         }, {
130                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
131                 .psize  = 62,
132                 .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
133                           "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
134         }, {
135                 .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
136                            "45678901234567890",
137                 .psize  = 80,
138                 .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
139                           "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
140         },
141 };
142
143 /*
144  * MD5 test vectors from RFC1321
145  */
146 #define MD5_TEST_VECTORS        7
147
148 static struct hash_testvec md5_tv_template[] = {
149         {
150                 .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
151                           "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
152         }, {
153                 .plaintext = "a",
154                 .psize  = 1,
155                 .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
156                           "\x31\xc3\x99\xe2\x69\x77\x26\x61",
157         }, {
158                 .plaintext = "abc",
159                 .psize  = 3,
160                 .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
161                           "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
162         }, {
163                 .plaintext = "message digest",
164                 .psize  = 14,
165                 .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
166                           "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
167         }, {
168                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
169                 .psize  = 26,
170                 .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
171                           "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
172                 .np     = 2,
173                 .tap    = {13, 13}
174         }, {
175                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
176                 .psize  = 62,
177                 .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
178                           "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
179         }, {
180                 .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
181                            "345678901234567890",
182                 .psize  = 80,
183                 .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
184                           "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
185         }
186
187 };
188
189 /*
190  * RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
191  */
192 #define RMD128_TEST_VECTORS     10
193
194 static struct hash_testvec rmd128_tv_template[] = {
195         {
196                 .digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
197                           "\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
198         }, {
199                 .plaintext = "a",
200                 .psize  = 1,
201                 .digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
202                           "\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
203         }, {
204                 .plaintext = "abc",
205                 .psize  = 3,
206                 .digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
207                           "\x84\x63\x6b\x0f\x69\x14\x4c\x77",
208         }, {
209                 .plaintext = "message digest",
210                 .psize  = 14,
211                 .digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
212                           "\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
213         }, {
214                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
215                 .psize  = 26,
216                 .digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
217                           "\x10\x71\x49\x22\xb3\x71\x83\x4e",
218         }, {
219                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
220                              "fghijklmnopqrstuvwxyz0123456789",
221                 .psize  = 62,
222                 .digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
223                           "\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
224         }, {
225                 .plaintext = "1234567890123456789012345678901234567890"
226                              "1234567890123456789012345678901234567890",
227                 .psize  = 80,
228                 .digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
229                           "\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
230         }, {
231                 .plaintext = "abcdbcdecdefdefgefghfghighij"
232                              "hijkijkljklmklmnlmnomnopnopq",
233                 .psize  = 56,
234                 .digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
235                           "\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
236                 .np     = 2,
237                 .tap    = { 28, 28 },
238         }, {
239                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
240                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
241                              "lmnopqrsmnopqrstnopqrstu",
242                 .psize  = 112,
243                 .digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
244                           "\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
245         }, {
246                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
247                 .psize  = 32,
248                 .digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
249                           "\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
250         }
251 };
252
253 /*
254  * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
255  */
256 #define RMD160_TEST_VECTORS     10
257
258 static struct hash_testvec rmd160_tv_template[] = {
259         {
260                 .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
261                           "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
262         }, {
263                 .plaintext = "a",
264                 .psize  = 1,
265                 .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
266                           "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
267         }, {
268                 .plaintext = "abc",
269                 .psize  = 3,
270                 .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
271                           "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
272         }, {
273                 .plaintext = "message digest",
274                 .psize  = 14,
275                 .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
276                           "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
277         }, {
278                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
279                 .psize  = 26,
280                 .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
281                           "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
282         }, {
283                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
284                              "fghijklmnopqrstuvwxyz0123456789",
285                 .psize  = 62,
286                 .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
287                           "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
288         }, {
289                 .plaintext = "1234567890123456789012345678901234567890"
290                              "1234567890123456789012345678901234567890",
291                 .psize  = 80,
292                 .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
293                           "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
294         }, {
295                 .plaintext = "abcdbcdecdefdefgefghfghighij"
296                              "hijkijkljklmklmnlmnomnopnopq",
297                 .psize  = 56,
298                 .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
299                           "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
300                 .np     = 2,
301                 .tap    = { 28, 28 },
302         }, {
303                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
304                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
305                              "lmnopqrsmnopqrstnopqrstu",
306                 .psize  = 112,
307                 .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
308                           "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
309         }, {
310                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
311                 .psize  = 32,
312                 .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
313                           "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
314         }
315 };
316
317 /*
318  * RIPEMD-256 test vectors
319  */
320 #define RMD256_TEST_VECTORS     8
321
322 static struct hash_testvec rmd256_tv_template[] = {
323         {
324                 .digest = "\x02\xba\x4c\x4e\x5f\x8e\xcd\x18"
325                           "\x77\xfc\x52\xd6\x4d\x30\xe3\x7a"
326                           "\x2d\x97\x74\xfb\x1e\x5d\x02\x63"
327                           "\x80\xae\x01\x68\xe3\xc5\x52\x2d",
328         }, {
329                 .plaintext = "a",
330                 .psize  = 1,
331                 .digest = "\xf9\x33\x3e\x45\xd8\x57\xf5\xd9"
332                           "\x0a\x91\xba\xb7\x0a\x1e\xba\x0c"
333                           "\xfb\x1b\xe4\xb0\x78\x3c\x9a\xcf"
334                           "\xcd\x88\x3a\x91\x34\x69\x29\x25",
335         }, {
336                 .plaintext = "abc",
337                 .psize  = 3,
338                 .digest = "\xaf\xbd\x6e\x22\x8b\x9d\x8c\xbb"
339                           "\xce\xf5\xca\x2d\x03\xe6\xdb\xa1"
340                           "\x0a\xc0\xbc\x7d\xcb\xe4\x68\x0e"
341                           "\x1e\x42\xd2\xe9\x75\x45\x9b\x65",
342         }, {
343                 .plaintext = "message digest",
344                 .psize  = 14,
345                 .digest = "\x87\xe9\x71\x75\x9a\x1c\xe4\x7a"
346                           "\x51\x4d\x5c\x91\x4c\x39\x2c\x90"
347                           "\x18\xc7\xc4\x6b\xc1\x44\x65\x55"
348                           "\x4a\xfc\xdf\x54\xa5\x07\x0c\x0e",
349         }, {
350                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
351                 .psize  = 26,
352                 .digest = "\x64\x9d\x30\x34\x75\x1e\xa2\x16"
353                           "\x77\x6b\xf9\xa1\x8a\xcc\x81\xbc"
354                           "\x78\x96\x11\x8a\x51\x97\x96\x87"
355                           "\x82\xdd\x1f\xd9\x7d\x8d\x51\x33",
356         }, {
357                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
358                              "fghijklmnopqrstuvwxyz0123456789",
359                 .psize  = 62,
360                 .digest = "\x57\x40\xa4\x08\xac\x16\xb7\x20"
361                           "\xb8\x44\x24\xae\x93\x1c\xbb\x1f"
362                           "\xe3\x63\xd1\xd0\xbf\x40\x17\xf1"
363                           "\xa8\x9f\x7e\xa6\xde\x77\xa0\xb8",
364         }, {
365                 .plaintext = "1234567890123456789012345678901234567890"
366                              "1234567890123456789012345678901234567890",
367                 .psize  = 80,
368                 .digest = "\x06\xfd\xcc\x7a\x40\x95\x48\xaa"
369                           "\xf9\x13\x68\xc0\x6a\x62\x75\xb5"
370                           "\x53\xe3\xf0\x99\xbf\x0e\xa4\xed"
371                           "\xfd\x67\x78\xdf\x89\xa8\x90\xdd",
372         }, {
373                 .plaintext = "abcdbcdecdefdefgefghfghighij"
374                              "hijkijkljklmklmnlmnomnopnopq",
375                 .psize  = 56,
376                 .digest = "\x38\x43\x04\x55\x83\xaa\xc6\xc8"
377                           "\xc8\xd9\x12\x85\x73\xe7\xa9\x80"
378                           "\x9a\xfb\x2a\x0f\x34\xcc\xc3\x6e"
379                           "\xa9\xe7\x2f\x16\xf6\x36\x8e\x3f",
380                 .np     = 2,
381                 .tap    = { 28, 28 },
382         }
383 };
384
385 /*
386  * RIPEMD-320 test vectors
387  */
388 #define RMD320_TEST_VECTORS     8
389
390 static struct hash_testvec rmd320_tv_template[] = {
391         {
392                 .digest = "\x22\xd6\x5d\x56\x61\x53\x6c\xdc\x75\xc1"
393                           "\xfd\xf5\xc6\xde\x7b\x41\xb9\xf2\x73\x25"
394                           "\xeb\xc6\x1e\x85\x57\x17\x7d\x70\x5a\x0e"
395                           "\xc8\x80\x15\x1c\x3a\x32\xa0\x08\x99\xb8",
396         }, {
397                 .plaintext = "a",
398                 .psize  = 1,
399                 .digest = "\xce\x78\x85\x06\x38\xf9\x26\x58\xa5\xa5"
400                           "\x85\x09\x75\x79\x92\x6d\xda\x66\x7a\x57"
401                           "\x16\x56\x2c\xfc\xf6\xfb\xe7\x7f\x63\x54"
402                           "\x2f\x99\xb0\x47\x05\xd6\x97\x0d\xff\x5d",
403         }, {
404                 .plaintext = "abc",
405                 .psize  = 3,
406                 .digest = "\xde\x4c\x01\xb3\x05\x4f\x89\x30\xa7\x9d"
407                           "\x09\xae\x73\x8e\x92\x30\x1e\x5a\x17\x08"
408                           "\x5b\xef\xfd\xc1\xb8\xd1\x16\x71\x3e\x74"
409                           "\xf8\x2f\xa9\x42\xd6\x4c\xdb\xc4\x68\x2d",
410         }, {
411                 .plaintext = "message digest",
412                 .psize  = 14,
413                 .digest = "\x3a\x8e\x28\x50\x2e\xd4\x5d\x42\x2f\x68"
414                           "\x84\x4f\x9d\xd3\x16\xe7\xb9\x85\x33\xfa"
415                           "\x3f\x2a\x91\xd2\x9f\x84\xd4\x25\xc8\x8d"
416                           "\x6b\x4e\xff\x72\x7d\xf6\x6a\x7c\x01\x97",
417         }, {
418                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
419                 .psize  = 26,
420                 .digest = "\xca\xbd\xb1\x81\x0b\x92\x47\x0a\x20\x93"
421                           "\xaa\x6b\xce\x05\x95\x2c\x28\x34\x8c\xf4"
422                           "\x3f\xf6\x08\x41\x97\x51\x66\xbb\x40\xed"
423                           "\x23\x40\x04\xb8\x82\x44\x63\xe6\xb0\x09",
424         }, {
425                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
426                              "fghijklmnopqrstuvwxyz0123456789",
427                 .psize  = 62,
428                 .digest = "\xed\x54\x49\x40\xc8\x6d\x67\xf2\x50\xd2"
429                           "\x32\xc3\x0b\x7b\x3e\x57\x70\xe0\xc6\x0c"
430                           "\x8c\xb9\xa4\xca\xfe\x3b\x11\x38\x8a\xf9"
431                           "\x92\x0e\x1b\x99\x23\x0b\x84\x3c\x86\xa4",
432         }, {
433                 .plaintext = "1234567890123456789012345678901234567890"
434                              "1234567890123456789012345678901234567890",
435                 .psize  = 80,
436                 .digest = "\x55\x78\x88\xaf\x5f\x6d\x8e\xd6\x2a\xb6"
437                           "\x69\x45\xc6\xd2\xa0\xa4\x7e\xcd\x53\x41"
438                           "\xe9\x15\xeb\x8f\xea\x1d\x05\x24\x95\x5f"
439                           "\x82\x5d\xc7\x17\xe4\xa0\x08\xab\x2d\x42",
440         }, {
441                 .plaintext = "abcdbcdecdefdefgefghfghighij"
442                              "hijkijkljklmklmnlmnomnopnopq",
443                 .psize  = 56,
444                 .digest = "\xd0\x34\xa7\x95\x0c\xf7\x22\x02\x1b\xa4"
445                           "\xb8\x4d\xf7\x69\xa5\xde\x20\x60\xe2\x59"
446                           "\xdf\x4c\x9b\xb4\xa4\x26\x8c\x0e\x93\x5b"
447                           "\xbc\x74\x70\xa9\x69\xc9\xd0\x72\xa1\xac",
448                 .np     = 2,
449                 .tap    = { 28, 28 },
450         }
451 };
452
453 /*
454  * SHA1 test vectors  from from FIPS PUB 180-1
455  * Long vector from CAVS 5.0
456  */
457 #define SHA1_TEST_VECTORS       3
458
459 static struct hash_testvec sha1_tv_template[] = {
460         {
461                 .plaintext = "abc",
462                 .psize  = 3,
463                 .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
464                           "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
465         }, {
466                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
467                 .psize  = 56,
468                 .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
469                           "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
470                 .np     = 2,
471                 .tap    = { 28, 28 }
472         }, {
473                 .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
474                              "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
475                              "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
476                              "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
477                              "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
478                              "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
479                              "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
480                              "\x72\x28\x26\xc0\x66\x86\x9e\xda"
481                              "\xcd\x73\xb2\x54\x80\x35\x18\x58"
482                              "\x13\xe2\x26\x34\xa9\xda\x44\x00"
483                              "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
484                              "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
485                              "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
486                              "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
487                              "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
488                              "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
489                              "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
490                              "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
491                              "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
492                              "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
493                              "\x5a\x90\x11",
494                 .psize  = 163,
495                 .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
496                           "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
497                 .np     = 4,
498                 .tap    = { 63, 64, 31, 5 }
499         }
500 };
501
502
503 /*
504  * SHA224 test vectors from from FIPS PUB 180-2
505  */
506 #define SHA224_TEST_VECTORS     2
507
508 static struct hash_testvec sha224_tv_template[] = {
509         {
510                 .plaintext = "abc",
511                 .psize  = 3,
512                 .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
513                           "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
514                           "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
515                           "\xE3\x6C\x9D\xA7",
516         }, {
517                 .plaintext =
518                 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
519                 .psize  = 56,
520                 .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
521                           "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
522                           "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
523                           "\x52\x52\x25\x25",
524                 .np     = 2,
525                 .tap    = { 28, 28 }
526         }
527 };
528
529 /*
530  * SHA256 test vectors from from NIST
531  */
532 #define SHA256_TEST_VECTORS     2
533
534 static struct hash_testvec sha256_tv_template[] = {
535         {
536                 .plaintext = "abc",
537                 .psize  = 3,
538                 .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
539                           "\x41\x41\x40\xde\x5d\xae\x22\x23"
540                           "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
541                           "\xb4\x10\xff\x61\xf2\x00\x15\xad",
542         }, {
543                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
544                 .psize  = 56,
545                 .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
546                           "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
547                           "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
548                           "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
549                 .np     = 2,
550                 .tap    = { 28, 28 }
551         },
552 };
553
554 /*
555  * SHA384 test vectors from from NIST and kerneli
556  */
557 #define SHA384_TEST_VECTORS     4
558
559 static struct hash_testvec sha384_tv_template[] = {
560         {
561                 .plaintext= "abc",
562                 .psize  = 3,
563                 .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
564                           "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
565                           "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
566                           "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
567                           "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
568                           "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
569         }, {
570                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
571                 .psize  = 56,
572                 .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
573                           "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
574                           "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
575                           "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
576                           "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
577                           "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
578         }, {
579                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
580                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
581                 .psize  = 112,
582                 .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
583                           "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
584                           "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
585                           "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
586                           "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
587                           "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
588         }, {
589                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
590                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
591                 .psize  = 104,
592                 .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
593                           "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
594                           "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
595                           "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
596                           "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
597                           "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
598                 .np     = 4,
599                 .tap    = { 26, 26, 26, 26 }
600         },
601 };
602
603 /*
604  * SHA512 test vectors from from NIST and kerneli
605  */
606 #define SHA512_TEST_VECTORS     4
607
608 static struct hash_testvec sha512_tv_template[] = {
609         {
610                 .plaintext = "abc",
611                 .psize  = 3,
612                 .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
613                           "\xcc\x41\x73\x49\xae\x20\x41\x31"
614                           "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
615                           "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
616                           "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
617                           "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
618                           "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
619                           "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
620         }, {
621                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
622                 .psize  = 56,
623                 .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
624                           "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
625                           "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
626                           "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
627                           "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
628                           "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
629                           "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
630                           "\x54\xec\x63\x12\x38\xca\x34\x45",
631         }, {
632                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
633                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
634                 .psize  = 112,
635                 .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
636                           "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
637                           "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
638                           "\x72\x99\xae\xad\xb6\x88\x90\x18"
639                           "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
640                           "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
641                           "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
642                           "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
643         }, {
644                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
645                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
646                 .psize  = 104,
647                 .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
648                           "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
649                           "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
650                           "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
651                           "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
652                           "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
653                           "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
654                           "\xed\xb4\x19\x87\x23\x28\x50\xc9",
655                 .np     = 4,
656                 .tap    = { 26, 26, 26, 26 }
657         },
658 };
659
660
661 /*
662  * WHIRLPOOL test vectors from Whirlpool package
663  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
664  * submission
665  */
666 #define WP512_TEST_VECTORS      8
667
668 static struct hash_testvec wp512_tv_template[] = {
669         {
670                 .plaintext = "",
671                 .psize  = 0,
672                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
673                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
674                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
675                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
676                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
677                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
678                           "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
679                           "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
680
681
682         }, {
683                 .plaintext = "a",
684                 .psize  = 1,
685                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
686                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
687                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
688                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
689                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
690                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
691                           "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
692                           "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
693         }, {
694                 .plaintext = "abc",
695                 .psize  = 3,
696                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
697                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
698                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
699                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
700                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
701                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
702                           "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
703                           "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
704         }, {
705                 .plaintext = "message digest",
706                 .psize  = 14,
707                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
708                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
709                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
710                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
711                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
712                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
713                           "\x92\xED\x92\x00\x52\x83\x8F\x33"
714                           "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
715         }, {
716                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
717                 .psize  = 26,
718                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
719                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
720                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
721                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
722                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
723                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
724                           "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
725                           "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
726         }, {
727                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
728                            "abcdefghijklmnopqrstuvwxyz0123456789",
729                 .psize  = 62,
730                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
731                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
732                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
733                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
734                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
735                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
736                           "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
737                           "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
738         }, {
739                 .plaintext = "1234567890123456789012345678901234567890"
740                            "1234567890123456789012345678901234567890",
741                 .psize  = 80,
742                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
743                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
744                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
745                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
746                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
747                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
748                           "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
749                           "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
750         }, {
751                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
752                 .psize  = 32,
753                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
754                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
755                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
756                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
757                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
758                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
759                           "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
760                           "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
761         },
762 };
763
764 #define WP384_TEST_VECTORS      8
765
766 static struct hash_testvec wp384_tv_template[] = {
767         {
768                 .plaintext = "",
769                 .psize  = 0,
770                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
771                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
772                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
773                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
774                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
775                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
776
777
778         }, {
779                 .plaintext = "a",
780                 .psize  = 1,
781                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
782                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
783                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
784                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
785                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
786                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
787         }, {
788                 .plaintext = "abc",
789                 .psize  = 3,
790                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
791                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
792                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
793                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
794                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
795                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
796         }, {
797                 .plaintext = "message digest",
798                 .psize  = 14,
799                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
800                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
801                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
802                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
803                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
804                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
805         }, {
806                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
807                 .psize  = 26,
808                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
809                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
810                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
811                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
812                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
813                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
814         }, {
815                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
816                            "abcdefghijklmnopqrstuvwxyz0123456789",
817                 .psize  = 62,
818                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
819                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
820                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
821                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
822                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
823                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
824         }, {
825                 .plaintext = "1234567890123456789012345678901234567890"
826                            "1234567890123456789012345678901234567890",
827                 .psize  = 80,
828                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
829                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
830                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
831                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
832                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
833                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
834         }, {
835                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
836                 .psize  = 32,
837                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
838                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
839                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
840                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
841                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
842                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
843         },
844 };
845
846 #define WP256_TEST_VECTORS      8
847
848 static struct hash_testvec wp256_tv_template[] = {
849         {
850                 .plaintext = "",
851                 .psize  = 0,
852                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
853                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
854                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
855                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
856
857
858         }, {
859                 .plaintext = "a",
860                 .psize  = 1,
861                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
862                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
863                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
864                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
865         }, {
866                 .plaintext = "abc",
867                 .psize  = 3,
868                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
869                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
870                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
871                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
872         }, {
873                 .plaintext = "message digest",
874                 .psize  = 14,
875                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
876                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
877                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
878                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
879         }, {
880                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
881                 .psize  = 26,
882                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
883                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
884                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
885                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
886         }, {
887                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
888                            "abcdefghijklmnopqrstuvwxyz0123456789",
889                 .psize  = 62,
890                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
891                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
892                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
893                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
894         }, {
895                 .plaintext = "1234567890123456789012345678901234567890"
896                            "1234567890123456789012345678901234567890",
897                 .psize  = 80,
898                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
899                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
900                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
901                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
902         }, {
903                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
904                 .psize  = 32,
905                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
906                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
907                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
908                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
909         },
910 };
911
912 /*
913  * TIGER test vectors from Tiger website
914  */
915 #define TGR192_TEST_VECTORS     6
916
917 static struct hash_testvec tgr192_tv_template[] = {
918         {
919                 .plaintext = "",
920                 .psize  = 0,
921                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
922                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
923                           "\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
924         }, {
925                 .plaintext = "abc",
926                 .psize  = 3,
927                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
928                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
929                           "\x93\x5f\x7b\x95\x1c\x13\x29\x51",
930         }, {
931                 .plaintext = "Tiger",
932                 .psize  = 5,
933                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
934                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
935                           "\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
936         }, {
937                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
938                 .psize  = 64,
939                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
940                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
941                           "\xb5\x86\x44\x50\x34\xa5\xa3\x86",
942         }, {
943                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
944                 .psize  = 64,
945                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
946                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
947                           "\x57\x89\x65\x65\x97\x5f\x91\x97",
948         }, {
949                 .plaintext = "Tiger - A Fast New Hash Function, "
950                            "by Ross Anderson and Eli Biham, "
951                            "proceedings of Fast Software Encryption 3, "
952                            "Cambridge, 1996.",
953                 .psize  = 125,
954                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
955                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
956                           "\xdd\x68\x15\x1d\x50\x39\x74\xfc",
957         },
958 };
959
960 #define TGR160_TEST_VECTORS     6
961
962 static struct hash_testvec tgr160_tv_template[] = {
963         {
964                 .plaintext = "",
965                 .psize  = 0,
966                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
967                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
968                           "\xf3\x73\xde\x2d",
969         }, {
970                 .plaintext = "abc",
971                 .psize  = 3,
972                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
973                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
974                           "\x93\x5f\x7b\x95",
975         }, {
976                 .plaintext = "Tiger",
977                 .psize  = 5,
978                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
979                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
980                           "\x37\x79\x0c\x11",
981         }, {
982                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
983                 .psize  = 64,
984                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
985                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
986                           "\xb5\x86\x44\x50",
987         }, {
988                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
989                 .psize  = 64,
990                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
991                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
992                           "\x57\x89\x65\x65",
993         }, {
994                 .plaintext = "Tiger - A Fast New Hash Function, "
995                            "by Ross Anderson and Eli Biham, "
996                            "proceedings of Fast Software Encryption 3, "
997                            "Cambridge, 1996.",
998                 .psize  = 125,
999                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
1000                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
1001                           "\xdd\x68\x15\x1d",
1002         },
1003 };
1004
1005 #define TGR128_TEST_VECTORS     6
1006
1007 static struct hash_testvec tgr128_tv_template[] = {
1008         {
1009                 .plaintext = "",
1010                 .psize  = 0,
1011                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
1012                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
1013         }, {
1014                 .plaintext = "abc",
1015                 .psize  = 3,
1016                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
1017                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
1018         }, {
1019                 .plaintext = "Tiger",
1020                 .psize  = 5,
1021                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
1022                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
1023         }, {
1024                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1025                 .psize  = 64,
1026                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
1027                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
1028         }, {
1029                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
1030                 .psize  = 64,
1031                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
1032                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
1033         }, {
1034                 .plaintext = "Tiger - A Fast New Hash Function, "
1035                            "by Ross Anderson and Eli Biham, "
1036                            "proceedings of Fast Software Encryption 3, "
1037                            "Cambridge, 1996.",
1038                 .psize  = 125,
1039                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
1040                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
1041         },
1042 };
1043
1044 #define GHASH_TEST_VECTORS 1
1045
1046 static struct hash_testvec ghash_tv_template[] =
1047 {
1048         {
1049
1050                 .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61",
1051                 .ksize  = 16,
1052                 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
1053                 .psize  = 16,
1054                 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
1055                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
1056         },
1057 };
1058
1059 /*
1060  * HMAC-MD5 test vectors from RFC2202
1061  * (These need to be fixed to not use strlen).
1062  */
1063 #define HMAC_MD5_TEST_VECTORS   7
1064
1065 static struct hash_testvec hmac_md5_tv_template[] =
1066 {
1067         {
1068                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1069                 .ksize  = 16,
1070                 .plaintext = "Hi There",
1071                 .psize  = 8,
1072                 .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
1073                           "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
1074         }, {
1075                 .key    = "Jefe",
1076                 .ksize  = 4,
1077                 .plaintext = "what do ya want for nothing?",
1078                 .psize  = 28,
1079                 .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
1080                           "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
1081                 .np     = 2,
1082                 .tap    = {14, 14}
1083         }, {
1084                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1085                 .ksize  = 16,
1086                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1087                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1088                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1089                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1090                 .psize  = 50,
1091                 .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
1092                           "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
1093         }, {
1094                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1095                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1096                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1097                 .ksize  = 25,
1098                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1099                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1100                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1101                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1102                 .psize  = 50,
1103                 .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
1104                           "\x3a\x75\x16\x47\x46\xff\xaa\x79",
1105         }, {
1106                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1107                 .ksize  = 16,
1108                 .plaintext = "Test With Truncation",
1109                 .psize  = 20,
1110                 .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
1111                           "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
1112         }, {
1113                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1114                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1115                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1116                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1117                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1118                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1119                         "\xaa\xaa",
1120                 .ksize  = 80,
1121                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1122                 .psize  = 54,
1123                 .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
1124                           "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
1125         }, {
1126                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1127                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1128                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1129                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1130                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1131                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1132                         "\xaa\xaa",
1133                 .ksize  = 80,
1134                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1135                            "Block-Size Data",
1136                 .psize  = 73,
1137                 .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
1138                           "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
1139         },
1140 };
1141
1142 /*
1143  * HMAC-RIPEMD128 test vectors from RFC2286
1144  */
1145 #define HMAC_RMD128_TEST_VECTORS        7
1146
1147 static struct hash_testvec hmac_rmd128_tv_template[] = {
1148         {
1149                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1150                 .ksize  = 16,
1151                 .plaintext = "Hi There",
1152                 .psize  = 8,
1153                 .digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
1154                           "\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
1155         }, {
1156                 .key    = "Jefe",
1157                 .ksize  = 4,
1158                 .plaintext = "what do ya want for nothing?",
1159                 .psize  = 28,
1160                 .digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
1161                           "\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
1162                 .np     = 2,
1163                 .tap    = { 14, 14 },
1164         }, {
1165                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1166                 .ksize  = 16,
1167                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1168                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1169                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1170                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1171                 .psize  = 50,
1172                 .digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
1173                           "\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
1174         }, {
1175                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1176                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1177                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1178                 .ksize  = 25,
1179                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1180                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1181                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1182                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1183                 .psize  = 50,
1184                 .digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
1185                           "\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
1186         }, {
1187                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1188                 .ksize  = 16,
1189                 .plaintext = "Test With Truncation",
1190                 .psize  = 20,
1191                 .digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
1192                           "\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
1193         }, {
1194                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1195                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1196                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1197                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1198                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1199                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1200                         "\xaa\xaa",
1201                 .ksize  = 80,
1202                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1203                 .psize  = 54,
1204                 .digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
1205                           "\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
1206         }, {
1207                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1208                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1209                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1210                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1211                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1212                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1213                         "\xaa\xaa",
1214                 .ksize  = 80,
1215                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1216                            "Block-Size Data",
1217                 .psize  = 73,
1218                 .digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
1219                           "\x06\x90\xc2\x37\x63\x5f\x30\xc5",
1220         },
1221 };
1222
1223 /*
1224  * HMAC-RIPEMD160 test vectors from RFC2286
1225  */
1226 #define HMAC_RMD160_TEST_VECTORS        7
1227
1228 static struct hash_testvec hmac_rmd160_tv_template[] = {
1229         {
1230                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1231                 .ksize  = 20,
1232                 .plaintext = "Hi There",
1233                 .psize  = 8,
1234                 .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
1235                           "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
1236         }, {
1237                 .key    = "Jefe",
1238                 .ksize  = 4,
1239                 .plaintext = "what do ya want for nothing?",
1240                 .psize  = 28,
1241                 .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
1242                           "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
1243                 .np     = 2,
1244                 .tap    = { 14, 14 },
1245         }, {
1246                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1247                 .ksize  = 20,
1248                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1249                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1250                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1251                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1252                 .psize  = 50,
1253                 .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
1254                           "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
1255         }, {
1256                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1257                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1258                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1259                 .ksize  = 25,
1260                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1261                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1262                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1263                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1264                 .psize  = 50,
1265                 .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
1266                           "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
1267         }, {
1268                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1269                 .ksize  = 20,
1270                 .plaintext = "Test With Truncation",
1271                 .psize  = 20,
1272                 .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
1273                           "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
1274         }, {
1275                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1276                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1277                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1278                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1279                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1280                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1281                         "\xaa\xaa",
1282                 .ksize  = 80,
1283                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1284                 .psize  = 54,
1285                 .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
1286                           "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
1287         }, {
1288                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1289                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1290                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1291                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1292                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1293                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1294                         "\xaa\xaa",
1295                 .ksize  = 80,
1296                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1297                            "Block-Size Data",
1298                 .psize  = 73,
1299                 .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
1300                           "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
1301         },
1302 };
1303
1304 /*
1305  * HMAC-SHA1 test vectors from RFC2202
1306  */
1307 #define HMAC_SHA1_TEST_VECTORS  7
1308
1309 static struct hash_testvec hmac_sha1_tv_template[] = {
1310         {
1311                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1312                 .ksize  = 20,
1313                 .plaintext = "Hi There",
1314                 .psize  = 8,
1315                 .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
1316                           "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
1317                           "\x46\xbe",
1318         }, {
1319                 .key    = "Jefe",
1320                 .ksize  = 4,
1321                 .plaintext = "what do ya want for nothing?",
1322                 .psize  = 28,
1323                 .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
1324                           "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
1325                 .np     = 2,
1326                 .tap    = { 14, 14 }
1327         }, {
1328                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1329                 .ksize  = 20,
1330                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1331                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1332                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1333                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1334                 .psize  = 50,
1335                 .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
1336                           "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
1337         }, {
1338                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1339                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1340                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1341                 .ksize  = 25,
1342                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1343                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1344                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1345                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1346                 .psize  = 50,
1347                 .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
1348                           "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
1349         }, {
1350                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1351                 .ksize  = 20,
1352                 .plaintext = "Test With Truncation",
1353                 .psize  = 20,
1354                 .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
1355                           "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
1356         }, {
1357                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1358                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1359                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1360                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1361                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1362                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1363                         "\xaa\xaa",
1364                 .ksize  = 80,
1365                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1366                 .psize  = 54,
1367                 .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
1368                           "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
1369         }, {
1370                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1371                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1372                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1373                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1374                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1375                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1376                         "\xaa\xaa",
1377                 .ksize  = 80,
1378                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1379                            "Block-Size Data",
1380                 .psize  = 73,
1381                 .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
1382                           "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
1383         },
1384 };
1385
1386
1387 /*
1388  * SHA224 HMAC test vectors from RFC4231
1389  */
1390 #define HMAC_SHA224_TEST_VECTORS    4
1391
1392 static struct hash_testvec hmac_sha224_tv_template[] = {
1393         {
1394                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1395                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1396                         "\x0b\x0b\x0b\x0b",
1397                 .ksize  = 20,
1398                 /*  ("Hi There") */
1399                 .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
1400                 .psize  = 8,
1401                 .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
1402                         "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
1403                         "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
1404                         "\x53\x68\x4b\x22",
1405         }, {
1406                 .key    = "Jefe",
1407                 .ksize  = 4,
1408                 /* ("what do ya want for nothing?") */
1409                 .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
1410                         "\x79\x61\x20\x77\x61\x6e\x74\x20"
1411                         "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
1412                         "\x69\x6e\x67\x3f",
1413                 .psize  = 28,
1414                 .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
1415                         "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
1416                         "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
1417                         "\x8f\xd0\x5e\x44",
1418                 .np = 4,
1419                 .tap    = { 7, 7, 7, 7 }
1420         }, {
1421                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1422                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1423                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1424                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1425                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1426                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1427                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1428                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1429                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1430                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1431                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1432                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1433                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1434                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1435                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1436                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1437                         "\xaa\xaa\xaa",
1438                 .ksize  = 131,
1439                 /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
1440                 .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
1441                         "\x6e\x67\x20\x4c\x61\x72\x67\x65"
1442                         "\x72\x20\x54\x68\x61\x6e\x20\x42"
1443                         "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
1444                         "\x65\x20\x4b\x65\x79\x20\x2d\x20"
1445                         "\x48\x61\x73\x68\x20\x4b\x65\x79"
1446                         "\x20\x46\x69\x72\x73\x74",
1447                 .psize  = 54,
1448                 .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
1449                         "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
1450                         "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
1451                         "\x3f\xa6\x87\x0e",
1452         }, {
1453                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1454                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1455                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1456                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1457                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1458                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1459                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1460                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1461                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1462                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1463                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1464                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1465                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1466                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1467                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1468                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1469                         "\xaa\xaa\xaa",
1470                 .ksize  = 131,
1471                 /* ("This is a test using a larger than block-size key and a")
1472                 (" larger than block-size data. The key needs to be")
1473                         (" hashed before being used by the HMAC algorithm.") */
1474                 .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
1475                         "\x61\x20\x74\x65\x73\x74\x20\x75"
1476                         "\x73\x69\x6e\x67\x20\x61\x20\x6c"
1477                         "\x61\x72\x67\x65\x72\x20\x74\x68"
1478                         "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
1479                         "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
1480                         "\x79\x20\x61\x6e\x64\x20\x61\x20"
1481                         "\x6c\x61\x72\x67\x65\x72\x20\x74"
1482                         "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
1483                         "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
1484                         "\x61\x74\x61\x2e\x20\x54\x68\x65"
1485                         "\x20\x6b\x65\x79\x20\x6e\x65\x65"
1486                         "\x64\x73\x20\x74\x6f\x20\x62\x65"
1487                         "\x20\x68\x61\x73\x68\x65\x64\x20"
1488                         "\x62\x65\x66\x6f\x72\x65\x20\x62"
1489                         "\x65\x69\x6e\x67\x20\x75\x73\x65"
1490                         "\x64\x20\x62\x79\x20\x74\x68\x65"
1491                         "\x20\x48\x4d\x41\x43\x20\x61\x6c"
1492                         "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
1493                 .psize  = 152,
1494                 .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
1495                         "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
1496                         "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
1497                         "\xf6\xf5\x65\xd1",
1498         },
1499 };
1500
1501 /*
1502  * HMAC-SHA256 test vectors from
1503  * draft-ietf-ipsec-ciph-sha-256-01.txt
1504  */
1505 #define HMAC_SHA256_TEST_VECTORS        10
1506
1507 static struct hash_testvec hmac_sha256_tv_template[] = {
1508         {
1509                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1510                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1511                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1512                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1513                 .ksize  = 32,
1514                 .plaintext = "abc",
1515                 .psize  = 3,
1516                 .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
1517                           "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
1518                           "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
1519                           "\x92\x75\x90\x21\xcf\xab\x81\x81",
1520         }, {
1521                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1522                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1523                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1524                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1525                 .ksize  = 32,
1526                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1527                 .psize  = 56,
1528                 .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
1529                           "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
1530                           "\xe6\x98\xe3\x61\x19\x42\x11\x49"
1531                           "\xea\x8c\x71\x24\x56\x69\x7d\x30",
1532         }, {
1533                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1534                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1535                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1536                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1537                 .ksize  = 32,
1538                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
1539                            "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1540                 .psize  = 112,
1541                 .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
1542                           "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
1543                           "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
1544                           "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
1545         }, {
1546                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1547                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1548                         "\x0b\x0b\x0b\x0b\x0b\x0b",
1549                 .ksize  = 32,
1550                 .plaintext = "Hi There",
1551                 .psize  = 8,
1552                 .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
1553                           "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
1554                           "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
1555                           "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
1556         }, {
1557                 .key    = "Jefe",
1558                 .ksize  = 4,
1559                 .plaintext = "what do ya want for nothing?",
1560                 .psize  = 28,
1561                 .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
1562                           "\x6a\x04\x24\x26\x08\x95\x75\xc7"
1563                           "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
1564                           "\x9d\xec\x58\xb9\x64\xec\x38\x43",
1565                 .np     = 2,
1566                 .tap    = { 14, 14 }
1567         }, {
1568                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1569                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1570                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1571                 .ksize  = 32,
1572                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1573                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1574                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1575                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1576                 .psize  = 50,
1577                 .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
1578                           "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
1579                           "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
1580                           "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
1581         }, {
1582                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1583                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1584                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1585                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
1586                           "\x21\x22\x23\x24\x25",
1587                 .ksize  = 37,
1588                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1589                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1590                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1591                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1592                 .psize  = 50,
1593                 .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
1594                           "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
1595                           "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
1596                           "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
1597         }, {
1598                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
1599                         "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
1600                         "\x0c\x0c\x0c\x0c\x0c\x0c",
1601                 .ksize  = 32,
1602                 .plaintext = "Test With Truncation",
1603                 .psize  = 20,
1604                 .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
1605                           "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
1606                           "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
1607                           "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
1608         }, {
1609                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1610                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1611                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1612                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1613                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1614                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1615                         "\xaa\xaa",
1616                 .ksize  = 80,
1617                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1618                 .psize  = 54,
1619                 .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
1620                           "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
1621                           "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
1622                           "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
1623         }, {
1624                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1625                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1626                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1627                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1628                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1629                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1630                         "\xaa\xaa",
1631                 .ksize  = 80,
1632                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
1633                            "One Block-Size Data",
1634                 .psize  = 73,
1635                 .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
1636                           "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
1637                           "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
1638                           "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
1639         },
1640 };
1641
1642 #define XCBC_AES_TEST_VECTORS 6
1643
1644 static struct hash_testvec aes_xcbc128_tv_template[] = {
1645         {
1646                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1647                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1648                 .plaintext = zeroed_string,
1649                 .digest = "\x75\xf0\x25\x1d\x52\x8a\xc0\x1c"
1650                           "\x45\x73\xdf\xd5\x84\xd7\x9f\x29",
1651                 .psize  = 0,
1652                 .ksize  = 16,
1653         }, {
1654                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1655                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1656                 .plaintext = "\x00\x01\x02",
1657                 .digest = "\x5b\x37\x65\x80\xae\x2f\x19\xaf"
1658                           "\xe7\x21\x9c\xee\xf1\x72\x75\x6f",
1659                 .psize  = 3,
1660                 .ksize  = 16,
1661         } , {
1662                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1663                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1664                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1665                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1666                 .digest = "\xd2\xa2\x46\xfa\x34\x9b\x68\xa7"
1667                           "\x99\x98\xa4\x39\x4f\xf7\xa2\x63",
1668                 .psize  = 16,
1669                 .ksize  = 16,
1670         }, {
1671                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1672                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1673                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1674                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1675                              "\x10\x11\x12\x13",
1676                 .digest = "\x47\xf5\x1b\x45\x64\x96\x62\x15"
1677                           "\xb8\x98\x5c\x63\x05\x5e\xd3\x08",
1678                 .tap    = { 10, 10 },
1679                 .psize  = 20,
1680                 .np     = 2,
1681                 .ksize  = 16,
1682         }, {
1683                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1684                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1685                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1686                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1687                              "\x10\x11\x12\x13\x14\x15\x16\x17"
1688                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
1689                 .digest = "\xf5\x4f\x0e\xc8\xd2\xb9\xf3\xd3"
1690                           "\x68\x07\x73\x4b\xd5\x28\x3f\xd4",
1691                 .psize  = 32,
1692                 .ksize  = 16,
1693         }, {
1694                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1695                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1696                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1697                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1698                              "\x10\x11\x12\x13\x14\x15\x16\x17"
1699                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
1700                              "\x20\x21",
1701                 .digest = "\xbe\xcb\xb3\xbc\xcd\xb5\x18\xa3"
1702                           "\x06\x77\xd5\x48\x1f\xb6\xb4\xd8",
1703                 .tap    = { 17, 17 },
1704                 .psize  = 34,
1705                 .np     = 2,
1706                 .ksize  = 16,
1707         }
1708 };
1709
1710 #define VMAC_AES_TEST_VECTORS   8
1711 static char vmac_string1[128] = {'\x01', '\x01', '\x01', '\x01',
1712                                 '\x02', '\x03', '\x02', '\x02',
1713                                 '\x02', '\x04', '\x01', '\x07',
1714                                 '\x04', '\x01', '\x04', '\x03',};
1715 static char vmac_string2[128] = {'a', 'b', 'c',};
1716 static char vmac_string3[128] = {'a', 'b', 'c', 'a', 'b', 'c',
1717                                 'a', 'b', 'c', 'a', 'b', 'c',
1718                                 'a', 'b', 'c', 'a', 'b', 'c',
1719                                 'a', 'b', 'c', 'a', 'b', 'c',
1720                                 'a', 'b', 'c', 'a', 'b', 'c',
1721                                 'a', 'b', 'c', 'a', 'b', 'c',
1722                                 'a', 'b', 'c', 'a', 'b', 'c',
1723                                 'a', 'b', 'c', 'a', 'b', 'c',
1724                                 };
1725
1726 static struct hash_testvec aes_vmac128_tv_template[] = {
1727         {
1728                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1729                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1730                 .plaintext = NULL,
1731                 .digest = "\x07\x58\x80\x35\x77\xa4\x7b\x54",
1732                 .psize  = 0,
1733                 .ksize  = 16,
1734         }, {
1735                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1736                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1737                 .plaintext = vmac_string1,
1738                 .digest = "\xce\xf5\x3c\xd3\xae\x68\x8c\xa1",
1739                 .psize  = 128,
1740                 .ksize  = 16,
1741         }, {
1742                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1743                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1744                 .plaintext = vmac_string2,
1745                 .digest = "\xc9\x27\xb0\x73\x81\xbd\x14\x2d",
1746                 .psize  = 128,
1747                 .ksize  = 16,
1748         }, {
1749                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1750                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1751                 .plaintext = vmac_string3,
1752                 .digest = "\x8d\x1a\x95\x8c\x98\x47\x0b\x19",
1753                 .psize  = 128,
1754                 .ksize  = 16,
1755         }, {
1756                 .key    = "abcdefghijklmnop",
1757                 .plaintext = NULL,
1758                 .digest = "\x3b\x89\xa1\x26\x9e\x55\x8f\x84",
1759                 .psize  = 0,
1760                 .ksize  = 16,
1761         }, {
1762                 .key    = "abcdefghijklmnop",
1763                 .plaintext = vmac_string1,
1764                 .digest = "\xab\x5e\xab\xb0\xf6\x8d\x74\xc2",
1765                 .psize  = 128,
1766                 .ksize  = 16,
1767         }, {
1768                 .key    = "abcdefghijklmnop",
1769                 .plaintext = vmac_string2,
1770                 .digest = "\x11\x15\x68\x42\x3d\x7b\x09\xdf",
1771                 .psize  = 128,
1772                 .ksize  = 16,
1773         }, {
1774                 .key    = "abcdefghijklmnop",
1775                 .plaintext = vmac_string3,
1776                 .digest = "\x8b\x32\x8f\xe1\xed\x8f\xfa\xd4",
1777                 .psize  = 128,
1778                 .ksize  = 16,
1779         },
1780 };
1781
1782 /*
1783  * SHA384 HMAC test vectors from RFC4231
1784  */
1785
1786 #define HMAC_SHA384_TEST_VECTORS        4
1787
1788 static struct hash_testvec hmac_sha384_tv_template[] = {
1789         {
1790                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1791                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1792                           "\x0b\x0b\x0b\x0b",
1793                 .ksize  = 20,
1794                 .plaintext = "Hi There",
1795                 .psize  = 8,
1796                 .digest = "\xaf\xd0\x39\x44\xd8\x48\x95\x62"
1797                           "\x6b\x08\x25\xf4\xab\x46\x90\x7f"
1798                           "\x15\xf9\xda\xdb\xe4\x10\x1e\xc6"
1799                           "\x82\xaa\x03\x4c\x7c\xeb\xc5\x9c"
1800                           "\xfa\xea\x9e\xa9\x07\x6e\xde\x7f"
1801                           "\x4a\xf1\x52\xe8\xb2\xfa\x9c\xb6",
1802         }, {
1803                 .key    = "Jefe",
1804                 .ksize  = 4,
1805                 .plaintext = "what do ya want for nothing?",
1806                 .psize  = 28,
1807                 .digest = "\xaf\x45\xd2\xe3\x76\x48\x40\x31"
1808                           "\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
1809                           "\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47"
1810                           "\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
1811                           "\x8e\x22\x40\xca\x5e\x69\xe2\xc7"
1812                           "\x8b\x32\x39\xec\xfa\xb2\x16\x49",
1813                 .np     = 4,
1814                 .tap    = { 7, 7, 7, 7 }
1815         }, {
1816                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1817                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1818                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1819                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1820                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1821                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1822                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1823                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1824                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1825                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1826                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1827                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1828                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1829                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1830                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1831                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1832                           "\xaa\xaa\xaa",
1833                 .ksize  = 131,
1834                 .plaintext = "Test Using Larger Than Block-Siz"
1835                            "e Key - Hash Key First",
1836                 .psize  = 54,
1837                 .digest = "\x4e\xce\x08\x44\x85\x81\x3e\x90"
1838                           "\x88\xd2\xc6\x3a\x04\x1b\xc5\xb4"
1839                           "\x4f\x9e\xf1\x01\x2a\x2b\x58\x8f"
1840                           "\x3c\xd1\x1f\x05\x03\x3a\xc4\xc6"
1841                           "\x0c\x2e\xf6\xab\x40\x30\xfe\x82"
1842                           "\x96\x24\x8d\xf1\x63\xf4\x49\x52",
1843         }, {
1844                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1845                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1846                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1847                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1848                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1849                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1850                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1851                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1852                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1853                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1854                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1855                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1856                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1857                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1858                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1859                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1860                           "\xaa\xaa\xaa",
1861                 .ksize  = 131,
1862                 .plaintext = "This is a test u"
1863                            "sing a larger th"
1864                            "an block-size ke"
1865                            "y and a larger t"
1866                            "han block-size d"
1867                            "ata. The key nee"
1868                            "ds to be hashed "
1869                            "before being use"
1870                            "d by the HMAC al"
1871                            "gorithm.",
1872                 .psize  = 152,
1873                 .digest = "\x66\x17\x17\x8e\x94\x1f\x02\x0d"
1874                           "\x35\x1e\x2f\x25\x4e\x8f\xd3\x2c"
1875                           "\x60\x24\x20\xfe\xb0\xb8\xfb\x9a"
1876                           "\xdc\xce\xbb\x82\x46\x1e\x99\xc5"
1877                           "\xa6\x78\xcc\x31\xe7\x99\x17\x6d"
1878                           "\x38\x60\xe6\x11\x0c\x46\x52\x3e",
1879         },
1880 };
1881
1882 /*
1883  * SHA512 HMAC test vectors from RFC4231
1884  */
1885
1886 #define HMAC_SHA512_TEST_VECTORS        4
1887
1888 static struct hash_testvec hmac_sha512_tv_template[] = {
1889         {
1890                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1891                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1892                           "\x0b\x0b\x0b\x0b",
1893                 .ksize  = 20,
1894                 .plaintext = "Hi There",
1895                 .psize  = 8,
1896                 .digest = "\x87\xaa\x7c\xde\xa5\xef\x61\x9d"
1897                           "\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0"
1898                           "\x23\x79\xf4\xe2\xce\x4e\xc2\x78"
1899                           "\x7a\xd0\xb3\x05\x45\xe1\x7c\xde"
1900                           "\xda\xa8\x33\xb7\xd6\xb8\xa7\x02"
1901                           "\x03\x8b\x27\x4e\xae\xa3\xf4\xe4"
1902                           "\xbe\x9d\x91\x4e\xeb\x61\xf1\x70"
1903                           "\x2e\x69\x6c\x20\x3a\x12\x68\x54",
1904         }, {
1905                 .key    = "Jefe",
1906                 .ksize  = 4,
1907                 .plaintext = "what do ya want for nothing?",
1908                 .psize  = 28,
1909                 .digest = "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2"
1910                           "\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
1911                           "\x87\xbd\x64\x22\x2e\x83\x1f\xd6"
1912                           "\x10\x27\x0c\xd7\xea\x25\x05\x54"
1913                           "\x97\x58\xbf\x75\xc0\x5a\x99\x4a"
1914                           "\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd"
1915                           "\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b"
1916                           "\x63\x6e\x07\x0a\x38\xbc\xe7\x37",
1917                 .np     = 4,
1918                 .tap    = { 7, 7, 7, 7 }
1919         }, {
1920                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1921                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1922                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1923                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1924                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1925                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1926                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1927                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1928                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1929                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1930                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1931                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1932                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1933                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1934                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1935                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1936                           "\xaa\xaa\xaa",
1937                 .ksize  = 131,
1938                 .plaintext = "Test Using Large"
1939                            "r Than Block-Siz"
1940                            "e Key - Hash Key"
1941                            " First",
1942                 .psize  = 54,
1943                 .digest = "\x80\xb2\x42\x63\xc7\xc1\xa3\xeb"
1944                         "\xb7\x14\x93\xc1\xdd\x7b\xe8\xb4"
1945                         "\x9b\x46\xd1\xf4\x1b\x4a\xee\xc1"
1946                         "\x12\x1b\x01\x37\x83\xf8\xf3\x52"
1947                         "\x6b\x56\xd0\x37\xe0\x5f\x25\x98"
1948                         "\xbd\x0f\xd2\x21\x5d\x6a\x1e\x52"
1949                         "\x95\xe6\x4f\x73\xf6\x3f\x0a\xec"
1950                         "\x8b\x91\x5a\x98\x5d\x78\x65\x98",
1951         }, {
1952                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1953                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1954                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1955                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1956                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1957                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1958                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1959                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1960                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1961                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1962                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1963                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1964                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1965                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1966                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1967                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1968                         "\xaa\xaa\xaa",
1969                 .ksize  = 131,
1970                 .plaintext =
1971                           "This is a test u"
1972                           "sing a larger th"
1973                           "an block-size ke"
1974                           "y and a larger t"
1975                           "han block-size d"
1976                           "ata. The key nee"
1977                           "ds to be hashed "
1978                           "before being use"
1979                           "d by the HMAC al"
1980                           "gorithm.",
1981                 .psize  = 152,
1982                 .digest = "\xe3\x7b\x6a\x77\x5d\xc8\x7d\xba"
1983                         "\xa4\xdf\xa9\xf9\x6e\x5e\x3f\xfd"
1984                         "\xde\xbd\x71\xf8\x86\x72\x89\x86"
1985                         "\x5d\xf5\xa3\x2d\x20\xcd\xc9\x44"
1986                         "\xb6\x02\x2c\xac\x3c\x49\x82\xb1"
1987                         "\x0d\x5e\xeb\x55\xc3\xe4\xde\x15"
1988                         "\x13\x46\x76\xfb\x6d\xe0\x44\x60"
1989                         "\x65\xc9\x74\x40\xfa\x8c\x6a\x58",
1990         },
1991 };
1992
1993 /*
1994  * DES test vectors.
1995  */
1996 #define DES_ENC_TEST_VECTORS            10
1997 #define DES_DEC_TEST_VECTORS            4
1998 #define DES_CBC_ENC_TEST_VECTORS        5
1999 #define DES_CBC_DEC_TEST_VECTORS        4
2000 #define DES3_EDE_ENC_TEST_VECTORS       3
2001 #define DES3_EDE_DEC_TEST_VECTORS       3
2002 #define DES3_EDE_CBC_ENC_TEST_VECTORS   1
2003 #define DES3_EDE_CBC_DEC_TEST_VECTORS   1
2004
2005 static struct cipher_testvec des_enc_tv_template[] = {
2006         { /* From Applied Cryptography */
2007                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2008                 .klen   = 8,
2009                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2010                 .ilen   = 8,
2011                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2012                 .rlen   = 8,
2013         }, { /* Same key, different plaintext block */
2014                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2015                 .klen   = 8,
2016                 .input  = "\x22\x33\x44\x55\x66\x77\x88\x99",
2017                 .ilen   = 8,
2018                 .result = "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2019                 .rlen   = 8,
2020         }, { /* Sbox test from NBS */
2021                 .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
2022                 .klen   = 8,
2023                 .input  = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
2024                 .ilen   = 8,
2025                 .result = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2026                 .rlen   = 8,
2027         }, { /* Three blocks */
2028                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2029                 .klen   = 8,
2030                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2031                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2032                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
2033                 .ilen   = 24,
2034                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2035                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2036                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
2037                 .rlen   = 24,
2038         }, { /* Weak key */
2039                 .fail   = 1,
2040                 .wk     = 1,
2041                 .key    = "\x01\x01\x01\x01\x01\x01\x01\x01",
2042                 .klen   = 8,
2043                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2044                 .ilen   = 8,
2045                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2046                 .rlen   = 8,
2047         }, { /* Two blocks -- for testing encryption across pages */
2048                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2049                 .klen   = 8,
2050                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2051                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2052                 .ilen   = 16,
2053                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2054                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2055                 .rlen   = 16,
2056                 .np     = 2,
2057                 .tap    = { 8, 8 }
2058         }, { /* Four blocks -- for testing encryption with chunking */
2059                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2060                 .klen   = 8,
2061                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2062                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2063                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef"
2064                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2065                 .ilen   = 32,
2066                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2067                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2068                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90"
2069                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2070                 .rlen   = 32,
2071                 .np     = 3,
2072                 .tap    = { 14, 10, 8 }
2073         }, {
2074                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2075                 .klen   = 8,
2076                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2077                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2078                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
2079                 .ilen   = 24,
2080                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2081                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2082                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
2083                 .rlen   = 24,
2084                 .np     = 4,
2085                 .tap    = { 2, 1, 3, 18 }
2086         }, {
2087                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2088                 .klen   = 8,
2089                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2090                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2091                 .ilen   = 16,
2092                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2093                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2094                 .rlen   = 16,
2095                 .np     = 5,
2096                 .tap    = { 2, 2, 2, 2, 8 }
2097         }, {
2098                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2099                 .klen   = 8,
2100                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2101                 .ilen   = 8,
2102                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2103                 .rlen   = 8,
2104                 .np     = 8,
2105                 .tap    = { 1, 1, 1, 1, 1, 1, 1, 1 }
2106         },
2107 };
2108
2109 static struct cipher_testvec des_dec_tv_template[] = {
2110         { /* From Applied Cryptography */
2111                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2112                 .klen   = 8,
2113                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2114                 .ilen   = 8,
2115                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2116                 .rlen   = 8,
2117         }, { /* Sbox test from NBS */
2118                 .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
2119                 .klen   = 8,
2120                 .input  = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2121                 .ilen   = 8,
2122                 .result = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
2123                 .rlen   = 8,
2124         }, { /* Two blocks, for chunking test */
2125                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2126                 .klen   = 8,
2127                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2128                           "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2129                 .ilen   = 16,
2130                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2131                           "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
2132                 .rlen   = 16,
2133                 .np     = 2,
2134                 .tap    = { 8, 8 }
2135         }, {
2136                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2137                 .klen   = 8,
2138                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2139                           "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2140                 .ilen   = 16,
2141                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2142                           "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
2143                 .rlen   = 16,
2144                 .np     = 3,
2145                 .tap    = { 3, 12, 1 }
2146         },
2147 };
2148
2149 static struct cipher_testvec des_cbc_enc_tv_template[] = {
2150         { /* From OpenSSL */
2151                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2152                 .klen   = 8,
2153                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2154                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2155                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2156                           "\x68\x65\x20\x74\x69\x6d\x65\x20",
2157                 .ilen   = 24,
2158                 .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
2159                           "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
2160                           "\x46\x8e\x91\x15\x78\x88\xba\x68",
2161                 .rlen   = 24,
2162         }, { /* FIPS Pub 81 */
2163                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2164                 .klen   = 8,
2165                 .iv     = "\x12\x34\x56\x78\x90\xab\xcd\xef",
2166                 .input  = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
2167                 .ilen   = 8,
2168                 .result = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2169                 .rlen   = 8,
2170         }, {
2171                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2172                 .klen   = 8,
2173                 .iv     = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2174                 .input  = "\x68\x65\x20\x74\x69\x6d\x65\x20",
2175                 .ilen   = 8,
2176                 .result = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2177                 .rlen   = 8,
2178         }, {
2179                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2180                 .klen   = 8,
2181                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2182                 .input  = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2183                 .ilen   = 8,
2184                 .result = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2185                 .rlen   = 8,
2186         }, { /* Copy of openssl vector for chunk testing */
2187              /* From OpenSSL */
2188                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2189                 .klen   = 8,
2190                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2191                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2192                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2193                           "\x68\x65\x20\x74\x69\x6d\x65\x20",
2194                 .ilen   = 24,
2195                 .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
2196                           "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
2197                           "\x46\x8e\x91\x15\x78\x88\xba\x68",
2198                 .rlen   = 24,
2199                 .np     = 2,
2200                 .tap    = { 13, 11 }
2201         },
2202 };
2203
2204 static struct cipher_testvec des_cbc_dec_tv_template[] = {
2205         { /* FIPS Pub 81 */
2206                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2207                 .klen   = 8,
2208                 .iv     = "\x12\x34\x56\x78\x90\xab\xcd\xef",
2209                 .input  = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2210                 .ilen   = 8,
2211                 .result = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
2212                 .rlen   = 8,
2213         }, {
2214                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2215                 .klen   = 8,
2216                 .iv     = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2217                 .input  = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2218                 .ilen   = 8,
2219                 .result = "\x68\x65\x20\x74\x69\x6d\x65\x20",
2220                 .rlen   = 8,
2221         }, {
2222                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2223                 .klen   = 8,
2224                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2225                 .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2226                 .ilen   = 8,
2227                 .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2228                 .rlen   = 8,
2229         }, { /* Copy of above, for chunk testing */
2230                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2231                 .klen   = 8,
2232                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2233                 .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2234                 .ilen   = 8,
2235                 .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2236                 .rlen   = 8,
2237                 .np     = 2,
2238                 .tap    = { 4, 4 }
2239         },
2240 };
2241
2242 static struct cipher_testvec des3_ede_enc_tv_template[] = {
2243         { /* These are from openssl */
2244                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2245                           "\x55\x55\x55\x55\x55\x55\x55\x55"
2246                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2247                 .klen   = 24,
2248                 .input  = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
2249                 .ilen   = 8,
2250                 .result = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
2251                 .rlen   = 8,
2252         }, {
2253                 .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
2254                           "\x86\x02\x87\x66\x59\x08\x21\x98"
2255                           "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
2256                 .klen   = 24,
2257                 .input  = "\x73\x71\x75\x69\x67\x67\x6c\x65",
2258                 .ilen   = 8,
2259                 .result = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
2260                 .rlen   = 8,
2261         }, {
2262                 .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
2263                           "\x91\x07\xd0\x15\x89\x19\x01\x01"
2264                           "\x19\x07\x92\x10\x98\x1a\x01\x01",
2265                 .klen   = 24,
2266                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
2267                 .ilen   = 8,
2268                 .result = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
2269                 .rlen   = 8,
2270         },
2271 };
2272
2273 static struct cipher_testvec des3_ede_dec_tv_template[] = {
2274         { /* These are from openssl */
2275                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2276                           "\x55\x55\x55\x55\x55\x55\x55\x55"
2277                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2278                 .klen   = 24,
2279                 .input  = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
2280                 .ilen   = 8,
2281                 .result = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
2282                 .rlen   = 8,
2283         }, {
2284                 .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
2285                           "\x86\x02\x87\x66\x59\x08\x21\x98"
2286                           "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
2287                 .klen   = 24,
2288                 .input  = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
2289                 .ilen   = 8,
2290                 .result = "\x73\x71\x75\x69\x67\x67\x6c\x65",
2291                 .rlen   = 8,
2292         }, {
2293                 .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
2294                           "\x91\x07\xd0\x15\x89\x19\x01\x01"
2295                           "\x19\x07\x92\x10\x98\x1a\x01\x01",
2296                 .klen   = 24,
2297                 .input  = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
2298                 .ilen   = 8,
2299                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
2300                 .rlen   = 8,
2301         },
2302 };
2303
2304 static struct cipher_testvec des3_ede_cbc_enc_tv_template[] = {
2305         { /* Generated from openssl */
2306                 .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
2307                           "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
2308                           "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
2309                 .klen   = 24,
2310                 .iv     = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
2311                 .input  = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
2312                           "\x53\x20\x63\x65\x65\x72\x73\x74"
2313                           "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
2314                           "\x20\x79\x65\x53\x72\x63\x74\x65"
2315                           "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
2316                           "\x79\x6e\x53\x20\x63\x65\x65\x72"
2317                           "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
2318                           "\x6e\x61\x20\x79\x65\x53\x72\x63"
2319                           "\x74\x65\x20\x73\x6f\x54\x20\x6f"
2320                           "\x61\x4d\x79\x6e\x53\x20\x63\x65"
2321                           "\x65\x72\x73\x74\x54\x20\x6f\x6f"
2322                           "\x4d\x20\x6e\x61\x20\x79\x65\x53"
2323                           "\x72\x63\x74\x65\x20\x73\x6f\x54"
2324                           "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
2325                           "\x63\x65\x65\x72\x73\x74\x54\x20"
2326                           "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
2327                 .ilen   = 128,
2328                 .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
2329                           "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
2330                           "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
2331                           "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
2332                           "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
2333                           "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
2334                           "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
2335                           "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
2336                           "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
2337                           "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
2338                           "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
2339                           "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
2340                           "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
2341                           "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
2342                           "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
2343                           "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
2344                 .rlen   = 128,
2345         },
2346 };
2347
2348 static struct cipher_testvec des3_ede_cbc_dec_tv_template[] = {
2349         { /* Generated from openssl */
2350                 .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
2351                           "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
2352                           "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
2353                 .klen   = 24,
2354                 .iv     = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
2355                 .input  = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
2356                           "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
2357                           "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
2358                           "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
2359                           "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
2360                           "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
2361                           "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
2362                           "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
2363                           "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
2364                           "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
2365                           "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
2366                           "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
2367                           "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
2368                           "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
2369                           "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
2370                           "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
2371                 .ilen   = 128,
2372                 .result = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
2373                           "\x53\x20\x63\x65\x65\x72\x73\x74"
2374                           "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
2375                           "\x20\x79\x65\x53\x72\x63\x74\x65"
2376                           "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
2377                           "\x79\x6e\x53\x20\x63\x65\x65\x72"
2378                           "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
2379                           "\x6e\x61\x20\x79\x65\x53\x72\x63"
2380                           "\x74\x65\x20\x73\x6f\x54\x20\x6f"
2381                           "\x61\x4d\x79\x6e\x53\x20\x63\x65"
2382                           "\x65\x72\x73\x74\x54\x20\x6f\x6f"
2383                           "\x4d\x20\x6e\x61\x20\x79\x65\x53"
2384                           "\x72\x63\x74\x65\x20\x73\x6f\x54"
2385                           "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
2386                           "\x63\x65\x65\x72\x73\x74\x54\x20"
2387                           "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
2388                 .rlen   = 128,
2389         },
2390 };
2391
2392 /*
2393  * Blowfish test vectors.
2394  */
2395 #define BF_ENC_TEST_VECTORS     7
2396 #define BF_DEC_TEST_VECTORS     7
2397 #define BF_CBC_ENC_TEST_VECTORS 2
2398 #define BF_CBC_DEC_TEST_VECTORS 2
2399 #define BF_CTR_ENC_TEST_VECTORS 2
2400 #define BF_CTR_DEC_TEST_VECTORS 2
2401
2402 static struct cipher_testvec bf_enc_tv_template[] = {
2403         { /* DES test vectors from OpenSSL */
2404                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
2405                 .klen   = 8,
2406                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
2407                 .ilen   = 8,
2408                 .result = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
2409                 .rlen   = 8,
2410         }, {
2411                 .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
2412                 .klen   = 8,
2413                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2414                 .ilen   = 8,
2415                 .result = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
2416                 .rlen   = 8,
2417         }, {
2418                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2419                 .klen   = 8,
2420                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2421                 .ilen   = 8,
2422                 .result = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
2423                 .rlen   = 8,
2424         }, { /* Vary the keylength... */
2425                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2426                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
2427                 .klen   = 16,
2428                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2429                 .ilen   = 8,
2430                 .result = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
2431                 .rlen   = 8,
2432         }, {
2433                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2434                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2435                           "\x00\x11\x22\x33\x44",
2436                 .klen   = 21,
2437                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2438                 .ilen   = 8,
2439                 .result = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
2440                 .rlen   = 8,
2441         }, { /* Generated with bf488 */
2442                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2443                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2444                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2445                           "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
2446                           "\x58\x40\x23\x64\x1a\xba\x61\x76"
2447                           "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
2448                           "\xff\xff\xff\xff\xff\xff\xff\xff",
2449                 .klen   = 56,
2450                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2451                 .ilen   = 8,
2452                 .result = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
2453                 .rlen   = 8,
2454         }, { /* Generated with Crypto++ */
2455                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2456                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2457                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2458                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2459                 .klen   = 32,
2460                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2461                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2462                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2463                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2464                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2465                 .ilen   = 40,
2466                 .result = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
2467                           "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
2468                           "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
2469                           "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
2470                           "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
2471                 .rlen   = 40,
2472                 .also_non_np = 1,
2473                 .np     = 2,
2474                 .tap    = { 40 - 8, 8 },
2475         },
2476 };
2477
2478 static struct cipher_testvec bf_dec_tv_template[] = {
2479         { /* DES test vectors from OpenSSL */
2480                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
2481                 .klen   = 8,
2482                 .input  = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
2483                 .ilen   = 8,
2484                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
2485                 .rlen   = 8,
2486         }, {
2487                 .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
2488                 .klen   = 8,
2489                 .input  = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
2490                 .ilen   = 8,
2491                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2492                 .rlen   = 8,
2493         }, {
2494                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2495                 .klen   = 8,
2496                 .input  = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
2497                 .ilen   = 8,
2498                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2499                 .rlen   = 8,
2500         }, { /* Vary the keylength... */
2501                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2502                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
2503                 .klen   = 16,
2504                 .input  = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
2505                 .ilen   = 8,
2506                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2507                 .rlen   = 8,
2508         }, {
2509                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2510                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2511                           "\x00\x11\x22\x33\x44",
2512                 .klen   = 21,
2513                 .input  = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
2514                 .ilen   = 8,
2515                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2516                 .rlen   = 8,
2517         }, { /* Generated with bf488, using OpenSSL, Libgcrypt and Nettle */
2518                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2519                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2520                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2521                           "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
2522                           "\x58\x40\x23\x64\x1a\xba\x61\x76"
2523                           "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
2524                           "\xff\xff\xff\xff\xff\xff\xff\xff",
2525                 .klen   = 56,
2526                 .input  = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
2527                 .ilen   = 8,
2528                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2529                 .rlen   = 8,
2530         }, { /* Generated with Crypto++ */
2531                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2532                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2533                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2534                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2535                 .klen   = 32,
2536                 .input  = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
2537                           "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
2538                           "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
2539                           "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
2540                           "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
2541                 .ilen   = 40,
2542                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2543                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2544                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2545                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2546                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2547                 .rlen   = 40,
2548                 .also_non_np = 1,
2549                 .np     = 2,
2550                 .tap    = { 40 - 8, 8 },
2551         },
2552 };
2553
2554 static struct cipher_testvec bf_cbc_enc_tv_template[] = {
2555         { /* From OpenSSL */
2556                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2557                           "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2558                 .klen   = 16,
2559                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2560                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2561                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2562                           "\x68\x65\x20\x74\x69\x6d\x65\x20"
2563                           "\x66\x6f\x72\x20\x00\x00\x00\x00",
2564                 .ilen   = 32,
2565                 .result = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
2566                           "\x05\xb1\x56\xe2\x74\x03\x97\x93"
2567                           "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
2568                           "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
2569                 .rlen   = 32,
2570         }, { /* Generated with Crypto++ */
2571                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2572                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2573                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2574                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2575                 .klen   = 32,
2576                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2577                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2578                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2579                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2580                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2581                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2582                 .ilen   = 40,
2583                 .result = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
2584                           "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
2585                           "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
2586                           "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
2587                           "\x01\x9C\x93\x63\x51\x60\x82\xD2",
2588                 .rlen   = 40,
2589                 .also_non_np = 1,
2590                 .np     = 2,
2591                 .tap    = { 40 - 8, 8 },
2592         },
2593 };
2594
2595 static struct cipher_testvec bf_cbc_dec_tv_template[] = {
2596         { /* From OpenSSL */
2597                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2598                           "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2599                 .klen   = 16,
2600                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2601                 .input  = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
2602                           "\x05\xb1\x56\xe2\x74\x03\x97\x93"
2603                           "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
2604                           "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
2605                 .ilen   = 32,
2606                 .result = "\x37\x36\x35\x34\x33\x32\x31\x20"
2607                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2608                           "\x68\x65\x20\x74\x69\x6d\x65\x20"
2609                           "\x66\x6f\x72\x20\x00\x00\x00\x00",
2610                 .rlen   = 32,
2611         }, { /* Generated with Crypto++ */
2612                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2613                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2614                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2615                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2616                 .klen   = 32,
2617                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2618                 .input  = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
2619                           "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
2620                           "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
2621                           "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
2622                           "\x01\x9C\x93\x63\x51\x60\x82\xD2",
2623                 .ilen   = 40,
2624                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2625                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2626                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2627                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2628                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2629                 .rlen   = 40,
2630                 .also_non_np = 1,
2631                 .np     = 2,
2632                 .tap    = { 40 - 8, 8 },
2633         },
2634 };
2635
2636 static struct cipher_testvec bf_ctr_enc_tv_template[] = {
2637         { /* Generated with Crypto++ */
2638                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2639                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2640                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2641                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2642                 .klen   = 32,
2643                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2644                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2645                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2646                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2647                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2648                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2649                 .ilen   = 40,
2650                 .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2651                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2652                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2653                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2654                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
2655                 .rlen   = 40,
2656         }, { /* Generated with Crypto++ */
2657                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2658                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2659                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2660                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2661                 .klen   = 32,
2662                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2663                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2664                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2665                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2666                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2667                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2668                           "\x6D\x04\x9B",
2669                 .ilen   = 43,
2670                 .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2671                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2672                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2673                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2674                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
2675                           "\x3D\xA7\xE9",
2676                 .rlen   = 43,
2677                 .also_non_np = 1,
2678                 .np     = 2,
2679                 .tap    = { 43 - 8, 8 },
2680         },
2681 };
2682
2683 static struct cipher_testvec bf_ctr_dec_tv_template[] = {
2684         { /* Generated with Crypto++ */
2685                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2686                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2687                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2688                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2689                 .klen   = 32,
2690                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2691                 .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2692                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2693                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2694                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2695                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
2696                 .ilen   = 40,
2697                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2698                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2699                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2700                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2701                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2702                 .rlen   = 40,
2703         }, { /* Generated with Crypto++ */
2704                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2705                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2706                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2707                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2708                 .klen   = 32,
2709                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2710                 .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2711                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2712                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2713                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2714                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
2715                           "\x3D\xA7\xE9",
2716                 .ilen   = 43,
2717                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2718                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2719                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2720                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2721                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2722                           "\x6D\x04\x9B",
2723                 .rlen   = 43,
2724                 .also_non_np = 1,
2725                 .np     = 2,
2726                 .tap    = { 43 - 8, 8 },
2727         },
2728 };
2729
2730 /*
2731  * Twofish test vectors.
2732  */
2733 #define TF_ENC_TEST_VECTORS             4
2734 #define TF_DEC_TEST_VECTORS             4
2735 #define TF_CBC_ENC_TEST_VECTORS         5
2736 #define TF_CBC_DEC_TEST_VECTORS         5
2737 #define TF_CTR_ENC_TEST_VECTORS         2
2738 #define TF_CTR_DEC_TEST_VECTORS         2
2739 #define TF_LRW_ENC_TEST_VECTORS         8
2740 #define TF_LRW_DEC_TEST_VECTORS         8
2741 #define TF_XTS_ENC_TEST_VECTORS         5
2742 #define TF_XTS_DEC_TEST_VECTORS         5
2743
2744 static struct cipher_testvec tf_enc_tv_template[] = {
2745         {
2746                 .key    = zeroed_string,
2747                 .klen   = 16,
2748                 .input  = zeroed_string,
2749                 .ilen   = 16,
2750                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2751                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2752                 .rlen   = 16,
2753         }, {
2754                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2755                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2756                           "\x00\x11\x22\x33\x44\x55\x66\x77",
2757                 .klen   = 24,
2758                 .input  = zeroed_string,
2759                 .ilen   = 16,
2760                 .result = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
2761                           "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
2762                 .rlen   = 16,
2763         }, {
2764                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2765                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2766                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2767                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
2768                 .klen   = 32,
2769                 .input  = zeroed_string,
2770                 .ilen   = 16,
2771                 .result = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
2772                           "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
2773                 .rlen   = 16,
2774         }, { /* Generated with Crypto++ */
2775                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
2776                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
2777                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
2778                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
2779                 .klen   = 32,
2780                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2781                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2782                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2783                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2784                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2785                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2786                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2787                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
2788                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
2789                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
2790                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
2791                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
2792                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
2793                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
2794                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
2795                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
2796                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
2797                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
2798                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
2799                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
2800                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
2801                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
2802                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
2803                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
2804                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
2805                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
2806                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
2807                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
2808                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
2809                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
2810                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
2811                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
2812                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
2813                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
2814                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
2815                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
2816                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
2817                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
2818                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
2819                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
2820                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
2821                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
2822                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
2823                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
2824                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
2825                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
2826                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
2827                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
2828                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
2829                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
2830                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
2831                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
2832                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
2833                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
2834                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
2835                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
2836                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
2837                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
2838                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
2839                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
2840                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
2841                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
2842                 .ilen   = 496,
2843                 .result = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
2844                           "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
2845                           "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
2846                           "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
2847                           "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
2848                           "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
2849                           "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
2850                           "\x89\xF6\x82\xF0\xD3\xDB\x06\x02"
2851                           "\xB5\x11\x5C\x5E\x79\x1A\xAC\x43"
2852                           "\x5C\xC0\x30\x4B\x6B\x16\xA1\x40"
2853                           "\x80\x27\x88\xBA\x2C\x74\x42\xE0"
2854                           "\x1B\xA5\x85\x08\xB9\xE6\x22\x7A"
2855                           "\x36\x3B\x0D\x9F\xA0\x22\x6C\x2A"
2856                           "\x91\x75\x47\xBC\x67\x21\x4E\xF9"
2857                           "\xEA\xFF\xD9\xD5\xC0\xFC\x9E\x2C"
2858                           "\x3E\xAD\xC6\x61\x0E\x93\x7A\x22"
2859                           "\x09\xC8\x8D\xC1\x8E\xB4\x8B\x5C"
2860                           "\xC6\x24\x42\xB8\x23\x66\x80\xA9"
2861                           "\x32\x0B\x7A\x29\xBF\xB3\x0B\x63"
2862                           "\x43\x27\x13\xA9\xBE\xEB\xBD\xF3"
2863                           "\x33\x62\x70\xE2\x1B\x86\x7A\xA1"
2864                           "\x51\x4A\x16\xFE\x29\x63\x7E\xD0"
2865                           "\x7A\xA4\x6E\x2C\xF8\xC1\xDB\xE8"
2866                           "\xCB\x4D\xD2\x8C\x04\x14\xB4\x66"
2867                           "\x41\xB7\x3A\x96\x16\x7C\x1D\x5B"
2868                           "\xB6\x41\x42\x64\x43\xEE\x6E\x7C"
2869                           "\x8B\xAF\x01\x9C\xA4\x6E\x75\x8F"
2870                           "\xDE\x10\x9F\xA6\xE7\xD6\x44\x97"
2871                           "\x66\xA3\x96\x0F\x1C\x25\x60\xF5"
2872                           "\x3C\x2E\x32\x69\x0E\x82\xFF\x27"
2873                           "\x0F\xB5\x06\xDA\xD8\x31\x15\x6C"
2874                           "\xDF\x18\x6C\x87\xF5\x3B\x11\x9A"
2875                           "\x1B\x42\x1F\x5B\x29\x19\x96\x13"
2876                           "\x68\x2E\x5E\x08\x1C\x8F\x32\x4B"
2877                           "\x81\x77\x6D\xF4\xA0\x01\x42\xEC"
2878                           "\xDD\x5B\xFD\x3A\x8E\x6A\x14\xFB"
2879                           "\x83\x54\xDF\x0F\x86\xB7\xEA\x40"
2880                           "\x46\x39\xF7\x2A\x89\x8D\x4E\x96"
2881                           "\x5F\x5F\x6D\x76\xC6\x13\x9D\x3D"
2882                           "\x1D\x5F\x0C\x7D\xE2\xBC\xC2\x16"
2883                           "\x16\xBE\x89\x3E\xB0\x61\xA2\x5D"
2884                           "\xAF\xD1\x40\x5F\x1A\xB8\x26\x41"
2885                           "\xC6\xBD\x36\xEF\xED\x29\x50\x6D"
2886                           "\x10\xEF\x26\xE8\xA8\x93\x11\x3F"
2887                           "\x2D\x1F\x88\x20\x77\x45\xF5\x66"
2888                           "\x08\xB9\xF1\xEF\xB1\x93\xA8\x81"
2889                           "\x65\xC5\xCD\x3E\x8C\x06\x60\x2C"
2890                           "\xB2\x10\x7A\xCA\x05\x25\x59\xDB"
2891                           "\xC7\x28\xF5\x20\x35\x52\x9E\x62"
2892                           "\xF8\x88\x24\x1C\x4D\x84\x12\x39"
2893                           "\x39\xE4\x2E\xF4\xD4\x9D\x2B\xBC"
2894                           "\x87\x66\xE6\xC0\x6B\x31\x9A\x66"
2895                           "\x03\xDC\x95\xD8\x6B\xD0\x30\x8F"
2896                           "\xDF\x8F\x8D\xFA\xEC\x1F\x08\xBD"
2897                           "\xA3\x63\xE2\x71\x4F\x03\x94\x87"
2898                           "\x50\xDF\x15\x1F\xED\x3A\xA3\x7F"
2899                           "\x1F\x2A\xB5\xA1\x69\xAC\x4B\x0D"
2900                           "\x84\x9B\x2A\xE9\x55\xDD\x46\x91"
2901                           "\x15\x33\xF3\x2B\x9B\x46\x97\x00"
2902                           "\xF0\x29\xD8\x59\x5D\x33\x37\xF9"
2903                           "\x58\x33\x9B\x78\xC7\x58\x48\x6B"
2904                           "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5",
2905                 .rlen   = 496,
2906                 .also_non_np = 1,
2907                 .np     = 2,
2908                 .tap    = { 496 - 16, 16 },
2909         },
2910 };
2911
2912 static struct cipher_testvec tf_dec_tv_template[] = {
2913         {
2914                 .key    = zeroed_string,
2915                 .klen   = 16,
2916                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2917                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2918                 .ilen   = 16,
2919                 .result = zeroed_string,
2920                 .rlen   = 16,
2921         }, {
2922                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2923                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2924                           "\x00\x11\x22\x33\x44\x55\x66\x77",
2925                 .klen   = 24,
2926                 .input  = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
2927                           "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
2928                 .ilen   = 16,
2929                 .result = zeroed_string,
2930                 .rlen   = 16,
2931         }, {
2932                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2933                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2934                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2935                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
2936                 .klen   = 32,
2937                 .input  = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
2938                           "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
2939                 .ilen   = 16,
2940                 .result = zeroed_string,
2941                 .rlen   = 16,
2942         }, { /* Generated with Crypto++ */
2943                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
2944                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
2945                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
2946                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
2947                 .klen   = 32,
2948                 .input  = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
2949                           "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
2950                           "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
2951                           "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
2952                           "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
2953                           "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
2954                           "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
2955                           "\x89\xF6\x82\xF0\xD3\xDB\x06\x02"
2956                           "\xB5\x11\x5C\x5E\x79\x1A\xAC\x43"
2957                           "\x5C\xC0\x30\x4B\x6B\x16\xA1\x40"
2958                           "\x80\x27\x88\xBA\x2C\x74\x42\xE0"
2959                           "\x1B\xA5\x85\x08\xB9\xE6\x22\x7A"
2960                           "\x36\x3B\x0D\x9F\xA0\x22\x6C\x2A"
2961                           "\x91\x75\x47\xBC\x67\x21\x4E\xF9"
2962                           "\xEA\xFF\xD9\xD5\xC0\xFC\x9E\x2C"
2963                           "\x3E\xAD\xC6\x61\x0E\x93\x7A\x22"
2964                           "\x09\xC8\x8D\xC1\x8E\xB4\x8B\x5C"
2965                           "\xC6\x24\x42\xB8\x23\x66\x80\xA9"
2966                           "\x32\x0B\x7A\x29\xBF\xB3\x0B\x63"
2967                           "\x43\x27\x13\xA9\xBE\xEB\xBD\xF3"
2968                           "\x33\x62\x70\xE2\x1B\x86\x7A\xA1"
2969                           "\x51\x4A\x16\xFE\x29\x63\x7E\xD0"
2970                           "\x7A\xA4\x6E\x2C\xF8\xC1\xDB\xE8"
2971                           "\xCB\x4D\xD2\x8C\x04\x14\xB4\x66"
2972                           "\x41\xB7\x3A\x96\x16\x7C\x1D\x5B"
2973                           "\xB6\x41\x42\x64\x43\xEE\x6E\x7C"
2974                           "\x8B\xAF\x01\x9C\xA4\x6E\x75\x8F"
2975                           "\xDE\x10\x9F\xA6\xE7\xD6\x44\x97"
2976                           "\x66\xA3\x96\x0F\x1C\x25\x60\xF5"
2977                           "\x3C\x2E\x32\x69\x0E\x82\xFF\x27"
2978                           "\x0F\xB5\x06\xDA\xD8\x31\x15\x6C"
2979                           "\xDF\x18\x6C\x87\xF5\x3B\x11\x9A"
2980                           "\x1B\x42\x1F\x5B\x29\x19\x96\x13"
2981                           "\x68\x2E\x5E\x08\x1C\x8F\x32\x4B"
2982                           "\x81\x77\x6D\xF4\xA0\x01\x42\xEC"
2983                           "\xDD\x5B\xFD\x3A\x8E\x6A\x14\xFB"
2984                           "\x83\x54\xDF\x0F\x86\xB7\xEA\x40"
2985                           "\x46\x39\xF7\x2A\x89\x8D\x4E\x96"
2986                           "\x5F\x5F\x6D\x76\xC6\x13\x9D\x3D"
2987                           "\x1D\x5F\x0C\x7D\xE2\xBC\xC2\x16"
2988                           "\x16\xBE\x89\x3E\xB0\x61\xA2\x5D"
2989                           "\xAF\xD1\x40\x5F\x1A\xB8\x26\x41"
2990                           "\xC6\xBD\x36\xEF\xED\x29\x50\x6D"
2991                           "\x10\xEF\x26\xE8\xA8\x93\x11\x3F"
2992                           "\x2D\x1F\x88\x20\x77\x45\xF5\x66"
2993                           "\x08\xB9\xF1\xEF\xB1\x93\xA8\x81"
2994                           "\x65\xC5\xCD\x3E\x8C\x06\x60\x2C"
2995                           "\xB2\x10\x7A\xCA\x05\x25\x59\xDB"
2996                           "\xC7\x28\xF5\x20\x35\x52\x9E\x62"
2997                           "\xF8\x88\x24\x1C\x4D\x84\x12\x39"
2998                           "\x39\xE4\x2E\xF4\xD4\x9D\x2B\xBC"
2999                           "\x87\x66\xE6\xC0\x6B\x31\x9A\x66"
3000                           "\x03\xDC\x95\xD8\x6B\xD0\x30\x8F"
3001                           "\xDF\x8F\x8D\xFA\xEC\x1F\x08\xBD"
3002                           "\xA3\x63\xE2\x71\x4F\x03\x94\x87"
3003                           "\x50\xDF\x15\x1F\xED\x3A\xA3\x7F"
3004                           "\x1F\x2A\xB5\xA1\x69\xAC\x4B\x0D"
3005                           "\x84\x9B\x2A\xE9\x55\xDD\x46\x91"
3006                           "\x15\x33\xF3\x2B\x9B\x46\x97\x00"
3007                           "\xF0\x29\xD8\x59\x5D\x33\x37\xF9"
3008                           "\x58\x33\x9B\x78\xC7\x58\x48\x6B"
3009                           "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5",
3010                 .ilen   = 496,
3011                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3012                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3013                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3014                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3015                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3016                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3017                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3018                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3019                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3020                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3021                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3022                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3023                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3024                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3025                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3026                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3027                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3028                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3029                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3030                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3031                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3032                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3033                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3034                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3035                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3036                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3037                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3038                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3039                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3040                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3041                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3042                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3043                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3044                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3045                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3046                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3047                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3048                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3049                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3050                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3051                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3052                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3053                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3054                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3055                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3056                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3057                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3058                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3059                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3060                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3061                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3062                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3063                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3064                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3065                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3066                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3067                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3068                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3069                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3070                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3071                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3072                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3073                 .rlen   = 496,
3074                 .also_non_np = 1,
3075                 .np     = 2,
3076                 .tap    = { 496 - 16, 16 },
3077         },
3078 };
3079
3080 static struct cipher_testvec tf_cbc_enc_tv_template[] = {
3081         { /* Generated with Nettle */
3082                 .key    = zeroed_string,
3083                 .klen   = 16,
3084                 .iv     = zeroed_string,
3085                 .input  = zeroed_string,
3086                 .ilen   = 16,
3087                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3088                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
3089                 .rlen   = 16,
3090         }, {
3091                 .key    = zeroed_string,
3092                 .klen   = 16,
3093                 .iv     = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3094                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
3095                 .input  = zeroed_string,
3096                 .ilen   = 16,
3097                 .result = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3098                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
3099                 .rlen   = 16,
3100         }, {
3101                 .key    = zeroed_string,
3102                 .klen   = 16,
3103                 .iv     = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3104                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
3105                 .input  = zeroed_string,
3106                 .ilen   = 16,
3107                 .result = "\x05\xef\x8c\x61\xa8\x11\x58\x26"
3108                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
3109                 .rlen   = 16,
3110         }, {
3111                 .key    = zeroed_string,
3112                 .klen   = 16,
3113                 .iv     = zeroed_string,
3114                 .input  = zeroed_string,
3115                 .ilen   = 48,
3116                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3117                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a"
3118                           "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3119                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19"
3120                           "\x05\xef\x8c\x61\xa8\x11\x58\x26"
3121                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
3122                 .rlen   = 48,
3123         }, { /* Generated with Crypto++ */
3124                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3125                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3126                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3127                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3128                 .klen   = 32,
3129                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3130                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3131                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3132                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3133                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3134                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3135                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3136                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3137                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3138                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3139                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3140                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3141                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3142                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3143                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3144                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3145                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3146                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3147                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3148                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3149                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3150                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3151                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3152                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3153                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3154                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3155                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3156                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3157                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3158                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3159                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3160                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3161                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3162                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3163                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3164                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3165                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3166                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3167                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3168                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3169                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3170                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3171                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3172                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3173                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3174                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3175                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3176                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3177                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3178                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3179                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3180                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3181                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3182                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3183                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3184                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3185                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3186                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3187                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3188                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3189                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3190                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3191                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3192                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3193                 .ilen   = 496,
3194                 .result = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
3195                           "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
3196                           "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
3197                           "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
3198                           "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
3199                           "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
3200                           "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
3201                           "\xB1\xD3\x44\x65\xDF\xE7\x63\x38"
3202                           "\x4A\xFC\xDC\xEC\x3F\x26\x8E\xB8"
3203                           "\x43\xFC\xFE\x18\xB5\x11\x6D\x31"
3204                           "\x81\x8B\x0D\x75\xF6\x80\xEC\x84"
3205                           "\x04\xB9\xE6\x09\x63\xED\x39\xDB"
3206                           "\xC3\xF6\x14\xD6\x6E\x5E\x8B\xBD"
3207                           "\x3E\xFA\xD7\x98\x50\x6F\xD9\x63"
3208                           "\x02\xCD\x0D\x39\x4B\x0D\xEC\x80"
3209                           "\xE3\x6A\x17\xF4\xCC\xAD\xFF\x68"
3210                           "\x45\xDD\xC8\x83\x1D\x41\x96\x0D"
3211                           "\x91\x2E\x05\xD3\x59\x82\xE0\x43"
3212                           "\x90\x4F\xB9\xF7\xAD\x6B\x2E\xAF"
3213                           "\xA7\x84\x00\x53\xCD\x6F\xD1\x0C"
3214                           "\x4E\xF9\x5A\x23\xFB\xCA\xC7\xD3"
3215                           "\xA9\xAA\x9D\xB2\x3F\x66\xF1\xAC"
3216                           "\x25\x21\x8F\xF7\xEF\xF2\x6A\xDF"
3217                           "\xE8\xDA\x75\x1A\x8A\xF1\xDD\x38"
3218                           "\x1F\xF9\x3D\x68\x4A\xBB\x9E\x34"
3219                           "\x1F\x66\x1F\x9C\x2B\x54\xFF\x60"
3220                           "\x7F\x29\x4B\x55\x80\x8F\x4E\xA7"
3221                           "\xA6\x9A\x0A\xD9\x0D\x19\x00\xF8"
3222                           "\x1F\xBC\x0C\x40\x6B\xEC\x99\x25"
3223                           "\x94\x70\x74\x0E\x1D\xC5\xBC\x12"
3224                           "\xF3\x42\xBE\x95\xBF\xFB\x4E\x55"
3225                           "\x9A\xB9\xCE\x14\x16\x5B\xDC\xD3"
3226                           "\x75\x42\x62\x04\x31\x1F\x95\x7C"
3227                           "\x66\x1A\x97\xDC\x2F\x40\x5C\x39"
3228                           "\x78\xE6\x02\xDB\x49\xE1\xC6\x47"
3229                           "\xC2\x78\x9A\xBB\xF3\xBE\xCB\x93"
3230                           "\xD8\xB8\xE8\xBB\x8C\xB3\x9B\xA7"
3231                           "\xC2\x89\xF3\x91\x88\x83\x3D\xF0"
3232                           "\x29\xA2\xCD\xB5\x79\x16\xC2\x40"
3233                           "\x11\x03\x8E\x9C\xFD\xC9\x43\xC4"
3234                           "\xC2\x19\xF0\x4A\x32\xEF\x0C\x2B"
3235                           "\xD3\x2B\xE9\xD4\x4C\xDE\x95\xCF"
3236                           "\x04\x03\xD3\x2C\x7F\x82\xC8\xFA"
3237                           "\x0F\xD8\x7A\x39\x7B\x01\x41\x9C"
3238                           "\x78\xB6\xC9\xBF\xF9\x78\x57\x88"
3239                           "\xB1\xA5\xE1\xE0\xD9\x16\xD4\xC8"
3240                           "\xEE\xC4\xBE\x7B\x55\x59\x00\x48"
3241                           "\x1B\xBC\x14\xFA\x2A\x9D\xC9\x1C"
3242                           "\xFB\x28\x3F\x95\xDD\xB7\xD6\xCE"
3243                           "\x3A\x7F\x09\x0C\x0E\x69\x30\x7D"
3244                           "\xBC\x68\x9C\x91\x2A\x59\x57\x04"
3245                           "\xED\x1A\x1E\x00\xB1\x85\x92\x04"
3246                           "\x28\x8C\x0C\x3C\xC1\xD5\x12\xF7"
3247                           "\x4C\x3E\xB0\xE7\x86\x62\x68\x91"
3248                           "\xFC\xC4\xE2\xCE\xA6\xDC\x5E\x93"
3249                           "\x5D\x8D\x8C\x68\xB3\xB2\xB9\x64"
3250                           "\x16\xB8\xC8\x6F\xD8\xEE\x21\xBD"
3251                           "\xAC\x18\x0C\x7D\x0D\x05\xAB\xF1"
3252                           "\xFA\xDD\xE2\x48\xDF\x4C\x02\x39"
3253                           "\x69\xA1\x62\xBD\x49\x3A\x9D\x91"
3254                           "\x30\x70\x56\xA4\x37\xDD\x7C\xC0"
3255                           "\x0A\xA3\x30\x10\x26\x25\x41\x2C",
3256                 .rlen   = 496,
3257                 .also_non_np = 1,
3258                 .np     = 2,
3259                 .tap    = { 496 - 16, 16 },
3260         },
3261 };
3262
3263 static struct cipher_testvec tf_cbc_dec_tv_template[] = {
3264         { /* Reverse of the first four above */
3265                 .key    = zeroed_string,
3266                 .klen   = 16,
3267                 .iv     = zeroed_string,
3268                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3269                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
3270                 .ilen   = 16,
3271                 .result = zeroed_string,
3272                 .rlen   = 16,
3273         }, {
3274                 .key    = zeroed_string,
3275                 .klen   = 16,
3276                 .iv     = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3277                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
3278                 .input  = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3279                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
3280                 .ilen   = 16,
3281                 .result = zeroed_string,
3282                 .rlen   = 16,
3283         }, {
3284                 .key    = zeroed_string,
3285                 .klen   = 16,
3286                 .iv     = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3287                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
3288                 .input  = "\x05\xef\x8c\x61\xa8\x11\x58\x26"
3289                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
3290                 .ilen   = 16,
3291                 .result = zeroed_string,
3292                 .rlen   = 16,
3293         }, {
3294                 .key    = zeroed_string,
3295                 .klen   = 16,
3296                 .iv     = zeroed_string,
3297                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
3298                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a"
3299                           "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
3300                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19"
3301                           "\x05\xef\x8c\x61\xa8\x11\x58\x26"
3302                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
3303                 .ilen   = 48,
3304                 .result = zeroed_string,
3305                 .rlen   = 48,
3306         }, { /* Generated with Crypto++ */
3307                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3308                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3309                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3310                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3311                 .klen   = 32,
3312                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3313                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3314                 .input  = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
3315                           "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
3316                           "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
3317                           "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
3318                           "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
3319                           "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
3320                           "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
3321                           "\xB1\xD3\x44\x65\xDF\xE7\x63\x38"
3322                           "\x4A\xFC\xDC\xEC\x3F\x26\x8E\xB8"
3323                           "\x43\xFC\xFE\x18\xB5\x11\x6D\x31"
3324                           "\x81\x8B\x0D\x75\xF6\x80\xEC\x84"
3325                           "\x04\xB9\xE6\x09\x63\xED\x39\xDB"
3326                           "\xC3\xF6\x14\xD6\x6E\x5E\x8B\xBD"
3327                           "\x3E\xFA\xD7\x98\x50\x6F\xD9\x63"
3328                           "\x02\xCD\x0D\x39\x4B\x0D\xEC\x80"
3329                           "\xE3\x6A\x17\xF4\xCC\xAD\xFF\x68"
3330                           "\x45\xDD\xC8\x83\x1D\x41\x96\x0D"
3331                           "\x91\x2E\x05\xD3\x59\x82\xE0\x43"
3332                           "\x90\x4F\xB9\xF7\xAD\x6B\x2E\xAF"
3333                           "\xA7\x84\x00\x53\xCD\x6F\xD1\x0C"
3334                           "\x4E\xF9\x5A\x23\xFB\xCA\xC7\xD3"
3335                           "\xA9\xAA\x9D\xB2\x3F\x66\xF1\xAC"
3336                           "\x25\x21\x8F\xF7\xEF\xF2\x6A\xDF"
3337                           "\xE8\xDA\x75\x1A\x8A\xF1\xDD\x38"
3338                           "\x1F\xF9\x3D\x68\x4A\xBB\x9E\x34"
3339                           "\x1F\x66\x1F\x9C\x2B\x54\xFF\x60"
3340                           "\x7F\x29\x4B\x55\x80\x8F\x4E\xA7"
3341                           "\xA6\x9A\x0A\xD9\x0D\x19\x00\xF8"
3342                           "\x1F\xBC\x0C\x40\x6B\xEC\x99\x25"
3343                           "\x94\x70\x74\x0E\x1D\xC5\xBC\x12"
3344                           "\xF3\x42\xBE\x95\xBF\xFB\x4E\x55"
3345                           "\x9A\xB9\xCE\x14\x16\x5B\xDC\xD3"
3346                           "\x75\x42\x62\x04\x31\x1F\x95\x7C"
3347                           "\x66\x1A\x97\xDC\x2F\x40\x5C\x39"
3348                           "\x78\xE6\x02\xDB\x49\xE1\xC6\x47"
3349                           "\xC2\x78\x9A\xBB\xF3\xBE\xCB\x93"
3350                           "\xD8\xB8\xE8\xBB\x8C\xB3\x9B\xA7"
3351                           "\xC2\x89\xF3\x91\x88\x83\x3D\xF0"
3352                           "\x29\xA2\xCD\xB5\x79\x16\xC2\x40"
3353                           "\x11\x03\x8E\x9C\xFD\xC9\x43\xC4"
3354                           "\xC2\x19\xF0\x4A\x32\xEF\x0C\x2B"
3355                           "\xD3\x2B\xE9\xD4\x4C\xDE\x95\xCF"
3356                           "\x04\x03\xD3\x2C\x7F\x82\xC8\xFA"
3357                           "\x0F\xD8\x7A\x39\x7B\x01\x41\x9C"
3358                           "\x78\xB6\xC9\xBF\xF9\x78\x57\x88"
3359                           "\xB1\xA5\xE1\xE0\xD9\x16\xD4\xC8"
3360                           "\xEE\xC4\xBE\x7B\x55\x59\x00\x48"
3361                           "\x1B\xBC\x14\xFA\x2A\x9D\xC9\x1C"
3362                           "\xFB\x28\x3F\x95\xDD\xB7\xD6\xCE"
3363                           "\x3A\x7F\x09\x0C\x0E\x69\x30\x7D"
3364                           "\xBC\x68\x9C\x91\x2A\x59\x57\x04"
3365                           "\xED\x1A\x1E\x00\xB1\x85\x92\x04"
3366                           "\x28\x8C\x0C\x3C\xC1\xD5\x12\xF7"
3367                           "\x4C\x3E\xB0\xE7\x86\x62\x68\x91"
3368                           "\xFC\xC4\xE2\xCE\xA6\xDC\x5E\x93"
3369                           "\x5D\x8D\x8C\x68\xB3\xB2\xB9\x64"
3370                           "\x16\xB8\xC8\x6F\xD8\xEE\x21\xBD"
3371                           "\xAC\x18\x0C\x7D\x0D\x05\xAB\xF1"
3372                           "\xFA\xDD\xE2\x48\xDF\x4C\x02\x39"
3373                           "\x69\xA1\x62\xBD\x49\x3A\x9D\x91"
3374                           "\x30\x70\x56\xA4\x37\xDD\x7C\xC0"
3375                           "\x0A\xA3\x30\x10\x26\x25\x41\x2C",
3376                 .ilen   = 496,
3377                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3378                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3379                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3380                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3381                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3382                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3383                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3384                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3385                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3386                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3387                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3388                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3389                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3390                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3391                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3392                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3393                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3394                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3395                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3396                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3397                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3398                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3399                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3400                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3401                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3402                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3403                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3404                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3405                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3406                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3407                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3408                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3409                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3410                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3411                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3412                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3413                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3414                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3415                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3416                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3417                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3418                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3419                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3420                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3421                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3422                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3423                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3424                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3425                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3426                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3427                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3428                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3429                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3430                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3431                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3432                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3433                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3434                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3435                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3436                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3437                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3438                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3439                 .rlen   = 496,
3440                 .also_non_np = 1,
3441                 .np     = 2,
3442                 .tap    = { 496 - 16, 16 },
3443         },
3444 };
3445
3446 static struct cipher_testvec tf_ctr_enc_tv_template[] = {
3447         { /* Generated with Crypto++ */
3448                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3449                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3450                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3451                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3452                 .klen   = 32,
3453                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3454                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3455                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3456                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3457                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3458                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3459                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3460                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3461                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3462                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3463                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3464                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3465                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3466                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3467                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3468                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3469                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3470                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3471                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3472                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3473                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3474                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3475                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3476                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3477                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3478                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3479                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3480                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3481                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3482                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3483                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3484                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3485                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3486                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3487                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3488                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3489                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3490                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3491                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3492                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3493                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3494                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3495                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3496                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3497                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3498                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3499                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3500                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3501                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3502                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3503                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3504                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3505                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3506                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3507                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3508                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3509                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3510                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3511                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3512                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3513                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3514                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3515                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3516                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3517                 .ilen   = 496,
3518                 .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3519                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3520                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3521                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3522                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3523                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3524                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3525                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3526                           "\xA8\x57\x20\xE0\x21\x6A\x17\x0D"
3527                           "\x0E\xF9\x8E\x49\x42\x00\x3C\x94"
3528                           "\x14\xC0\xD0\x8D\x8A\x98\xEB\x29"
3529                           "\xEC\xAE\x96\x44\xC0\x3C\x48\xDC"
3530                           "\x29\x35\x25\x2F\xE7\x11\x6C\x68"
3531                           "\xC8\x67\x0A\x2F\xF4\x07\xBE\xF9"
3532                           "\x2C\x31\x87\x40\xAB\xB2\xB6\xFA"
3533                           "\xD2\xC9\x6D\x5C\x50\xE9\xE6\x7E"
3534                           "\xE3\x0A\xD2\xD5\x6D\x8D\x64\x9E"
3535                           "\x70\xCE\x03\x76\xDD\xE0\xF0\x8C"
3536                           "\x84\x86\x8B\x6A\xFE\xC7\xF9\x69"
3537                           "\x2E\xFE\xFC\xC2\xC4\x1A\x55\x58"
3538                           "\xB3\xBE\xE2\x7E\xED\x39\x42\x6C"
3539                           "\xB4\x42\x97\x9A\xEC\xE1\x0A\x06"
3540                           "\x02\xC5\x03\x9D\xC4\x48\x15\x66"
3541                           "\x35\x6A\xC2\xC9\xA2\x26\x30\xBB"
3542                           "\xDB\x2D\xC8\x08\x2B\xA0\x29\x1A"
3543                           "\x23\x61\x48\xEA\x80\x04\x27\xAA"
3544                           "\x69\x49\xE8\xE8\x4A\x83\x6B\x5A"
3545                           "\xCA\x7C\xD3\xB1\xB5\x0B\xCC\x23"
3546                           "\x74\x1F\xA9\x87\xCD\xED\xC0\x2D"
3547                           "\xBF\xEB\xCF\x16\x2D\x2A\x2E\x1D"
3548                           "\x96\xBA\x36\x11\x45\x41\xDA\xCE"
3549                           "\xA4\x48\x80\x8B\x06\xF4\x98\x89"
3550                           "\x8B\x23\x08\x53\xF4\xD4\x5A\x24"
3551                           "\x8B\xF8\x43\x73\xD1\xEE\xC4\xB0"
3552                           "\xF8\xFE\x09\x0C\x75\x05\x38\x0B"
3553                           "\x7C\x81\xDE\x9D\xE4\x61\x37\x63"
3554                           "\x63\xAD\x12\xD2\x04\xB9\xCE\x45"
3555                           "\x5A\x1A\x6E\xB3\x78\x2A\xA4\x74"
3556                           "\x86\xD0\xE3\xFF\xDA\x38\x9C\xB5"
3557                           "\xB8\xB1\xDB\x38\x2F\xC5\x6A\xB4"
3558                           "\xEB\x6E\x96\xE8\x43\x80\xB5\x51"
3559                           "\x61\x2D\x48\xAA\x07\x65\x11\x8C"
3560                           "\x48\xE3\x90\x7E\x78\x3A\xEC\x97"
3561                           "\x05\x3D\x84\xE7\x90\x2B\xAA\xBD"
3562                           "\x83\x29\x0E\x1A\x81\x73\x7B\xE0"
3563                           "\x7A\x01\x4A\x37\x3B\x77\x7F\x8D"
3564                           "\x49\xA4\x2F\x6E\xBE\x68\x99\x08"
3565                           "\x99\xAA\x4C\x12\x04\xAE\x1F\x77"
3566                           "\x35\x88\xF1\x65\x06\x0A\x0B\x4D"
3567                           "\x47\xF9\x50\x38\x5D\x71\xF9\x6E"
3568                           "\xDE\xEC\x61\x35\x2C\x4C\x96\x50"
3569                           "\xE8\x28\x93\x9C\x7E\x01\xC6\x04"
3570                           "\xB2\xD6\xBC\x6C\x17\xEB\xC1\x7D"
3571                           "\x11\xE9\x43\x83\x76\xAA\x53\x37"
3572                           "\x0C\x1D\x39\x89\x53\x72\x09\x7E"
3573                           "\xD9\x85\x16\x04\xA5\x2C\x05\x6F"
3574                           "\x17\x0C\x6E\x66\xAA\x84\xA7\xD9"
3575                           "\xE2\xD9\xC4\xEB\x43\x3E\xB1\x8D"
3576                           "\x7C\x36\xC7\x71\x70\x9C\x10\xD8"
3577                           "\xE8\x47\x2A\x4D\xFD\xA1\xBC\xE3"
3578                           "\xB9\x32\xE2\xC1\x82\xAC\xFE\xCC"
3579                           "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF",
3580                 .rlen   = 496,
3581         }, { /* Generated with Crypto++ */
3582                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3583                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3584                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3585                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3586                 .klen   = 32,
3587                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3588                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3589                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3590                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3591                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3592                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3593                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3594                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3595                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3596                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3597                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3598                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3599                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3600                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3601                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3602                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3603                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3604                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3605                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3606                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3607                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3608                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3609                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3610                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3611                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3612                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3613                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3614                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3615                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3616                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3617                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3618                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3619                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3620                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3621                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3622                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3623                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3624                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3625                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3626                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3627                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3628                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3629                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3630                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3631                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3632                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3633                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3634                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3635                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3636                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3637                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3638                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3639                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3640                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3641                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3642                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3643                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3644                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3645                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3646                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3647                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3648                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3649                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3650                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
3651                           "\x2B\xC2\x59",
3652                 .ilen   = 499,
3653                 .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3654                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3655                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3656                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3657                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3658                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3659                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3660                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3661                           "\xA8\x57\x20\xE0\x21\x6A\x17\x0D"
3662                           "\x0E\xF9\x8E\x49\x42\x00\x3C\x94"
3663                           "\x14\xC0\xD0\x8D\x8A\x98\xEB\x29"
3664                           "\xEC\xAE\x96\x44\xC0\x3C\x48\xDC"
3665                           "\x29\x35\x25\x2F\xE7\x11\x6C\x68"
3666                           "\xC8\x67\x0A\x2F\xF4\x07\xBE\xF9"
3667                           "\x2C\x31\x87\x40\xAB\xB2\xB6\xFA"
3668                           "\xD2\xC9\x6D\x5C\x50\xE9\xE6\x7E"
3669                           "\xE3\x0A\xD2\xD5\x6D\x8D\x64\x9E"
3670                           "\x70\xCE\x03\x76\xDD\xE0\xF0\x8C"
3671                           "\x84\x86\x8B\x6A\xFE\xC7\xF9\x69"
3672                           "\x2E\xFE\xFC\xC2\xC4\x1A\x55\x58"
3673                           "\xB3\xBE\xE2\x7E\xED\x39\x42\x6C"
3674                           "\xB4\x42\x97\x9A\xEC\xE1\x0A\x06"
3675                           "\x02\xC5\x03\x9D\xC4\x48\x15\x66"
3676                           "\x35\x6A\xC2\xC9\xA2\x26\x30\xBB"
3677                           "\xDB\x2D\xC8\x08\x2B\xA0\x29\x1A"
3678                           "\x23\x61\x48\xEA\x80\x04\x27\xAA"
3679                           "\x69\x49\xE8\xE8\x4A\x83\x6B\x5A"
3680                           "\xCA\x7C\xD3\xB1\xB5\x0B\xCC\x23"
3681                           "\x74\x1F\xA9\x87\xCD\xED\xC0\x2D"
3682                           "\xBF\xEB\xCF\x16\x2D\x2A\x2E\x1D"
3683                           "\x96\xBA\x36\x11\x45\x41\xDA\xCE"
3684                           "\xA4\x48\x80\x8B\x06\xF4\x98\x89"
3685                           "\x8B\x23\x08\x53\xF4\xD4\x5A\x24"
3686                           "\x8B\xF8\x43\x73\xD1\xEE\xC4\xB0"
3687                           "\xF8\xFE\x09\x0C\x75\x05\x38\x0B"
3688                           "\x7C\x81\xDE\x9D\xE4\x61\x37\x63"
3689                           "\x63\xAD\x12\xD2\x04\xB9\xCE\x45"
3690                           "\x5A\x1A\x6E\xB3\x78\x2A\xA4\x74"
3691                           "\x86\xD0\xE3\xFF\xDA\x38\x9C\xB5"
3692                           "\xB8\xB1\xDB\x38\x2F\xC5\x6A\xB4"
3693                           "\xEB\x6E\x96\xE8\x43\x80\xB5\x51"
3694                           "\x61\x2D\x48\xAA\x07\x65\x11\x8C"
3695                           "\x48\xE3\x90\x7E\x78\x3A\xEC\x97"
3696                           "\x05\x3D\x84\xE7\x90\x2B\xAA\xBD"
3697                           "\x83\x29\x0E\x1A\x81\x73\x7B\xE0"
3698                           "\x7A\x01\x4A\x37\x3B\x77\x7F\x8D"
3699                           "\x49\xA4\x2F\x6E\xBE\x68\x99\x08"
3700                           "\x99\xAA\x4C\x12\x04\xAE\x1F\x77"
3701                           "\x35\x88\xF1\x65\x06\x0A\x0B\x4D"
3702                           "\x47\xF9\x50\x38\x5D\x71\xF9\x6E"
3703                           "\xDE\xEC\x61\x35\x2C\x4C\x96\x50"
3704                           "\xE8\x28\x93\x9C\x7E\x01\xC6\x04"
3705                           "\xB2\xD6\xBC\x6C\x17\xEB\xC1\x7D"
3706                           "\x11\xE9\x43\x83\x76\xAA\x53\x37"
3707                           "\x0C\x1D\x39\x89\x53\x72\x09\x7E"
3708                           "\xD9\x85\x16\x04\xA5\x2C\x05\x6F"
3709                           "\x17\x0C\x6E\x66\xAA\x84\xA7\xD9"
3710                           "\xE2\xD9\xC4\xEB\x43\x3E\xB1\x8D"
3711                           "\x7C\x36\xC7\x71\x70\x9C\x10\xD8"
3712                           "\xE8\x47\x2A\x4D\xFD\xA1\xBC\xE3"
3713                           "\xB9\x32\xE2\xC1\x82\xAC\xFE\xCC"
3714                           "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF"
3715                           "\x6C\x82\x9D",
3716                 .rlen   = 499,
3717                 .also_non_np = 1,
3718                 .np     = 2,
3719                 .tap    = { 499 - 16, 16 },
3720         },
3721 };
3722
3723 static struct cipher_testvec tf_ctr_dec_tv_template[] = {
3724         { /* Generated with Crypto++ */
3725                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3726                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3727                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3728                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3729                 .klen   = 32,
3730                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3731                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3732                 .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3733                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3734                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3735                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3736                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3737                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3738                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3739                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3740                           "\xA8\x57\x20\xE0\x21\x6A\x17\x0D"
3741                           "\x0E\xF9\x8E\x49\x42\x00\x3C\x94"
3742                           "\x14\xC0\xD0\x8D\x8A\x98\xEB\x29"
3743                           "\xEC\xAE\x96\x44\xC0\x3C\x48\xDC"
3744                           "\x29\x35\x25\x2F\xE7\x11\x6C\x68"
3745                           "\xC8\x67\x0A\x2F\xF4\x07\xBE\xF9"
3746                           "\x2C\x31\x87\x40\xAB\xB2\xB6\xFA"
3747                           "\xD2\xC9\x6D\x5C\x50\xE9\xE6\x7E"
3748                           "\xE3\x0A\xD2\xD5\x6D\x8D\x64\x9E"
3749                           "\x70\xCE\x03\x76\xDD\xE0\xF0\x8C"
3750                           "\x84\x86\x8B\x6A\xFE\xC7\xF9\x69"
3751                           "\x2E\xFE\xFC\xC2\xC4\x1A\x55\x58"
3752                           "\xB3\xBE\xE2\x7E\xED\x39\x42\x6C"
3753                           "\xB4\x42\x97\x9A\xEC\xE1\x0A\x06"
3754                           "\x02\xC5\x03\x9D\xC4\x48\x15\x66"
3755                           "\x35\x6A\xC2\xC9\xA2\x26\x30\xBB"
3756                           "\xDB\x2D\xC8\x08\x2B\xA0\x29\x1A"
3757                           "\x23\x61\x48\xEA\x80\x04\x27\xAA"
3758                           "\x69\x49\xE8\xE8\x4A\x83\x6B\x5A"
3759                           "\xCA\x7C\xD3\xB1\xB5\x0B\xCC\x23"
3760                           "\x74\x1F\xA9\x87\xCD\xED\xC0\x2D"
3761                           "\xBF\xEB\xCF\x16\x2D\x2A\x2E\x1D"
3762                           "\x96\xBA\x36\x11\x45\x41\xDA\xCE"
3763                           "\xA4\x48\x80\x8B\x06\xF4\x98\x89"
3764                           "\x8B\x23\x08\x53\xF4\xD4\x5A\x24"
3765                           "\x8B\xF8\x43\x73\xD1\xEE\xC4\xB0"
3766                           "\xF8\xFE\x09\x0C\x75\x05\x38\x0B"
3767                           "\x7C\x81\xDE\x9D\xE4\x61\x37\x63"
3768                           "\x63\xAD\x12\xD2\x04\xB9\xCE\x45"
3769                           "\x5A\x1A\x6E\xB3\x78\x2A\xA4\x74"
3770                           "\x86\xD0\xE3\xFF\xDA\x38\x9C\xB5"
3771                           "\xB8\xB1\xDB\x38\x2F\xC5\x6A\xB4"
3772                           "\xEB\x6E\x96\xE8\x43\x80\xB5\x51"
3773                           "\x61\x2D\x48\xAA\x07\x65\x11\x8C"
3774                           "\x48\xE3\x90\x7E\x78\x3A\xEC\x97"
3775                           "\x05\x3D\x84\xE7\x90\x2B\xAA\xBD"
3776                           "\x83\x29\x0E\x1A\x81\x73\x7B\xE0"
3777                           "\x7A\x01\x4A\x37\x3B\x77\x7F\x8D"
3778                           "\x49\xA4\x2F\x6E\xBE\x68\x99\x08"
3779                           "\x99\xAA\x4C\x12\x04\xAE\x1F\x77"
3780                           "\x35\x88\xF1\x65\x06\x0A\x0B\x4D"
3781                           "\x47\xF9\x50\x38\x5D\x71\xF9\x6E"
3782                           "\xDE\xEC\x61\x35\x2C\x4C\x96\x50"
3783                           "\xE8\x28\x93\x9C\x7E\x01\xC6\x04"
3784                           "\xB2\xD6\xBC\x6C\x17\xEB\xC1\x7D"
3785                           "\x11\xE9\x43\x83\x76\xAA\x53\x37"
3786                           "\x0C\x1D\x39\x89\x53\x72\x09\x7E"
3787                           "\xD9\x85\x16\x04\xA5\x2C\x05\x6F"
3788                           "\x17\x0C\x6E\x66\xAA\x84\xA7\xD9"
3789                           "\xE2\xD9\xC4\xEB\x43\x3E\xB1\x8D"
3790                           "\x7C\x36\xC7\x71\x70\x9C\x10\xD8"
3791                           "\xE8\x47\x2A\x4D\xFD\xA1\xBC\xE3"
3792                           "\xB9\x32\xE2\xC1\x82\xAC\xFE\xCC"
3793                           "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF",
3794                 .ilen   = 496,
3795                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3796                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3797                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3798                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3799                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3800                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3801                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3802                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3803                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3804                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3805                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3806                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3807                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3808                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3809                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3810                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3811                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3812                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3813                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3814                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3815                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3816                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3817                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3818                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3819                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3820                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3821                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3822                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3823                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3824                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3825                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3826                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3827                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3828                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3829                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3830                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3831                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3832                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3833                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3834                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3835                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3836                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3837                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3838                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3839                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3840                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3841                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3842                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3843                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3844                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3845                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3846                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3847                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3848                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3849                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3850                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3851                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3852                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3853                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3854                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3855                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3856                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3857                 .rlen   = 496,
3858         }, { /* Generated with Crypto++ */
3859                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3860                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3861                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3862                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3863                 .klen   = 32,
3864                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3865                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3866                 .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3867                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3868                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3869                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3870                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3871                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3872                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3873                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3874                           "\xA8\x57\x20\xE0\x21\x6A\x17\x0D"
3875                           "\x0E\xF9\x8E\x49\x42\x00\x3C\x94"
3876                           "\x14\xC0\xD0\x8D\x8A\x98\xEB\x29"
3877                           "\xEC\xAE\x96\x44\xC0\x3C\x48\xDC"
3878                           "\x29\x35\x25\x2F\xE7\x11\x6C\x68"
3879                           "\xC8\x67\x0A\x2F\xF4\x07\xBE\xF9"
3880                           "\x2C\x31\x87\x40\xAB\xB2\xB6\xFA"
3881                           "\xD2\xC9\x6D\x5C\x50\xE9\xE6\x7E"
3882                           "\xE3\x0A\xD2\xD5\x6D\x8D\x64\x9E"
3883                           "\x70\xCE\x03\x76\xDD\xE0\xF0\x8C"
3884                           "\x84\x86\x8B\x6A\xFE\xC7\xF9\x69"
3885                           "\x2E\xFE\xFC\xC2\xC4\x1A\x55\x58"
3886                           "\xB3\xBE\xE2\x7E\xED\x39\x42\x6C"
3887                           "\xB4\x42\x97\x9A\xEC\xE1\x0A\x06"
3888                           "\x02\xC5\x03\x9D\xC4\x48\x15\x66"
3889                           "\x35\x6A\xC2\xC9\xA2\x26\x30\xBB"
3890                           "\xDB\x2D\xC8\x08\x2B\xA0\x29\x1A"
3891                           "\x23\x61\x48\xEA\x80\x04\x27\xAA"
3892                           "\x69\x49\xE8\xE8\x4A\x83\x6B\x5A"
3893                           "\xCA\x7C\xD3\xB1\xB5\x0B\xCC\x23"
3894                           "\x74\x1F\xA9\x87\xCD\xED\xC0\x2D"
3895                           "\xBF\xEB\xCF\x16\x2D\x2A\x2E\x1D"
3896                           "\x96\xBA\x36\x11\x45\x41\xDA\xCE"
3897                           "\xA4\x48\x80\x8B\x06\xF4\x98\x89"
3898                           "\x8B\x23\x08\x53\xF4\xD4\x5A\x24"
3899                           "\x8B\xF8\x43\x73\xD1\xEE\xC4\xB0"
3900                           "\xF8\xFE\x09\x0C\x75\x05\x38\x0B"
3901                           "\x7C\x81\xDE\x9D\xE4\x61\x37\x63"
3902                           "\x63\xAD\x12\xD2\x04\xB9\xCE\x45"
3903                           "\x5A\x1A\x6E\xB3\x78\x2A\xA4\x74"
3904                           "\x86\xD0\xE3\xFF\xDA\x38\x9C\xB5"
3905                           "\xB8\xB1\xDB\x38\x2F\xC5\x6A\xB4"
3906                           "\xEB\x6E\x96\xE8\x43\x80\xB5\x51"
3907                           "\x61\x2D\x48\xAA\x07\x65\x11\x8C"
3908                           "\x48\xE3\x90\x7E\x78\x3A\xEC\x97"
3909                           "\x05\x3D\x84\xE7\x90\x2B\xAA\xBD"
3910                           "\x83\x29\x0E\x1A\x81\x73\x7B\xE0"
3911                           "\x7A\x01\x4A\x37\x3B\x77\x7F\x8D"
3912                           "\x49\xA4\x2F\x6E\xBE\x68\x99\x08"
3913                           "\x99\xAA\x4C\x12\x04\xAE\x1F\x77"
3914                           "\x35\x88\xF1\x65\x06\x0A\x0B\x4D"
3915                           "\x47\xF9\x50\x38\x5D\x71\xF9\x6E"
3916                           "\xDE\xEC\x61\x35\x2C\x4C\x96\x50"
3917                           "\xE8\x28\x93\x9C\x7E\x01\xC6\x04"
3918                           "\xB2\xD6\xBC\x6C\x17\xEB\xC1\x7D"
3919                           "\x11\xE9\x43\x83\x76\xAA\x53\x37"
3920                           "\x0C\x1D\x39\x89\x53\x72\x09\x7E"
3921                           "\xD9\x85\x16\x04\xA5\x2C\x05\x6F"
3922                           "\x17\x0C\x6E\x66\xAA\x84\xA7\xD9"
3923                           "\xE2\xD9\xC4\xEB\x43\x3E\xB1\x8D"
3924                           "\x7C\x36\xC7\x71\x70\x9C\x10\xD8"
3925                           "\xE8\x47\x2A\x4D\xFD\xA1\xBC\xE3"
3926                           "\xB9\x32\xE2\xC1\x82\xAC\xFE\xCC"
3927                           "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF"
3928                           "\x6C\x82\x9D",
3929                 .ilen   = 499,
3930                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3931                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3932                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3933                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3934                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3935                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3936                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3937                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3938                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3939                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3940                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3941                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3942                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3943                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3944                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3945                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3946                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3947                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3948                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3949                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3950                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3951                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3952                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3953                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3954                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3955                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3956                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3957                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3958                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3959                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3960                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3961                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3962                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3963                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3964                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3965                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3966                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3967                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3968                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3969                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3970                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3971                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3972                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3973                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3974                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3975                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3976                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3977                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3978                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3979                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3980                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3981                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3982                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3983                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3984                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3985                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3986                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3987                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3988                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3989                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3990                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3991                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
3992                           "\x2B\xC2\x59",
3993                 .rlen   = 499,
3994                 .also_non_np = 1,
3995                 .np     = 2,
3996                 .tap    = { 499 - 16, 16 },
3997         },
3998 };
3999
4000 static struct cipher_testvec tf_lrw_enc_tv_template[] = {
4001         /* Generated from AES-LRW test vectors */
4002         {
4003                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
4004                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
4005                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
4006                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
4007                 .klen   = 32,
4008                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4009                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4010                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4011                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4012                 .ilen   = 16,
4013                 .result = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
4014                           "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
4015                 .rlen   = 16,
4016         }, {
4017                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
4018                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
4019                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
4020                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
4021                 .klen   = 32,
4022                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4023                           "\x00\x00\x00\x00\x00\x00\x00\x02",
4024                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4025                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4026                 .ilen   = 16,
4027                 .result = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
4028                           "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
4029                 .rlen   = 16,
4030         }, {
4031                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
4032                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
4033                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
4034                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
4035                 .klen   = 32,
4036                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4037                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4038                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4039                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4040                 .ilen   = 16,
4041                 .result = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
4042                           "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
4043                 .rlen   = 16,
4044         }, {
4045                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
4046                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
4047                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
4048                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
4049                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
4050                 .klen   = 40,
4051                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4052                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4053                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4054                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4055                 .ilen   = 16,
4056                 .result = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
4057                           "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
4058                 .rlen   = 16,
4059         }, {
4060                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
4061                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
4062                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
4063                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
4064                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
4065                 .klen   = 40,
4066                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4067                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4068                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4069                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4070                 .ilen   = 16,
4071                 .result = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
4072                           "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
4073                 .rlen   = 16,
4074         }, {
4075                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4076                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4077                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4078                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4079                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4080                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4081                 .klen   = 48,
4082                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4083                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4084                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4085                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4086                 .ilen   = 16,
4087                 .result = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
4088                           "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
4089                 .rlen   = 16,
4090         }, {
4091                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
4092                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
4093                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
4094                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
4095                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
4096                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
4097                 .klen   = 48,
4098                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4099                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4100                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4101                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4102                 .ilen   = 16,
4103                 .result = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
4104                           "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
4105                 .rlen   = 16,
4106         }, {
4107                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4108                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4109                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4110                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4111                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4112                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4113                 .klen   = 48,
4114                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4115                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4116                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
4117                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
4118                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
4119                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
4120                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
4121                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
4122                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
4123                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
4124                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
4125                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
4126                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
4127                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
4128                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
4129                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
4130                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
4131                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
4132                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
4133                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
4134                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
4135                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
4136                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
4137                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
4138                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
4139                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
4140                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
4141                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
4142                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
4143                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
4144                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
4145                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
4146                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
4147                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
4148                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
4149                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
4150                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
4151                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
4152                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
4153                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
4154                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
4155                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
4156                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
4157                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
4158                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
4159                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
4160                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
4161                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
4162                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
4163                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
4164                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
4165                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
4166                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
4167                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
4168                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
4169                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
4170                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
4171                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
4172                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
4173                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
4174                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
4175                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
4176                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
4177                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
4178                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
4179                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
4180                 .ilen   = 512,
4181                 .result = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
4182                           "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
4183                           "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
4184                           "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
4185                           "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
4186                           "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
4187                           "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
4188                           "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
4189                           "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
4190                           "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
4191                           "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
4192                           "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
4193                           "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
4194                           "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
4195                           "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
4196                           "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
4197                           "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
4198                           "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
4199                           "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
4200                           "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
4201                           "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
4202                           "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
4203                           "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
4204                           "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
4205                           "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
4206                           "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
4207                           "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
4208                           "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
4209                           "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
4210                           "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
4211                           "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
4212                           "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
4213                           "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
4214                           "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
4215                           "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
4216                           "\x3e\xae\x71\x90\x07\x70\x1c\x38"
4217                           "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
4218                           "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
4219                           "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
4220                           "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
4221                           "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
4222                           "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
4223                           "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
4224                           "\x93\x51\x1d\x3d\x62\x59\x83\x82"
4225                           "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
4226                           "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
4227                           "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
4228                           "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
4229                           "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
4230                           "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
4231                           "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
4232                           "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
4233                           "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
4234                           "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
4235                           "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
4236                           "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
4237                           "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
4238                           "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
4239                           "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
4240                           "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
4241                           "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
4242                           "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
4243                           "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
4244                           "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
4245                 .rlen   = 512,
4246                 .also_non_np = 1,
4247                 .np     = 2,
4248                 .tap    = { 512 - 16, 16 },
4249         },
4250 };
4251
4252 static struct cipher_testvec tf_lrw_dec_tv_template[] = {
4253         /* Generated from AES-LRW test vectors */
4254         /* same as enc vectors with input and result reversed */
4255         {
4256                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
4257                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
4258                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
4259                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
4260                 .klen   = 32,
4261                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4262                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4263                 .input  = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
4264                           "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
4265                 .ilen   = 16,
4266                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4267                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4268                 .rlen   = 16,
4269         }, {
4270                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
4271                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
4272                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
4273                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
4274                 .klen   = 32,
4275                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4276                           "\x00\x00\x00\x00\x00\x00\x00\x02",
4277                 .input  = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
4278                           "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
4279                 .ilen   = 16,
4280                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4281                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4282                 .rlen   = 16,
4283         }, {
4284                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
4285                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
4286                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
4287                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
4288                 .klen   = 32,
4289                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4290                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4291                 .input  = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
4292                           "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
4293                 .ilen   = 16,
4294                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4295                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4296                 .rlen   = 16,
4297         }, {
4298                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
4299                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
4300                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
4301                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
4302                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
4303                 .klen   = 40,
4304                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4305                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4306                 .input  = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
4307                           "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
4308                 .ilen   = 16,
4309                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4310                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4311                 .rlen   = 16,
4312         }, {
4313                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
4314                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
4315                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
4316                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
4317                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
4318                 .klen   = 40,
4319                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4320                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4321                 .input  = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
4322                           "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
4323                 .ilen   = 16,
4324                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4325                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4326                 .rlen   = 16,
4327         }, {
4328                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4329                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4330                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4331                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4332                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4333                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4334                 .klen   = 48,
4335                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4336                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4337                 .input  = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
4338                           "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
4339                 .ilen   = 16,
4340                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4341                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4342                 .rlen   = 16,
4343         }, {
4344                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
4345                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
4346                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
4347                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
4348                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
4349                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
4350                 .klen   = 48,
4351                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4352                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4353                 .input  = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
4354                           "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
4355                 .ilen   = 16,
4356                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4357                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4358                 .rlen   = 16,
4359         }, {
4360                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4361                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4362                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4363                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4364                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4365                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4366                 .klen   = 48,
4367                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4368                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4369                 .input  = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
4370                           "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
4371                           "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
4372                           "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
4373                           "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
4374                           "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
4375                           "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
4376                           "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
4377                           "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
4378                           "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
4379                           "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
4380                           "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
4381                           "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
4382                           "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
4383                           "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
4384                           "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
4385                           "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
4386                           "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
4387                           "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
4388                           "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
4389                           "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
4390                           "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
4391                           "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
4392                           "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
4393                           "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
4394                           "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
4395                           "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
4396                           "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
4397                           "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
4398                           "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
4399                           "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
4400                           "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
4401                           "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
4402                           "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
4403                           "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
4404                           "\x3e\xae\x71\x90\x07\x70\x1c\x38"
4405                           "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
4406                           "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
4407                           "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
4408                           "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
4409                           "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
4410                           "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
4411                           "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
4412                           "\x93\x51\x1d\x3d\x62\x59\x83\x82"
4413                           "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
4414                           "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
4415                           "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
4416                           "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
4417                           "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
4418                           "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
4419                           "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
4420                           "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
4421                           "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
4422                           "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
4423                           "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
4424                           "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
4425                           "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
4426                           "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
4427                           "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
4428                           "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
4429                           "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
4430                           "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
4431                           "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
4432                           "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
4433                 .ilen   = 512,
4434                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
4435                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
4436                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
4437                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
4438                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
4439                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
4440                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
4441                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
4442                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
4443                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
4444                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
4445                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
4446                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
4447                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
4448                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
4449                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
4450                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
4451                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
4452                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
4453                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
4454                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
4455                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
4456                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
4457                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
4458                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
4459                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
4460                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
4461                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
4462                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
4463                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
4464                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
4465                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
4466                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
4467                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
4468                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
4469                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
4470                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
4471                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
4472                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
4473                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
4474                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
4475                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
4476                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
4477                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
4478                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
4479                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
4480                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
4481                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
4482                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
4483                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
4484                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
4485                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
4486                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
4487                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
4488                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
4489                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
4490                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
4491                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
4492                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
4493                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
4494                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
4495                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
4496                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
4497                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
4498                 .rlen   = 512,
4499                 .also_non_np = 1,
4500                 .np     = 2,
4501                 .tap    = { 512 - 16, 16 },
4502         },
4503 };
4504
4505 static struct cipher_testvec tf_xts_enc_tv_template[] = {
4506         /* Generated from AES-XTS test vectors */
4507 {
4508                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
4509                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4510                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4511                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4512                 .klen   = 32,
4513                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4514                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4515                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
4516                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4517                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4518                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4519                 .ilen   = 32,
4520                 .result = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
4521                           "\x30\x74\xe4\x44\x52\x77\x97\x43"
4522                           "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
4523                           "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
4524                 .rlen   = 32,
4525         }, {
4526                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
4527                           "\x11\x11\x11\x11\x11\x11\x11\x11"
4528                           "\x22\x22\x22\x22\x22\x22\x22\x22"
4529                           "\x22\x22\x22\x22\x22\x22\x22\x22",
4530                 .klen   = 32,
4531                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
4532                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4533                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
4534                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4535                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4536                           "\x44\x44\x44\x44\x44\x44\x44\x44",
4537                 .ilen   = 32,
4538                 .result = "\x57\x0e\x8f\xe5\x2a\x35\x61\x4f"
4539                           "\x32\xd3\xbd\x36\x05\x15\x44\x2c"
4540                           "\x58\x06\xf7\xf8\x00\xa8\xb6\xd5"
4541                           "\xc6\x28\x92\xdb\xd8\x34\xa2\xe9",
4542                 .rlen   = 32,
4543         }, {
4544                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
4545                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
4546                           "\x22\x22\x22\x22\x22\x22\x22\x22"
4547                           "\x22\x22\x22\x22\x22\x22\x22\x22",
4548                 .klen   = 32,
4549                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
4550                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4551                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
4552                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4553                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4554                           "\x44\x44\x44\x44\x44\x44\x44\x44",
4555                 .ilen   = 32,
4556                 .result = "\x96\x45\x8f\x8d\x7a\x75\xb1\xde"
4557                           "\x40\x0c\x89\x56\xf6\x4d\xa7\x07"
4558                           "\x38\xbb\x5b\xe9\xcd\x84\xae\xb2"
4559                           "\x7b\x6a\x62\xf4\x8c\xb5\x37\xea",
4560                 .rlen   = 32,
4561         }, {
4562                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
4563                           "\x23\x53\x60\x28\x74\x71\x35\x26"
4564                           "\x31\x41\x59\x26\x53\x58\x97\x93"
4565                           "\x23\x84\x62\x64\x33\x83\x27\x95",
4566                 .klen   = 32,
4567                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4568                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4569                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
4570                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4571                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4572                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
4573                           "\x20\x21\x22\x23\x24\x25\x26\x27"
4574                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
4575                           "\x30\x31\x32\x33\x34\x35\x36\x37"
4576                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
4577                           "\x40\x41\x42\x43\x44\x45\x46\x47"
4578                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
4579                           "\x50\x51\x52\x53\x54\x55\x56\x57"
4580                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
4581                           "\x60\x61\x62\x63\x64\x65\x66\x67"
4582                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
4583                           "\x70\x71\x72\x73\x74\x75\x76\x77"
4584                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
4585                           "\x80\x81\x82\x83\x84\x85\x86\x87"
4586                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
4587                           "\x90\x91\x92\x93\x94\x95\x96\x97"
4588                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
4589                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
4590                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
4591                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
4592                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
4593                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
4594                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
4595                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
4596                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
4597                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
4598                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
4599                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
4600                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
4601                           "\x00\x01\x02\x03\x04\x05\x06\x07"
4602                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4603                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4604                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
4605                           "\x20\x21\x22\x23\x24\x25\x26\x27"
4606                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
4607                           "\x30\x31\x32\x33\x34\x35\x36\x37"
4608                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
4609                           "\x40\x41\x42\x43\x44\x45\x46\x47"
4610                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
4611                           "\x50\x51\x52\x53\x54\x55\x56\x57"
4612                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
4613                           "\x60\x61\x62\x63\x64\x65\x66\x67"
4614                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
4615                           "\x70\x71\x72\x73\x74\x75\x76\x77"
4616                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
4617                           "\x80\x81\x82\x83\x84\x85\x86\x87"
4618                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
4619                           "\x90\x91\x92\x93\x94\x95\x96\x97"
4620                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
4621                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
4622                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
4623                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
4624                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
4625                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
4626                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
4627                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
4628                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
4629                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
4630                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
4631                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
4632                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
4633                 .ilen   = 512,
4634                 .result = "\xa9\x78\xae\x1e\xea\xa2\x44\x4c"
4635                           "\xa2\x7a\x64\x1f\xaf\x46\xc1\xe0"
4636                           "\x6c\xb2\xf3\x92\x9a\xd6\x7d\x58"
4637                           "\xb8\x2d\xb9\x5d\x58\x07\x66\x50"
4638                           "\xea\x35\x35\x8c\xb2\x46\x61\x06"
4639                           "\x5d\x65\xfc\x57\x8f\x69\x74\xab"
4640                           "\x8a\x06\x69\xb5\x6c\xda\x66\xc7"
4641                           "\x52\x90\xbb\x8e\x6d\x8b\xb5\xa2"
4642                           "\x78\x1d\xc2\xa9\xc2\x73\x00\xc3"
4643                           "\x32\x36\x7c\x97\x6b\x4e\x8a\x50"
4644                           "\xe4\x91\x83\x96\x8f\xf4\x94\x1a"
4645                           "\xa6\x27\xe1\x33\xcb\x91\xc6\x5f"
4646                           "\x94\x75\xbc\xd7\x3e\x3e\x6f\x9e"
4647                           "\xa9\x31\x80\x5e\xe5\xdb\xc8\x53"
4648                           "\x01\x73\x68\x32\x25\x19\xfa\xfb"
4649                           "\xe4\xcf\xb9\x3e\xa2\xa0\x8f\x31"
4650                           "\xbf\x54\x06\x93\xa8\xb1\x0f\xb6"
4651                           "\x7c\x3c\xde\x6f\x0f\xfb\x0c\x11"
4652                           "\x39\x80\x39\x09\x97\x65\xf2\x83"
4653                           "\xae\xe6\xa1\x6f\x47\xb8\x49\xde"
4654                           "\x99\x36\x20\x7d\x97\x3b\xec\xfa"
4655                           "\xb4\x33\x6e\x7a\xc7\x46\x84\x49"
4656                           "\x91\xcd\xe1\x57\x0d\xed\x40\x08"
4657                           "\x13\xf1\x4e\x3e\xa4\xa4\x5c\xe6"
4658                           "\xd2\x0c\x20\x8f\x3e\xdf\x3f\x47"
4659                           "\x9a\x2f\xde\x6d\x66\xc9\x99\x4a"
4660                           "\x2d\x9e\x9d\x4b\x1a\x27\xa2\x12"
4661                           "\x99\xf0\xf8\xb1\xb6\xf6\x57\xc3"
4662                           "\xca\x1c\xa3\x8e\xed\x39\x28\xb5"
4663                           "\x10\x1b\x4b\x08\x42\x00\x4a\xd3"
4664                           "\xad\x5a\xc6\x8e\xc8\xbb\x95\xc4"
4665                           "\x4b\xaa\xfe\xd5\x42\xa8\xa3\x6d"
4666                           "\x3c\xf3\x34\x91\x2d\xb4\xdd\x20"
4667                           "\x0c\x90\x6d\xa3\x9b\x66\x9d\x24"
4668                           "\x02\xa6\xa9\x3f\x3f\x58\x5d\x47"
4669                           "\x24\x65\x63\x7e\xbd\x8c\xe6\x52"
4670                           "\x7d\xef\x33\x53\x63\xec\xaa\x0b"
4671                           "\x64\x15\xa9\xa6\x1f\x10\x00\x38"
4672                           "\x35\xa8\xe7\xbe\x23\x70\x22\xe0"
4673                           "\xd3\xb9\xe6\xfd\xe6\xaa\x03\x50"
4674                           "\xf3\x3c\x27\x36\x8b\xcc\xfe\x9c"
4675                           "\x9c\xa3\xb3\xe7\x68\x9b\xa2\x71"
4676                           "\xe0\x07\xd9\x1f\x68\x1f\xac\x5e"
4677                           "\x7a\x74\x85\xa9\x6a\x90\xab\x2c"
4678                           "\x38\x51\xbc\x1f\x43\x4a\x56\x1c"
4679                           "\xf8\x47\x03\x4e\x67\xa8\x1f\x99"
4680                           "\x04\x39\x73\x32\xb2\x86\x79\xe7"
4681                           "\x14\x28\x70\xb8\xe2\x7d\x69\x85"
4682                           "\xb6\x0f\xc5\xd0\xd0\x01\x5c\xe6"
4683                           "\x09\x0f\x75\xf7\xb6\x81\xd2\x11"
4684                           "\x20\x9c\xa1\xee\x11\x44\x79\xd0"
4685                           "\xb2\x34\x77\xda\x10\x9a\x6f\x6f"
4686                           "\xef\x7c\xd9\xdc\x35\xb7\x61\xdd"
4687                           "\xf1\xa4\xc6\x1c\xbf\x05\x22\xac"
4688                           "\xfe\x2f\x85\x00\x44\xdf\x33\x16"
4689                           "\x35\xb6\xa3\xd3\x70\xdf\x69\x35"
4690                           "\x6a\xc7\xb4\x99\x45\x27\xc8\x8e"
4691                           "\x5a\x14\x30\xd0\x55\x3e\x4f\x64"
4692                           "\x0d\x38\xe3\xdf\x8b\xa8\x93\x26"
4693                           "\x75\xae\xf6\xb5\x23\x0b\x17\x31"
4694                           "\xbf\x27\xb8\xb5\x94\x31\xa7\x8f"
4695                           "\x43\xc4\x46\x24\x22\x4f\x8f\x7e"
4696                           "\xe5\xf4\x6d\x1e\x0e\x18\x7a\xbb"
4697                           "\xa6\x8f\xfb\x49\x49\xd8\x7e\x5a",
4698                 .rlen   = 512,
4699         }, {
4700                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
4701                           "\x23\x53\x60\x28\x74\x71\x35\x26"
4702                           "\x62\x49\x77\x57\x24\x70\x93\x69"
4703                           "\x99\x59\x57\x49\x66\x96\x76\x27"
4704                           "\x31\x41\x59\x26\x53\x58\x97\x93"
4705                           "\x23\x84\x62\x64\x33\x83\x27\x95"
4706                           "\x02\x88\x41\x97\x16\x93\x99\x37"
4707                           "\x51\x05\x82\x09\x74\x94\x45\x92",
4708                 .klen   = 64,
4709                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
4710                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4711                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
4712                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4713                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4714                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
4715                           "\x20\x21\x22\x23\x24\x25\x26\x27"
4716                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
4717                           "\x30\x31\x32\x33\x34\x35\x36\x37"
4718                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
4719                           "\x40\x41\x42\x43\x44\x45\x46\x47"
4720                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
4721                           "\x50\x51\x52\x53\x54\x55\x56\x57"
4722                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
4723                           "\x60\x61\x62\x63\x64\x65\x66\x67"
4724                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
4725                           "\x70\x71\x72\x73\x74\x75\x76\x77"
4726                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
4727                           "\x80\x81\x82\x83\x84\x85\x86\x87"
4728                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
4729                           "\x90\x91\x92\x93\x94\x95\x96\x97"
4730                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
4731                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
4732                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
4733                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
4734                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
4735                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
4736                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
4737                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
4738                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
4739                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
4740                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
4741                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
4742                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
4743                           "\x00\x01\x02\x03\x04\x05\x06\x07"
4744                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4745                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4746                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
4747                           "\x20\x21\x22\x23\x24\x25\x26\x27"
4748                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
4749                           "\x30\x31\x32\x33\x34\x35\x36\x37"
4750                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
4751                           "\x40\x41\x42\x43\x44\x45\x46\x47"
4752                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
4753                           "\x50\x51\x52\x53\x54\x55\x56\x57"
4754                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
4755                           "\x60\x61\x62\x63\x64\x65\x66\x67"
4756                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
4757                           "\x70\x71\x72\x73\x74\x75\x76\x77"
4758                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
4759                           "\x80\x81\x82\x83\x84\x85\x86\x87"
4760                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
4761                           "\x90\x91\x92\x93\x94\x95\x96\x97"
4762                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
4763                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
4764                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
4765                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
4766                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
4767                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
4768                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
4769                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
4770                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
4771                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
4772                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
4773                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
4774                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
4775                 .ilen   = 512,
4776                 .result = "\xd7\x4b\x93\x7d\x13\xa2\xa2\xe1"
4777                           "\x35\x39\x71\x88\x76\x1e\xc9\xea"
4778                           "\x86\xad\xf3\x14\x48\x3d\x5e\xe9"
4779                           "\xe9\x2d\xb2\x56\x59\x35\x9d\xec"
4780                           "\x84\xfa\x7e\x9d\x6d\x33\x36\x8f"
4781                           "\xce\xf4\xa9\x21\x0b\x5f\x96\xec"
4782                           "\xcb\xf9\x57\x68\x33\x88\x39\xbf"
4783                           "\x2f\xbb\x59\x03\xbd\x66\x8b\x11"
4784                           "\x11\x65\x51\x2e\xb8\x67\x05\xd1"
4785                           "\x27\x11\x5c\xd4\xcc\x97\xc2\xb3"
4786                           "\xa9\x55\xaf\x07\x56\xd1\xdc\xf5"
4787                           "\x85\xdc\x46\xe6\xf0\x24\xeb\x93"
4788                           "\x4d\xf0\x9b\xf5\x73\x1c\xda\x03"
4789                           "\x22\xc8\x3a\x4f\xb4\x19\x91\x09"
4790                           "\x54\x0b\xf6\xfe\x17\x3d\x1a\x53"
4791                           "\x72\x60\x79\xcb\x0e\x32\x8a\x77"
4792                           "\xd5\xed\xdb\x33\xd7\x62\x16\x69"
4793                           "\x63\xe0\xab\xb5\xf6\x9c\x5f\x3d"
4794                           "\x69\x35\x61\x86\xf8\x86\xb9\x89"
4795                           "\x6e\x59\x35\xac\xf6\x6b\x33\xa0"
4796                           "\xea\xef\x96\x62\xd8\xa9\xcf\x56"
4797                           "\xbf\xdb\x8a\xfd\xa1\x82\x77\x73"
4798                           "\x3d\x94\x4a\x49\x42\x6d\x08\x60"
4799                           "\xa1\xea\xab\xb6\x88\x13\x94\xb8"
4800                           "\x51\x98\xdb\x35\x85\xdf\xf6\xb9"
4801                           "\x8f\xcd\xdf\x80\xd3\x40\x2d\x72"
4802                           "\xb8\xb2\x6c\x02\x43\x35\x22\x2a"
4803                           "\x31\xed\xcd\x16\x19\xdf\x62\x0f"
4804                           "\x29\xcf\x87\x04\xec\x02\x4f\xe4"
4805                           "\xa2\xed\x73\xc6\x69\xd3\x7e\x89"
4806                           "\x0b\x76\x10\x7c\xd6\xf9\x6a\x25"
4807                           "\xed\xcc\x60\x5d\x61\x20\xc1\x97"
4808                           "\x56\x91\x57\x28\xbe\x71\x0d\xcd"
4809                           "\xde\xc4\x9e\x55\x91\xbe\xd1\x28"
4810                           "\x9b\x90\xeb\x73\xf3\x68\x51\xc6"
4811                           "\xdf\x82\xcc\xd8\x1f\xce\x5b\x27"
4812                           "\xc0\x60\x5e\x33\xd6\xa7\x20\xea"
4813                           "\xb2\x54\xc7\x5d\x6a\x3b\x67\x47"
4814                           "\xcf\xa0\xe3\xab\x86\xaf\xc1\x42"
4815                           "\xe6\xb0\x23\x4a\xaf\x53\xdf\xa0"
4816                           "\xad\x12\x32\x31\x03\xf7\x21\xbe"
4817                           "\x2d\xd5\x82\x42\xb6\x4a\x3d\xcd"
4818                           "\xd8\x81\x77\xa9\x49\x98\x6c\x09"
4819                           "\xc5\xa3\x61\x12\x62\x85\x6b\xcd"
4820                           "\xb3\xf4\x20\x0c\x41\xc4\x05\x37"
4821                           "\x46\x5f\xeb\x71\x8b\xf1\xaf\x6e"
4822                           "\xba\xf3\x50\x2e\xfe\xa8\x37\xeb"
4823                           "\xe8\x8c\x4f\xa4\x0c\xf1\x31\xc8"
4824                           "\x6e\x71\x4f\xa5\xd7\x97\x73\xe0"
4825                           "\x93\x4a\x2f\xda\x7b\xe0\x20\x54"
4826                           "\x1f\x8d\x85\x79\x0b\x7b\x5e\x75"
4827                           "\xb9\x07\x67\xcc\xc8\xe7\x21\x15"
4828                           "\xa7\xc8\x98\xff\x4b\x80\x1c\x12"
4829                           "\xa8\x54\xe1\x38\x52\xe6\x74\x81"
4830                           "\x97\x47\xa1\x41\x0e\xc0\x50\xe3"
4831                           "\x55\x0e\xc3\xa7\x70\x77\xce\x07"
4832                           "\xed\x8c\x88\xe6\xa1\x5b\x14\xec"
4833                           "\xe6\xde\x06\x6d\x74\xc5\xd9\xfa"
4834                           "\xe5\x2f\x5a\xff\xc8\x05\xee\x27"
4835                           "\x35\x61\xbf\x0b\x19\x78\x9b\xd2"
4836                           "\x04\xc7\x05\xb1\x79\xb4\xff\x5f"
4837                           "\xf3\xea\x67\x52\x78\xc2\xce\x70"
4838                           "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97"
4839                           "\x37\x30\xe1\x91\x8d\xb3\x2a\xff",
4840                 .rlen   = 512,
4841                 .also_non_np = 1,
4842                 .np     = 2,
4843                 .tap    = { 512 - 16, 16 },
4844         },
4845 };
4846
4847 static struct cipher_testvec tf_xts_dec_tv_template[] = {
4848         /* Generated from AES-XTS test vectors */
4849         /* same as enc vectors with input and result reversed */
4850         {
4851                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
4852                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4853                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4854                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4855                 .klen   = 32,
4856                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4857                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4858                 .input  = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
4859                           "\x30\x74\xe4\x44\x52\x77\x97\x43"
4860                           "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
4861                           "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
4862                 .ilen   = 32,
4863                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
4864                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4865                           "\x00\x00\x00\x00\x00\x00\x00\x00"
4866                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4867                 .rlen   = 32,
4868         }, {
4869                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
4870                           "\x11\x11\x11\x11\x11\x11\x11\x11"
4871                           "\x22\x22\x22\x22\x22\x22\x22\x22"
4872                           "\x22\x22\x22\x22\x22\x22\x22\x22",
4873                 .klen   = 32,
4874                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
4875                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4876                 .input  = "\x57\x0e\x8f\xe5\x2a\x35\x61\x4f"
4877                           "\x32\xd3\xbd\x36\x05\x15\x44\x2c"
4878                           "\x58\x06\xf7\xf8\x00\xa8\xb6\xd5"
4879                           "\xc6\x28\x92\xdb\xd8\x34\xa2\xe9",
4880                 .ilen   = 32,
4881                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
4882                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4883                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4884                           "\x44\x44\x44\x44\x44\x44\x44\x44",
4885                 .rlen   = 32,
4886         }, {
4887                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
4888                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
4889                           "\x22\x22\x22\x22\x22\x22\x22\x22"
4890                           "\x22\x22\x22\x22\x22\x22\x22\x22",
4891                 .klen   = 32,
4892                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
4893                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4894                 .input  = "\x96\x45\x8f\x8d\x7a\x75\xb1\xde"
4895                           "\x40\x0c\x89\x56\xf6\x4d\xa7\x07"
4896                           "\x38\xbb\x5b\xe9\xcd\x84\xae\xb2"
4897                           "\x7b\x6a\x62\xf4\x8c\xb5\x37\xea",
4898                 .ilen   = 32,
4899                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
4900                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4901                           "\x44\x44\x44\x44\x44\x44\x44\x44"
4902                           "\x44\x44\x44\x44\x44\x44\x44\x44",
4903                 .rlen   = 32,
4904         }, {
4905                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
4906                           "\x23\x53\x60\x28\x74\x71\x35\x26"
4907                           "\x31\x41\x59\x26\x53\x58\x97\x93"
4908                           "\x23\x84\x62\x64\x33\x83\x27\x95",
4909                 .klen   = 32,
4910                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4911                           "\x00\x00\x00\x00\x00\x00\x00\x00",
4912                 .input  = "\xa9\x78\xae\x1e\xea\xa2\x44\x4c"
4913                           "\xa2\x7a\x64\x1f\xaf\x46\xc1\xe0"
4914                           "\x6c\xb2\xf3\x92\x9a\xd6\x7d\x58"
4915                           "\xb8\x2d\xb9\x5d\x58\x07\x66\x50"
4916                           "\xea\x35\x35\x8c\xb2\x46\x61\x06"
4917                           "\x5d\x65\xfc\x57\x8f\x69\x74\xab"
4918                           "\x8a\x06\x69\xb5\x6c\xda\x66\xc7"
4919                           "\x52\x90\xbb\x8e\x6d\x8b\xb5\xa2"
4920                           "\x78\x1d\xc2\xa9\xc2\x73\x00\xc3"
4921                           "\x32\x36\x7c\x97\x6b\x4e\x8a\x50"
4922                           "\xe4\x91\x83\x96\x8f\xf4\x94\x1a"
4923                           "\xa6\x27\xe1\x33\xcb\x91\xc6\x5f"
4924                           "\x94\x75\xbc\xd7\x3e\x3e\x6f\x9e"
4925                           "\xa9\x31\x80\x5e\xe5\xdb\xc8\x53"
4926                           "\x01\x73\x68\x32\x25\x19\xfa\xfb"
4927                           "\xe4\xcf\xb9\x3e\xa2\xa0\x8f\x31"
4928                           "\xbf\x54\x06\x93\xa8\xb1\x0f\xb6"
4929                           "\x7c\x3c\xde\x6f\x0f\xfb\x0c\x11"
4930                           "\x39\x80\x39\x09\x97\x65\xf2\x83"
4931                           "\xae\xe6\xa1\x6f\x47\xb8\x49\xde"
4932                           "\x99\x36\x20\x7d\x97\x3b\xec\xfa"
4933                           "\xb4\x33\x6e\x7a\xc7\x46\x84\x49"
4934                           "\x91\xcd\xe1\x57\x0d\xed\x40\x08"
4935                           "\x13\xf1\x4e\x3e\xa4\xa4\x5c\xe6"
4936                           "\xd2\x0c\x20\x8f\x3e\xdf\x3f\x47"
4937                           "\x9a\x2f\xde\x6d\x66\xc9\x99\x4a"
4938                           "\x2d\x9e\x9d\x4b\x1a\x27\xa2\x12"
4939                           "\x99\xf0\xf8\xb1\xb6\xf6\x57\xc3"
4940                           "\xca\x1c\xa3\x8e\xed\x39\x28\xb5"
4941                           "\x10\x1b\x4b\x08\x42\x00\x4a\xd3"
4942                           "\xad\x5a\xc6\x8e\xc8\xbb\x95\xc4"
4943                           "\x4b\xaa\xfe\xd5\x42\xa8\xa3\x6d"
4944                           "\x3c\xf3\x34\x91\x2d\xb4\xdd\x20"
4945                           "\x0c\x90\x6d\xa3\x9b\x66\x9d\x24"
4946                           "\x02\xa6\xa9\x3f\x3f\x58\x5d\x47"
4947                           "\x24\x65\x63\x7e\xbd\x8c\xe6\x52"
4948                           "\x7d\xef\x33\x53\x63\xec\xaa\x0b"
4949                           "\x64\x15\xa9\xa6\x1f\x10\x00\x38"
4950                           "\x35\xa8\xe7\xbe\x23\x70\x22\xe0"
4951                           "\xd3\xb9\xe6\xfd\xe6\xaa\x03\x50"
4952                           "\xf3\x3c\x27\x36\x8b\xcc\xfe\x9c"
4953                           "\x9c\xa3\xb3\xe7\x68\x9b\xa2\x71"
4954                           "\xe0\x07\xd9\x1f\x68\x1f\xac\x5e"
4955                           "\x7a\x74\x85\xa9\x6a\x90\xab\x2c"
4956                           "\x38\x51\xbc\x1f\x43\x4a\x56\x1c"
4957                           "\xf8\x47\x03\x4e\x67\xa8\x1f\x99"
4958                           "\x04\x39\x73\x32\xb2\x86\x79\xe7"
4959                           "\x14\x28\x70\xb8\xe2\x7d\x69\x85"
4960                           "\xb6\x0f\xc5\xd0\xd0\x01\x5c\xe6"
4961                           "\x09\x0f\x75\xf7\xb6\x81\xd2\x11"
4962                           "\x20\x9c\xa1\xee\x11\x44\x79\xd0"
4963                           "\xb2\x34\x77\xda\x10\x9a\x6f\x6f"
4964                           "\xef\x7c\xd9\xdc\x35\xb7\x61\xdd"
4965                           "\xf1\xa4\xc6\x1c\xbf\x05\x22\xac"
4966                           "\xfe\x2f\x85\x00\x44\xdf\x33\x16"
4967                           "\x35\xb6\xa3\xd3\x70\xdf\x69\x35"
4968                           "\x6a\xc7\xb4\x99\x45\x27\xc8\x8e"
4969                           "\x5a\x14\x30\xd0\x55\x3e\x4f\x64"
4970                           "\x0d\x38\xe3\xdf\x8b\xa8\x93\x26"
4971                           "\x75\xae\xf6\xb5\x23\x0b\x17\x31"
4972                           "\xbf\x27\xb8\xb5\x94\x31\xa7\x8f"
4973                           "\x43\xc4\x46\x24\x22\x4f\x8f\x7e"
4974                           "\xe5\xf4\x6d\x1e\x0e\x18\x7a\xbb"
4975                           "\xa6\x8f\xfb\x49\x49\xd8\x7e\x5a",
4976                 .ilen   = 512,
4977                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
4978                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4979                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4980                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
4981                           "\x20\x21\x22\x23\x24\x25\x26\x27"
4982                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
4983                           "\x30\x31\x32\x33\x34\x35\x36\x37"
4984                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
4985                           "\x40\x41\x42\x43\x44\x45\x46\x47"
4986                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
4987                           "\x50\x51\x52\x53\x54\x55\x56\x57"
4988                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
4989                           "\x60\x61\x62\x63\x64\x65\x66\x67"
4990                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
4991                           "\x70\x71\x72\x73\x74\x75\x76\x77"
4992                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
4993                           "\x80\x81\x82\x83\x84\x85\x86\x87"
4994                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
4995                           "\x90\x91\x92\x93\x94\x95\x96\x97"
4996                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
4997                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
4998                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
4999                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5000                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5001                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5002                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5003                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5004                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5005                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5006                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5007                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5008                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
5009                           "\x00\x01\x02\x03\x04\x05\x06\x07"
5010                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5011                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5012                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5013                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5014                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5015                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5016                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5017                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5018                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5019                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5020                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5021                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5022                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5023                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5024                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5025                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5026                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5027                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5028                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5029                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5030                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5031                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5032                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5033                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5034                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5035                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5036                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5037                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5038                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5039                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5040                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
5041                 .rlen   = 512,
5042         }, {
5043                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
5044                           "\x23\x53\x60\x28\x74\x71\x35\x26"
5045                           "\x62\x49\x77\x57\x24\x70\x93\x69"
5046                           "\x99\x59\x57\x49\x66\x96\x76\x27"
5047                           "\x31\x41\x59\x26\x53\x58\x97\x93"
5048                           "\x23\x84\x62\x64\x33\x83\x27\x95"
5049                           "\x02\x88\x41\x97\x16\x93\x99\x37"
5050                           "\x51\x05\x82\x09\x74\x94\x45\x92",
5051                 .klen   = 64,
5052                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
5053                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5054                 .input  = "\xd7\x4b\x93\x7d\x13\xa2\xa2\xe1"
5055                           "\x35\x39\x71\x88\x76\x1e\xc9\xea"
5056                           "\x86\xad\xf3\x14\x48\x3d\x5e\xe9"
5057                           "\xe9\x2d\xb2\x56\x59\x35\x9d\xec"
5058                           "\x84\xfa\x7e\x9d\x6d\x33\x36\x8f"
5059                           "\xce\xf4\xa9\x21\x0b\x5f\x96\xec"
5060                           "\xcb\xf9\x57\x68\x33\x88\x39\xbf"
5061                           "\x2f\xbb\x59\x03\xbd\x66\x8b\x11"
5062                           "\x11\x65\x51\x2e\xb8\x67\x05\xd1"
5063                           "\x27\x11\x5c\xd4\xcc\x97\xc2\xb3"
5064                           "\xa9\x55\xaf\x07\x56\xd1\xdc\xf5"
5065                           "\x85\xdc\x46\xe6\xf0\x24\xeb\x93"
5066                           "\x4d\xf0\x9b\xf5\x73\x1c\xda\x03"
5067                           "\x22\xc8\x3a\x4f\xb4\x19\x91\x09"
5068                           "\x54\x0b\xf6\xfe\x17\x3d\x1a\x53"
5069                           "\x72\x60\x79\xcb\x0e\x32\x8a\x77"
5070                           "\xd5\xed\xdb\x33\xd7\x62\x16\x69"
5071                           "\x63\xe0\xab\xb5\xf6\x9c\x5f\x3d"
5072                           "\x69\x35\x61\x86\xf8\x86\xb9\x89"
5073                           "\x6e\x59\x35\xac\xf6\x6b\x33\xa0"
5074                           "\xea\xef\x96\x62\xd8\xa9\xcf\x56"
5075                           "\xbf\xdb\x8a\xfd\xa1\x82\x77\x73"
5076                           "\x3d\x94\x4a\x49\x42\x6d\x08\x60"
5077                           "\xa1\xea\xab\xb6\x88\x13\x94\xb8"
5078                           "\x51\x98\xdb\x35\x85\xdf\xf6\xb9"
5079                           "\x8f\xcd\xdf\x80\xd3\x40\x2d\x72"
5080                           "\xb8\xb2\x6c\x02\x43\x35\x22\x2a"
5081                           "\x31\xed\xcd\x16\x19\xdf\x62\x0f"
5082                           "\x29\xcf\x87\x04\xec\x02\x4f\xe4"
5083                           "\xa2\xed\x73\xc6\x69\xd3\x7e\x89"
5084                           "\x0b\x76\x10\x7c\xd6\xf9\x6a\x25"
5085                           "\xed\xcc\x60\x5d\x61\x20\xc1\x97"
5086                           "\x56\x91\x57\x28\xbe\x71\x0d\xcd"
5087                           "\xde\xc4\x9e\x55\x91\xbe\xd1\x28"
5088                           "\x9b\x90\xeb\x73\xf3\x68\x51\xc6"
5089                           "\xdf\x82\xcc\xd8\x1f\xce\x5b\x27"
5090                           "\xc0\x60\x5e\x33\xd6\xa7\x20\xea"
5091                           "\xb2\x54\xc7\x5d\x6a\x3b\x67\x47"
5092                           "\xcf\xa0\xe3\xab\x86\xaf\xc1\x42"
5093                           "\xe6\xb0\x23\x4a\xaf\x53\xdf\xa0"
5094                           "\xad\x12\x32\x31\x03\xf7\x21\xbe"
5095                           "\x2d\xd5\x82\x42\xb6\x4a\x3d\xcd"
5096                           "\xd8\x81\x77\xa9\x49\x98\x6c\x09"
5097                           "\xc5\xa3\x61\x12\x62\x85\x6b\xcd"
5098                           "\xb3\xf4\x20\x0c\x41\xc4\x05\x37"
5099                           "\x46\x5f\xeb\x71\x8b\xf1\xaf\x6e"
5100                           "\xba\xf3\x50\x2e\xfe\xa8\x37\xeb"
5101                           "\xe8\x8c\x4f\xa4\x0c\xf1\x31\xc8"
5102                           "\x6e\x71\x4f\xa5\xd7\x97\x73\xe0"
5103                           "\x93\x4a\x2f\xda\x7b\xe0\x20\x54"
5104                           "\x1f\x8d\x85\x79\x0b\x7b\x5e\x75"
5105                           "\xb9\x07\x67\xcc\xc8\xe7\x21\x15"
5106                           "\xa7\xc8\x98\xff\x4b\x80\x1c\x12"
5107                           "\xa8\x54\xe1\x38\x52\xe6\x74\x81"
5108                           "\x97\x47\xa1\x41\x0e\xc0\x50\xe3"
5109                           "\x55\x0e\xc3\xa7\x70\x77\xce\x07"
5110                           "\xed\x8c\x88\xe6\xa1\x5b\x14\xec"
5111                           "\xe6\xde\x06\x6d\x74\xc5\xd9\xfa"
5112                           "\xe5\x2f\x5a\xff\xc8\x05\xee\x27"
5113                           "\x35\x61\xbf\x0b\x19\x78\x9b\xd2"
5114                           "\x04\xc7\x05\xb1\x79\xb4\xff\x5f"
5115                           "\xf3\xea\x67\x52\x78\xc2\xce\x70"
5116                           "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97"
5117                           "\x37\x30\xe1\x91\x8d\xb3\x2a\xff",
5118                 .ilen   = 512,
5119                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5120                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5121                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5122                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5123                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5124                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5125                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5126                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5127                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5128                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5129                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5130                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5131                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5132                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5133                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5134                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5135                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5136                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5137                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5138                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5139                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5140                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5141                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5142                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5143                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5144                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5145                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5146                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5147                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5148                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5149                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5150                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
5151                           "\x00\x01\x02\x03\x04\x05\x06\x07"
5152                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5153                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5154                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5155                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5156                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5157                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5158                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5159                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5160                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5161                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5162                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5163                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5164                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5165                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5166                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5167                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5168                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5169                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5170                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5171                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5172                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5173                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5174                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5175                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5176                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5177                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5178                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5179                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5180                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5181                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5182                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
5183                 .rlen   = 512,
5184                 .also_non_np = 1,
5185                 .np     = 2,
5186                 .tap    = { 512 - 16, 16 },
5187         },
5188 };
5189
5190 /*
5191  * Serpent test vectors.  These are backwards because Serpent writes
5192  * octet sequences in right-to-left mode.
5193  */
5194 #define SERPENT_ENC_TEST_VECTORS        5
5195 #define SERPENT_DEC_TEST_VECTORS        5
5196
5197 #define TNEPRES_ENC_TEST_VECTORS        4
5198 #define TNEPRES_DEC_TEST_VECTORS        4
5199
5200 #define SERPENT_CBC_ENC_TEST_VECTORS    1
5201 #define SERPENT_CBC_DEC_TEST_VECTORS    1
5202
5203 #define SERPENT_CTR_ENC_TEST_VECTORS    2
5204 #define SERPENT_CTR_DEC_TEST_VECTORS    2
5205
5206 #define SERPENT_LRW_ENC_TEST_VECTORS    8
5207 #define SERPENT_LRW_DEC_TEST_VECTORS    8
5208
5209 #define SERPENT_XTS_ENC_TEST_VECTORS    5
5210 #define SERPENT_XTS_DEC_TEST_VECTORS    5
5211
5212 static struct cipher_testvec serpent_enc_tv_template[] = {
5213         {
5214                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
5215                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5216                 .ilen   = 16,
5217                 .result = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
5218                           "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
5219                 .rlen   = 16,
5220         }, {
5221                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5222                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5223                 .klen   = 16,
5224                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
5225                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5226                 .ilen   = 16,
5227                 .result = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
5228                           "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
5229                 .rlen   = 16,
5230         }, {
5231                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5232                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5233                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5234                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
5235                 .klen   = 32,
5236                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
5237                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5238                 .ilen   = 16,
5239                 .result = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
5240                           "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
5241                 .rlen   = 16,
5242         }, {
5243                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
5244                 .klen   = 16,
5245                 .input  = zeroed_string,
5246                 .ilen   = 16,
5247                 .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
5248                           "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
5249                 .rlen   = 16,
5250         }, { /* Generated with Crypto++ */
5251                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5252                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5253                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5254                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5255                 .klen   = 32,
5256                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5257                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5258                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5259                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5260                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5261                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5262                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5263                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5264                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5265                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5266                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5267                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5268                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5269                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5270                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5271                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5272                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5273                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5274                 .ilen   = 144,
5275                 .result = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
5276                           "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
5277                           "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
5278                           "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
5279                           "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
5280                           "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
5281                           "\x99\x34\x89\x5B\x54\xE9\x12\x13"
5282                           "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
5283                           "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
5284                           "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
5285                           "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
5286                           "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
5287                           "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
5288                           "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
5289                           "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
5290                           "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
5291                           "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
5292                           "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
5293                 .rlen   = 144,
5294                 .also_non_np = 1,
5295                 .np     = 2,
5296                 .tap    = { 144 - 16, 16 },
5297         },
5298 };
5299
5300 static struct cipher_testvec tnepres_enc_tv_template[] = {
5301         { /* KeySize=128, PT=0, I=1 */
5302                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
5303                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5304                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
5305                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5306                 .klen   = 16,
5307                 .ilen   = 16,
5308                 .result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05"
5309                           "\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd",
5310                 .rlen   = 16,
5311         }, { /* KeySize=192, PT=0, I=1 */
5312                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
5313                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5314                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5315                 .klen   = 24,
5316                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
5317                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5318                 .ilen   = 16,
5319                 .result = "\xe7\x8e\x54\x02\xc7\x19\x55\x68"
5320                           "\xac\x36\x78\xf7\xa3\xf6\x0c\x66",
5321                 .rlen   = 16,
5322         }, { /* KeySize=256, PT=0, I=1 */
5323                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
5324                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5325                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5326                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5327                 .klen   = 32,
5328                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
5329                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5330                 .ilen   = 16,
5331                 .result = "\xab\xed\x96\xe7\x66\xbf\x28\xcb"
5332                           "\xc0\xeb\xd2\x1a\x82\xef\x08\x19",
5333                 .rlen   = 16,
5334         }, { /* KeySize=256, I=257 */
5335                 .key    = "\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18"
5336                           "\x17\x16\x15\x14\x13\x12\x11\x10"
5337                           "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
5338                           "\x07\x06\x05\x04\x03\x02\x01\x00",
5339                 .klen   = 32,
5340                 .input  = "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
5341                           "\x07\x06\x05\x04\x03\x02\x01\x00",
5342                 .ilen   = 16,
5343                 .result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b"
5344                           "\xb8\x32\xe4\x33\xf8\x9f\x26\xde",
5345                 .rlen   = 16,
5346         },
5347 };
5348
5349
5350 static struct cipher_testvec serpent_dec_tv_template[] = {
5351         {
5352                 .input  = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
5353                           "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
5354                 .ilen   = 16,
5355                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5356                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5357                 .rlen   = 16,
5358         }, {
5359                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5360                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5361                 .klen   = 16,
5362                 .input  = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
5363                           "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
5364                 .ilen   = 16,
5365                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5366                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5367                 .rlen   = 16,
5368         }, {
5369                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5370                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5371                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5372                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
5373                 .klen   = 32,
5374                 .input  = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
5375                           "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
5376                 .ilen   = 16,
5377                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5378                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5379                 .rlen   = 16,
5380         }, {
5381                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
5382                 .klen   = 16,
5383                 .input  = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
5384                           "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
5385                 .ilen   = 16,
5386                 .result = zeroed_string,
5387                 .rlen   = 16,
5388         }, { /* Generated with Crypto++ */
5389                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5390                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5391                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5392                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5393                 .klen   = 32,
5394                 .input  = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
5395                           "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
5396                           "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
5397                           "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
5398                           "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
5399                           "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
5400                           "\x99\x34\x89\x5B\x54\xE9\x12\x13"
5401                           "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
5402                           "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
5403                           "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
5404                           "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
5405                           "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
5406                           "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
5407                           "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
5408                           "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
5409                           "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
5410                           "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
5411                           "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
5412                 .ilen   = 144,
5413                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5414                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5415                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5416                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5417                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5418                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5419                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5420                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5421                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5422                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5423                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5424                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5425                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5426                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5427                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5428                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5429                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5430                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5431                 .rlen   = 144,
5432                 .also_non_np = 1,
5433                 .np     = 2,
5434                 .tap    = { 144 - 16, 16 },
5435         },
5436 };
5437
5438 static struct cipher_testvec tnepres_dec_tv_template[] = {
5439         {
5440                 .input  = "\x41\xcc\x6b\x31\x59\x31\x45\x97"
5441                           "\x6d\x6f\xbb\x38\x4b\x37\x21\x28",
5442                 .ilen   = 16,
5443                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5444                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5445                 .rlen   = 16,
5446         }, {
5447                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5448                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5449                 .klen   = 16,
5450                 .input  = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47"
5451                           "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e",
5452                 .ilen   = 16,
5453                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5454                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5455                 .rlen   = 16,
5456         }, {
5457                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
5458                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5459                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5460                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
5461                 .klen   = 32,
5462                 .input  = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49"
5463                           "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee",
5464                 .ilen   = 16,
5465                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5466                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
5467                 .rlen   = 16,
5468         }, { /* KeySize=128, I=121 */
5469                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
5470                 .klen   = 16,
5471                 .input  = "\x3d\xda\xbf\xc0\x06\xda\xab\x06"
5472                           "\x46\x2a\xf4\xef\x81\x54\x4e\x26",
5473                 .ilen   = 16,
5474                 .result = zeroed_string,
5475                 .rlen   = 16,
5476         },
5477 };
5478
5479 static struct cipher_testvec serpent_cbc_enc_tv_template[] = {
5480         { /* Generated with Crypto++ */
5481                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5482                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5483                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5484                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5485                 .klen   = 32,
5486                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5487                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5488                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5489                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5490                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5491                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5492                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5493                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5494                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5495                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5496                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5497                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5498                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5499                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5500                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5501                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5502                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5503                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5504                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5505                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5506                 .ilen   = 144,
5507                 .result = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
5508                           "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
5509                           "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
5510                           "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
5511                           "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
5512                           "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
5513                           "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
5514                           "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
5515                           "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
5516                           "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
5517                           "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
5518                           "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
5519                           "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
5520                           "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
5521                           "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
5522                           "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
5523                           "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
5524                           "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
5525                 .rlen   = 144,
5526                 .also_non_np = 1,
5527                 .np     = 2,
5528                 .tap    = { 144 - 16, 16 },
5529         },
5530 };
5531
5532 static struct cipher_testvec serpent_cbc_dec_tv_template[] = {
5533         { /* Generated with Crypto++ */
5534                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5535                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5536                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5537                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5538                 .klen   = 32,
5539                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5540                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5541                 .input  = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
5542                           "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
5543                           "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
5544                           "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
5545                           "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
5546                           "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
5547                           "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
5548                           "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
5549                           "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
5550                           "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
5551                           "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
5552                           "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
5553                           "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
5554                           "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
5555                           "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
5556                           "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
5557                           "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
5558                           "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
5559                 .ilen   = 144,
5560                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5561                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5562                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5563                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5564                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5565                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5566                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5567                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5568                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5569                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5570                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5571                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5572                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5573                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5574                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5575                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5576                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5577                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5578                 .rlen   = 144,
5579                 .also_non_np = 1,
5580                 .np     = 2,
5581                 .tap    = { 144 - 16, 16 },
5582         },
5583 };
5584
5585 static struct cipher_testvec serpent_ctr_enc_tv_template[] = {
5586         { /* Generated with Crypto++ */
5587                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5588                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5589                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5590                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5591                 .klen   = 32,
5592                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5593                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5594                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5595                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5596                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5597                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5598                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5599                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5600                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5601                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5602                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5603                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5604                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5605                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5606                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5607                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5608                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5609                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5610                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5611                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5612                 .ilen   = 144,
5613                 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
5614                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
5615                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
5616                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
5617                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
5618                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
5619                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
5620                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
5621                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
5622                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
5623                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
5624                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
5625                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
5626                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
5627                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
5628                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
5629                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
5630                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
5631                 .rlen   = 144,
5632         }, { /* Generated with Crypto++ */
5633                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5634                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5635                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5636                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5637                 .klen   = 32,
5638                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5639                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5640                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5641                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5642                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5643                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5644                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5645                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5646                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5647                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5648                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5649                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5650                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5651                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5652                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5653                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5654                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5655                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5656                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5657                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
5658                           "\xF1\x65\xFC",
5659                 .ilen   = 147,
5660                 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
5661                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
5662                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
5663                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
5664                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
5665                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
5666                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
5667                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
5668                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
5669                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
5670                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
5671                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
5672                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
5673                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
5674                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
5675                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
5676                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
5677                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
5678                           "\xE6\xD0\x97",
5679                 .rlen   = 147,
5680                 .also_non_np = 1,
5681                 .np     = 2,
5682                 .tap    = { 147 - 16, 16 },
5683         },
5684 };
5685
5686 static struct cipher_testvec serpent_ctr_dec_tv_template[] = {
5687         { /* Generated with Crypto++ */
5688                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5689                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5690                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5691                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5692                 .klen   = 32,
5693                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5694                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5695                 .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
5696                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
5697                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
5698                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
5699                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
5700                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
5701                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
5702                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
5703                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
5704                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
5705                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
5706                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
5707                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
5708                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
5709                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
5710                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
5711                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
5712                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
5713                 .ilen   = 144,
5714                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5715                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5716                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5717                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5718                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5719                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5720                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5721                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5722                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5723                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5724                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5725                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5726                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5727                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5728                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5729                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5730                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5731                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5732                 .rlen   = 144,
5733         }, { /* Generated with Crypto++ */
5734                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
5735                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
5736                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
5737                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
5738                 .klen   = 32,
5739                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
5740                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
5741                 .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
5742                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
5743                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
5744                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
5745                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
5746                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
5747                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
5748                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
5749                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
5750                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
5751                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
5752                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
5753                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
5754                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
5755                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
5756                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
5757                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
5758                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
5759                           "\xE6\xD0\x97",
5760                 .ilen   = 147,
5761                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
5762                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
5763                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
5764                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
5765                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
5766                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
5767                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
5768                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
5769                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
5770                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
5771                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
5772                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
5773                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
5774                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
5775                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
5776                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
5777                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5778                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
5779                           "\xF1\x65\xFC",
5780                 .rlen   = 147,
5781                 .also_non_np = 1,
5782                 .np     = 2,
5783                 .tap    = { 147 - 16, 16 },
5784         },
5785 };
5786
5787 static struct cipher_testvec serpent_lrw_enc_tv_template[] = {
5788         /* Generated from AES-LRW test vectors */
5789         {
5790                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
5791                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
5792                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
5793                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
5794                 .klen   = 32,
5795                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5796                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5797                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5798                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5799                 .ilen   = 16,
5800                 .result = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
5801                           "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
5802                 .rlen   = 16,
5803         }, {
5804                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
5805                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
5806                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
5807                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
5808                 .klen   = 32,
5809                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5810                           "\x00\x00\x00\x00\x00\x00\x00\x02",
5811                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5812                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5813                 .ilen   = 16,
5814                 .result = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
5815                           "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
5816                 .rlen   = 16,
5817         }, {
5818                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
5819                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
5820                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
5821                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
5822                 .klen   = 32,
5823                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5824                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5825                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5826                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5827                 .ilen   = 16,
5828                 .result = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
5829                           "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
5830                 .rlen   = 16,
5831         }, {
5832                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
5833                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
5834                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
5835                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
5836                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
5837                 .klen   = 40,
5838                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5839                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5840                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5841                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5842                 .ilen   = 16,
5843                 .result = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
5844                           "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
5845                 .rlen   = 16,
5846         }, {
5847                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
5848                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
5849                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
5850                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
5851                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
5852                 .klen   = 40,
5853                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5854                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5855                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5856                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5857                 .ilen   = 16,
5858                 .result = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
5859                           "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
5860                 .rlen   = 16,
5861         }, {
5862                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5863                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5864                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5865                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5866                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5867                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5868                 .klen   = 48,
5869                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5870                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5871                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5872                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5873                 .ilen   = 16,
5874                 .result = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
5875                           "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
5876                 .rlen   = 16,
5877         }, {
5878                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
5879                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
5880                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
5881                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
5882                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
5883                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
5884                 .klen   = 48,
5885                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5886                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5887                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5888                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5889                 .ilen   = 16,
5890                 .result = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
5891                           "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
5892                 .rlen   = 16,
5893         }, {
5894                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5895                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5896                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5897                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5898                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5899                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5900                 .klen   = 48,
5901                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5902                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5903                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
5904                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
5905                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
5906                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
5907                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
5908                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
5909                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
5910                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
5911                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
5912                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
5913                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
5914                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
5915                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
5916                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
5917                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
5918                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
5919                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
5920                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
5921                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
5922                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
5923                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
5924                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
5925                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
5926                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
5927                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
5928                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
5929                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
5930                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
5931                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
5932                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
5933                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
5934                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
5935                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
5936                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
5937                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
5938                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
5939                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
5940                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
5941                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
5942                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
5943                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
5944                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
5945                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
5946                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
5947                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
5948                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
5949                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
5950                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
5951                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
5952                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
5953                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
5954                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
5955                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
5956                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
5957                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
5958                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
5959                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
5960                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
5961                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
5962                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
5963                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
5964                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
5965                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
5966                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
5967                 .ilen   = 512,
5968                 .result = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
5969                           "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
5970                           "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
5971                           "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
5972                           "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
5973                           "\xce\xab\xda\x33\x30\x20\x12\xfa"
5974                           "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
5975                           "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
5976                           "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
5977                           "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
5978                           "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
5979                           "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
5980                           "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
5981                           "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
5982                           "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
5983                           "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
5984                           "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
5985                           "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
5986                           "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
5987                           "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
5988                           "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
5989                           "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
5990                           "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
5991                           "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
5992                           "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
5993                           "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
5994                           "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
5995                           "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
5996                           "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
5997                           "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
5998                           "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
5999                           "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
6000                           "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
6001                           "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
6002                           "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
6003                           "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
6004                           "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
6005                           "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
6006                           "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
6007                           "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
6008                           "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
6009                           "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
6010                           "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
6011                           "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
6012                           "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
6013                           "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
6014                           "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
6015                           "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
6016                           "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
6017                           "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
6018                           "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
6019                           "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
6020                           "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
6021                           "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
6022                           "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
6023                           "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
6024                           "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
6025                           "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
6026                           "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
6027                           "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
6028                           "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
6029                           "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
6030                           "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
6031                           "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
6032                 .rlen   = 512,
6033                 .also_non_np = 1,
6034                 .np     = 2,
6035                 .tap    = { 512 - 16, 16 },
6036         },
6037 };
6038
6039 static struct cipher_testvec serpent_lrw_dec_tv_template[] = {
6040         /* Generated from AES-LRW test vectors */
6041         /* same as enc vectors with input and result reversed */
6042         {
6043                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
6044                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
6045                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
6046                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
6047                 .klen   = 32,
6048                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6049                           "\x00\x00\x00\x00\x00\x00\x00\x01",
6050                 .input  = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
6051                           "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
6052                 .ilen   = 16,
6053                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6054                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6055                 .rlen   = 16,
6056         }, {
6057                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
6058                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
6059                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
6060                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
6061                 .klen   = 32,
6062                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6063                           "\x00\x00\x00\x00\x00\x00\x00\x02",
6064                 .input  = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
6065                           "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
6066                 .ilen   = 16,
6067                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6068                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6069                 .rlen   = 16,
6070         }, {
6071                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
6072                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
6073                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
6074                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
6075                 .klen   = 32,
6076                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6077                           "\x00\x00\x00\x02\x00\x00\x00\x00",
6078                 .input  = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
6079                           "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
6080                 .ilen   = 16,
6081                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6082                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6083                 .rlen   = 16,
6084         }, {
6085                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
6086                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
6087                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
6088                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
6089                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
6090                 .klen   = 40,
6091                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6092                           "\x00\x00\x00\x00\x00\x00\x00\x01",
6093                 .input  = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
6094                           "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
6095                 .ilen   = 16,
6096                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6097                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6098                 .rlen   = 16,
6099         }, {
6100                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
6101                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
6102                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
6103                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
6104                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
6105                 .klen   = 40,
6106                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6107                           "\x00\x00\x00\x02\x00\x00\x00\x00",
6108                 .input  = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
6109                           "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
6110                 .ilen   = 16,
6111                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6112                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6113                 .rlen   = 16,
6114         }, {
6115                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
6116                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
6117                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
6118                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
6119                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
6120                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
6121                 .klen   = 48,
6122                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6123                           "\x00\x00\x00\x00\x00\x00\x00\x01",
6124                 .input  = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
6125                           "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
6126                 .ilen   = 16,
6127                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6128                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6129                 .rlen   = 16,
6130         }, {
6131                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
6132                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
6133                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
6134                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
6135                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
6136                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
6137                 .klen   = 48,
6138                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6139                           "\x00\x00\x00\x02\x00\x00\x00\x00",
6140                 .input  = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
6141                           "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
6142                 .ilen   = 16,
6143                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
6144                           "\x38\x39\x41\x42\x43\x44\x45\x46",
6145                 .rlen   = 16,
6146         }, {
6147                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
6148                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
6149                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
6150                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
6151                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
6152                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
6153                 .klen   = 48,
6154                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6155                           "\x00\x00\x00\x00\x00\x00\x00\x01",
6156                 .input  = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
6157                           "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
6158                           "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
6159                           "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
6160                           "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
6161                           "\xce\xab\xda\x33\x30\x20\x12\xfa"
6162                           "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
6163                           "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
6164                           "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
6165                           "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
6166                           "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
6167                           "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
6168                           "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
6169                           "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
6170                           "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
6171                           "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
6172                           "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
6173                           "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
6174                           "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
6175                           "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
6176                           "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
6177                           "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
6178                           "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
6179                           "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
6180                           "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
6181                           "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
6182                           "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
6183                           "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
6184                           "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
6185                           "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
6186                           "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
6187                           "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
6188                           "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
6189                           "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
6190                           "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
6191                           "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
6192                           "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
6193                           "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
6194                           "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
6195                           "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
6196                           "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
6197                           "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
6198                           "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
6199                           "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
6200                           "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
6201                           "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
6202                           "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
6203                           "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
6204                           "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
6205                           "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
6206                           "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
6207                           "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
6208                           "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
6209                           "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
6210                           "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
6211                           "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
6212                           "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
6213                           "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
6214                           "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
6215                           "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
6216                           "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
6217                           "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
6218                           "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
6219                           "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
6220                 .ilen   = 512,
6221                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
6222                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
6223                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
6224                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
6225                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
6226                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
6227                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
6228                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
6229                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
6230                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
6231                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
6232                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
6233                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
6234                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
6235                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
6236                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
6237                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
6238                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
6239                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
6240                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
6241                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
6242                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
6243                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
6244                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
6245                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
6246                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
6247                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
6248                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
6249                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
6250                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
6251                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
6252                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
6253                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
6254                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
6255                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
6256                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
6257                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
6258                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
6259                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
6260                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
6261                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
6262                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
6263                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
6264                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
6265                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
6266                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
6267                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
6268                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
6269                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
6270                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
6271                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
6272                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
6273                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
6274                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
6275                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
6276                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
6277                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
6278                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
6279                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
6280                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
6281                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
6282                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
6283                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
6284                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
6285                 .rlen   = 512,
6286                 .also_non_np = 1,
6287                 .np     = 2,
6288                 .tap    = { 512 - 16, 16 },
6289         },
6290 };
6291
6292 static struct cipher_testvec serpent_xts_enc_tv_template[] = {
6293         /* Generated from AES-XTS test vectors */
6294         {
6295                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
6296                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6297                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6298                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6299                 .klen   = 32,
6300                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6301                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6302                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
6303                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6304                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6305                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6306                 .ilen   = 32,
6307                 .result = "\xe1\x08\xb8\x1d\x2c\xf5\x33\x64"
6308                           "\xc8\x12\x04\xc7\xb3\x70\xe8\xc4"
6309                           "\x6a\x31\xc5\xf3\x00\xca\xb9\x16"
6310                           "\xde\xe2\x77\x66\xf7\xfe\x62\x08",
6311                 .rlen   = 32,
6312         }, {
6313                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
6314                           "\x11\x11\x11\x11\x11\x11\x11\x11"
6315                           "\x22\x22\x22\x22\x22\x22\x22\x22"
6316                           "\x22\x22\x22\x22\x22\x22\x22\x22",
6317                 .klen   = 32,
6318                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
6319                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6320                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
6321                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6322                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6323                           "\x44\x44\x44\x44\x44\x44\x44\x44",
6324                 .ilen   = 32,
6325                 .result = "\x1a\x0a\x09\x5f\xcd\x07\x07\x98"
6326                           "\x41\x86\x12\xaf\xb3\xd7\x68\x13"
6327                           "\xed\x81\xcd\x06\x87\x43\x1a\xbb"
6328                           "\x13\x3d\xd6\x1e\x2b\xe1\x77\xbe",
6329                 .rlen   = 32,
6330         }, {
6331                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
6332                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
6333                           "\x22\x22\x22\x22\x22\x22\x22\x22"
6334                           "\x22\x22\x22\x22\x22\x22\x22\x22",
6335                 .klen   = 32,
6336                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
6337                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6338                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
6339                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6340                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6341                           "\x44\x44\x44\x44\x44\x44\x44\x44",
6342                 .ilen   = 32,
6343                 .result = "\xf9\x9b\x28\xb8\x5c\xaf\x8c\x61"
6344                           "\xb6\x1c\x81\x8f\x2c\x87\x60\x89"
6345                           "\x0d\x8d\x7a\xe8\x60\x48\xcc\x86"
6346                           "\xc1\x68\x45\xaa\x00\xe9\x24\xc5",
6347                 .rlen   = 32,
6348         }, {
6349                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
6350                           "\x23\x53\x60\x28\x74\x71\x35\x26"
6351                           "\x31\x41\x59\x26\x53\x58\x97\x93"
6352                           "\x23\x84\x62\x64\x33\x83\x27\x95",
6353                 .klen   = 32,
6354                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6355                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6356                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
6357                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6358                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6359                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6360                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6361                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6362                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6363                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6364                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6365                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6366                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6367                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6368                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6369                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6370                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6371                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6372                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6373                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6374                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6375                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6376                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6377                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6378                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6379                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6380                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6381                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6382                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6383                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6384                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6385                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6386                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6387                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6388                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6389                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6390                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6391                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6392                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6393                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6394                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6395                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6396                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6397                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6398                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6399                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6400                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6401                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6402                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6403                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6404                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6405                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6406                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6407                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6408                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6409                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6410                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6411                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6412                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6413                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6414                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6415                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6416                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6417                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6418                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6419                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6420                 .ilen   = 512,
6421                 .result = "\xfe\x47\x4a\xc8\x60\x7e\xb4\x8b"
6422                           "\x0d\x10\xf4\xb0\x0d\xba\xf8\x53"
6423                           "\x65\x6e\x38\x4b\xdb\xaa\xb1\x9e"
6424                           "\x28\xca\xb0\x22\xb3\x85\x75\xf4"
6425                           "\x00\x5c\x75\x14\x06\xd6\x25\x82"
6426                           "\xe6\xcb\x08\xf7\x29\x90\x23\x8e"
6427                           "\xa4\x68\x57\xe4\xf0\xd8\x32\xf3"
6428                           "\x80\x51\x67\xb5\x0b\x85\x69\xe8"
6429                           "\x19\xfe\xc4\xc7\x3e\xea\x90\xd3"
6430                           "\x8f\xa3\xf2\x0a\xac\x17\x4b\xa0"
6431                           "\x63\x5a\x16\x0f\xf0\xce\x66\x1f"
6432                           "\x2c\x21\x07\xf1\xa4\x03\xa3\x44"
6433                           "\x41\x61\x87\x5d\x6b\xb3\xef\xd4"
6434                           "\xfc\xaa\x32\x7e\x55\x58\x04\x41"
6435                           "\xc9\x07\x33\xc6\xa2\x68\xd6\x5a"
6436                           "\x55\x79\x4b\x6f\xcf\x89\xb9\x19"
6437                           "\xe5\x54\x13\x15\xb2\x1a\xfa\x15"
6438                           "\xc2\xf0\x06\x59\xfa\xa0\x25\x05"
6439                           "\x58\xfa\x43\x91\x16\x85\x40\xbb"
6440                           "\x0d\x34\x4d\xc5\x1e\x20\xd5\x08"
6441                           "\xcd\x22\x22\x41\x11\x9f\x6c\x7c"
6442                           "\x8d\x57\xc9\xba\x57\xe8\x2c\xf7"
6443                           "\xa0\x42\xa8\xde\xfc\xa3\xca\x98"
6444                           "\x4b\x43\xb1\xce\x4b\xbf\x01\x67"
6445                           "\x6e\x29\x60\xbd\x10\x14\x84\x82"
6446                           "\x83\x82\x0c\x63\x73\x92\x02\x7c"
6447                           "\x55\x37\x20\x80\x17\x51\xc8\xbc"
6448                           "\x46\x02\xcb\x38\x07\x6d\xe2\x85"
6449                           "\xaa\x29\xaf\x24\x58\x0d\xf0\x75"
6450                           "\x08\x0a\xa5\x34\x25\x16\xf3\x74"
6451                           "\xa7\x0b\x97\xbe\xc1\xa9\xdc\x29"
6452                           "\x1a\x0a\x56\xc1\x1a\x91\x97\x8c"
6453                           "\x0b\xc7\x16\xed\x5a\x22\xa6\x2e"
6454                           "\x8c\x2b\x4f\x54\x76\x47\x53\x8e"
6455                           "\xe8\x00\xec\x92\xb9\x55\xe6\xa2"
6456                           "\xf3\xe2\x4f\x6a\x66\x60\xd0\x87"
6457                           "\xe6\xd1\xcc\xe3\x6a\xc5\x2d\x21"
6458                           "\xcc\x9d\x6a\xb6\x75\xaa\xe2\x19"
6459                           "\x21\x9f\xa1\x5e\x4c\xfd\x72\xf9"
6460                           "\x94\x4e\x63\xc7\xae\xfc\xed\x47"
6461                           "\xe2\xfe\x7a\x63\x77\xfe\x97\x82"
6462                           "\xb1\x10\x6e\x36\x1d\xe1\xc4\x80"
6463                           "\xec\x69\x41\xec\xa7\x8a\xe0\x2f"
6464                           "\xe3\x49\x26\xa2\x41\xb2\x08\x0f"
6465                           "\x28\xb4\xa7\x39\xa1\x99\x2d\x1e"
6466                           "\x43\x42\x35\xd0\xcf\xec\x77\x67"
6467                           "\xb2\x3b\x9e\x1c\x35\xde\x4f\x5e"
6468                           "\x73\x3f\x5d\x6f\x07\x4b\x2e\x50"
6469                           "\xab\x6c\x6b\xff\xea\x00\x67\xaa"
6470                           "\x0e\x82\x32\xdd\x3d\xb5\xe5\x76"
6471                           "\x2b\x77\x3f\xbe\x12\x75\xfb\x92"
6472                           "\xc6\x89\x67\x4d\xca\xf7\xd4\x50"
6473                           "\xc0\x74\x47\xcc\xd9\x0a\xd4\xc6"
6474                           "\x3b\x17\x2e\xe3\x35\xbb\x53\xb5"
6475                           "\x86\xad\x51\xcc\xd5\x96\xb8\xdc"
6476                           "\x03\x57\xe6\x98\x52\x2f\x61\x62"
6477                           "\xc4\x5c\x9c\x36\x71\x07\xfb\x94"
6478                           "\xe3\x02\xc4\x2b\x08\x75\xc7\x35"
6479                           "\xfb\x2e\x88\x7b\xbb\x67\x00\xe1"
6480                           "\xc9\xdd\x99\xb2\x13\x53\x1a\x4e"
6481                           "\x76\x87\x19\x04\x1a\x2f\x38\x3e"
6482                           "\xef\x91\x64\x1d\x18\x07\x4e\x31"
6483                           "\x88\x21\x7c\xb0\xa5\x12\x4c\x3c"
6484                           "\xb0\x20\xbd\xda\xdf\xf9\x7c\xdd",
6485                 .rlen   = 512,
6486         }, {
6487                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
6488                           "\x23\x53\x60\x28\x74\x71\x35\x26"
6489                           "\x62\x49\x77\x57\x24\x70\x93\x69"
6490                           "\x99\x59\x57\x49\x66\x96\x76\x27"
6491                           "\x31\x41\x59\x26\x53\x58\x97\x93"
6492                           "\x23\x84\x62\x64\x33\x83\x27\x95"
6493                           "\x02\x88\x41\x97\x16\x93\x99\x37"
6494                           "\x51\x05\x82\x09\x74\x94\x45\x92",
6495                 .klen   = 64,
6496                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
6497                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6498                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
6499                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6500                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6501                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6502                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6503                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6504                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6505                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6506                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6507                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6508                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6509                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6510                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6511                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6512                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6513                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6514                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6515                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6516                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6517                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6518                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6519                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6520                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6521                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6522                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6523                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6524                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6525                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6526                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6527                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6528                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6529                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6530                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6531                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6532                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6533                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6534                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6535                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6536                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6537                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6538                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6539                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6540                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6541                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6542                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6543                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6544                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6545                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6546                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6547                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6548                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6549                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6550                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6551                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6552                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6553                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6554                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6555                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6556                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6557                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6558                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6559                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6560                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6561                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6562                 .ilen   = 512,
6563                 .result = "\x2b\xc9\xb4\x6b\x10\x94\xa9\x32"
6564                           "\xaa\xb0\x20\xc6\x44\x3d\x74\x1f"
6565                           "\x75\x01\xa7\xf6\xf5\xf7\x62\x1b"
6566                           "\x80\x1b\x82\xcb\x01\x59\x91\x7f"
6567                           "\x80\x3a\x98\xf0\xd2\xca\xc4\xc3"
6568                           "\x34\xfd\xe6\x11\xf9\x33\x45\x12"
6569                           "\x48\xc5\x8c\x25\xf1\xc5\xc5\x23"
6570                           "\xd3\x44\xb4\x73\xd5\x04\xc0\xb7"
6571                           "\xca\x2f\xf5\xcd\xc5\xb4\xdd\xb0"
6572                           "\xf4\x60\xe8\xfb\xc6\x9c\xc5\x78"
6573                           "\xcd\xec\x7d\xdc\x19\x9c\x72\x64"
6574                           "\x63\x0b\x38\x2e\x76\xdd\x2d\x36"
6575                           "\x49\xb0\x1d\xea\x78\x9e\x00\xca"
6576                           "\x20\xcc\x1b\x1e\x98\x74\xab\xed"
6577                           "\x79\xf7\xd0\x6c\xd8\x93\x80\x29"
6578                           "\xac\xa5\x5e\x34\xa9\xab\xa0\x55"
6579                           "\x9a\xea\xaa\x95\x4d\x7b\xfe\x46"
6580                           "\x26\x8a\xfd\x88\xa2\xa8\xa6\xae"
6581                           "\x25\x42\x17\xbf\x76\x8f\x1c\x3d"
6582                           "\xec\x9a\xda\x64\x96\xb5\x61\xff"
6583                           "\x99\xeb\x12\x96\x85\x82\x9d\xd5"
6584                           "\x81\x85\x14\xa8\x59\xac\x8c\x94"
6585                           "\xbb\x3b\x85\x2b\xdf\xb3\x0c\xba"
6586                           "\x82\xc6\x4d\xca\x86\xea\x53\x28"
6587                           "\x4c\xe0\x4e\x31\xe3\x73\x2f\x79"
6588                           "\x9d\x42\xe1\x03\xe3\x8b\xc4\xff"
6589                           "\x05\xca\x81\x7b\xda\xa2\xde\x63"
6590                           "\x3a\x10\xbe\xc2\xac\x32\xc4\x05"
6591                           "\x47\x7e\xef\x67\xe2\x5f\x5b\xae"
6592                           "\xed\xf1\x70\x34\x16\x9a\x07\x7b"
6593                           "\xf2\x25\x2b\xb0\xf8\x3c\x15\x9a"
6594                           "\xa6\x59\x55\x5f\xc1\xf4\x1e\xcd"
6595                           "\x93\x1f\x06\xba\xd4\x9a\x22\x69"
6596                           "\xfa\x8e\x95\x0d\xf3\x23\x59\x2c"
6597                           "\xfe\x00\xba\xf0\x0e\xbc\x6d\xd6"
6598                           "\x62\xf0\x7a\x0e\x83\x3e\xdb\x32"
6599                           "\xfd\x43\x7d\xda\x42\x51\x87\x43"
6600                           "\x9d\xf9\xef\xf4\x30\x97\xf8\x09"
6601                           "\x88\xfc\x3f\x93\x70\xc1\x4a\xec"
6602                           "\x27\x5f\x11\xac\x71\xc7\x48\x46"
6603                           "\x2f\xf9\xdf\x8d\x9f\xf7\x2e\x56"
6604                           "\x0d\x4e\xb0\x32\x76\xce\x86\x81"
6605                           "\xcd\xdf\xe4\x00\xbf\xfd\x5f\x24"
6606                           "\xaf\xf7\x9a\xde\xff\x18\xac\x14"
6607                           "\x90\xc5\x01\x39\x34\x0f\x24\xf3"
6608                           "\x13\x2f\x5e\x4f\x30\x9a\x36\x40"
6609                           "\xec\xea\xbc\xcd\x9e\x0e\x5b\x23"
6610                           "\x50\x88\x97\x40\x69\xb1\x37\xf5"
6611                           "\xc3\x15\xf9\x3f\xb7\x79\x64\xe8"
6612                           "\x7b\x10\x20\xb9\x2b\x46\x83\x5b"
6613                           "\xd8\x39\xfc\xe4\xfa\x88\x52\xf2"
6614                           "\x72\xb0\x97\x4e\x89\xb3\x48\x00"
6615                           "\xc1\x16\x73\x50\x77\xba\xa6\x65"
6616                           "\x20\x2d\xb0\x02\x27\x89\xda\x99"
6617                           "\x45\xfb\xe9\xd3\x1d\x39\x2f\xd6"
6618                           "\x2a\xda\x09\x12\x11\xaf\xe6\x57"
6619                           "\x01\x04\x8a\xff\x86\x8b\xac\xf8"
6620                           "\xee\xe4\x1c\x98\x5b\xcf\x6b\x76"
6621                           "\xa3\x0e\x33\x74\x40\x18\x39\x72"
6622                           "\x66\x50\x31\xfd\x70\xdf\xe8\x51"
6623                           "\x96\x21\x36\xb2\x9b\xfa\x85\xd1"
6624                           "\x30\x05\xc8\x92\x98\x80\xff\x7a"
6625                           "\xaf\x43\x0b\xc5\x20\x41\x92\x20"
6626                           "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1",
6627                 .rlen   = 512,
6628                 .also_non_np = 1,
6629                 .np     = 2,
6630                 .tap    = { 512 - 16, 16 },
6631         },
6632 };
6633
6634 static struct cipher_testvec serpent_xts_dec_tv_template[] = {
6635         /* Generated from AES-XTS test vectors */
6636         /* same as enc vectors with input and result reversed */
6637         {
6638                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
6639                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6640                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6641                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6642                 .klen   = 32,
6643                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6644                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6645                 .input  = "\xe1\x08\xb8\x1d\x2c\xf5\x33\x64"
6646                           "\xc8\x12\x04\xc7\xb3\x70\xe8\xc4"
6647                           "\x6a\x31\xc5\xf3\x00\xca\xb9\x16"
6648                           "\xde\xe2\x77\x66\xf7\xfe\x62\x08",
6649                 .ilen   = 32,
6650                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
6651                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6652                           "\x00\x00\x00\x00\x00\x00\x00\x00"
6653                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6654                 .rlen   = 32,
6655         }, {
6656                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
6657                           "\x11\x11\x11\x11\x11\x11\x11\x11"
6658                           "\x22\x22\x22\x22\x22\x22\x22\x22"
6659                           "\x22\x22\x22\x22\x22\x22\x22\x22",
6660                 .klen   = 32,
6661                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
6662                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6663                 .input  = "\x1a\x0a\x09\x5f\xcd\x07\x07\x98"
6664                           "\x41\x86\x12\xaf\xb3\xd7\x68\x13"
6665                           "\xed\x81\xcd\x06\x87\x43\x1a\xbb"
6666                           "\x13\x3d\xd6\x1e\x2b\xe1\x77\xbe",
6667                 .ilen   = 32,
6668                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
6669                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6670                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6671                           "\x44\x44\x44\x44\x44\x44\x44\x44",
6672                 .rlen   = 32,
6673         }, {
6674                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
6675                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
6676                           "\x22\x22\x22\x22\x22\x22\x22\x22"
6677                           "\x22\x22\x22\x22\x22\x22\x22\x22",
6678                 .klen   = 32,
6679                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
6680                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6681                 .input  = "\xf9\x9b\x28\xb8\x5c\xaf\x8c\x61"
6682                           "\xb6\x1c\x81\x8f\x2c\x87\x60\x89"
6683                           "\x0d\x8d\x7a\xe8\x60\x48\xcc\x86"
6684                           "\xc1\x68\x45\xaa\x00\xe9\x24\xc5",
6685                 .ilen   = 32,
6686                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
6687                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6688                           "\x44\x44\x44\x44\x44\x44\x44\x44"
6689                           "\x44\x44\x44\x44\x44\x44\x44\x44",
6690                 .rlen   = 32,
6691         }, {
6692                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
6693                           "\x23\x53\x60\x28\x74\x71\x35\x26"
6694                           "\x31\x41\x59\x26\x53\x58\x97\x93"
6695                           "\x23\x84\x62\x64\x33\x83\x27\x95",
6696                 .klen   = 32,
6697                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
6698                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6699                 .input  = "\xfe\x47\x4a\xc8\x60\x7e\xb4\x8b"
6700                           "\x0d\x10\xf4\xb0\x0d\xba\xf8\x53"
6701                           "\x65\x6e\x38\x4b\xdb\xaa\xb1\x9e"
6702                           "\x28\xca\xb0\x22\xb3\x85\x75\xf4"
6703                           "\x00\x5c\x75\x14\x06\xd6\x25\x82"
6704                           "\xe6\xcb\x08\xf7\x29\x90\x23\x8e"
6705                           "\xa4\x68\x57\xe4\xf0\xd8\x32\xf3"
6706                           "\x80\x51\x67\xb5\x0b\x85\x69\xe8"
6707                           "\x19\xfe\xc4\xc7\x3e\xea\x90\xd3"
6708                           "\x8f\xa3\xf2\x0a\xac\x17\x4b\xa0"
6709                           "\x63\x5a\x16\x0f\xf0\xce\x66\x1f"
6710                           "\x2c\x21\x07\xf1\xa4\x03\xa3\x44"
6711                           "\x41\x61\x87\x5d\x6b\xb3\xef\xd4"
6712                           "\xfc\xaa\x32\x7e\x55\x58\x04\x41"
6713                           "\xc9\x07\x33\xc6\xa2\x68\xd6\x5a"
6714                           "\x55\x79\x4b\x6f\xcf\x89\xb9\x19"
6715                           "\xe5\x54\x13\x15\xb2\x1a\xfa\x15"
6716                           "\xc2\xf0\x06\x59\xfa\xa0\x25\x05"
6717                           "\x58\xfa\x43\x91\x16\x85\x40\xbb"
6718                           "\x0d\x34\x4d\xc5\x1e\x20\xd5\x08"
6719                           "\xcd\x22\x22\x41\x11\x9f\x6c\x7c"
6720                           "\x8d\x57\xc9\xba\x57\xe8\x2c\xf7"
6721                           "\xa0\x42\xa8\xde\xfc\xa3\xca\x98"
6722                           "\x4b\x43\xb1\xce\x4b\xbf\x01\x67"
6723                           "\x6e\x29\x60\xbd\x10\x14\x84\x82"
6724                           "\x83\x82\x0c\x63\x73\x92\x02\x7c"
6725                           "\x55\x37\x20\x80\x17\x51\xc8\xbc"
6726                           "\x46\x02\xcb\x38\x07\x6d\xe2\x85"
6727                           "\xaa\x29\xaf\x24\x58\x0d\xf0\x75"
6728                           "\x08\x0a\xa5\x34\x25\x16\xf3\x74"
6729                           "\xa7\x0b\x97\xbe\xc1\xa9\xdc\x29"
6730                           "\x1a\x0a\x56\xc1\x1a\x91\x97\x8c"
6731                           "\x0b\xc7\x16\xed\x5a\x22\xa6\x2e"
6732                           "\x8c\x2b\x4f\x54\x76\x47\x53\x8e"
6733                           "\xe8\x00\xec\x92\xb9\x55\xe6\xa2"
6734                           "\xf3\xe2\x4f\x6a\x66\x60\xd0\x87"
6735                           "\xe6\xd1\xcc\xe3\x6a\xc5\x2d\x21"
6736                           "\xcc\x9d\x6a\xb6\x75\xaa\xe2\x19"
6737                           "\x21\x9f\xa1\x5e\x4c\xfd\x72\xf9"
6738                           "\x94\x4e\x63\xc7\xae\xfc\xed\x47"
6739                           "\xe2\xfe\x7a\x63\x77\xfe\x97\x82"
6740                           "\xb1\x10\x6e\x36\x1d\xe1\xc4\x80"
6741                           "\xec\x69\x41\xec\xa7\x8a\xe0\x2f"
6742                           "\xe3\x49\x26\xa2\x41\xb2\x08\x0f"
6743                           "\x28\xb4\xa7\x39\xa1\x99\x2d\x1e"
6744                           "\x43\x42\x35\xd0\xcf\xec\x77\x67"
6745                           "\xb2\x3b\x9e\x1c\x35\xde\x4f\x5e"
6746                           "\x73\x3f\x5d\x6f\x07\x4b\x2e\x50"
6747                           "\xab\x6c\x6b\xff\xea\x00\x67\xaa"
6748                           "\x0e\x82\x32\xdd\x3d\xb5\xe5\x76"
6749                           "\x2b\x77\x3f\xbe\x12\x75\xfb\x92"
6750                           "\xc6\x89\x67\x4d\xca\xf7\xd4\x50"
6751                           "\xc0\x74\x47\xcc\xd9\x0a\xd4\xc6"
6752                           "\x3b\x17\x2e\xe3\x35\xbb\x53\xb5"
6753                           "\x86\xad\x51\xcc\xd5\x96\xb8\xdc"
6754                           "\x03\x57\xe6\x98\x52\x2f\x61\x62"
6755                           "\xc4\x5c\x9c\x36\x71\x07\xfb\x94"
6756                           "\xe3\x02\xc4\x2b\x08\x75\xc7\x35"
6757                           "\xfb\x2e\x88\x7b\xbb\x67\x00\xe1"
6758                           "\xc9\xdd\x99\xb2\x13\x53\x1a\x4e"
6759                           "\x76\x87\x19\x04\x1a\x2f\x38\x3e"
6760                           "\xef\x91\x64\x1d\x18\x07\x4e\x31"
6761                           "\x88\x21\x7c\xb0\xa5\x12\x4c\x3c"
6762                           "\xb0\x20\xbd\xda\xdf\xf9\x7c\xdd",
6763                 .ilen   = 512,
6764                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
6765                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6766                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6767                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6768                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6769                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6770                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6771                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6772                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6773                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6774                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6775                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6776                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6777                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6778                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6779                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6780                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6781                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6782                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6783                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6784                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6785                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6786                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6787                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6788                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6789                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6790                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6791                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6792                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6793                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6794                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6795                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6796                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6797                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6798                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6799                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6800                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6801                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6802                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6803                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6804                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6805                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6806                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6807                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6808                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6809                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6810                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6811                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6812                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6813                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6814                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6815                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6816                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6817                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6818                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6819                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6820                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6821                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6822                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6823                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6824                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6825                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6826                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6827                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6828                 .rlen   = 512,
6829         }, {
6830                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
6831                           "\x23\x53\x60\x28\x74\x71\x35\x26"
6832                           "\x62\x49\x77\x57\x24\x70\x93\x69"
6833                           "\x99\x59\x57\x49\x66\x96\x76\x27"
6834                           "\x31\x41\x59\x26\x53\x58\x97\x93"
6835                           "\x23\x84\x62\x64\x33\x83\x27\x95"
6836                           "\x02\x88\x41\x97\x16\x93\x99\x37"
6837                           "\x51\x05\x82\x09\x74\x94\x45\x92",
6838                 .klen   = 64,
6839                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
6840                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6841                 .input  = "\x2b\xc9\xb4\x6b\x10\x94\xa9\x32"
6842                           "\xaa\xb0\x20\xc6\x44\x3d\x74\x1f"
6843                           "\x75\x01\xa7\xf6\xf5\xf7\x62\x1b"
6844                           "\x80\x1b\x82\xcb\x01\x59\x91\x7f"
6845                           "\x80\x3a\x98\xf0\xd2\xca\xc4\xc3"
6846                           "\x34\xfd\xe6\x11\xf9\x33\x45\x12"
6847                           "\x48\xc5\x8c\x25\xf1\xc5\xc5\x23"
6848                           "\xd3\x44\xb4\x73\xd5\x04\xc0\xb7"
6849                           "\xca\x2f\xf5\xcd\xc5\xb4\xdd\xb0"
6850                           "\xf4\x60\xe8\xfb\xc6\x9c\xc5\x78"
6851                           "\xcd\xec\x7d\xdc\x19\x9c\x72\x64"
6852                           "\x63\x0b\x38\x2e\x76\xdd\x2d\x36"
6853                           "\x49\xb0\x1d\xea\x78\x9e\x00\xca"
6854                           "\x20\xcc\x1b\x1e\x98\x74\xab\xed"
6855                           "\x79\xf7\xd0\x6c\xd8\x93\x80\x29"
6856                           "\xac\xa5\x5e\x34\xa9\xab\xa0\x55"
6857                           "\x9a\xea\xaa\x95\x4d\x7b\xfe\x46"
6858                           "\x26\x8a\xfd\x88\xa2\xa8\xa6\xae"
6859                           "\x25\x42\x17\xbf\x76\x8f\x1c\x3d"
6860                           "\xec\x9a\xda\x64\x96\xb5\x61\xff"
6861                           "\x99\xeb\x12\x96\x85\x82\x9d\xd5"
6862                           "\x81\x85\x14\xa8\x59\xac\x8c\x94"
6863                           "\xbb\x3b\x85\x2b\xdf\xb3\x0c\xba"
6864                           "\x82\xc6\x4d\xca\x86\xea\x53\x28"
6865                           "\x4c\xe0\x4e\x31\xe3\x73\x2f\x79"
6866                           "\x9d\x42\xe1\x03\xe3\x8b\xc4\xff"
6867                           "\x05\xca\x81\x7b\xda\xa2\xde\x63"
6868                           "\x3a\x10\xbe\xc2\xac\x32\xc4\x05"
6869                           "\x47\x7e\xef\x67\xe2\x5f\x5b\xae"
6870                           "\xed\xf1\x70\x34\x16\x9a\x07\x7b"
6871                           "\xf2\x25\x2b\xb0\xf8\x3c\x15\x9a"
6872                           "\xa6\x59\x55\x5f\xc1\xf4\x1e\xcd"
6873                           "\x93\x1f\x06\xba\xd4\x9a\x22\x69"
6874                           "\xfa\x8e\x95\x0d\xf3\x23\x59\x2c"
6875                           "\xfe\x00\xba\xf0\x0e\xbc\x6d\xd6"
6876                           "\x62\xf0\x7a\x0e\x83\x3e\xdb\x32"
6877                           "\xfd\x43\x7d\xda\x42\x51\x87\x43"
6878                           "\x9d\xf9\xef\xf4\x30\x97\xf8\x09"
6879                           "\x88\xfc\x3f\x93\x70\xc1\x4a\xec"
6880                           "\x27\x5f\x11\xac\x71\xc7\x48\x46"
6881                           "\x2f\xf9\xdf\x8d\x9f\xf7\x2e\x56"
6882                           "\x0d\x4e\xb0\x32\x76\xce\x86\x81"
6883                           "\xcd\xdf\xe4\x00\xbf\xfd\x5f\x24"
6884                           "\xaf\xf7\x9a\xde\xff\x18\xac\x14"
6885                           "\x90\xc5\x01\x39\x34\x0f\x24\xf3"
6886                           "\x13\x2f\x5e\x4f\x30\x9a\x36\x40"
6887                           "\xec\xea\xbc\xcd\x9e\x0e\x5b\x23"
6888                           "\x50\x88\x97\x40\x69\xb1\x37\xf5"
6889                           "\xc3\x15\xf9\x3f\xb7\x79\x64\xe8"
6890                           "\x7b\x10\x20\xb9\x2b\x46\x83\x5b"
6891                           "\xd8\x39\xfc\xe4\xfa\x88\x52\xf2"
6892                           "\x72\xb0\x97\x4e\x89\xb3\x48\x00"
6893                           "\xc1\x16\x73\x50\x77\xba\xa6\x65"
6894                           "\x20\x2d\xb0\x02\x27\x89\xda\x99"
6895                           "\x45\xfb\xe9\xd3\x1d\x39\x2f\xd6"
6896                           "\x2a\xda\x09\x12\x11\xaf\xe6\x57"
6897                           "\x01\x04\x8a\xff\x86\x8b\xac\xf8"
6898                           "\xee\xe4\x1c\x98\x5b\xcf\x6b\x76"
6899                           "\xa3\x0e\x33\x74\x40\x18\x39\x72"
6900                           "\x66\x50\x31\xfd\x70\xdf\xe8\x51"
6901                           "\x96\x21\x36\xb2\x9b\xfa\x85\xd1"
6902                           "\x30\x05\xc8\x92\x98\x80\xff\x7a"
6903                           "\xaf\x43\x0b\xc5\x20\x41\x92\x20"
6904                           "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1",
6905                 .ilen   = 512,
6906                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
6907                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6908                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6909                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6910                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6911                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6912                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6913                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6914                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6915                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6916                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6917                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6918                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6919                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6920                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6921                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6922                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6923                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6924                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6925                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6926                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6927                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6928                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6929                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6930                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6931                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6932                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6933                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6934                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6935                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6936                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6937                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6938                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6939                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6940                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6941                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6942                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6943                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6944                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6945                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6946                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6947                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6948                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6949                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6950                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6951                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6952                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6953                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6954                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6955                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6956                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6957                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6958                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6959                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6960                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6961                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6962                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6963                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6964                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6965                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6966                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6967                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6968                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6969                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6970                 .rlen   = 512,
6971                 .also_non_np = 1,
6972                 .np     = 2,
6973                 .tap    = { 512 - 16, 16 },
6974         },
6975 };
6976
6977 /* Cast6 test vectors from RFC 2612 */
6978 #define CAST6_ENC_TEST_VECTORS          4
6979 #define CAST6_DEC_TEST_VECTORS          4
6980 #define CAST6_CBC_ENC_TEST_VECTORS      1
6981 #define CAST6_CBC_DEC_TEST_VECTORS      1
6982 #define CAST6_CTR_ENC_TEST_VECTORS      1
6983 #define CAST6_CTR_DEC_TEST_VECTORS      1
6984 #define CAST6_LRW_ENC_TEST_VECTORS      1
6985 #define CAST6_LRW_DEC_TEST_VECTORS      1
6986 #define CAST6_XTS_ENC_TEST_VECTORS      1
6987 #define CAST6_XTS_DEC_TEST_VECTORS      1
6988
6989 static struct cipher_testvec cast6_enc_tv_template[] = {
6990         {
6991                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
6992                           "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
6993                 .klen   = 16,
6994                 .input  = zeroed_string,
6995                 .ilen   = 16,
6996                 .result = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
6997                           "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
6998                 .rlen   = 16,
6999         }, {
7000                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
7001                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
7002                           "\xba\xc7\x7a\x77\x17\x94\x28\x63",
7003                 .klen   = 24,
7004                 .input  = zeroed_string,
7005                 .ilen   = 16,
7006                 .result = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
7007                           "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
7008                 .rlen   = 16,
7009         }, {
7010                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
7011                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
7012                           "\x8d\x7c\x47\xce\x26\x49\x08\x46"
7013                           "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
7014                 .klen   = 32,
7015                 .input  = zeroed_string,
7016                 .ilen   = 16,
7017                 .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
7018                           "\xc9\x87\x01\x36\x55\x33\x17\xfa",
7019                 .rlen   = 16,
7020         }, { /* Generated from TF test vectors */
7021                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7022                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7023                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7024                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7025                 .klen   = 32,
7026                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7027                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7028                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7029                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7030                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7031                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7032                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7033                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7034                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7035                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7036                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7037                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7038                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7039                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7040                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7041                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7042                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7043                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7044                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7045                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7046                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7047                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7048                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7049                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7050                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7051                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7052                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7053                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7054                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7055                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7056                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7057                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7058                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7059                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7060                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7061                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7062                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7063                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7064                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7065                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7066                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7067                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7068                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7069                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7070                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7071                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7072                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7073                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7074                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7075                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7076                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7077                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7078                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7079                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7080                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7081                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7082                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7083                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7084                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7085                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7086                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7087                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7088                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7089                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7090                 .ilen   = 496,
7091                 .result = "\xC3\x70\x22\x32\xF5\x80\xCB\x54"
7092                           "\xFC\x30\xE0\xF6\xEB\x39\x57\xA6"
7093                           "\xB6\xB9\xC5\xA4\x91\x55\x14\x97"
7094                           "\xC1\x20\xFF\x6C\x5C\xF0\x67\xEA"
7095                           "\x2F\xED\xD8\xC9\xFB\x38\x3F\xFE"
7096                           "\x93\xBE\xDC\x00\xD3\x7F\xAD\x4C"
7097                           "\x5A\x08\x92\xD1\x47\x0C\xFA\x6C"
7098                           "\xD0\x6A\x99\x10\x72\xF8\x47\x62"
7099                           "\x81\x42\xF8\xD8\xF5\xBB\x94\x08"
7100                           "\xAA\x97\xA2\x8B\x69\xB3\xD2\x7E"
7101                           "\xBC\xB5\x00\x0C\xE5\x44\x4B\x58"
7102                           "\xE8\x63\xDC\xB3\xC4\xE5\x23\x12"
7103                           "\x5A\x72\x85\x47\x8B\xEC\x9F\x26"
7104                           "\x84\xB6\xED\x10\x33\x63\x9B\x5F"
7105                           "\x4D\x53\xEE\x94\x45\x8B\x60\x58"
7106                           "\x86\x20\xF9\x1E\x82\x08\x3E\x58"
7107                           "\x60\x1B\x34\x19\x02\xBE\x4E\x09"
7108                           "\xBB\x7C\x15\xCC\x60\x27\x55\x7A"
7109                           "\x12\xB8\xD8\x08\x89\x3C\xA6\xF3"
7110                           "\xF1\xDD\xA7\x07\xA3\x12\x85\x28"
7111                           "\xE9\x57\xAC\x80\x0C\x5C\x0F\x3A"
7112                           "\x5D\xC2\x91\xC7\x90\xE4\x8C\x43"
7113                           "\x92\xE4\x7C\x26\x69\x4D\x83\x68"
7114                           "\x14\x96\x42\x47\xBD\xA9\xE4\x8A"
7115                           "\x33\x19\xEB\x54\x8E\x0D\x4B\x6E"
7116                           "\x91\x51\xB5\x36\x08\xDE\x1C\x06"
7117                           "\x03\xBD\xDE\x81\x26\xF7\x99\xC2"
7118                           "\xBA\xF7\x6D\x87\x0D\xE4\xA6\xCF"
7119                           "\xC1\xF5\x27\x05\xB8\x02\x57\x72"
7120                           "\xE6\x42\x13\x0B\xC6\x47\x05\x74"
7121                           "\x24\x15\xF7\x0D\xC2\x23\x9D\xB9"
7122                           "\x3C\x77\x18\x93\xBA\xB4\xFC\x8C"
7123                           "\x98\x82\x67\x67\xB4\xD7\xD3\x43"
7124                           "\x23\x08\x02\xB7\x9B\x99\x05\xFB"
7125                           "\xD3\xB5\x00\x0A\xA9\x9D\x66\xD6"
7126                           "\x2E\x49\x58\xD0\xA8\x57\x29\x7F"
7127                           "\x0A\x0E\x7D\xFC\x92\x83\xCC\x67"
7128                           "\xA2\xB1\x70\x3A\x8F\x87\x4A\x8D"
7129                           "\x17\xE2\x58\x2B\x88\x0D\x68\x62"
7130                           "\xBF\x35\xD1\x6F\xC0\xF0\x18\x62"
7131                           "\xB2\xC7\x2D\x58\xC7\x16\xDE\x08"
7132                           "\xEB\x84\x1D\x25\xA7\x38\x94\x06"
7133                           "\x93\x9D\xF8\xFE\x88\x71\xE7\x84"
7134                           "\x2C\xA0\x38\xA3\x1D\x48\xCF\x29"
7135                           "\x0B\xBC\xD8\x50\x99\x1A\x26\xFB"
7136                           "\x8E\x75\x3D\x73\xEB\x6A\xED\x29"
7137                           "\xE0\x8E\xED\xFC\xFE\x6F\xF6\xBA"
7138                           "\x41\xE2\x10\x4C\x01\x8B\x69\x2B"
7139                           "\x25\x3F\x4D\x70\x7B\x92\xD6\x3B"
7140                           "\xAC\xF9\x77\x18\xD9\x6A\x30\xA6"
7141                           "\x2E\xFA\x30\xFF\xC8\xD5\x1D\x06"
7142                           "\x59\x28\x1D\x86\x43\x04\x5D\x3B"
7143                           "\x99\x4C\x04\x5A\x21\x17\x8B\x76"
7144                           "\x8F\x72\xCB\xA1\x9C\x29\x4C\xC3"
7145                           "\x65\xA2\x58\x2A\xC5\x66\x24\xBF"
7146                           "\xBA\xE6\x0C\xDD\x34\x24\x74\xC8"
7147                           "\x84\x0A\x66\x2C\xBE\x8F\x32\xA9"
7148                           "\xE7\xE4\xA1\xD7\xDA\xAB\x23\x1E"
7149                           "\xEB\xEE\x6C\x94\x6F\x9C\x2E\xD1"
7150                           "\x49\x2C\xF3\xD4\x90\xCC\x93\x4C"
7151                           "\x84\x52\x6D\x68\xDE\xC6\x64\xB2"
7152                           "\x11\x74\x93\x57\xB4\x7E\xC6\x00",
7153                 .rlen   = 496,
7154                 .also_non_np = 1,
7155                 .np     = 2,
7156                 .tap    = { 496 - 16, 16 },
7157         },
7158 };
7159
7160 static struct cipher_testvec cast6_dec_tv_template[] = {
7161         {
7162                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
7163                           "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
7164                 .klen   = 16,
7165                 .input  = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
7166                           "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
7167                 .ilen   = 16,
7168                 .result = zeroed_string,
7169                 .rlen   = 16,
7170         }, {
7171                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
7172                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
7173                           "\xba\xc7\x7a\x77\x17\x94\x28\x63",
7174                 .klen   = 24,
7175                 .input  = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
7176                           "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
7177                 .ilen   = 16,
7178                 .result = zeroed_string,
7179                 .rlen   = 16,
7180         }, {
7181                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
7182                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
7183                           "\x8d\x7c\x47\xce\x26\x49\x08\x46"
7184                           "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
7185                 .klen   = 32,
7186                 .input  = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
7187                           "\xc9\x87\x01\x36\x55\x33\x17\xfa",
7188                 .ilen   = 16,
7189                 .result = zeroed_string,
7190                 .rlen   = 16,
7191         }, { /* Generated from TF test vectors */
7192                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7193                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7194                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7195                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7196                 .klen   = 32,
7197                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7198                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7199                 .input  = "\xC3\x70\x22\x32\xF5\x80\xCB\x54"
7200                           "\xFC\x30\xE0\xF6\xEB\x39\x57\xA6"
7201                           "\xB6\xB9\xC5\xA4\x91\x55\x14\x97"
7202                           "\xC1\x20\xFF\x6C\x5C\xF0\x67\xEA"
7203                           "\x2F\xED\xD8\xC9\xFB\x38\x3F\xFE"
7204                           "\x93\xBE\xDC\x00\xD3\x7F\xAD\x4C"
7205                           "\x5A\x08\x92\xD1\x47\x0C\xFA\x6C"
7206                           "\xD0\x6A\x99\x10\x72\xF8\x47\x62"
7207                           "\x81\x42\xF8\xD8\xF5\xBB\x94\x08"
7208                           "\xAA\x97\xA2\x8B\x69\xB3\xD2\x7E"
7209                           "\xBC\xB5\x00\x0C\xE5\x44\x4B\x58"
7210                           "\xE8\x63\xDC\xB3\xC4\xE5\x23\x12"
7211                           "\x5A\x72\x85\x47\x8B\xEC\x9F\x26"
7212                           "\x84\xB6\xED\x10\x33\x63\x9B\x5F"
7213                           "\x4D\x53\xEE\x94\x45\x8B\x60\x58"
7214                           "\x86\x20\xF9\x1E\x82\x08\x3E\x58"
7215                           "\x60\x1B\x34\x19\x02\xBE\x4E\x09"
7216                           "\xBB\x7C\x15\xCC\x60\x27\x55\x7A"
7217                           "\x12\xB8\xD8\x08\x89\x3C\xA6\xF3"
7218                           "\xF1\xDD\xA7\x07\xA3\x12\x85\x28"
7219                           "\xE9\x57\xAC\x80\x0C\x5C\x0F\x3A"
7220                           "\x5D\xC2\x91\xC7\x90\xE4\x8C\x43"
7221                           "\x92\xE4\x7C\x26\x69\x4D\x83\x68"
7222                           "\x14\x96\x42\x47\xBD\xA9\xE4\x8A"
7223                           "\x33\x19\xEB\x54\x8E\x0D\x4B\x6E"
7224                           "\x91\x51\xB5\x36\x08\xDE\x1C\x06"
7225                           "\x03\xBD\xDE\x81\x26\xF7\x99\xC2"
7226                           "\xBA\xF7\x6D\x87\x0D\xE4\xA6\xCF"
7227                           "\xC1\xF5\x27\x05\xB8\x02\x57\x72"
7228                           "\xE6\x42\x13\x0B\xC6\x47\x05\x74"
7229                           "\x24\x15\xF7\x0D\xC2\x23\x9D\xB9"
7230                           "\x3C\x77\x18\x93\xBA\xB4\xFC\x8C"
7231                           "\x98\x82\x67\x67\xB4\xD7\xD3\x43"
7232                           "\x23\x08\x02\xB7\x9B\x99\x05\xFB"
7233                           "\xD3\xB5\x00\x0A\xA9\x9D\x66\xD6"
7234                           "\x2E\x49\x58\xD0\xA8\x57\x29\x7F"
7235                           "\x0A\x0E\x7D\xFC\x92\x83\xCC\x67"
7236                           "\xA2\xB1\x70\x3A\x8F\x87\x4A\x8D"
7237                           "\x17\xE2\x58\x2B\x88\x0D\x68\x62"
7238                           "\xBF\x35\xD1\x6F\xC0\xF0\x18\x62"
7239                           "\xB2\xC7\x2D\x58\xC7\x16\xDE\x08"
7240                           "\xEB\x84\x1D\x25\xA7\x38\x94\x06"
7241                           "\x93\x9D\xF8\xFE\x88\x71\xE7\x84"
7242                           "\x2C\xA0\x38\xA3\x1D\x48\xCF\x29"
7243                           "\x0B\xBC\xD8\x50\x99\x1A\x26\xFB"
7244                           "\x8E\x75\x3D\x73\xEB\x6A\xED\x29"
7245                           "\xE0\x8E\xED\xFC\xFE\x6F\xF6\xBA"
7246                           "\x41\xE2\x10\x4C\x01\x8B\x69\x2B"
7247                           "\x25\x3F\x4D\x70\x7B\x92\xD6\x3B"
7248                           "\xAC\xF9\x77\x18\xD9\x6A\x30\xA6"
7249                           "\x2E\xFA\x30\xFF\xC8\xD5\x1D\x06"
7250                           "\x59\x28\x1D\x86\x43\x04\x5D\x3B"
7251                           "\x99\x4C\x04\x5A\x21\x17\x8B\x76"
7252                           "\x8F\x72\xCB\xA1\x9C\x29\x4C\xC3"
7253                           "\x65\xA2\x58\x2A\xC5\x66\x24\xBF"
7254                           "\xBA\xE6\x0C\xDD\x34\x24\x74\xC8"
7255                           "\x84\x0A\x66\x2C\xBE\x8F\x32\xA9"
7256                           "\xE7\xE4\xA1\xD7\xDA\xAB\x23\x1E"
7257                           "\xEB\xEE\x6C\x94\x6F\x9C\x2E\xD1"
7258                           "\x49\x2C\xF3\xD4\x90\xCC\x93\x4C"
7259                           "\x84\x52\x6D\x68\xDE\xC6\x64\xB2"
7260                           "\x11\x74\x93\x57\xB4\x7E\xC6\x00",
7261                 .ilen   = 496,
7262                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7263                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7264                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7265                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7266                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7267                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7268                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7269                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7270                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7271                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7272                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7273                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7274                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7275                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7276                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7277                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7278                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7279                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7280                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7281                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7282                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7283                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7284                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7285                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7286                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7287                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7288                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7289                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7290                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7291                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7292                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7293                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7294                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7295                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7296                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7297                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7298                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7299                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7300                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7301                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7302                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7303                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7304                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7305                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7306                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7307                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7308                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7309                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7310                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7311                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7312                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7313                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7314                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7315                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7316                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7317                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7318                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7319                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7320                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7321                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7322                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7323                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7324                 .rlen   = 496,
7325                 .also_non_np = 1,
7326                 .np     = 2,
7327                 .tap    = { 496 - 16, 16 },
7328         },
7329 };
7330
7331 static struct cipher_testvec cast6_cbc_enc_tv_template[] = {
7332         { /* Generated from TF test vectors */
7333                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7334                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7335                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7336                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7337                 .klen   = 32,
7338                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7339                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7340                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7341                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7342                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7343                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7344                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7345                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7346                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7347                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7348                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7349                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7350                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7351                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7352                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7353                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7354                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7355                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7356                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7357                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7358                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7359                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7360                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7361                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7362                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7363                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7364                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7365                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7366                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7367                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7368                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7369                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7370                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7371                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7372                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7373                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7374                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7375                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7376                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7377                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7378                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7379                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7380                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7381                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7382                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7383                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7384                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7385                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7386                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7387                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7388                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7389                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7390                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7391                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7392                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7393                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7394                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7395                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7396                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7397                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7398                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7399                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7400                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7401                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7402                 .ilen   = 496,
7403                 .result = "\xDF\x77\x68\x96\xC7\xBA\xF8\xE2"
7404                           "\x0E\x24\x99\x1A\xAA\xF3\xC6\x9F"
7405                           "\xA0\x73\xB3\x70\xC3\x68\x64\x70"
7406                           "\xAD\x33\x02\xFB\x88\x74\xAA\x78"
7407                           "\xC7\x47\x1A\x18\x61\x2D\xAC\x9F"
7408                           "\x7E\x6F\xDF\x05\x13\x76\xA6\x72"
7409                           "\xB7\x13\x09\x0F\x7D\x38\xDF\x25"
7410                           "\x4E\xFD\x50\x45\xFA\x35\x6A\xC0"
7411                           "\x57\x95\xE1\x21\x26\x10\x9A\x21"
7412                           "\xA1\x8A\x51\x05\xD1\xB1\x78\x35"
7413                           "\x98\xF5\xAE\xC0\xC1\x8B\x94\xFF"
7414                           "\xD0\x69\x3F\x42\xC2\x01\xA7\x9B"
7415                           "\x23\x16\x47\x72\x81\x13\x3A\x72"
7416                           "\xEC\xD9\x40\x88\x00\x9C\xB0\xA8"
7417                           "\x9C\xAC\xCE\x11\x73\x7B\x63\x3E"
7418                           "\xA3\x63\x98\x7D\x35\xE4\xD9\x83"
7419                           "\xE2\xD0\x52\x87\x0C\x1F\xB0\xB3"
7420                           "\x41\x1A\x93\x8D\x76\x31\x9F\xF2"
7421                           "\xFE\x09\xA3\x8F\x22\x6A\x3B\xB9"
7422                           "\x6C\x9E\xE4\xA1\xA0\xC4\xE7\xA1"
7423                           "\x21\x9C\x1A\xCA\x65\xDE\x44\x03"
7424                           "\x99\xF2\xD2\x39\xE3\x3F\x0F\x37"
7425                           "\x53\x50\x23\xA4\x81\x6E\xDA\xFB"
7426                           "\xF8\x7B\x01\xD7\xB2\x32\x9C\xB8"
7427                           "\xB1\x0E\x99\x17\xB5\x38\xF9\xD7"
7428                           "\x86\x2D\x6E\x94\x5C\x99\x9D\xB3"
7429                           "\xD3\x63\x4B\x2A\x7D\x44\x6A\xB2"
7430                           "\xC1\x03\xE6\x5A\x37\xD8\x64\x18"
7431                           "\xAA\x32\xCE\x29\xED\xC0\xA2\xCB"
7432                           "\x8D\xAF\xCD\xBE\x8F\xB6\xEC\xB4"
7433                           "\x89\x05\x81\x6E\x71\x4F\xC3\x28"
7434                           "\x10\xC1\x62\xC4\x41\xE9\xD2\x39"
7435                           "\xF3\x22\x39\x12\x2C\xC2\x95\x2D"
7436                           "\xBF\x93\x58\x4B\x04\xD1\x8D\x57"
7437                           "\xAE\xEB\x60\x03\x56\x35\xAD\x5A"
7438                           "\xE9\xC3\xFF\x4E\x31\xE1\x37\xF8"
7439                           "\x7D\xEE\x65\x8A\xB6\x88\x1A\x3E"
7440                           "\x07\x09\x82\xBA\xF0\x80\x8A\xD0"
7441                           "\xA0\x3F\x6A\xE9\x24\x87\x19\x65"
7442                           "\x73\x3F\x12\x91\x47\x54\xBA\x39"
7443                           "\x30\x5B\x1E\xE5\xC2\xF9\x3F\xEF"
7444                           "\xD6\x75\xF9\xB8\x7C\x8B\x05\x76"
7445                           "\xEE\xB7\x08\x25\x4B\xB6\x7B\x47"
7446                           "\x72\xC0\x4C\xD4\xDA\xE0\x75\xF1"
7447                           "\x7C\xE8\x94\x9E\x16\x6E\xB8\x12"
7448                           "\xA1\xC1\x6E\x3B\x1C\x59\x41\x2D"
7449                           "\x23\xFA\x7D\x77\xB8\x46\x75\xFE"
7450                           "\x4F\x10\xD3\x09\x60\xA1\x36\x96"
7451                           "\x5B\xC2\xDC\x6E\x84\x7D\x9B\x14"
7452                           "\x80\x21\x83\x58\x3C\x76\xFD\x28"
7453                           "\x1D\xF9\x93\x13\xD7\x0E\x62\x14"
7454                           "\x5A\xC5\x4E\x08\xA5\x56\xA4\x3C"
7455                           "\x68\x93\x44\x70\xDF\xCF\x4A\x51"
7456                           "\x0B\x81\x29\x41\xE5\x62\x4D\x36"
7457                           "\xB3\xEA\x94\xA6\xB9\xDD\x3F\x09"
7458                           "\x62\x34\xA0\x6A\x7E\x7D\xF5\xF6"
7459                           "\x01\x91\xB4\x27\xDA\x59\xD6\x17"
7460                           "\x56\x4D\x82\x62\x37\xA3\x48\x01"
7461                           "\x99\x91\x77\xB2\x08\x6B\x2C\x37"
7462                           "\xC5\x5C\xAD\xB6\x07\xB6\x84\xF3"
7463                           "\x4D\x59\x7D\xC5\x28\x69\xFA\x92"
7464                           "\x22\x46\x89\x2D\x0F\x2B\x08\x24",
7465                 .rlen   = 496,
7466                 .also_non_np = 1,
7467                 .np     = 2,
7468                 .tap    = { 496 - 16, 16 },
7469         },
7470 };
7471
7472 static struct cipher_testvec cast6_cbc_dec_tv_template[] = {
7473         { /* Generated from TF test vectors */
7474                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7475                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7476                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7477                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7478                 .klen   = 32,
7479                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7480                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7481                 .input  = "\xDF\x77\x68\x96\xC7\xBA\xF8\xE2"
7482                           "\x0E\x24\x99\x1A\xAA\xF3\xC6\x9F"
7483                           "\xA0\x73\xB3\x70\xC3\x68\x64\x70"
7484                           "\xAD\x33\x02\xFB\x88\x74\xAA\x78"
7485                           "\xC7\x47\x1A\x18\x61\x2D\xAC\x9F"
7486                           "\x7E\x6F\xDF\x05\x13\x76\xA6\x72"
7487                           "\xB7\x13\x09\x0F\x7D\x38\xDF\x25"
7488                           "\x4E\xFD\x50\x45\xFA\x35\x6A\xC0"
7489                           "\x57\x95\xE1\x21\x26\x10\x9A\x21"
7490                           "\xA1\x8A\x51\x05\xD1\xB1\x78\x35"
7491                           "\x98\xF5\xAE\xC0\xC1\x8B\x94\xFF"
7492                           "\xD0\x69\x3F\x42\xC2\x01\xA7\x9B"
7493                           "\x23\x16\x47\x72\x81\x13\x3A\x72"
7494                           "\xEC\xD9\x40\x88\x00\x9C\xB0\xA8"
7495                           "\x9C\xAC\xCE\x11\x73\x7B\x63\x3E"
7496                           "\xA3\x63\x98\x7D\x35\xE4\xD9\x83"
7497                           "\xE2\xD0\x52\x87\x0C\x1F\xB0\xB3"
7498                           "\x41\x1A\x93\x8D\x76\x31\x9F\xF2"
7499                           "\xFE\x09\xA3\x8F\x22\x6A\x3B\xB9"
7500                           "\x6C\x9E\xE4\xA1\xA0\xC4\xE7\xA1"
7501                           "\x21\x9C\x1A\xCA\x65\xDE\x44\x03"
7502                           "\x99\xF2\xD2\x39\xE3\x3F\x0F\x37"
7503                           "\x53\x50\x23\xA4\x81\x6E\xDA\xFB"
7504                           "\xF8\x7B\x01\xD7\xB2\x32\x9C\xB8"
7505                           "\xB1\x0E\x99\x17\xB5\x38\xF9\xD7"
7506                           "\x86\x2D\x6E\x94\x5C\x99\x9D\xB3"
7507                           "\xD3\x63\x4B\x2A\x7D\x44\x6A\xB2"
7508                           "\xC1\x03\xE6\x5A\x37\xD8\x64\x18"
7509                           "\xAA\x32\xCE\x29\xED\xC0\xA2\xCB"
7510                           "\x8D\xAF\xCD\xBE\x8F\xB6\xEC\xB4"
7511                           "\x89\x05\x81\x6E\x71\x4F\xC3\x28"
7512                           "\x10\xC1\x62\xC4\x41\xE9\xD2\x39"
7513                           "\xF3\x22\x39\x12\x2C\xC2\x95\x2D"
7514                           "\xBF\x93\x58\x4B\x04\xD1\x8D\x57"
7515                           "\xAE\xEB\x60\x03\x56\x35\xAD\x5A"
7516                           "\xE9\xC3\xFF\x4E\x31\xE1\x37\xF8"
7517                           "\x7D\xEE\x65\x8A\xB6\x88\x1A\x3E"
7518                           "\x07\x09\x82\xBA\xF0\x80\x8A\xD0"
7519                           "\xA0\x3F\x6A\xE9\x24\x87\x19\x65"
7520                           "\x73\x3F\x12\x91\x47\x54\xBA\x39"
7521                           "\x30\x5B\x1E\xE5\xC2\xF9\x3F\xEF"
7522                           "\xD6\x75\xF9\xB8\x7C\x8B\x05\x76"
7523                           "\xEE\xB7\x08\x25\x4B\xB6\x7B\x47"
7524                           "\x72\xC0\x4C\xD4\xDA\xE0\x75\xF1"
7525                           "\x7C\xE8\x94\x9E\x16\x6E\xB8\x12"
7526                           "\xA1\xC1\x6E\x3B\x1C\x59\x41\x2D"
7527                           "\x23\xFA\x7D\x77\xB8\x46\x75\xFE"
7528                           "\x4F\x10\xD3\x09\x60\xA1\x36\x96"
7529                           "\x5B\xC2\xDC\x6E\x84\x7D\x9B\x14"
7530                           "\x80\x21\x83\x58\x3C\x76\xFD\x28"
7531                           "\x1D\xF9\x93\x13\xD7\x0E\x62\x14"
7532                           "\x5A\xC5\x4E\x08\xA5\x56\xA4\x3C"
7533                           "\x68\x93\x44\x70\xDF\xCF\x4A\x51"
7534                           "\x0B\x81\x29\x41\xE5\x62\x4D\x36"
7535                           "\xB3\xEA\x94\xA6\xB9\xDD\x3F\x09"
7536                           "\x62\x34\xA0\x6A\x7E\x7D\xF5\xF6"
7537                           "\x01\x91\xB4\x27\xDA\x59\xD6\x17"
7538                           "\x56\x4D\x82\x62\x37\xA3\x48\x01"
7539                           "\x99\x91\x77\xB2\x08\x6B\x2C\x37"
7540                           "\xC5\x5C\xAD\xB6\x07\xB6\x84\xF3"
7541                           "\x4D\x59\x7D\xC5\x28\x69\xFA\x92"
7542                           "\x22\x46\x89\x2D\x0F\x2B\x08\x24",
7543                 .ilen   = 496,
7544                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7545                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7546                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7547                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7548                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7549                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7550                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7551                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7552                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7553                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7554                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7555                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7556                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7557                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7558                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7559                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7560                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7561                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7562                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7563                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7564                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7565                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7566                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7567                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7568                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7569                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7570                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7571                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7572                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7573                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7574                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7575                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7576                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7577                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7578                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7579                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7580                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7581                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7582                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7583                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7584                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7585                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7586                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7587                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7588                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7589                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7590                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7591                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7592                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7593                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7594                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7595                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7596                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7597                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7598                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7599                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7600                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7601                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7602                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7603                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7604                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7605                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7606                 .rlen   = 496,
7607                 .also_non_np = 1,
7608                 .np     = 2,
7609                 .tap    = { 496 - 16, 16 },
7610         },
7611 };
7612
7613 static struct cipher_testvec cast6_ctr_enc_tv_template[] = {
7614         { /* Generated from TF test vectors */
7615                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7616                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7617                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7618                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7619                 .klen   = 32,
7620                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7621                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7622                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7623                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7624                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7625                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7626                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7627                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7628                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7629                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7630                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7631                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7632                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7633                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7634                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7635                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7636                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7637                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7638                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7639                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7640                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7641                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7642                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7643                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7644                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7645                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7646                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7647                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7648                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7649                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7650                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7651                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7652                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7653                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7654                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7655                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7656                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7657                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7658                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7659                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7660                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7661                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7662                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7663                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7664                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7665                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7666                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7667                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7668                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7669                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7670                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7671                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7672                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7673                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7674                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7675                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7676                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7677                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7678                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7679                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7680                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7681                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7682                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7683                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7684                 .ilen   = 496,
7685                 .result = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
7686                           "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
7687                           "\x57\xA3\xEF\x47\x2A\xE8\x88\xA7"
7688                           "\x3C\xD0\xEC\xB9\x94\x50\x7D\x56"
7689                           "\xBC\xE1\xC1\xF5\xE1\xEE\x12\xF8"
7690                           "\x4F\x03\x82\x3A\x93\x6B\x4C\xD3"
7691                           "\xE3\xF3\xFA\xC2\x23\x55\x98\x20"
7692                           "\x49\x76\x9B\x6B\xC1\x23\xBF\xE5"
7693                           "\xD4\xC4\x2F\x61\xE1\x67\x2A\x30"
7694                           "\x6F\x29\xCA\x54\xF8\x1B\xA6\x7D"
7695                           "\x66\x45\xEE\xC8\x19\xBE\x50\xF0"
7696                           "\x5F\x65\xF8\x1E\x4D\x07\x87\xD9"
7697                           "\xD3\xD9\x1B\x09\x89\xFD\x42\xC5"
7698                           "\xDB\xEB\x86\xF1\x67\x04\x0F\x5C"
7699                           "\x81\xDF\x82\x12\xC7\x4C\x1B\x07"
7700                           "\xDE\xE6\xFA\x29\x86\xD1\xB0\xBA"
7701                           "\x3D\x6A\x69\x76\xEC\x0F\xB4\xE6"
7702                           "\xCD\xA7\xF8\xA8\xB8\xE0\x33\xF5"
7703                           "\x49\x61\x22\x52\x64\x8C\x46\x41"
7704                           "\x1F\x48\x5F\x4F\xA2\x89\x36\x17"
7705                           "\x20\xF8\x2F\x8F\x4B\xFA\xF2\xC0"
7706                           "\x1E\x18\xA2\xF8\xB7\x6D\x98\xE3"
7707                           "\x00\x14\x15\x59\xC1\x30\x64\xAF"
7708                           "\xA8\x01\x38\xAB\xD4\x8B\xEC\x7C"
7709                           "\x44\x9A\xC6\x2C\x2E\x2B\x2B\xF4"
7710                           "\x02\x37\xC4\x69\xEF\x36\xC1\xF3"
7711                           "\xA0\xFB\xFE\x29\xAD\x39\xCF\xD0"
7712                           "\x51\x73\xA3\x22\x42\x41\xAB\xD2"
7713                           "\x0F\x50\x14\xB9\x54\xD3\xD4\xFA"
7714                           "\xBF\xC9\xBB\xCE\xC4\x1D\x2D\xAF"
7715                           "\xC9\x3F\x07\x87\x42\x4B\x3A\x54"
7716                           "\x34\x8E\x37\xA3\x03\x6F\x65\x66"
7717                           "\xDB\x44\xC3\xE8\xD7\xDD\x7D\xDD"
7718                           "\x61\xB4\x2B\x80\xA3\x98\x13\xF5"
7719                           "\x5A\xD3\x34\x58\xC3\x6E\xF6\xB8"
7720                           "\x0A\xC6\x50\x01\x8E\xD5\x6C\x7D"
7721                           "\xFE\x16\xB6\xCF\xFC\x51\x40\xAE"
7722                           "\xB3\x15\xAC\x90\x6F\x0B\x28\x3A"
7723                           "\x60\x40\x38\x90\x20\x46\xC7\xB3"
7724                           "\x0B\x12\x6D\x3B\x15\x14\xF9\xF4"
7725                           "\x11\x41\x76\x6B\xB3\x60\x82\x3C"
7726                           "\x84\xFB\x08\x2E\x92\x25\xCB\x79"
7727                           "\x6F\x58\xC5\x94\x00\x00\x47\xB6"
7728                           "\x9E\xDC\x0F\x29\x70\x46\x20\x76"
7729                           "\x65\x75\x66\x5C\x00\x96\xB3\xE1"
7730                           "\x0B\xA7\x11\x8B\x2E\x61\x4E\x45"
7731                           "\x73\xFC\x91\xAB\x79\x41\x23\x14"
7732                           "\x13\xB6\x72\x6C\x46\xB3\x03\x11"
7733                           "\xE4\xF1\xEE\xC9\x7A\xCF\x96\x32"
7734                           "\xB6\xF0\x8B\x97\xB4\xCF\x82\xB7"
7735                           "\x15\x48\x44\x99\x09\xF6\xE0\xD7"
7736                           "\xBC\xF1\x5B\x91\x4F\x30\x22\xA2"
7737                           "\x45\xC4\x68\x55\xC2\xBE\xA7\xD2"
7738                           "\x12\x53\x35\x9C\xF9\xE7\x35\x5D"
7739                           "\x81\xE4\x86\x42\xC3\x58\xFB\xF0"
7740                           "\x38\x9B\x8E\x5A\xEF\x83\x33\x0F"
7741                           "\x00\x4E\x3F\x9F\xF5\x84\x62\xC4"
7742                           "\x19\x35\x88\x22\x45\x59\x0E\x8F"
7743                           "\xEC\x27\xDD\x4A\xA4\x1F\xBC\x41"
7744                           "\x9B\x66\x8D\x32\xBA\x81\x34\x87"
7745                           "\x0E\x74\x33\x30\x62\xB9\x89\xDF"
7746                           "\xF9\xC5\xDD\x27\xB3\x39\xCB\xCB",
7747                 .rlen   = 496,
7748                 .also_non_np = 1,
7749                 .np     = 2,
7750                 .tap    = { 496 - 16, 16 },
7751         },
7752 };
7753
7754 static struct cipher_testvec cast6_ctr_dec_tv_template[] = {
7755         { /* Generated from TF test vectors */
7756                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7757                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7758                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7759                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7760                 .klen   = 32,
7761                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7762                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7763                 .input  = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
7764                           "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
7765                           "\x57\xA3\xEF\x47\x2A\xE8\x88\xA7"
7766                           "\x3C\xD0\xEC\xB9\x94\x50\x7D\x56"
7767                           "\xBC\xE1\xC1\xF5\xE1\xEE\x12\xF8"
7768                           "\x4F\x03\x82\x3A\x93\x6B\x4C\xD3"
7769                           "\xE3\xF3\xFA\xC2\x23\x55\x98\x20"
7770                           "\x49\x76\x9B\x6B\xC1\x23\xBF\xE5"
7771                           "\xD4\xC4\x2F\x61\xE1\x67\x2A\x30"
7772                           "\x6F\x29\xCA\x54\xF8\x1B\xA6\x7D"
7773                           "\x66\x45\xEE\xC8\x19\xBE\x50\xF0"
7774                           "\x5F\x65\xF8\x1E\x4D\x07\x87\xD9"
7775                           "\xD3\xD9\x1B\x09\x89\xFD\x42\xC5"
7776                           "\xDB\xEB\x86\xF1\x67\x04\x0F\x5C"
7777                           "\x81\xDF\x82\x12\xC7\x4C\x1B\x07"
7778                           "\xDE\xE6\xFA\x29\x86\xD1\xB0\xBA"
7779                           "\x3D\x6A\x69\x76\xEC\x0F\xB4\xE6"
7780                           "\xCD\xA7\xF8\xA8\xB8\xE0\x33\xF5"
7781                           "\x49\x61\x22\x52\x64\x8C\x46\x41"
7782                           "\x1F\x48\x5F\x4F\xA2\x89\x36\x17"
7783                           "\x20\xF8\x2F\x8F\x4B\xFA\xF2\xC0"
7784                           "\x1E\x18\xA2\xF8\xB7\x6D\x98\xE3"
7785                           "\x00\x14\x15\x59\xC1\x30\x64\xAF"
7786                           "\xA8\x01\x38\xAB\xD4\x8B\xEC\x7C"
7787                           "\x44\x9A\xC6\x2C\x2E\x2B\x2B\xF4"
7788                           "\x02\x37\xC4\x69\xEF\x36\xC1\xF3"
7789                           "\xA0\xFB\xFE\x29\xAD\x39\xCF\xD0"
7790                           "\x51\x73\xA3\x22\x42\x41\xAB\xD2"
7791                           "\x0F\x50\x14\xB9\x54\xD3\xD4\xFA"
7792                           "\xBF\xC9\xBB\xCE\xC4\x1D\x2D\xAF"
7793                           "\xC9\x3F\x07\x87\x42\x4B\x3A\x54"
7794                           "\x34\x8E\x37\xA3\x03\x6F\x65\x66"
7795                           "\xDB\x44\xC3\xE8\xD7\xDD\x7D\xDD"
7796                           "\x61\xB4\x2B\x80\xA3\x98\x13\xF5"
7797                           "\x5A\xD3\x34\x58\xC3\x6E\xF6\xB8"
7798                           "\x0A\xC6\x50\x01\x8E\xD5\x6C\x7D"
7799                           "\xFE\x16\xB6\xCF\xFC\x51\x40\xAE"
7800                           "\xB3\x15\xAC\x90\x6F\x0B\x28\x3A"
7801                           "\x60\x40\x38\x90\x20\x46\xC7\xB3"
7802                           "\x0B\x12\x6D\x3B\x15\x14\xF9\xF4"
7803                           "\x11\x41\x76\x6B\xB3\x60\x82\x3C"
7804                           "\x84\xFB\x08\x2E\x92\x25\xCB\x79"
7805                           "\x6F\x58\xC5\x94\x00\x00\x47\xB6"
7806                           "\x9E\xDC\x0F\x29\x70\x46\x20\x76"
7807                           "\x65\x75\x66\x5C\x00\x96\xB3\xE1"
7808                           "\x0B\xA7\x11\x8B\x2E\x61\x4E\x45"
7809                           "\x73\xFC\x91\xAB\x79\x41\x23\x14"
7810                           "\x13\xB6\x72\x6C\x46\xB3\x03\x11"
7811                           "\xE4\xF1\xEE\xC9\x7A\xCF\x96\x32"
7812                           "\xB6\xF0\x8B\x97\xB4\xCF\x82\xB7"
7813                           "\x15\x48\x44\x99\x09\xF6\xE0\xD7"
7814                           "\xBC\xF1\x5B\x91\x4F\x30\x22\xA2"
7815                           "\x45\xC4\x68\x55\xC2\xBE\xA7\xD2"
7816                           "\x12\x53\x35\x9C\xF9\xE7\x35\x5D"
7817                           "\x81\xE4\x86\x42\xC3\x58\xFB\xF0"
7818                           "\x38\x9B\x8E\x5A\xEF\x83\x33\x0F"
7819                           "\x00\x4E\x3F\x9F\xF5\x84\x62\xC4"
7820                           "\x19\x35\x88\x22\x45\x59\x0E\x8F"
7821                           "\xEC\x27\xDD\x4A\xA4\x1F\xBC\x41"
7822                           "\x9B\x66\x8D\x32\xBA\x81\x34\x87"
7823                           "\x0E\x74\x33\x30\x62\xB9\x89\xDF"
7824                           "\xF9\xC5\xDD\x27\xB3\x39\xCB\xCB",
7825                 .ilen   = 496,
7826                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7827                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7828                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7829                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7830                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7831                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7832                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7833                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7834                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7835                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7836                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7837                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7838                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7839                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7840                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7841                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7842                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7843                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7844                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7845                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7846                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7847                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7848                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7849                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7850                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7851                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7852                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7853                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7854                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7855                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7856                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7857                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7858                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7859                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7860                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7861                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7862                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7863                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7864                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7865                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7866                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7867                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7868                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7869                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7870                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7871                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7872                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7873                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7874                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7875                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7876                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7877                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7878                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7879                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7880                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7881                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7882                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7883                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7884                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7885                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7886                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7887                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7888                 .rlen   = 496,
7889                 .also_non_np = 1,
7890                 .np     = 2,
7891                 .tap    = { 496 - 16, 16 },
7892         },
7893 };
7894
7895 static struct cipher_testvec cast6_lrw_enc_tv_template[] = {
7896         { /* Generated from TF test vectors */
7897                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
7898                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
7899                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
7900                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
7901                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
7902                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
7903                 .klen   = 48,
7904                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
7905                           "\x00\x00\x00\x00\x00\x00\x00\x01",
7906                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
7907                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
7908                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
7909                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
7910                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
7911                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
7912                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
7913                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
7914                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
7915                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
7916                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
7917                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
7918                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
7919                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
7920                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
7921                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
7922                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
7923                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
7924                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
7925                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
7926                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
7927                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
7928                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
7929                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
7930                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
7931                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
7932                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
7933                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
7934                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
7935                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
7936                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
7937                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
7938                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
7939                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
7940                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
7941                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
7942                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
7943                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
7944                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
7945                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
7946                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
7947                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
7948                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
7949                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
7950                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
7951                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
7952                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
7953                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
7954                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
7955                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
7956                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
7957                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
7958                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
7959                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
7960                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
7961                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
7962                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
7963                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
7964                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
7965                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
7966                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
7967                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
7968                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
7969                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
7970                 .ilen   = 512,
7971                 .result = "\x55\x25\x09\x8B\xB5\xD5\xF8\xBF"
7972                           "\x37\x4A\xFE\x3C\x47\xD8\xE6\xEB"
7973                           "\xCA\xA4\x9B\xB0\xAB\x6D\x64\xCA"
7974                           "\x58\xB6\x73\xF0\xD7\x52\x34\xEF"
7975                           "\xFB\x3E\x96\x81\xB7\x71\x34\xA4"
7976                           "\x55\x20\xBE\x39\x5A\x2B\xF9\xD1"
7977                           "\x65\x0B\xDA\xD3\x7E\xB3\xA6\xF7"
7978                           "\x2E\x0B\x5A\x52\xDB\x39\x8C\x9B"
7979                           "\x61\x17\x5F\xAF\xB6\x5A\xC8\x08"
7980                           "\xA7\xB7\x2A\x11\x7C\x97\x38\x9D"
7981                           "\x59\x0E\x66\x59\x5E\xD8\x8B\xCE"
7982                           "\x70\xE0\xC3\x42\xB0\x8C\x0F\xBA"
7983                           "\xB2\x0D\x81\xB6\xBE\x61\x1C\x2D"
7984                           "\x7E\xEA\x91\x25\xAC\xEC\xF8\x28"
7985                           "\x80\x1D\xF0\x30\xBA\x62\x77\x7D"
7986                           "\xDB\x15\x69\xDF\xFA\x2A\x81\x64"
7987                           "\x95\x5B\xA4\x7F\x3E\x4F\xE3\x30"
7988                           "\xB0\x5C\xC2\x05\xF8\xF0\x29\xE7"
7989                           "\x0A\xA0\x66\xB2\x5D\x0F\x39\x2B"
7990                           "\xB4\xB3\x00\xA9\xD0\xAB\x63\x61"
7991                           "\x5E\xDB\xFC\x11\x74\x25\x96\x65"
7992                           "\xE8\xE2\x34\x57\x77\x15\x5E\x70"
7993                           "\xFF\x10\x90\xC3\x64\xF0\x11\x0A"
7994                           "\x63\x3A\xD3\x55\x92\x15\x4B\x0C"
7995                           "\xC7\x08\x89\x17\x3B\x99\xAD\x63"
7996                           "\xE7\x06\xDF\x52\xBC\x15\x64\x45"
7997                           "\x9D\x7A\xFB\x69\xBC\x2D\x6E\xA9"
7998                           "\x35\xD9\xD8\xF5\x0C\xC4\xA2\x23"
7999                           "\x9C\x18\x8B\xA8\x8C\xFE\xF8\x0E"
8000                           "\xBD\xAB\x60\x1A\x51\x17\x54\x27"
8001                           "\xB6\xE8\xBE\x0F\xA9\xA5\x82\x19"
8002                           "\x2F\x6F\x20\xA7\x47\xED\x74\x6C"
8003                           "\x4E\xC1\xF8\x8C\x14\xF3\xBB\x1F"
8004                           "\xED\x4D\x8F\x7C\x37\xEF\x19\xA1"
8005                           "\x07\x16\xDE\x76\xCC\x5E\x94\x02"
8006                           "\xFB\xBF\xE4\x81\x50\xCE\xFC\x0F"
8007                           "\x9E\xCF\x3D\xF6\x67\x00\xBF\xA7"
8008                           "\x6E\x21\x58\x36\x06\xDE\xB3\xD4"
8009                           "\xA2\xFA\xD8\x4E\xE0\xB9\x7F\x23"
8010                           "\x51\x21\x2B\x32\x68\xAA\xF8\xA8"
8011                           "\x93\x08\xB5\x6D\xE6\x43\x2C\xB7"
8012                           "\x31\xB2\x0F\xD0\xA2\x51\xC0\x25"
8013                           "\x30\xC7\x10\x3F\x97\x27\x01\x8E"
8014                           "\xFA\xD8\x4F\x78\xD8\x2E\x1D\xEB"
8015                           "\xA1\x37\x52\x0F\x7B\x5E\x87\xA8"
8016                           "\x22\xE2\xE6\x92\xA7\x5F\x11\x32"
8017                           "\xCC\x93\x34\xFC\xD1\x7E\xAE\x54"
8018                           "\xBC\x6A\x1B\x91\xD1\x2E\x21\xEC"
8019                           "\x5D\xF1\xC4\xF1\x55\x20\xBF\xE5"
8020                           "\x96\x3D\x69\x91\x20\x4E\xF2\x61"
8021                           "\xDA\x77\xFE\xEE\xC3\x74\x57\x2A"
8022                           "\x78\x39\xB0\xE0\xCF\x12\x56\xD6"
8023                           "\x05\xDC\xF9\x19\x66\x44\x1D\xF9"
8024                           "\x82\x37\xD4\xC2\x60\xB6\x31\xDF"
8025                           "\x0C\xAF\xBC\x8B\x55\x9A\xC8\x2D"
8026                           "\xAB\xA7\x88\x7B\x41\xE8\x29\xC9"
8027                           "\x9B\x8D\xA7\x00\x86\x25\xB6\x14"
8028                           "\xF5\x13\x73\xD7\x4B\x6B\x83\xF3"
8029                           "\xAF\x96\x00\xE4\xB7\x3C\x65\xA6"
8030                           "\x15\xB7\x94\x7D\x4E\x70\x4C\x75"
8031                           "\xF3\xB4\x02\xA9\x17\x1C\x7A\x0A"
8032                           "\xC0\xD5\x33\x11\x56\xDE\xDC\xF5"
8033                           "\x8D\xD9\xCD\x3B\x22\x67\x18\xC7"
8034                           "\xC4\xF5\x99\x61\xBC\xBB\x5B\x46",
8035                 .rlen   = 512,
8036                 .also_non_np = 1,
8037                 .np     = 2,
8038                 .tap    = { 512 - 16, 16 },
8039         },
8040 };
8041
8042 static struct cipher_testvec cast6_lrw_dec_tv_template[] = {
8043         { /* Generated from TF test vectors */
8044                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
8045                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
8046                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
8047                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
8048                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
8049                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
8050                 .klen   = 48,
8051                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
8052                           "\x00\x00\x00\x00\x00\x00\x00\x01",
8053                 .input  = "\x55\x25\x09\x8B\xB5\xD5\xF8\xBF"
8054                           "\x37\x4A\xFE\x3C\x47\xD8\xE6\xEB"
8055                           "\xCA\xA4\x9B\xB0\xAB\x6D\x64\xCA"
8056                           "\x58\xB6\x73\xF0\xD7\x52\x34\xEF"
8057                           "\xFB\x3E\x96\x81\xB7\x71\x34\xA4"
8058                           "\x55\x20\xBE\x39\x5A\x2B\xF9\xD1"
8059                           "\x65\x0B\xDA\xD3\x7E\xB3\xA6\xF7"
8060                           "\x2E\x0B\x5A\x52\xDB\x39\x8C\x9B"
8061                           "\x61\x17\x5F\xAF\xB6\x5A\xC8\x08"
8062                           "\xA7\xB7\x2A\x11\x7C\x97\x38\x9D"
8063                           "\x59\x0E\x66\x59\x5E\xD8\x8B\xCE"
8064                           "\x70\xE0\xC3\x42\xB0\x8C\x0F\xBA"
8065                           "\xB2\x0D\x81\xB6\xBE\x61\x1C\x2D"
8066                           "\x7E\xEA\x91\x25\xAC\xEC\xF8\x28"
8067                           "\x80\x1D\xF0\x30\xBA\x62\x77\x7D"
8068                           "\xDB\x15\x69\xDF\xFA\x2A\x81\x64"
8069                           "\x95\x5B\xA4\x7F\x3E\x4F\xE3\x30"
8070                           "\xB0\x5C\xC2\x05\xF8\xF0\x29\xE7"
8071                           "\x0A\xA0\x66\xB2\x5D\x0F\x39\x2B"
8072                           "\xB4\xB3\x00\xA9\xD0\xAB\x63\x61"
8073                           "\x5E\xDB\xFC\x11\x74\x25\x96\x65"
8074                           "\xE8\xE2\x34\x57\x77\x15\x5E\x70"
8075                           "\xFF\x10\x90\xC3\x64\xF0\x11\x0A"
8076                           "\x63\x3A\xD3\x55\x92\x15\x4B\x0C"
8077                           "\xC7\x08\x89\x17\x3B\x99\xAD\x63"
8078                           "\xE7\x06\xDF\x52\xBC\x15\x64\x45"
8079                           "\x9D\x7A\xFB\x69\xBC\x2D\x6E\xA9"
8080                           "\x35\xD9\xD8\xF5\x0C\xC4\xA2\x23"
8081                           "\x9C\x18\x8B\xA8\x8C\xFE\xF8\x0E"
8082                           "\xBD\xAB\x60\x1A\x51\x17\x54\x27"
8083                           "\xB6\xE8\xBE\x0F\xA9\xA5\x82\x19"
8084                           "\x2F\x6F\x20\xA7\x47\xED\x74\x6C"
8085                           "\x4E\xC1\xF8\x8C\x14\xF3\xBB\x1F"
8086                           "\xED\x4D\x8F\x7C\x37\xEF\x19\xA1"
8087                           "\x07\x16\xDE\x76\xCC\x5E\x94\x02"
8088                           "\xFB\xBF\xE4\x81\x50\xCE\xFC\x0F"
8089                           "\x9E\xCF\x3D\xF6\x67\x00\xBF\xA7"
8090                           "\x6E\x21\x58\x36\x06\xDE\xB3\xD4"
8091                           "\xA2\xFA\xD8\x4E\xE0\xB9\x7F\x23"
8092                           "\x51\x21\x2B\x32\x68\xAA\xF8\xA8"
8093                           "\x93\x08\xB5\x6D\xE6\x43\x2C\xB7"
8094                           "\x31\xB2\x0F\xD0\xA2\x51\xC0\x25"
8095                           "\x30\xC7\x10\x3F\x97\x27\x01\x8E"
8096                           "\xFA\xD8\x4F\x78\xD8\x2E\x1D\xEB"
8097                           "\xA1\x37\x52\x0F\x7B\x5E\x87\xA8"
8098                           "\x22\xE2\xE6\x92\xA7\x5F\x11\x32"
8099                           "\xCC\x93\x34\xFC\xD1\x7E\xAE\x54"
8100                           "\xBC\x6A\x1B\x91\xD1\x2E\x21\xEC"
8101                           "\x5D\xF1\xC4\xF1\x55\x20\xBF\xE5"
8102                           "\x96\x3D\x69\x91\x20\x4E\xF2\x61"
8103                           "\xDA\x77\xFE\xEE\xC3\x74\x57\x2A"
8104                           "\x78\x39\xB0\xE0\xCF\x12\x56\xD6"
8105                           "\x05\xDC\xF9\x19\x66\x44\x1D\xF9"
8106                           "\x82\x37\xD4\xC2\x60\xB6\x31\xDF"
8107                           "\x0C\xAF\xBC\x8B\x55\x9A\xC8\x2D"
8108                           "\xAB\xA7\x88\x7B\x41\xE8\x29\xC9"
8109                           "\x9B\x8D\xA7\x00\x86\x25\xB6\x14"
8110                           "\xF5\x13\x73\xD7\x4B\x6B\x83\xF3"
8111                           "\xAF\x96\x00\xE4\xB7\x3C\x65\xA6"
8112                           "\x15\xB7\x94\x7D\x4E\x70\x4C\x75"
8113                           "\xF3\xB4\x02\xA9\x17\x1C\x7A\x0A"
8114                           "\xC0\xD5\x33\x11\x56\xDE\xDC\xF5"
8115                           "\x8D\xD9\xCD\x3B\x22\x67\x18\xC7"
8116                           "\xC4\xF5\x99\x61\xBC\xBB\x5B\x46",
8117                 .ilen   = 512,
8118                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
8119                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
8120                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
8121                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
8122                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
8123                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
8124                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
8125                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
8126                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
8127                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
8128                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
8129                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
8130                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
8131                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
8132                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
8133                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
8134                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
8135                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
8136                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
8137                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
8138                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
8139                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
8140                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
8141                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
8142                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
8143                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
8144                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
8145                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
8146                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
8147                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
8148                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
8149                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
8150                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
8151                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
8152                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
8153                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
8154                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
8155                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
8156                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
8157                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
8158                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
8159                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
8160                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
8161                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
8162                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
8163                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
8164                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
8165                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
8166                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
8167                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
8168                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
8169                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
8170                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
8171                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
8172                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
8173                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
8174                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
8175                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
8176                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
8177                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
8178                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
8179                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
8180                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
8181                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
8182                 .rlen   = 512,
8183                 .also_non_np = 1,
8184                 .np     = 2,
8185                 .tap    = { 512 - 16, 16 },
8186         },
8187 };
8188
8189 static struct cipher_testvec cast6_xts_enc_tv_template[] = {
8190         { /* Generated from TF test vectors */
8191                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
8192                           "\x23\x53\x60\x28\x74\x71\x35\x26"
8193                           "\x62\x49\x77\x57\x24\x70\x93\x69"
8194                           "\x99\x59\x57\x49\x66\x96\x76\x27"
8195                           "\x31\x41\x59\x26\x53\x58\x97\x93"
8196                           "\x23\x84\x62\x64\x33\x83\x27\x95"
8197                           "\x02\x88\x41\x97\x16\x93\x99\x37"
8198                           "\x51\x05\x82\x09\x74\x94\x45\x92",
8199                 .klen   = 64,
8200                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
8201                           "\x00\x00\x00\x00\x00\x00\x00\x00",
8202                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8203                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8204                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8205                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8206                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8207                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8208                           "\x30\x31\x32\x33\x34\x35\x36\x37"
8209                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
8210                           "\x40\x41\x42\x43\x44\x45\x46\x47"
8211                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
8212                           "\x50\x51\x52\x53\x54\x55\x56\x57"
8213                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
8214                           "\x60\x61\x62\x63\x64\x65\x66\x67"
8215                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
8216                           "\x70\x71\x72\x73\x74\x75\x76\x77"
8217                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
8218                           "\x80\x81\x82\x83\x84\x85\x86\x87"
8219                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
8220                           "\x90\x91\x92\x93\x94\x95\x96\x97"
8221                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
8222                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
8223                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
8224                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
8225                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
8226                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8227                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
8228                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
8229                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
8230                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
8231                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
8232                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
8233                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
8234                           "\x00\x01\x02\x03\x04\x05\x06\x07"
8235                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8236                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8237                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8238                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8239                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8240                           "\x30\x31\x32\x33\x34\x35\x36\x37"
8241                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
8242                           "\x40\x41\x42\x43\x44\x45\x46\x47"
8243                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
8244                           "\x50\x51\x52\x53\x54\x55\x56\x57"
8245                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
8246                           "\x60\x61\x62\x63\x64\x65\x66\x67"
8247                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
8248                           "\x70\x71\x72\x73\x74\x75\x76\x77"
8249                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
8250                           "\x80\x81\x82\x83\x84\x85\x86\x87"
8251                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
8252                           "\x90\x91\x92\x93\x94\x95\x96\x97"
8253                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
8254                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
8255                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
8256                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
8257                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
8258                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8259                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
8260                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
8261                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
8262                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
8263                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
8264                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
8265                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
8266                 .ilen   = 512,
8267                 .result = "\xDE\x6F\x22\xA5\xE8\x39\xE8\x78"
8268                           "\x88\x5A\x4F\x8D\x82\x76\x52\x6D"
8269                           "\xB2\x41\x16\xF4\x2B\xA6\xEB\xF6"
8270                           "\xE2\xC5\x62\x8D\x61\xA1\x01\xED"
8271                           "\xD9\x38\x01\xC1\x43\x63\x4E\x88"
8272                           "\xC9\x4B\x5A\x88\x80\xB7\x5C\x71"
8273                           "\x47\xEE\x11\xD8\xB7\x2D\x5D\x13"
8274                           "\x1A\xB1\x68\x5B\x61\xA7\xA9\x81"
8275                           "\x8B\x83\xA1\x6A\xAA\x36\xD6\xB6"
8276                           "\x60\x54\x09\x32\xFE\x6A\x76\x2E"
8277                           "\x28\xFF\xD5\xD6\xDD\x1D\x45\x7D"
8278                           "\xF0\x8B\xF3\x32\x4E\x6C\x12\xCB"
8279                           "\xB8\x25\x70\xF8\x40\xBC\x90\x1B"
8280                           "\x11\xC3\x59\xAF\xF0\x2F\x92\xDD"
8281                           "\xD3\x3B\xCF\x60\xA1\x78\x94\x57"
8282                           "\xAF\x76\xC1\x67\xA6\x3C\xCD\x98"
8283                           "\xB1\xF7\x27\xB9\xA3\xBD\x10\xEA"
8284                           "\xCD\x8B\xC2\xF2\x14\xF2\xB2\x67"
8285                           "\x05\xDD\x1D\x58\x6E\x2F\x95\x08"
8286                           "\x3A\xF8\x78\x76\x82\x56\xA7\xEC"
8287                           "\x51\x4B\x85\x77\xC2\x4C\x4A\x34"
8288                           "\x71\x38\x17\x91\x44\xE8\xFC\x65"
8289                           "\x99\x0D\x52\x91\xEE\xF8\xEF\x27"
8290                           "\x2A\x9E\x6E\x78\xC4\x26\x87\xF4"
8291                           "\x8A\xF0\x2D\x04\xE8\x14\x92\x5D"
8292                           "\x59\x22\x9B\x29\x5C\x18\xF0\xC3"
8293                           "\x47\xF3\x76\xD8\xE4\xF3\x1B\xD1"
8294                           "\x70\xA3\x0D\xB5\x70\x02\x1D\xA3"
8295                           "\x91\x3B\x49\x73\x18\xAB\xD4\xC9"
8296                           "\xC3\x1E\xEF\x1F\xFE\xD5\x59\x8A"
8297                           "\xD7\xF6\xC9\x71\x67\x79\xD7\x0E"
8298                           "\xBE\x1F\x8E\xEC\x55\x7E\x4F\x24"
8299                           "\xE6\x87\xEA\xFE\x96\x25\x67\x8E"
8300                           "\x93\x03\xFA\xFF\xCE\xAF\xB2\x3C"
8301                           "\x6F\xEB\x57\xFB\xD3\x28\x87\xA9"
8302                           "\xCE\xC2\xF5\x9C\xC6\x67\xB5\x97"
8303                           "\x49\xF7\x04\xCB\xEF\x84\x98\x33"
8304                           "\xAF\x38\xD3\x04\x1C\x24\x71\x38"
8305                           "\xC7\x71\xDD\x43\x0D\x12\x4A\x18"
8306                           "\xBA\xC4\xAF\xBA\xB2\x5B\xEB\x95"
8307                           "\x02\x43\x5D\xCE\x19\xCC\xCD\x66"
8308                           "\x91\x0B\x8C\x7F\x51\xC4\xBF\x3C"
8309                           "\x8B\xF1\xCC\xAA\x29\xD7\x87\xCB"
8310                           "\x3E\xC5\xF3\xC9\x75\xE8\xA3\x5B"
8311                           "\x30\x45\xA9\xB7\xAF\x80\x64\x6F"
8312                           "\x75\x4A\xA7\xC0\x6D\x19\x6B\xDE"
8313                           "\x17\xDE\x6D\xEA\x87\x9F\x95\xAE"
8314                           "\xF5\x3C\xEE\x54\xB8\x27\x84\xF8"
8315                           "\x97\xA3\xE1\x6F\x38\x24\x34\x88"
8316                           "\xCE\xBD\x32\x52\xE0\x00\x6C\x94"
8317                           "\xC9\xD7\x5D\x37\x81\x33\x2E\x7F"
8318                           "\x4F\x7E\x2E\x0D\x94\xBD\xEA\x59"
8319                           "\x34\x39\xA8\x35\x12\xB7\xBC\xAC"
8320                           "\xEA\x52\x9C\x78\x02\x6D\x92\x36"
8321                           "\xFB\x59\x2B\xA4\xEA\x7B\x1B\x83"
8322                           "\xE1\x4D\x5E\x2A\x7E\x92\xB1\x64"
8323                           "\xDE\xE0\x27\x4B\x0A\x6F\x4C\xE3"
8324                           "\xB0\xEB\x31\xE4\x69\x95\xAB\x35"
8325                           "\x8B\x2C\xF5\x6B\x7F\xF1\xA2\x82"
8326                           "\xF8\xD9\x47\x82\xA9\x82\x03\x91"
8327                           "\x69\x1F\xBE\x4C\xE7\xC7\x34\x2F"
8328                           "\x45\x72\x80\x17\x81\xBD\x9D\x62"
8329                           "\xA1\xAC\xE8\xCF\xC6\x74\xCF\xDC"
8330                           "\x22\x60\x4E\xE8\xA4\x5D\x85\xB9",
8331                 .rlen   = 512,
8332                 .also_non_np = 1,
8333                 .np     = 2,
8334                 .tap    = { 512 - 16, 16 },
8335         },
8336 };
8337
8338 static struct cipher_testvec cast6_xts_dec_tv_template[] = {
8339         { /* Generated from TF test vectors */
8340                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
8341                           "\x23\x53\x60\x28\x74\x71\x35\x26"
8342                           "\x62\x49\x77\x57\x24\x70\x93\x69"
8343                           "\x99\x59\x57\x49\x66\x96\x76\x27"
8344                           "\x31\x41\x59\x26\x53\x58\x97\x93"
8345                           "\x23\x84\x62\x64\x33\x83\x27\x95"
8346                           "\x02\x88\x41\x97\x16\x93\x99\x37"
8347                           "\x51\x05\x82\x09\x74\x94\x45\x92",
8348                 .klen   = 64,
8349                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
8350                           "\x00\x00\x00\x00\x00\x00\x00\x00",
8351                 .input  = "\xDE\x6F\x22\xA5\xE8\x39\xE8\x78"
8352                           "\x88\x5A\x4F\x8D\x82\x76\x52\x6D"
8353                           "\xB2\x41\x16\xF4\x2B\xA6\xEB\xF6"
8354                           "\xE2\xC5\x62\x8D\x61\xA1\x01\xED"
8355                           "\xD9\x38\x01\xC1\x43\x63\x4E\x88"
8356                           "\xC9\x4B\x5A\x88\x80\xB7\x5C\x71"
8357                           "\x47\xEE\x11\xD8\xB7\x2D\x5D\x13"
8358                           "\x1A\xB1\x68\x5B\x61\xA7\xA9\x81"
8359                           "\x8B\x83\xA1\x6A\xAA\x36\xD6\xB6"
8360                           "\x60\x54\x09\x32\xFE\x6A\x76\x2E"
8361                           "\x28\xFF\xD5\xD6\xDD\x1D\x45\x7D"
8362                           "\xF0\x8B\xF3\x32\x4E\x6C\x12\xCB"
8363                           "\xB8\x25\x70\xF8\x40\xBC\x90\x1B"
8364                           "\x11\xC3\x59\xAF\xF0\x2F\x92\xDD"
8365                           "\xD3\x3B\xCF\x60\xA1\x78\x94\x57"
8366                           "\xAF\x76\xC1\x67\xA6\x3C\xCD\x98"
8367                           "\xB1\xF7\x27\xB9\xA3\xBD\x10\xEA"
8368                           "\xCD\x8B\xC2\xF2\x14\xF2\xB2\x67"
8369                           "\x05\xDD\x1D\x58\x6E\x2F\x95\x08"
8370                           "\x3A\xF8\x78\x76\x82\x56\xA7\xEC"
8371                           "\x51\x4B\x85\x77\xC2\x4C\x4A\x34"
8372                           "\x71\x38\x17\x91\x44\xE8\xFC\x65"
8373                           "\x99\x0D\x52\x91\xEE\xF8\xEF\x27"
8374                           "\x2A\x9E\x6E\x78\xC4\x26\x87\xF4"
8375                           "\x8A\xF0\x2D\x04\xE8\x14\x92\x5D"
8376                           "\x59\x22\x9B\x29\x5C\x18\xF0\xC3"
8377                           "\x47\xF3\x76\xD8\xE4\xF3\x1B\xD1"
8378                           "\x70\xA3\x0D\xB5\x70\x02\x1D\xA3"
8379                           "\x91\x3B\x49\x73\x18\xAB\xD4\xC9"
8380                           "\xC3\x1E\xEF\x1F\xFE\xD5\x59\x8A"
8381                           "\xD7\xF6\xC9\x71\x67\x79\xD7\x0E"
8382                           "\xBE\x1F\x8E\xEC\x55\x7E\x4F\x24"
8383                           "\xE6\x87\xEA\xFE\x96\x25\x67\x8E"
8384                           "\x93\x03\xFA\xFF\xCE\xAF\xB2\x3C"
8385                           "\x6F\xEB\x57\xFB\xD3\x28\x87\xA9"
8386                           "\xCE\xC2\xF5\x9C\xC6\x67\xB5\x97"
8387                           "\x49\xF7\x04\xCB\xEF\x84\x98\x33"
8388                           "\xAF\x38\xD3\x04\x1C\x24\x71\x38"
8389                           "\xC7\x71\xDD\x43\x0D\x12\x4A\x18"
8390                           "\xBA\xC4\xAF\xBA\xB2\x5B\xEB\x95"
8391                           "\x02\x43\x5D\xCE\x19\xCC\xCD\x66"
8392                           "\x91\x0B\x8C\x7F\x51\xC4\xBF\x3C"
8393                           "\x8B\xF1\xCC\xAA\x29\xD7\x87\xCB"
8394                           "\x3E\xC5\xF3\xC9\x75\xE8\xA3\x5B"
8395                           "\x30\x45\xA9\xB7\xAF\x80\x64\x6F"
8396                           "\x75\x4A\xA7\xC0\x6D\x19\x6B\xDE"
8397                           "\x17\xDE\x6D\xEA\x87\x9F\x95\xAE"
8398                           "\xF5\x3C\xEE\x54\xB8\x27\x84\xF8"
8399                           "\x97\xA3\xE1\x6F\x38\x24\x34\x88"
8400                           "\xCE\xBD\x32\x52\xE0\x00\x6C\x94"
8401                           "\xC9\xD7\x5D\x37\x81\x33\x2E\x7F"
8402                           "\x4F\x7E\x2E\x0D\x94\xBD\xEA\x59"
8403                           "\x34\x39\xA8\x35\x12\xB7\xBC\xAC"
8404                           "\xEA\x52\x9C\x78\x02\x6D\x92\x36"
8405                           "\xFB\x59\x2B\xA4\xEA\x7B\x1B\x83"
8406                           "\xE1\x4D\x5E\x2A\x7E\x92\xB1\x64"
8407                           "\xDE\xE0\x27\x4B\x0A\x6F\x4C\xE3"
8408                           "\xB0\xEB\x31\xE4\x69\x95\xAB\x35"
8409                           "\x8B\x2C\xF5\x6B\x7F\xF1\xA2\x82"
8410                           "\xF8\xD9\x47\x82\xA9\x82\x03\x91"
8411                           "\x69\x1F\xBE\x4C\xE7\xC7\x34\x2F"
8412                           "\x45\x72\x80\x17\x81\xBD\x9D\x62"
8413                           "\xA1\xAC\xE8\xCF\xC6\x74\xCF\xDC"
8414                           "\x22\x60\x4E\xE8\xA4\x5D\x85\xB9",
8415                 .ilen   = 512,
8416                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
8417                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8418                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8419                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8420                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8421                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8422                           "\x30\x31\x32\x33\x34\x35\x36\x37"
8423                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
8424                           "\x40\x41\x42\x43\x44\x45\x46\x47"
8425                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
8426                           "\x50\x51\x52\x53\x54\x55\x56\x57"
8427                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
8428                           "\x60\x61\x62\x63\x64\x65\x66\x67"
8429                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
8430                           "\x70\x71\x72\x73\x74\x75\x76\x77"
8431                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
8432                           "\x80\x81\x82\x83\x84\x85\x86\x87"
8433                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
8434                           "\x90\x91\x92\x93\x94\x95\x96\x97"
8435                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
8436                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
8437                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
8438                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
8439                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
8440                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8441                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
8442                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
8443                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
8444                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
8445                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
8446                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
8447                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
8448                           "\x00\x01\x02\x03\x04\x05\x06\x07"
8449                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8450                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8451                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8452                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8453                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8454                           "\x30\x31\x32\x33\x34\x35\x36\x37"
8455                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
8456                           "\x40\x41\x42\x43\x44\x45\x46\x47"
8457                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
8458                           "\x50\x51\x52\x53\x54\x55\x56\x57"
8459                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
8460                           "\x60\x61\x62\x63\x64\x65\x66\x67"
8461                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
8462                           "\x70\x71\x72\x73\x74\x75\x76\x77"
8463                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
8464                           "\x80\x81\x82\x83\x84\x85\x86\x87"
8465                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
8466                           "\x90\x91\x92\x93\x94\x95\x96\x97"
8467                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
8468                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
8469                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
8470                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
8471                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
8472                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8473                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
8474                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
8475                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
8476                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
8477                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
8478                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
8479                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
8480                 .rlen   = 512,
8481                 .also_non_np = 1,
8482                 .np     = 2,
8483                 .tap    = { 512 - 16, 16 },
8484         },
8485 };
8486
8487
8488 /*
8489  * AES test vectors.
8490  */
8491 #define AES_ENC_TEST_VECTORS 3
8492 #define AES_DEC_TEST_VECTORS 3
8493 #define AES_CBC_ENC_TEST_VECTORS 4
8494 #define AES_CBC_DEC_TEST_VECTORS 4
8495 #define HMAC_SHA1_AES_CBC_ENC_TEST_VECTORS 7
8496 #define HMAC_SHA256_AES_CBC_ENC_TEST_VECTORS 7
8497 #define HMAC_SHA512_AES_CBC_ENC_TEST_VECTORS 7
8498 #define AES_LRW_ENC_TEST_VECTORS 8
8499 #define AES_LRW_DEC_TEST_VECTORS 8
8500 #define AES_XTS_ENC_TEST_VECTORS 5
8501 #define AES_XTS_DEC_TEST_VECTORS 5
8502 #define AES_CTR_ENC_TEST_VECTORS 3
8503 #define AES_CTR_DEC_TEST_VECTORS 3
8504 #define AES_OFB_ENC_TEST_VECTORS 1
8505 #define AES_OFB_DEC_TEST_VECTORS 1
8506 #define AES_CTR_3686_ENC_TEST_VECTORS 7
8507 #define AES_CTR_3686_DEC_TEST_VECTORS 6
8508 #define AES_GCM_ENC_TEST_VECTORS 9
8509 #define AES_GCM_DEC_TEST_VECTORS 8
8510 #define AES_GCM_4106_ENC_TEST_VECTORS 7
8511 #define AES_GCM_4106_DEC_TEST_VECTORS 7
8512 #define AES_CCM_ENC_TEST_VECTORS 7
8513 #define AES_CCM_DEC_TEST_VECTORS 7
8514 #define AES_CCM_4309_ENC_TEST_VECTORS 7
8515 #define AES_CCM_4309_DEC_TEST_VECTORS 10
8516
8517 static struct cipher_testvec aes_enc_tv_template[] = {
8518         { /* From FIPS-197 */
8519                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8520                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8521                 .klen   = 16,
8522                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
8523                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8524                 .ilen   = 16,
8525                 .result = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
8526                           "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
8527                 .rlen   = 16,
8528         }, {
8529                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8530                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8531                           "\x10\x11\x12\x13\x14\x15\x16\x17",
8532                 .klen   = 24,
8533                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
8534                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8535                 .ilen   = 16,
8536                 .result = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
8537                           "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
8538                 .rlen   = 16,
8539         }, {
8540                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8541                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8542                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8543                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
8544                 .klen   = 32,
8545                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
8546                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8547                 .ilen   = 16,
8548                 .result = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
8549                           "\xea\xfc\x49\x90\x4b\x49\x60\x89",
8550                 .rlen   = 16,
8551         },
8552 };
8553
8554 static struct cipher_testvec aes_dec_tv_template[] = {
8555         { /* From FIPS-197 */
8556                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8557                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8558                 .klen   = 16,
8559                 .input  = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
8560                           "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
8561                 .ilen   = 16,
8562                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
8563                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8564                 .rlen   = 16,
8565         }, {
8566                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8567                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8568                           "\x10\x11\x12\x13\x14\x15\x16\x17",
8569                 .klen   = 24,
8570                 .input  = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
8571                           "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
8572                 .ilen   = 16,
8573                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
8574                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8575                 .rlen   = 16,
8576         }, {
8577                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8578                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8579                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8580                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
8581                 .klen   = 32,
8582                 .input  = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
8583                           "\xea\xfc\x49\x90\x4b\x49\x60\x89",
8584                 .ilen   = 16,
8585                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
8586                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8587                 .rlen   = 16,
8588         },
8589 };
8590
8591 static struct cipher_testvec aes_cbc_enc_tv_template[] = {
8592         { /* From RFC 3602 */
8593                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
8594                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
8595                 .klen   = 16,
8596                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
8597                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
8598                 .input  = "Single block msg",
8599                 .ilen   = 16,
8600                 .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
8601                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
8602                 .rlen   = 16,
8603         }, {
8604                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
8605                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
8606                 .klen   = 16,
8607                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
8608                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
8609                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8610                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8611                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8612                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
8613                 .ilen   = 32,
8614                 .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
8615                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
8616                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
8617                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
8618                 .rlen   = 32,
8619         }, { /* From NIST SP800-38A */
8620                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
8621                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
8622                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
8623                 .klen   = 24,
8624                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8625                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8626                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8627                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8628                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8629                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8630                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8631                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8632                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8633                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8634                 .ilen   = 64,
8635                 .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
8636                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
8637                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
8638                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
8639                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
8640                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
8641                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
8642                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
8643                 .rlen   = 64,
8644         }, {
8645                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
8646                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
8647                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
8648                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
8649                 .klen   = 32,
8650                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8651                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8652                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8653                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8654                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8655                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8656                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8657                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8658                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8659                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8660                 .ilen   = 64,
8661                 .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
8662                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
8663                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
8664                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
8665                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
8666                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
8667                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
8668                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
8669                 .rlen   = 64,
8670         },
8671 };
8672
8673 static struct cipher_testvec aes_cbc_dec_tv_template[] = {
8674         { /* From RFC 3602 */
8675                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
8676                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
8677                 .klen   = 16,
8678                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
8679                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
8680                 .input  = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
8681                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
8682                 .ilen   = 16,
8683                 .result = "Single block msg",
8684                 .rlen   = 16,
8685         }, {
8686                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
8687                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
8688                 .klen   = 16,
8689                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
8690                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
8691                 .input  = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
8692                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
8693                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
8694                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
8695                 .ilen   = 32,
8696                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
8697                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8698                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8699                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
8700                 .rlen   = 32,
8701         }, { /* From NIST SP800-38A */
8702                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
8703                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
8704                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
8705                 .klen   = 24,
8706                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8707                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8708                 .input  = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
8709                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
8710                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
8711                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
8712                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
8713                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
8714                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
8715                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
8716                 .ilen   = 64,
8717                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8718                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8719                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8720                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8721                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8722                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8723                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8724                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8725                 .rlen   = 64,
8726         }, {
8727                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
8728                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
8729                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
8730                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
8731                 .klen   = 32,
8732                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8733                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8734                 .input  = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
8735                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
8736                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
8737                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
8738                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
8739                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
8740                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
8741                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
8742                 .ilen   = 64,
8743                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8744                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8745                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8746                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8747                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8748                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8749                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8750                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8751                 .rlen   = 64,
8752         },
8753 };
8754
8755 static struct aead_testvec hmac_sha1_aes_cbc_enc_tv_template[] = {
8756         { /* RFC 3602 Case 1 */
8757 #ifdef __LITTLE_ENDIAN
8758                 .key    = "\x08\x00"            /* rta length */
8759                           "\x01\x00"            /* rta type */
8760 #else
8761                 .key    = "\x00\x08"            /* rta length */
8762                           "\x00\x01"            /* rta type */
8763 #endif
8764                           "\x00\x00\x00\x10"    /* enc key length */
8765                           "\x00\x00\x00\x00\x00\x00\x00\x00"
8766                           "\x00\x00\x00\x00\x00\x00\x00\x00"
8767                           "\x00\x00\x00\x00"
8768                           "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
8769                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
8770                 .klen   = 8 + 20 + 16,
8771                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
8772                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
8773                 .input  = "Single block msg",
8774                 .ilen   = 16,
8775                 .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
8776                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
8777                           "\x1b\x13\xcb\xaf\x89\x5e\xe1\x2c"
8778                           "\x13\xc5\x2e\xa3\xcc\xed\xdc\xb5"
8779                           "\x03\x71\xa2\x06",
8780                 .rlen   = 16 + 20,
8781         }, { /* RFC 3602 Case 2 */
8782 #ifdef __LITTLE_ENDIAN
8783                 .key    = "\x08\x00"            /* rta length */
8784                           "\x01\x00"            /* rta type */
8785 #else
8786                 .key    = "\x00\x08"            /* rta length */
8787                           "\x00\x01"            /* rta type */
8788 #endif
8789                           "\x00\x00\x00\x10"    /* enc key length */
8790                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8791                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8792                           "\x30\x31\x32\x33"
8793                           "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
8794                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
8795                 .klen   = 8 + 20 + 16,
8796                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
8797                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
8798                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8799                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8800                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8801                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
8802                 .ilen   = 32,
8803                 .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
8804                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
8805                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
8806                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
8807                           "\xad\x9b\x4c\x5c\x85\xe1\xda\xae"
8808                           "\xee\x81\x4e\xd7\xdb\x74\xcf\x58"
8809                           "\x65\x39\xf8\xde",
8810                 .rlen   = 32 + 20,
8811         }, { /* RFC 3602 Case 3 */
8812 #ifdef __LITTLE_ENDIAN
8813                 .key    = "\x08\x00"            /* rta length */
8814                           "\x01\x00"            /* rta type */
8815 #else
8816                 .key    = "\x00\x08"            /* rta length */
8817                           "\x00\x01"            /* rta type */
8818 #endif
8819                           "\x00\x00\x00\x10"    /* enc key length */
8820                           "\x11\x22\x33\x44\x55\x66\x77\x88"
8821                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
8822                           "\x22\x33\x44\x55"
8823                           "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
8824                           "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
8825                 .klen   = 8 + 20 + 16,
8826                 .iv     = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
8827                           "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
8828                 .input  = "This is a 48-byte message (exactly 3 AES blocks)",
8829                 .ilen   = 48,
8830                 .result = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
8831                           "\xd4\x93\x66\x5d\x33\xf0\xe8\x86"
8832                           "\x2d\xea\x54\xcd\xb2\x93\xab\xc7"
8833                           "\x50\x69\x39\x27\x67\x72\xf8\xd5"
8834                           "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
8835                           "\x85\x79\x69\x5d\x83\xba\x26\x84"
8836                           "\xc2\xec\x0c\xf8\x7f\x05\xba\xca"
8837                           "\xff\xee\x4c\xd0\x93\xe6\x36\x7f"
8838                           "\x8d\x62\xf2\x1e",
8839                 .rlen   = 48 + 20,
8840         }, { /* RFC 3602 Case 4 */
8841 #ifdef __LITTLE_ENDIAN
8842                 .key    = "\x08\x00"            /* rta length */
8843                           "\x01\x00"            /* rta type */
8844 #else
8845                 .key    = "\x00\x08"            /* rta length */
8846                           "\x00\x01"            /* rta type */
8847 #endif
8848                           "\x00\x00\x00\x10"    /* enc key length */
8849                           "\x11\x22\x33\x44\x55\x66\x77\x88"
8850                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
8851                           "\x22\x33\x44\x55"
8852                           "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
8853                           "\xbc\x46\x90\x3d\xba\x29\x03\x49",
8854                 .klen   = 8 + 20 + 16,
8855                 .iv     = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
8856                           "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
8857                 .input  = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
8858                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
8859                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
8860                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
8861                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8862                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
8863                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
8864                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
8865                 .ilen   = 64,
8866                 .result = "\xc3\x0e\x32\xff\xed\xc0\x77\x4e"
8867                           "\x6a\xff\x6a\xf0\x86\x9f\x71\xaa"
8868                           "\x0f\x3a\xf0\x7a\x9a\x31\xa9\xc6"
8869                           "\x84\xdb\x20\x7e\xb0\xef\x8e\x4e"
8870                           "\x35\x90\x7a\xa6\x32\xc3\xff\xdf"
8871                           "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
8872                           "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
8873                           "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
8874                           "\x1c\x45\x57\xa9\x56\xcb\xa9\x2d"
8875                           "\x18\xac\xf1\xc7\x5d\xd1\xcd\x0d"
8876                           "\x1d\xbe\xc6\xe9",
8877                 .rlen   = 64 + 20,
8878         }, { /* RFC 3602 Case 5 */
8879 #ifdef __LITTLE_ENDIAN
8880                 .key    = "\x08\x00"            /* rta length */
8881                           "\x01\x00"            /* rta type */
8882 #else
8883                 .key    = "\x00\x08"            /* rta length */
8884                           "\x00\x01"            /* rta type */
8885 #endif
8886                           "\x00\x00\x00\x10"    /* enc key length */
8887                           "\x11\x22\x33\x44\x55\x66\x77\x88"
8888                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
8889                           "\x22\x33\x44\x55"
8890                           "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
8891                           "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
8892                 .klen   = 8 + 20 + 16,
8893                 .iv     = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
8894                           "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
8895                 .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x01",
8896                 .alen   = 8,
8897                 .input  = "\x08\x00\x0e\xbd\xa7\x0a\x00\x00"
8898                           "\x8e\x9c\x08\x3d\xb9\x5b\x07\x00"
8899                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8900                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8901                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8902                           "\x20\x21\x22\x23\x24\x25\x26\x27"
8903                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
8904                           "\x30\x31\x32\x33\x34\x35\x36\x37"
8905                           "\x01\x02\x03\x04\x05\x06\x07\x08"
8906                           "\x09\x0a\x0b\x0c\x0d\x0e\x0e\x01",
8907                 .ilen   = 80,
8908                 .result = "\xf6\x63\xc2\x5d\x32\x5c\x18\xc6"
8909                           "\xa9\x45\x3e\x19\x4e\x12\x08\x49"
8910                           "\xa4\x87\x0b\x66\xcc\x6b\x99\x65"
8911                           "\x33\x00\x13\xb4\x89\x8d\xc8\x56"
8912                           "\xa4\x69\x9e\x52\x3a\x55\xdb\x08"
8913                           "\x0b\x59\xec\x3a\x8e\x4b\x7e\x52"
8914                           "\x77\x5b\x07\xd1\xdb\x34\xed\x9c"
8915                           "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
8916                           "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
8917                           "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
8918                           "\x58\xc6\x84\x75\xe4\xe9\x6b\x0c"
8919                           "\xe1\xc5\x0b\x73\x4d\x82\x55\xa8"
8920                           "\x85\xe1\x59\xf7",
8921                 .rlen   = 80 + 20,
8922        }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
8923 #ifdef __LITTLE_ENDIAN
8924                 .key    = "\x08\x00"            /* rta length */
8925                           "\x01\x00"            /* rta type */
8926 #else
8927                 .key    = "\x00\x08"            /* rta length */
8928                           "\x00\x01"            /* rta type */
8929 #endif
8930                           "\x00\x00\x00\x18"    /* enc key length */
8931                           "\x11\x22\x33\x44\x55\x66\x77\x88"
8932                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
8933                           "\x22\x33\x44\x55"
8934                           "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
8935                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
8936                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
8937                 .klen   = 8 + 20 + 24,
8938                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8939                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8940                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8941                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8942                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8943                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8944                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8945                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8946                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8947                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8948                 .ilen   = 64,
8949                 .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
8950                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
8951                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
8952                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
8953                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
8954                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
8955                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
8956                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
8957                           "\x73\xe3\x19\x3f\x8b\xc9\xc6\xf4"
8958                           "\x5a\xf1\x5b\xa8\x98\x07\xc5\x36"
8959                           "\x47\x4c\xfc\x36",
8960                 .rlen   = 64 + 20,
8961         }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
8962 #ifdef __LITTLE_ENDIAN
8963                 .key    = "\x08\x00"            /* rta length */
8964                           "\x01\x00"            /* rta type */
8965 #else
8966                 .key    = "\x00\x08"            /* rta length */
8967                           "\x00\x01"            /* rta type */
8968 #endif
8969                           "\x00\x00\x00\x20"    /* enc key length */
8970                           "\x11\x22\x33\x44\x55\x66\x77\x88"
8971                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
8972                           "\x22\x33\x44\x55"
8973                           "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
8974                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
8975                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
8976                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
8977                 .klen   = 8 + 20 + 32,
8978                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
8979                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
8980                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
8981                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
8982                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
8983                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
8984                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
8985                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
8986                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
8987                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
8988                 .ilen   = 64,
8989                 .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
8990                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
8991                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
8992                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
8993                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
8994                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
8995                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
8996                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
8997                           "\xa3\xe8\x9b\x17\xe3\xf4\x7f\xde"
8998                           "\x1b\x9f\xc6\x81\x26\x43\x4a\x87"
8999                           "\x51\xee\xd6\x4e",
9000                 .rlen   = 64 + 20,
9001         },
9002 };
9003
9004 static struct aead_testvec hmac_sha256_aes_cbc_enc_tv_template[] = {
9005         { /* RFC 3602 Case 1 */
9006 #ifdef __LITTLE_ENDIAN
9007                 .key    = "\x08\x00"            /* rta length */
9008                           "\x01\x00"            /* rta type */
9009 #else
9010                 .key    = "\x00\x08"            /* rta length */
9011                           "\x00\x01"            /* rta type */
9012 #endif
9013                           "\x00\x00\x00\x10"    /* enc key length */
9014                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9015                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9016                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9017                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9018                           "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
9019                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
9020                 .klen   = 8 + 32 + 16,
9021                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
9022                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
9023                 .input  = "Single block msg",
9024                 .ilen   = 16,
9025                 .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
9026                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
9027                           "\xcc\xde\x2d\x6a\xae\xf1\x0b\xcc"
9028                           "\x38\x06\x38\x51\xb4\xb8\xf3\x5b"
9029                           "\x5c\x34\xa6\xa3\x6e\x0b\x05\xe5"
9030                           "\x6a\x6d\x44\xaa\x26\xa8\x44\xa5",
9031                 .rlen   = 16 + 32,
9032         }, { /* RFC 3602 Case 2 */
9033 #ifdef __LITTLE_ENDIAN
9034                 .key    = "\x08\x00"            /* rta length */
9035                           "\x01\x00"            /* rta type */
9036 #else
9037                 .key    = "\x00\x08"            /* rta length */
9038                           "\x00\x01"            /* rta type */
9039 #endif
9040                           "\x00\x00\x00\x10"    /* enc key length */
9041                           "\x20\x21\x22\x23\x24\x25\x26\x27"
9042                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9043                           "\x30\x31\x32\x33\x34\x35\x36\x37"
9044                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9045                           "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
9046                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
9047                 .klen   = 8 + 32 + 16,
9048                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
9049                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
9050                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
9051                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9052                           "\x10\x11\x12\x13\x14\x15\x16\x17"
9053                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
9054                 .ilen   = 32,
9055                 .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
9056                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
9057                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
9058                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
9059                           "\xf5\x33\x53\xf3\x68\x85\x2a\x99"
9060                           "\x0e\x06\x58\x8f\xba\xf6\x06\xda"
9061                           "\x49\x69\x0d\x5b\xd4\x36\x06\x62"
9062                           "\x35\x5e\x54\x58\x53\x4d\xdf\xbf",
9063                 .rlen   = 32 + 32,
9064         }, { /* RFC 3602 Case 3 */
9065 #ifdef __LITTLE_ENDIAN
9066                 .key    = "\x08\x00"            /* rta length */
9067                           "\x01\x00"            /* rta type */
9068 #else
9069                 .key    = "\x00\x08"            /* rta length */
9070                           "\x00\x01"            /* rta type */
9071 #endif
9072                           "\x00\x00\x00\x10"    /* enc key length */
9073                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9074                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9075                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9076                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9077                           "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
9078                           "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
9079                 .klen   = 8 + 32 + 16,
9080                 .iv     = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
9081                           "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
9082                 .input  = "This is a 48-byte message (exactly 3 AES blocks)",
9083                 .ilen   = 48,
9084                 .result = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
9085                           "\xd4\x93\x66\x5d\x33\xf0\xe8\x86"
9086                           "\x2d\xea\x54\xcd\xb2\x93\xab\xc7"
9087                           "\x50\x69\x39\x27\x67\x72\xf8\xd5"
9088                           "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
9089                           "\x85\x79\x69\x5d\x83\xba\x26\x84"
9090                           "\x68\xb9\x3e\x90\x38\xa0\x88\x01"
9091                           "\xe7\xc6\xce\x10\x31\x2f\x9b\x1d"
9092                           "\x24\x78\xfb\xbe\x02\xe0\x4f\x40"
9093                           "\x10\xbd\xaa\xc6\xa7\x79\xe0\x1a",
9094                 .rlen   = 48 + 32,
9095         }, { /* RFC 3602 Case 4 */
9096 #ifdef __LITTLE_ENDIAN
9097                 .key    = "\x08\x00"            /* rta length */
9098                           "\x01\x00"            /* rta type */
9099 #else
9100                 .key    = "\x00\x08"            /* rta length */
9101                           "\x00\x01"            /* rta type */
9102 #endif
9103                           "\x00\x00\x00\x10"    /* enc key length */
9104                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9105                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9106                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9107                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9108                           "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
9109                           "\xbc\x46\x90\x3d\xba\x29\x03\x49",
9110                 .klen   = 8 + 32 + 16,
9111                 .iv     = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
9112                           "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
9113                 .input  = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9114                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9115                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9116                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9117                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9118                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9119                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9120                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
9121                 .ilen   = 64,
9122                 .result = "\xc3\x0e\x32\xff\xed\xc0\x77\x4e"
9123                           "\x6a\xff\x6a\xf0\x86\x9f\x71\xaa"
9124                           "\x0f\x3a\xf0\x7a\x9a\x31\xa9\xc6"
9125                           "\x84\xdb\x20\x7e\xb0\xef\x8e\x4e"
9126                           "\x35\x90\x7a\xa6\x32\xc3\xff\xdf"
9127                           "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
9128                           "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
9129                           "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
9130                           "\x7a\x1b\xd4\x3c\xdb\x17\x95\xe2"
9131                           "\xe0\x93\xec\xc9\x9f\xf7\xce\xd8"
9132                           "\x3f\x54\xe2\x49\x39\xe3\x71\x25"
9133                           "\x2b\x6c\xe9\x5d\xec\xec\x2b\x64",
9134                 .rlen   = 64 + 32,
9135         }, { /* RFC 3602 Case 5 */
9136 #ifdef __LITTLE_ENDIAN
9137                 .key    = "\x08\x00"            /* rta length */
9138                           "\x01\x00"            /* rta type */
9139 #else
9140                 .key    = "\x00\x08"            /* rta length */
9141                           "\x00\x01"            /* rta type */
9142 #endif
9143                           "\x00\x00\x00\x10"    /* enc key length */
9144                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9145                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9146                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9147                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9148                           "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
9149                           "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
9150                 .klen   = 8 + 32 + 16,
9151                 .iv     = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
9152                           "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
9153                 .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x01",
9154                 .alen   = 8,
9155                 .input  = "\x08\x00\x0e\xbd\xa7\x0a\x00\x00"
9156                           "\x8e\x9c\x08\x3d\xb9\x5b\x07\x00"
9157                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9158                           "\x10\x11\x12\x13\x14\x15\x16\x17"
9159                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9160                           "\x20\x21\x22\x23\x24\x25\x26\x27"
9161                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9162                           "\x30\x31\x32\x33\x34\x35\x36\x37"
9163                           "\x01\x02\x03\x04\x05\x06\x07\x08"
9164                           "\x09\x0a\x0b\x0c\x0d\x0e\x0e\x01",
9165                 .ilen   = 80,
9166                 .result = "\xf6\x63\xc2\x5d\x32\x5c\x18\xc6"
9167                           "\xa9\x45\x3e\x19\x4e\x12\x08\x49"
9168                           "\xa4\x87\x0b\x66\xcc\x6b\x99\x65"
9169                           "\x33\x00\x13\xb4\x89\x8d\xc8\x56"
9170                           "\xa4\x69\x9e\x52\x3a\x55\xdb\x08"
9171                           "\x0b\x59\xec\x3a\x8e\x4b\x7e\x52"
9172                           "\x77\x5b\x07\xd1\xdb\x34\xed\x9c"
9173                           "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
9174                           "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
9175                           "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
9176                           "\xbb\xd4\x0f\xbe\xa3\x3b\x4c\xb8"
9177                           "\x3a\xd2\xe1\x03\x86\xa5\x59\xb7"
9178                           "\x73\xc3\x46\x20\x2c\xb1\xef\x68"
9179                           "\xbb\x8a\x32\x7e\x12\x8c\x69\xcf",
9180                 .rlen   = 80 + 32,
9181        }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
9182 #ifdef __LITTLE_ENDIAN
9183                 .key    = "\x08\x00"            /* rta length */
9184                           "\x01\x00"            /* rta type */
9185 #else
9186                 .key    = "\x00\x08"            /* rta length */
9187                           "\x00\x01"            /* rta type */
9188 #endif
9189                           "\x00\x00\x00\x18"    /* enc key length */
9190                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9191                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9192                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9193                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9194                           "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
9195                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
9196                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
9197                 .klen   = 8 + 32 + 24,
9198                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
9199                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
9200                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
9201                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
9202                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
9203                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
9204                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
9205                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
9206                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
9207                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
9208                 .ilen   = 64,
9209                 .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
9210                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
9211                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
9212                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
9213                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
9214                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
9215                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
9216                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
9217                           "\x2f\xee\x5f\xdb\x66\xfe\x79\x09"
9218                           "\x61\x81\x31\xea\x5b\x3d\x8e\xfb"
9219                           "\xca\x71\x85\x93\xf7\x85\x55\x8b"
9220                           "\x7a\xe4\x94\xca\x8b\xba\x19\x33",
9221                 .rlen   = 64 + 32,
9222         }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
9223 #ifdef __LITTLE_ENDIAN
9224                 .key    = "\x08\x00"            /* rta length */
9225                           "\x01\x00"            /* rta type */
9226 #else
9227                 .key    = "\x00\x08"            /* rta length */
9228                           "\x00\x01"            /* rta type */
9229 #endif
9230                           "\x00\x00\x00\x20"    /* enc key length */
9231                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9232                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9233                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9234                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9235                           "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
9236                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
9237                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
9238                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
9239                 .klen   = 8 + 32 + 32,
9240                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
9241                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
9242                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
9243                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
9244                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
9245                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
9246                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
9247                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
9248                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
9249                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
9250                 .ilen   = 64,
9251                 .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
9252                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
9253                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
9254                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
9255                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
9256                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
9257                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
9258                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
9259                           "\x24\x29\xed\xc2\x31\x49\xdb\xb1"
9260                           "\x8f\x74\xbd\x17\x92\x03\xbe\x8f"
9261                           "\xf3\x61\xde\x1c\xe9\xdb\xcd\xd0"
9262                           "\xcc\xce\xe9\x85\x57\xcf\x6f\x5f",
9263                 .rlen   = 64 + 32,
9264         },
9265 };
9266
9267 static struct aead_testvec hmac_sha512_aes_cbc_enc_tv_template[] = {
9268         { /* RFC 3602 Case 1 */
9269 #ifdef __LITTLE_ENDIAN
9270                 .key    = "\x08\x00"            /* rta length */
9271                           "\x01\x00"            /* rta type */
9272 #else
9273                 .key    = "\x00\x08"            /* rta length */
9274                           "\x00\x01"            /* rta type */
9275 #endif
9276                           "\x00\x00\x00\x10"    /* enc key length */
9277                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9278                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9279                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9280                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9281                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9282                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9283                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9284                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9285                           "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
9286                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
9287                 .klen   = 8 + 64 + 16,
9288                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
9289                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
9290                 .input  = "Single block msg",
9291                 .ilen   = 16,
9292                 .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
9293                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
9294                           "\x3f\xdc\xad\x90\x03\x63\x5e\x68"
9295                           "\xc3\x13\xdd\xa4\x5c\x4d\x54\xa7"
9296                           "\x19\x6e\x03\x75\x2b\xa1\x62\xce"
9297                           "\xe0\xc6\x96\x75\xb2\x14\xca\x96"
9298                           "\xec\xbd\x50\x08\x07\x64\x1a\x49"
9299                           "\xe8\x9a\x7c\x06\x3d\xcb\xff\xb2"
9300                           "\xfa\x20\x89\xdd\x9c\xac\x9e\x16"
9301                           "\x18\x8a\xa0\x6d\x01\x6c\xa3\x3a",
9302                 .rlen   = 16 + 64,
9303         }, { /* RFC 3602 Case 2 */
9304 #ifdef __LITTLE_ENDIAN
9305                 .key    = "\x08\x00"            /* rta length */
9306                           "\x01\x00"            /* rta type */
9307 #else
9308                 .key    = "\x00\x08"            /* rta length */
9309                           "\x00\x01"            /* rta type */
9310 #endif
9311                           "\x00\x00\x00\x10"    /* enc key length */
9312                           "\x20\x21\x22\x23\x24\x25\x26\x27"
9313                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9314                           "\x30\x31\x32\x33\x34\x35\x36\x37"
9315                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9316                           "\x40\x41\x42\x43\x44\x45\x46\x47"
9317                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
9318                           "\x50\x51\x52\x53\x54\x55\x56\x57"
9319                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
9320                           "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
9321                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
9322                 .klen   = 8 + 64 + 16,
9323                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
9324                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
9325                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
9326                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9327                           "\x10\x11\x12\x13\x14\x15\x16\x17"
9328                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
9329                 .ilen   = 32,
9330                 .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
9331                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
9332                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
9333                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
9334                           "\xda\xb2\x0c\xb2\x26\xc4\xd5\xef"
9335                           "\x60\x38\xa4\x5e\x9a\x8c\x1b\x41"
9336                           "\x03\x9f\xc4\x64\x7f\x01\x42\x9b"
9337                           "\x0e\x1b\xea\xef\xbc\x88\x19\x5e"
9338                           "\x31\x7e\xc2\x95\xfc\x09\x32\x0a"
9339                           "\x46\x32\x7c\x41\x9c\x59\x3e\xe9"
9340                           "\x8f\x9f\xd4\x31\xd6\x22\xbd\xf8"
9341                           "\xf7\x0a\x94\xe5\xa9\xc3\xf6\x9d",
9342                 .rlen   = 32 + 64,
9343         }, { /* RFC 3602 Case 3 */
9344 #ifdef __LITTLE_ENDIAN
9345                 .key    = "\x08\x00"            /* rta length */
9346                           "\x01\x00"            /* rta type */
9347 #else
9348                 .key    = "\x00\x08"            /* rta length */
9349                           "\x00\x01"            /* rta type */
9350 #endif
9351                           "\x00\x00\x00\x10"    /* enc key length */
9352                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9353                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9354                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9355                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9356                           "\x33\x44\x55\x66\x77\x88\x99\xaa"
9357                           "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
9358                           "\x44\x55\x66\x77\x88\x99\xaa\xbb"
9359                           "\xcc\xdd\xee\xff\x11\x22\x33\x44"
9360                           "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
9361                           "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
9362                 .klen   = 8 + 64 + 16,
9363                 .iv     = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
9364                           "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
9365                 .input  = "This is a 48-byte message (exactly 3 AES blocks)",
9366                 .ilen   = 48,
9367                 .result = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
9368                           "\xd4\x93\x66\x5d\x33\xf0\xe8\x86"
9369                           "\x2d\xea\x54\xcd\xb2\x93\xab\xc7"
9370                           "\x50\x69\x39\x27\x67\x72\xf8\xd5"
9371                           "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
9372                           "\x85\x79\x69\x5d\x83\xba\x26\x84"
9373                           "\x64\x19\x17\x5b\x57\xe0\x21\x0f"
9374                           "\xca\xdb\xa1\x26\x38\x14\xa2\x69"
9375                           "\xdb\x54\x67\x80\xc0\x54\xe0\xfd"
9376                           "\x3e\x91\xe7\x91\x7f\x13\x38\x44"
9377                           "\xb7\xb1\xd6\xc8\x7d\x48\x8d\x41"
9378                           "\x08\xea\x29\x6c\x74\x67\x3f\xb0"
9379                           "\xac\x7f\x5c\x1d\xf5\xee\x22\x66"
9380                           "\x27\xa6\xb6\x13\xba\xba\xf0\xc2",
9381                 .rlen   = 48 + 64,
9382         }, { /* RFC 3602 Case 4 */
9383 #ifdef __LITTLE_ENDIAN
9384                 .key    = "\x08\x00"            /* rta length */
9385                           "\x01\x00"            /* rta type */
9386 #else
9387                 .key    = "\x00\x08"            /* rta length */
9388                           "\x00\x01"            /* rta type */
9389 #endif
9390                           "\x00\x00\x00\x10"    /* enc key length */
9391                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9392                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9393                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9394                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9395                           "\x33\x44\x55\x66\x77\x88\x99\xaa"
9396                           "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
9397                           "\x44\x55\x66\x77\x88\x99\xaa\xbb"
9398                           "\xcc\xdd\xee\xff\x11\x22\x33\x44"
9399                           "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
9400                           "\xbc\x46\x90\x3d\xba\x29\x03\x49",
9401                 .klen   = 8 + 64 + 16,
9402                 .iv     = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
9403                           "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
9404                 .input  = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9405                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9406                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9407                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9408                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9409                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9410                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9411                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
9412                 .ilen   = 64,
9413                 .result = "\xc3\x0e\x32\xff\xed\xc0\x77\x4e"
9414                           "\x6a\xff\x6a\xf0\x86\x9f\x71\xaa"
9415                           "\x0f\x3a\xf0\x7a\x9a\x31\xa9\xc6"
9416                           "\x84\xdb\x20\x7e\xb0\xef\x8e\x4e"
9417                           "\x35\x90\x7a\xa6\x32\xc3\xff\xdf"
9418                           "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
9419                           "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
9420                           "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
9421                           "\x82\xcd\x42\x28\x21\x20\x15\xcc"
9422                           "\xb7\xb2\x48\x40\xc7\x64\x41\x3a"
9423                           "\x61\x32\x82\x85\xcf\x27\xed\xb4"
9424                           "\xe4\x68\xa2\xf5\x79\x26\x27\xb2"
9425                           "\x51\x67\x6a\xc4\xf0\x66\x55\x50"
9426                           "\xbc\x6f\xed\xd5\x8d\xde\x23\x7c"
9427                           "\x62\x98\x14\xd7\x2f\x37\x8d\xdf"
9428                           "\xf4\x33\x80\xeb\x8e\xb4\xa4\xda",
9429                 .rlen   = 64 + 64,
9430         }, { /* RFC 3602 Case 5 */
9431 #ifdef __LITTLE_ENDIAN
9432                 .key    = "\x08\x00"            /* rta length */
9433                           "\x01\x00"            /* rta type */
9434 #else
9435                 .key    = "\x00\x08"            /* rta length */
9436                           "\x00\x01"            /* rta type */
9437 #endif
9438                           "\x00\x00\x00\x10"    /* enc key length */
9439                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9440                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9441                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9442                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9443                           "\x33\x44\x55\x66\x77\x88\x99\xaa"
9444                           "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
9445                           "\x44\x55\x66\x77\x88\x99\xaa\xbb"
9446                           "\xcc\xdd\xee\xff\x11\x22\x33\x44"
9447                           "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
9448                           "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
9449                 .klen   = 8 + 64 + 16,
9450                 .iv     = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
9451                           "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
9452                 .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x01",
9453                 .alen   = 8,
9454                 .input  = "\x08\x00\x0e\xbd\xa7\x0a\x00\x00"
9455                           "\x8e\x9c\x08\x3d\xb9\x5b\x07\x00"
9456                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9457                           "\x10\x11\x12\x13\x14\x15\x16\x17"
9458                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9459                           "\x20\x21\x22\x23\x24\x25\x26\x27"
9460                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9461                           "\x30\x31\x32\x33\x34\x35\x36\x37"
9462                           "\x01\x02\x03\x04\x05\x06\x07\x08"
9463                           "\x09\x0a\x0b\x0c\x0d\x0e\x0e\x01",
9464                 .ilen   = 80,
9465                 .result = "\xf6\x63\xc2\x5d\x32\x5c\x18\xc6"
9466                           "\xa9\x45\x3e\x19\x4e\x12\x08\x49"
9467                           "\xa4\x87\x0b\x66\xcc\x6b\x99\x65"
9468                           "\x33\x00\x13\xb4\x89\x8d\xc8\x56"
9469                           "\xa4\x69\x9e\x52\x3a\x55\xdb\x08"
9470                           "\x0b\x59\xec\x3a\x8e\x4b\x7e\x52"
9471                           "\x77\x5b\x07\xd1\xdb\x34\xed\x9c"
9472                           "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
9473                           "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
9474                           "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
9475                           "\x74\x84\x94\xe2\xd7\x7a\xf9\xbf"
9476                           "\x00\x8a\xa2\xd5\xb7\xf3\x60\xcf"
9477                           "\xa0\x47\xdf\x4e\x09\xf4\xb1\x7f"
9478                           "\x14\xd9\x3d\x53\x8e\x12\xb3\x00"
9479                           "\x4c\x0a\x4e\x32\x40\x43\x88\xce"
9480                           "\x92\x26\xc1\x76\x20\x11\xeb\xba"
9481                           "\x62\x4f\x9a\x62\x25\xc3\x75\x80"
9482                           "\xb7\x0a\x17\xf5\xd7\x94\xb4\x14",
9483                 .rlen   = 80 + 64,
9484        }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
9485 #ifdef __LITTLE_ENDIAN
9486                 .key    = "\x08\x00"            /* rta length */
9487                           "\x01\x00"            /* rta type */
9488 #else
9489                 .key    = "\x00\x08"            /* rta length */
9490                           "\x00\x01"            /* rta type */
9491 #endif
9492                           "\x00\x00\x00\x18"    /* enc key length */
9493                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9494                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9495                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9496                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9497                           "\x33\x44\x55\x66\x77\x88\x99\xaa"
9498                           "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
9499                           "\x44\x55\x66\x77\x88\x99\xaa\xbb"
9500                           "\xcc\xdd\xee\xff\x11\x22\x33\x44"
9501                           "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
9502                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
9503                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
9504                 .klen   = 8 + 64 + 24,
9505                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
9506                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
9507                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
9508                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
9509                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
9510                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
9511                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
9512                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
9513                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
9514                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
9515                 .ilen   = 64,
9516                 .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
9517                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
9518                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
9519                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
9520                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
9521                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
9522                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
9523                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
9524                           "\x77\x4b\x69\x9d\x3a\x0d\xb4\x99"
9525                           "\x8f\xc6\x8e\x0e\x72\x58\xe3\x56"
9526                           "\xbb\x21\xd2\x7d\x93\x11\x17\x91"
9527                           "\xc4\x83\xfd\x0a\xea\x71\xfe\x77"
9528                           "\xae\x6f\x0a\xa5\xf0\xcf\xe1\x35"
9529                           "\xba\x03\xd5\x32\xfa\x5f\x41\x58"
9530                           "\x8d\x43\x98\xa7\x94\x16\x07\x02"
9531                           "\x0f\xb6\x81\x50\x28\x95\x2e\x75",
9532                 .rlen   = 64 + 64,
9533         }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
9534 #ifdef __LITTLE_ENDIAN
9535                 .key    = "\x08\x00"            /* rta length */
9536                           "\x01\x00"            /* rta type */
9537 #else
9538                 .key    = "\x00\x08"            /* rta length */
9539                           "\x00\x01"            /* rta type */
9540 #endif
9541                           "\x00\x00\x00\x20"    /* enc key length */
9542                           "\x11\x22\x33\x44\x55\x66\x77\x88"
9543                           "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
9544                           "\x22\x33\x44\x55\x66\x77\x88\x99"
9545                           "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
9546                           "\x33\x44\x55\x66\x77\x88\x99\xaa"
9547                           "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
9548                           "\x44\x55\x66\x77\x88\x99\xaa\xbb"
9549                           "\xcc\xdd\xee\xff\x11\x22\x33\x44"
9550                           "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
9551                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
9552                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
9553                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
9554                 .klen   = 8 + 64 + 32,
9555                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
9556                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
9557                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
9558                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
9559                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
9560                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
9561                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
9562                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
9563                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
9564                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
9565                 .ilen   = 64,
9566                 .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
9567                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
9568                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
9569                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
9570                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
9571                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
9572                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
9573                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
9574                           "\xb2\x27\x69\x7f\x45\x64\x79\x2b"
9575                           "\xb7\xb8\x4c\xd4\x75\x94\x68\x40"
9576                           "\x2a\xea\x91\xc7\x3f\x7c\xed\x7b"
9577                           "\x95\x2c\x9b\xa8\xf5\xe5\x52\x8d"
9578                           "\x6b\xe1\xae\xf1\x74\xfa\x0d\x0c"
9579                           "\xe3\x8d\x64\xc3\x8d\xff\x7c\x8c"
9580                           "\xdb\xbf\xa0\xb4\x01\xa2\xa8\xa2"
9581                           "\x2c\xb1\x62\x2c\x10\xca\xf1\x21",
9582                 .rlen   = 64 + 64,
9583         },
9584 };
9585
9586 static struct cipher_testvec aes_lrw_enc_tv_template[] = {
9587         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
9588         { /* LRW-32-AES 1 */
9589                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
9590                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
9591                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
9592                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
9593                 .klen   = 32,
9594                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9595                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9596                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9597                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9598                 .ilen   = 16,
9599                 .result = "\xf1\xb2\x73\xcd\x65\xa3\xdf\x5f"
9600                           "\xe9\x5d\x48\x92\x54\x63\x4e\xb8",
9601                 .rlen   = 16,
9602         }, { /* LRW-32-AES 2 */
9603                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
9604                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
9605                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
9606                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
9607                 .klen   = 32,
9608                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9609                           "\x00\x00\x00\x00\x00\x00\x00\x02",
9610                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9611                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9612                 .ilen   = 16,
9613                 .result = "\x00\xc8\x2b\xae\x95\xbb\xcd\xe5"
9614                           "\x27\x4f\x07\x69\xb2\x60\xe1\x36",
9615                 .rlen   = 16,
9616         }, { /* LRW-32-AES 3 */
9617                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
9618                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
9619                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
9620                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
9621                 .klen   = 32,
9622                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9623                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9624                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9625                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9626                 .ilen   = 16,
9627                 .result = "\x76\x32\x21\x83\xed\x8f\xf1\x82"
9628                           "\xf9\x59\x62\x03\x69\x0e\x5e\x01",
9629                 .rlen   = 16,
9630         }, { /* LRW-32-AES 4 */
9631                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
9632                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
9633                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
9634                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
9635                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
9636                 .klen   = 40,
9637                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9638                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9639                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9640                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9641                 .ilen   = 16,
9642                 .result = "\x9c\x0f\x15\x2f\x55\xa2\xd8\xf0"
9643                           "\xd6\x7b\x8f\x9e\x28\x22\xbc\x41",
9644                 .rlen   = 16,
9645         }, { /* LRW-32-AES 5 */
9646                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
9647                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
9648                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
9649                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
9650                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
9651                 .klen   = 40,
9652                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9653                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9654                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9655                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9656                 .ilen   = 16,
9657                 .result = "\xd4\x27\x6a\x7f\x14\x91\x3d\x65"
9658                           "\xc8\x60\x48\x02\x87\xe3\x34\x06",
9659                 .rlen   = 16,
9660         }, { /* LRW-32-AES 6 */
9661                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
9662                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
9663                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
9664                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
9665                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
9666                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
9667                 .klen   = 48,
9668                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9669                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9670                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9671                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9672                 .ilen   = 16,
9673                 .result = "\xbd\x06\xb8\xe1\xdb\x98\x89\x9e"
9674                           "\xc4\x98\xe4\x91\xcf\x1c\x70\x2b",
9675                 .rlen   = 16,
9676         }, { /* LRW-32-AES 7 */
9677                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
9678                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
9679                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
9680                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
9681                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
9682                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
9683                 .klen   = 48,
9684                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9685                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9686                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9687                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9688                 .ilen   = 16,
9689                 .result = "\x5b\x90\x8e\xc1\xab\xdd\x67\x5f"
9690                           "\x3d\x69\x8a\x95\x53\xc8\x9c\xe5",
9691                 .rlen   = 16,
9692         }, {
9693 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
9694                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
9695                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
9696                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
9697                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
9698                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
9699                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
9700                 .klen   = 48,
9701                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9702                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9703                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
9704                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
9705                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
9706                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
9707                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
9708                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
9709                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
9710                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
9711                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
9712                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
9713                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
9714                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
9715                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
9716                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
9717                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
9718                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
9719                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
9720                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
9721                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
9722                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
9723                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
9724                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
9725                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
9726                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
9727                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
9728                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
9729                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
9730                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
9731                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
9732                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
9733                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
9734                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
9735                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
9736                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
9737                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
9738                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
9739                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
9740                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
9741                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
9742                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
9743                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
9744                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
9745                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
9746                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
9747                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
9748                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
9749                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
9750                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
9751                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
9752                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
9753                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
9754                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
9755                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
9756                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
9757                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
9758                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
9759                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
9760                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
9761                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
9762                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
9763                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
9764                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
9765                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
9766                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
9767                 .ilen   = 512,
9768                 .result = "\x1a\x1d\xa9\x30\xad\xf9\x2f\x9b"
9769                           "\xb6\x1d\xae\xef\xf0\x2f\xf8\x5a"
9770                           "\x39\x3c\xbf\x2a\xb2\x45\xb2\x23"
9771                           "\x1b\x63\x3c\xcf\xaa\xbe\xcf\x4e"
9772                           "\xfa\xe8\x29\xc2\x20\x68\x2b\x3c"
9773                           "\x2e\x8b\xf7\x6e\x25\xbd\xe3\x3d"
9774                           "\x66\x27\xd6\xaf\xd6\x64\x3e\xe3"
9775                           "\xe8\x58\x46\x97\x39\x51\x07\xde"
9776                           "\xcb\x37\xbc\xa9\xc0\x5f\x75\xc3"
9777                           "\x0e\x84\x23\x1d\x16\xd4\x1c\x59"
9778                           "\x9c\x1a\x02\x55\xab\x3a\x97\x1d"
9779                           "\xdf\xdd\xc7\x06\x51\xd7\x70\xae"
9780                           "\x23\xc6\x8c\xf5\x1e\xa0\xe5\x82"
9781                           "\xb8\xb2\xbf\x04\xa0\x32\x8e\x68"
9782                           "\xeb\xaf\x6e\x2d\x94\x22\x2f\xce"
9783                           "\x4c\xb5\x59\xe2\xa2\x2f\xa0\x98"
9784                           "\x1a\x97\xc6\xd4\xb5\x00\x59\xf2"
9785                           "\x84\x14\x72\xb1\x9a\x6e\xa3\x7f"
9786                           "\xea\x20\xe7\xcb\x65\x77\x3a\xdf"
9787                           "\xc8\x97\x67\x15\xc2\x2a\x27\xcc"
9788                           "\x18\x55\xa1\x24\x0b\x24\x24\xaf"
9789                           "\x5b\xec\x68\xb8\xc8\xf5\xba\x63"
9790                           "\xff\xed\x89\xce\xd5\x3d\x88\xf3"
9791                           "\x25\xef\x05\x7c\x3a\xef\xeb\xd8"
9792                           "\x7a\x32\x0d\xd1\x1e\x58\x59\x99"
9793                           "\x90\x25\xb5\x26\xb0\xe3\x2b\x6c"
9794                           "\x4c\xa9\x8b\x84\x4f\x5e\x01\x50"
9795                           "\x41\x30\x58\xc5\x62\x74\x52\x1d"
9796                           "\x45\x24\x6a\x42\x64\x4f\x97\x1c"
9797                           "\xa8\x66\xb5\x6d\x79\xd4\x0d\x48"
9798                           "\xc5\x5f\xf3\x90\x32\xdd\xdd\xe1"
9799                           "\xe4\xa9\x9f\xfc\xc3\x52\x5a\x46"
9800                           "\xe4\x81\x84\x95\x36\x59\x7a\x6b"
9801                           "\xaa\xb3\x60\xad\xce\x9f\x9f\x28"
9802                           "\xe0\x01\x75\x22\xc4\x4e\xa9\x62"
9803                           "\x5c\x62\x0d\x00\xcb\x13\xe8\x43"
9804                           "\x72\xd4\x2d\x53\x46\xb5\xd1\x16"
9805                           "\x22\x18\xdf\x34\x33\xf5\xd6\x1c"
9806                           "\xb8\x79\x78\x97\x94\xff\x72\x13"
9807                           "\x4c\x27\xfc\xcb\xbf\x01\x53\xa6"
9808                           "\xb4\x50\x6e\xde\xdf\xb5\x43\xa4"
9809                           "\x59\xdf\x52\xf9\x7c\xe0\x11\x6f"
9810                           "\x2d\x14\x8e\x24\x61\x2c\xe1\x17"
9811                           "\xcc\xce\x51\x0c\x19\x8a\x82\x30"
9812                           "\x94\xd5\x3d\x6a\x53\x06\x5e\xbd"
9813                           "\xb7\xeb\xfa\xfd\x27\x51\xde\x85"
9814                           "\x1e\x86\x53\x11\x53\x94\x00\xee"
9815                           "\x2b\x8c\x08\x2a\xbf\xdd\xae\x11"
9816                           "\xcb\x1e\xa2\x07\x9a\x80\xcf\x62"
9817                           "\x9b\x09\xdc\x95\x3c\x96\x8e\xb1"
9818                           "\x09\xbd\xe4\xeb\xdb\xca\x70\x7a"
9819                           "\x9e\xfa\x31\x18\x45\x3c\x21\x33"
9820                           "\xb0\xb3\x2b\xea\xf3\x71\x2d\xe1"
9821                           "\x03\xad\x1b\x48\xd4\x67\x27\xf0"
9822                           "\x62\xe4\x3d\xfb\x9b\x08\x76\xe7"
9823                           "\xdd\x2b\x01\x39\x04\x5a\x58\x7a"
9824                           "\xf7\x11\x90\xec\xbd\x51\x5c\x32"
9825                           "\x6b\xd7\x35\x39\x02\x6b\xf2\xa6"
9826                           "\xd0\x0d\x07\xe1\x06\xc4\x5b\x7d"
9827                           "\xe4\x6a\xd7\xee\x15\x1f\x83\xb4"
9828                           "\xa3\xa7\x5e\xc3\x90\xb7\xef\xd3"
9829                           "\xb7\x4f\xf8\x92\x4c\xb7\x3c\x29"
9830                           "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7"
9831                           "\x74\x3f\x7d\x58\x88\x75\xde\x3e",
9832                 .rlen   = 512,
9833                 .also_non_np = 1,
9834                 .np     = 2,
9835                 .tap    = { 512 - 16, 16 },
9836         }
9837 };
9838
9839 static struct cipher_testvec aes_lrw_dec_tv_template[] = {
9840         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
9841         /* same as enc vectors with input and result reversed */
9842         { /* LRW-32-AES 1 */
9843                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
9844                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
9845                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
9846                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
9847                 .klen   = 32,
9848                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9849                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9850                 .input  = "\xf1\xb2\x73\xcd\x65\xa3\xdf\x5f"
9851                           "\xe9\x5d\x48\x92\x54\x63\x4e\xb8",
9852                 .ilen   = 16,
9853                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9854                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9855                 .rlen   = 16,
9856         }, { /* LRW-32-AES 2 */
9857                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
9858                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
9859                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
9860                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
9861                 .klen   = 32,
9862                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9863                           "\x00\x00\x00\x00\x00\x00\x00\x02",
9864                 .input  = "\x00\xc8\x2b\xae\x95\xbb\xcd\xe5"
9865                           "\x27\x4f\x07\x69\xb2\x60\xe1\x36",
9866                 .ilen   = 16,
9867                 .result  = "\x30\x31\x32\x33\x34\x35\x36\x37"
9868                            "\x38\x39\x41\x42\x43\x44\x45\x46",
9869                 .rlen   = 16,
9870         }, { /* LRW-32-AES 3 */
9871                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
9872                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
9873                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
9874                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
9875                 .klen   = 32,
9876                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9877                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9878                 .input  = "\x76\x32\x21\x83\xed\x8f\xf1\x82"
9879                           "\xf9\x59\x62\x03\x69\x0e\x5e\x01",
9880                 .ilen   = 16,
9881                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9882                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9883                 .rlen   = 16,
9884         }, { /* LRW-32-AES 4 */
9885                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
9886                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
9887                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
9888                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
9889                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
9890                 .klen   = 40,
9891                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9892                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9893                 .input  = "\x9c\x0f\x15\x2f\x55\xa2\xd8\xf0"
9894                           "\xd6\x7b\x8f\x9e\x28\x22\xbc\x41",
9895                 .ilen   = 16,
9896                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9897                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9898                 .rlen   = 16,
9899         }, { /* LRW-32-AES 5 */
9900                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
9901                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
9902                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
9903                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
9904                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
9905                 .klen   = 40,
9906                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9907                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9908                 .input  = "\xd4\x27\x6a\x7f\x14\x91\x3d\x65"
9909                           "\xc8\x60\x48\x02\x87\xe3\x34\x06",
9910                 .ilen   = 16,
9911                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9912                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9913                 .rlen   = 16,
9914         }, { /* LRW-32-AES 6 */
9915                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
9916                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
9917                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
9918                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
9919                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
9920                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
9921                 .klen   = 48,
9922                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9923                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9924                 .input  = "\xbd\x06\xb8\xe1\xdb\x98\x89\x9e"
9925                           "\xc4\x98\xe4\x91\xcf\x1c\x70\x2b",
9926                 .ilen   = 16,
9927                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9928                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9929                 .rlen   = 16,
9930         }, { /* LRW-32-AES 7 */
9931                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
9932                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
9933                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
9934                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
9935                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
9936                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
9937                 .klen   = 48,
9938                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9939                           "\x00\x00\x00\x02\x00\x00\x00\x00",
9940                 .input  = "\x5b\x90\x8e\xc1\xab\xdd\x67\x5f"
9941                           "\x3d\x69\x8a\x95\x53\xc8\x9c\xe5",
9942                 .ilen   = 16,
9943                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
9944                           "\x38\x39\x41\x42\x43\x44\x45\x46",
9945                 .rlen   = 16,
9946         }, {
9947 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
9948                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
9949                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
9950                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
9951                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
9952                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
9953                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
9954                 .klen   = 48,
9955                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
9956                           "\x00\x00\x00\x00\x00\x00\x00\x01",
9957                 .input  = "\x1a\x1d\xa9\x30\xad\xf9\x2f\x9b"
9958                           "\xb6\x1d\xae\xef\xf0\x2f\xf8\x5a"
9959                           "\x39\x3c\xbf\x2a\xb2\x45\xb2\x23"
9960                           "\x1b\x63\x3c\xcf\xaa\xbe\xcf\x4e"
9961                           "\xfa\xe8\x29\xc2\x20\x68\x2b\x3c"
9962                           "\x2e\x8b\xf7\x6e\x25\xbd\xe3\x3d"
9963                           "\x66\x27\xd6\xaf\xd6\x64\x3e\xe3"
9964                           "\xe8\x58\x46\x97\x39\x51\x07\xde"
9965                           "\xcb\x37\xbc\xa9\xc0\x5f\x75\xc3"
9966                           "\x0e\x84\x23\x1d\x16\xd4\x1c\x59"
9967                           "\x9c\x1a\x02\x55\xab\x3a\x97\x1d"
9968                           "\xdf\xdd\xc7\x06\x51\xd7\x70\xae"
9969                           "\x23\xc6\x8c\xf5\x1e\xa0\xe5\x82"
9970                           "\xb8\xb2\xbf\x04\xa0\x32\x8e\x68"
9971                           "\xeb\xaf\x6e\x2d\x94\x22\x2f\xce"
9972                           "\x4c\xb5\x59\xe2\xa2\x2f\xa0\x98"
9973                           "\x1a\x97\xc6\xd4\xb5\x00\x59\xf2"
9974                           "\x84\x14\x72\xb1\x9a\x6e\xa3\x7f"
9975                           "\xea\x20\xe7\xcb\x65\x77\x3a\xdf"
9976                           "\xc8\x97\x67\x15\xc2\x2a\x27\xcc"
9977                           "\x18\x55\xa1\x24\x0b\x24\x24\xaf"
9978                           "\x5b\xec\x68\xb8\xc8\xf5\xba\x63"
9979                           "\xff\xed\x89\xce\xd5\x3d\x88\xf3"
9980                           "\x25\xef\x05\x7c\x3a\xef\xeb\xd8"
9981                           "\x7a\x32\x0d\xd1\x1e\x58\x59\x99"
9982                           "\x90\x25\xb5\x26\xb0\xe3\x2b\x6c"
9983                           "\x4c\xa9\x8b\x84\x4f\x5e\x01\x50"
9984                           "\x41\x30\x58\xc5\x62\x74\x52\x1d"
9985                           "\x45\x24\x6a\x42\x64\x4f\x97\x1c"
9986                           "\xa8\x66\xb5\x6d\x79\xd4\x0d\x48"
9987                           "\xc5\x5f\xf3\x90\x32\xdd\xdd\xe1"
9988                           "\xe4\xa9\x9f\xfc\xc3\x52\x5a\x46"
9989                           "\xe4\x81\x84\x95\x36\x59\x7a\x6b"
9990                           "\xaa\xb3\x60\xad\xce\x9f\x9f\x28"
9991                           "\xe0\x01\x75\x22\xc4\x4e\xa9\x62"
9992                           "\x5c\x62\x0d\x00\xcb\x13\xe8\x43"
9993                           "\x72\xd4\x2d\x53\x46\xb5\xd1\x16"
9994                           "\x22\x18\xdf\x34\x33\xf5\xd6\x1c"
9995                           "\xb8\x79\x78\x97\x94\xff\x72\x13"
9996                           "\x4c\x27\xfc\xcb\xbf\x01\x53\xa6"
9997                           "\xb4\x50\x6e\xde\xdf\xb5\x43\xa4"
9998                           "\x59\xdf\x52\xf9\x7c\xe0\x11\x6f"
9999                           "\x2d\x14\x8e\x24\x61\x2c\xe1\x17"
10000                           "\xcc\xce\x51\x0c\x19\x8a\x82\x30"
10001                           "\x94\xd5\x3d\x6a\x53\x06\x5e\xbd"
10002                           "\xb7\xeb\xfa\xfd\x27\x51\xde\x85"
10003                           "\x1e\x86\x53\x11\x53\x94\x00\xee"
10004                           "\x2b\x8c\x08\x2a\xbf\xdd\xae\x11"
10005                           "\xcb\x1e\xa2\x07\x9a\x80\xcf\x62"
10006                           "\x9b\x09\xdc\x95\x3c\x96\x8e\xb1"
10007                           "\x09\xbd\xe4\xeb\xdb\xca\x70\x7a"
10008                           "\x9e\xfa\x31\x18\x45\x3c\x21\x33"
10009                           "\xb0\xb3\x2b\xea\xf3\x71\x2d\xe1"
10010                           "\x03\xad\x1b\x48\xd4\x67\x27\xf0"
10011                           "\x62\xe4\x3d\xfb\x9b\x08\x76\xe7"
10012                           "\xdd\x2b\x01\x39\x04\x5a\x58\x7a"
10013                           "\xf7\x11\x90\xec\xbd\x51\x5c\x32"
10014                           "\x6b\xd7\x35\x39\x02\x6b\xf2\xa6"
10015                           "\xd0\x0d\x07\xe1\x06\xc4\x5b\x7d"
10016                           "\xe4\x6a\xd7\xee\x15\x1f\x83\xb4"
10017                           "\xa3\xa7\x5e\xc3\x90\xb7\xef\xd3"
10018                           "\xb7\x4f\xf8\x92\x4c\xb7\x3c\x29"
10019                           "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7"
10020                           "\x74\x3f\x7d\x58\x88\x75\xde\x3e",
10021                 .ilen   = 512,
10022                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
10023                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
10024                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
10025                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
10026                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
10027                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
10028                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
10029                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
10030                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
10031                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
10032                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
10033                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
10034                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
10035                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
10036                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
10037                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
10038                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
10039                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
10040                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
10041                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
10042                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
10043                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
10044                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
10045                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
10046                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
10047                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
10048                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
10049                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
10050                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
10051                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
10052                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
10053                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
10054                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
10055                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
10056                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
10057                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
10058                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
10059                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
10060                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
10061                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
10062                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
10063                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
10064                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
10065                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
10066                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
10067                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
10068                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
10069                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
10070                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
10071                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
10072                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
10073                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
10074                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
10075                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
10076                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
10077                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
10078                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
10079                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
10080                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
10081                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
10082                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
10083                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
10084                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
10085                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
10086                 .rlen   = 512,
10087                 .also_non_np = 1,
10088                 .np     = 2,
10089                 .tap    = { 512 - 16, 16 },
10090         }
10091 };
10092
10093 static struct cipher_testvec aes_xts_enc_tv_template[] = {
10094         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
10095         { /* XTS-AES 1 */
10096                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
10097                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10098                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10099                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10100                 .klen   = 32,
10101                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
10102                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10103                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10104                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10105                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10106                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10107                 .ilen   = 32,
10108                 .result = "\x91\x7c\xf6\x9e\xbd\x68\xb2\xec"
10109                           "\x9b\x9f\xe9\xa3\xea\xdd\xa6\x92"
10110                           "\xcd\x43\xd2\xf5\x95\x98\xed\x85"
10111                           "\x8c\x02\xc2\x65\x2f\xbf\x92\x2e",
10112                 .rlen   = 32,
10113         }, { /* XTS-AES 2 */
10114                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
10115                           "\x11\x11\x11\x11\x11\x11\x11\x11"
10116                           "\x22\x22\x22\x22\x22\x22\x22\x22"
10117                           "\x22\x22\x22\x22\x22\x22\x22\x22",
10118                 .klen   = 32,
10119                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
10120                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10121                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
10122                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10123                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10124                           "\x44\x44\x44\x44\x44\x44\x44\x44",
10125                 .ilen   = 32,
10126                 .result = "\xc4\x54\x18\x5e\x6a\x16\x93\x6e"
10127                           "\x39\x33\x40\x38\xac\xef\x83\x8b"
10128                           "\xfb\x18\x6f\xff\x74\x80\xad\xc4"
10129                           "\x28\x93\x82\xec\xd6\xd3\x94\xf0",
10130                 .rlen   = 32,
10131         }, { /* XTS-AES 3 */
10132                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
10133                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
10134                           "\x22\x22\x22\x22\x22\x22\x22\x22"
10135                           "\x22\x22\x22\x22\x22\x22\x22\x22",
10136                 .klen   = 32,
10137                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
10138                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10139                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
10140                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10141                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10142                           "\x44\x44\x44\x44\x44\x44\x44\x44",
10143                 .ilen   = 32,
10144                 .result = "\xaf\x85\x33\x6b\x59\x7a\xfc\x1a"
10145                           "\x90\x0b\x2e\xb2\x1e\xc9\x49\xd2"
10146                           "\x92\xdf\x4c\x04\x7e\x0b\x21\x53"
10147                           "\x21\x86\xa5\x97\x1a\x22\x7a\x89",
10148                 .rlen   = 32,
10149         }, { /* XTS-AES 4 */
10150                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
10151                           "\x23\x53\x60\x28\x74\x71\x35\x26"
10152                           "\x31\x41\x59\x26\x53\x58\x97\x93"
10153                           "\x23\x84\x62\x64\x33\x83\x27\x95",
10154                 .klen   = 32,
10155                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
10156                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10157                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10158                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10159                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10160                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10161                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10162                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10163                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10164                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10165                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10166                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10167                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10168                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10169                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10170                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10171                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10172                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10173                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10174                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10175                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10176                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10177                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10178                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10179                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10180                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10181                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10182                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10183                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10184                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10185                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10186                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10187                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10188                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
10189                           "\x00\x01\x02\x03\x04\x05\x06\x07"
10190                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10191                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10192                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10193                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10194                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10195                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10196                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10197                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10198                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10199                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10200                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10201                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10202                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10203                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10204                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10205                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10206                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10207                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10208                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10209                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10210                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10211                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10212                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10213                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10214                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10215                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10216                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10217                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10218                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10219                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10220                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10221                 .ilen   = 512,
10222                 .result = "\x27\xa7\x47\x9b\xef\xa1\xd4\x76"
10223                           "\x48\x9f\x30\x8c\xd4\xcf\xa6\xe2"
10224                           "\xa9\x6e\x4b\xbe\x32\x08\xff\x25"
10225                           "\x28\x7d\xd3\x81\x96\x16\xe8\x9c"
10226                           "\xc7\x8c\xf7\xf5\xe5\x43\x44\x5f"
10227                           "\x83\x33\xd8\xfa\x7f\x56\x00\x00"
10228                           "\x05\x27\x9f\xa5\xd8\xb5\xe4\xad"
10229                           "\x40\xe7\x36\xdd\xb4\xd3\x54\x12"
10230                           "\x32\x80\x63\xfd\x2a\xab\x53\xe5"
10231                           "\xea\x1e\x0a\x9f\x33\x25\x00\xa5"
10232                           "\xdf\x94\x87\xd0\x7a\x5c\x92\xcc"
10233                           "\x51\x2c\x88\x66\xc7\xe8\x60\xce"
10234                           "\x93\xfd\xf1\x66\xa2\x49\x12\xb4"
10235                           "\x22\x97\x61\x46\xae\x20\xce\x84"
10236                           "\x6b\xb7\xdc\x9b\xa9\x4a\x76\x7a"
10237                           "\xae\xf2\x0c\x0d\x61\xad\x02\x65"
10238                           "\x5e\xa9\x2d\xc4\xc4\xe4\x1a\x89"
10239                           "\x52\xc6\x51\xd3\x31\x74\xbe\x51"
10240                           "\xa1\x0c\x42\x11\x10\xe6\xd8\x15"
10241                           "\x88\xed\xe8\x21\x03\xa2\x52\xd8"
10242                           "\xa7\x50\xe8\x76\x8d\xef\xff\xed"
10243                           "\x91\x22\x81\x0a\xae\xb9\x9f\x91"
10244                           "\x72\xaf\x82\xb6\x04\xdc\x4b\x8e"
10245                           "\x51\xbc\xb0\x82\x35\xa6\xf4\x34"
10246                           "\x13\x32\xe4\xca\x60\x48\x2a\x4b"
10247                           "\xa1\xa0\x3b\x3e\x65\x00\x8f\xc5"
10248                           "\xda\x76\xb7\x0b\xf1\x69\x0d\xb4"
10249                           "\xea\xe2\x9c\x5f\x1b\xad\xd0\x3c"
10250                           "\x5c\xcf\x2a\x55\xd7\x05\xdd\xcd"
10251                           "\x86\xd4\x49\x51\x1c\xeb\x7e\xc3"
10252                           "\x0b\xf1\x2b\x1f\xa3\x5b\x91\x3f"
10253                           "\x9f\x74\x7a\x8a\xfd\x1b\x13\x0e"
10254                           "\x94\xbf\xf9\x4e\xff\xd0\x1a\x91"
10255                           "\x73\x5c\xa1\x72\x6a\xcd\x0b\x19"
10256                           "\x7c\x4e\x5b\x03\x39\x36\x97\xe1"
10257                           "\x26\x82\x6f\xb6\xbb\xde\x8e\xcc"
10258                           "\x1e\x08\x29\x85\x16\xe2\xc9\xed"
10259                           "\x03\xff\x3c\x1b\x78\x60\xf6\xde"
10260                           "\x76\xd4\xce\xcd\x94\xc8\x11\x98"
10261                           "\x55\xef\x52\x97\xca\x67\xe9\xf3"
10262                           "\xe7\xff\x72\xb1\xe9\x97\x85\xca"
10263                           "\x0a\x7e\x77\x20\xc5\xb3\x6d\xc6"
10264                           "\xd7\x2c\xac\x95\x74\xc8\xcb\xbc"
10265                           "\x2f\x80\x1e\x23\xe5\x6f\xd3\x44"
10266                           "\xb0\x7f\x22\x15\x4b\xeb\xa0\xf0"
10267                           "\x8c\xe8\x89\x1e\x64\x3e\xd9\x95"
10268                           "\xc9\x4d\x9a\x69\xc9\xf1\xb5\xf4"
10269                           "\x99\x02\x7a\x78\x57\x2a\xee\xbd"
10270                           "\x74\xd2\x0c\xc3\x98\x81\xc2\x13"
10271                           "\xee\x77\x0b\x10\x10\xe4\xbe\xa7"
10272                           "\x18\x84\x69\x77\xae\x11\x9f\x7a"
10273                           "\x02\x3a\xb5\x8c\xca\x0a\xd7\x52"
10274                           "\xaf\xe6\x56\xbb\x3c\x17\x25\x6a"
10275                           "\x9f\x6e\x9b\xf1\x9f\xdd\x5a\x38"
10276                           "\xfc\x82\xbb\xe8\x72\xc5\x53\x9e"
10277                           "\xdb\x60\x9e\xf4\xf7\x9c\x20\x3e"
10278                           "\xbb\x14\x0f\x2e\x58\x3c\xb2\xad"
10279                           "\x15\xb4\xaa\x5b\x65\x50\x16\xa8"
10280                           "\x44\x92\x77\xdb\xd4\x77\xef\x2c"
10281                           "\x8d\x6c\x01\x7d\xb7\x38\xb1\x8d"
10282                           "\xeb\x4a\x42\x7d\x19\x23\xce\x3f"
10283                           "\xf2\x62\x73\x57\x79\xa4\x18\xf2"
10284                           "\x0a\x28\x2d\xf9\x20\x14\x7b\xea"
10285                           "\xbe\x42\x1e\xe5\x31\x9d\x05\x68",
10286                 .rlen   = 512,
10287         }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
10288                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
10289                           "\x23\x53\x60\x28\x74\x71\x35\x26"
10290                           "\x62\x49\x77\x57\x24\x70\x93\x69"
10291                           "\x99\x59\x57\x49\x66\x96\x76\x27"
10292                           "\x31\x41\x59\x26\x53\x58\x97\x93"
10293                           "\x23\x84\x62\x64\x33\x83\x27\x95"
10294                           "\x02\x88\x41\x97\x16\x93\x99\x37"
10295                           "\x51\x05\x82\x09\x74\x94\x45\x92",
10296                 .klen   = 64,
10297                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
10298                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10299                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10300                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10301                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10302                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10303                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10304                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10305                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10306                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10307                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10308                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10309                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10310                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10311                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10312                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10313                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10314                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10315                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10316                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10317                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10318                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10319                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10320                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10321                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10322                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10323                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10324                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10325                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10326                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10327                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10328                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10329                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10330                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10331                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10332                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
10333                           "\x00\x01\x02\x03\x04\x05\x06\x07"
10334                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10335                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10336                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10337                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10338                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10339                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10340                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10341                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10342                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10343                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10344                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10345                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10346                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10347                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10348                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10349                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10350                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10351                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10352                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10353                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10354                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10355                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10356                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10357                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10358                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10359                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10360                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10361                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10362                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10363                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10364                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10365                 .ilen   = 512,
10366                 .result = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
10367                           "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
10368                           "\xea\x00\x80\x3f\x5e\x48\x23\x57"
10369                           "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
10370                           "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
10371                           "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
10372                           "\x68\x0a\x86\xac\x35\xad\xfc\x33"
10373                           "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
10374                           "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
10375                           "\xb1\x08\xfd\x10\x98\xba\xec\x70"
10376                           "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
10377                           "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
10378                           "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
10379                           "\xae\xba\x12\x29\x61\xd0\x3a\x75"
10380                           "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
10381                           "\x00\x02\x08\x87\x89\x14\x29\xca"
10382                           "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
10383                           "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
10384                           "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
10385                           "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
10386                           "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
10387                           "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
10388                           "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
10389                           "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
10390                           "\x93\xec\x05\xc5\x2e\x04\x93\xef"
10391                           "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
10392                           "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
10393                           "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
10394                           "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
10395                           "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
10396                           "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
10397                           "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
10398                           "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
10399                           "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
10400                           "\xbc\x48\x14\x57\x77\x8f\x61\x60"
10401                           "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
10402                           "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
10403                           "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
10404                           "\xf4\xc3\x33\xec\x44\x23\x88\x51"
10405                           "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
10406                           "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
10407                           "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
10408                           "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
10409                           "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
10410                           "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
10411                           "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
10412                           "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
10413                           "\x92\x5f\xed\xc4\xae\x74\xff\xac"
10414                           "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
10415                           "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
10416                           "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
10417                           "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
10418                           "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
10419                           "\x94\x30\x54\xff\x84\x01\x14\x93"
10420                           "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
10421                           "\x53\x76\x44\x1a\x77\xed\x43\x85"
10422                           "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
10423                           "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
10424                           "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
10425                           "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
10426                           "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
10427                           "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
10428                           "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
10429                           "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
10430                 .rlen   = 512,
10431                 .also_non_np = 1,
10432                 .np     = 2,
10433                 .tap    = { 512 - 16, 16 },
10434         }
10435 };
10436
10437 static struct cipher_testvec aes_xts_dec_tv_template[] = {
10438         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
10439         { /* XTS-AES 1 */
10440                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
10441                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10442                           "\x00\x00\x00\x00\x00\x00\x00\x00"
10443                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10444                 .klen   = 32,
10445                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
10446                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10447                 .input = "\x91\x7c\xf6\x9e\xbd\x68\xb2\xec"
10448                          "\x9b\x9f\xe9\xa3\xea\xdd\xa6\x92"
10449                          "\xcd\x43\xd2\xf5\x95\x98\xed\x85"
10450                          "\x8c\x02\xc2\x65\x2f\xbf\x92\x2e",
10451                 .ilen   = 32,
10452                 .result  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10453                            "\x00\x00\x00\x00\x00\x00\x00\x00"
10454                            "\x00\x00\x00\x00\x00\x00\x00\x00"
10455                            "\x00\x00\x00\x00\x00\x00\x00\x00",
10456                 .rlen   = 32,
10457         }, { /* XTS-AES 2 */
10458                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
10459                           "\x11\x11\x11\x11\x11\x11\x11\x11"
10460                           "\x22\x22\x22\x22\x22\x22\x22\x22"
10461                           "\x22\x22\x22\x22\x22\x22\x22\x22",
10462                 .klen   = 32,
10463                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
10464                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10465                 .input  = "\xc4\x54\x18\x5e\x6a\x16\x93\x6e"
10466                           "\x39\x33\x40\x38\xac\xef\x83\x8b"
10467                           "\xfb\x18\x6f\xff\x74\x80\xad\xc4"
10468                           "\x28\x93\x82\xec\xd6\xd3\x94\xf0",
10469                 .ilen   = 32,
10470                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
10471                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10472                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10473                           "\x44\x44\x44\x44\x44\x44\x44\x44",
10474                 .rlen   = 32,
10475         }, { /* XTS-AES 3 */
10476                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
10477                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
10478                           "\x22\x22\x22\x22\x22\x22\x22\x22"
10479                           "\x22\x22\x22\x22\x22\x22\x22\x22",
10480                 .klen   = 32,
10481                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
10482                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10483                 .input = "\xaf\x85\x33\x6b\x59\x7a\xfc\x1a"
10484                           "\x90\x0b\x2e\xb2\x1e\xc9\x49\xd2"
10485                           "\x92\xdf\x4c\x04\x7e\x0b\x21\x53"
10486                           "\x21\x86\xa5\x97\x1a\x22\x7a\x89",
10487                 .ilen   = 32,
10488                 .result  = "\x44\x44\x44\x44\x44\x44\x44\x44"
10489                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10490                           "\x44\x44\x44\x44\x44\x44\x44\x44"
10491                           "\x44\x44\x44\x44\x44\x44\x44\x44",
10492                 .rlen   = 32,
10493         }, { /* XTS-AES 4 */
10494                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
10495                           "\x23\x53\x60\x28\x74\x71\x35\x26"
10496                           "\x31\x41\x59\x26\x53\x58\x97\x93"
10497                           "\x23\x84\x62\x64\x33\x83\x27\x95",
10498                 .klen   = 32,
10499                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
10500                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10501                 .input  = "\x27\xa7\x47\x9b\xef\xa1\xd4\x76"
10502                           "\x48\x9f\x30\x8c\xd4\xcf\xa6\xe2"
10503                           "\xa9\x6e\x4b\xbe\x32\x08\xff\x25"
10504                           "\x28\x7d\xd3\x81\x96\x16\xe8\x9c"
10505                           "\xc7\x8c\xf7\xf5\xe5\x43\x44\x5f"
10506                           "\x83\x33\xd8\xfa\x7f\x56\x00\x00"
10507                           "\x05\x27\x9f\xa5\xd8\xb5\xe4\xad"
10508                           "\x40\xe7\x36\xdd\xb4\xd3\x54\x12"
10509                           "\x32\x80\x63\xfd\x2a\xab\x53\xe5"
10510                           "\xea\x1e\x0a\x9f\x33\x25\x00\xa5"
10511                           "\xdf\x94\x87\xd0\x7a\x5c\x92\xcc"
10512                           "\x51\x2c\x88\x66\xc7\xe8\x60\xce"
10513                           "\x93\xfd\xf1\x66\xa2\x49\x12\xb4"
10514                           "\x22\x97\x61\x46\xae\x20\xce\x84"
10515                           "\x6b\xb7\xdc\x9b\xa9\x4a\x76\x7a"
10516                           "\xae\xf2\x0c\x0d\x61\xad\x02\x65"
10517                           "\x5e\xa9\x2d\xc4\xc4\xe4\x1a\x89"
10518                           "\x52\xc6\x51\xd3\x31\x74\xbe\x51"
10519                           "\xa1\x0c\x42\x11\x10\xe6\xd8\x15"
10520                           "\x88\xed\xe8\x21\x03\xa2\x52\xd8"
10521                           "\xa7\x50\xe8\x76\x8d\xef\xff\xed"
10522                           "\x91\x22\x81\x0a\xae\xb9\x9f\x91"
10523                           "\x72\xaf\x82\xb6\x04\xdc\x4b\x8e"
10524                           "\x51\xbc\xb0\x82\x35\xa6\xf4\x34"
10525                           "\x13\x32\xe4\xca\x60\x48\x2a\x4b"
10526                           "\xa1\xa0\x3b\x3e\x65\x00\x8f\xc5"
10527                           "\xda\x76\xb7\x0b\xf1\x69\x0d\xb4"
10528                           "\xea\xe2\x9c\x5f\x1b\xad\xd0\x3c"
10529                           "\x5c\xcf\x2a\x55\xd7\x05\xdd\xcd"
10530                           "\x86\xd4\x49\x51\x1c\xeb\x7e\xc3"
10531                           "\x0b\xf1\x2b\x1f\xa3\x5b\x91\x3f"
10532                           "\x9f\x74\x7a\x8a\xfd\x1b\x13\x0e"
10533                           "\x94\xbf\xf9\x4e\xff\xd0\x1a\x91"
10534                           "\x73\x5c\xa1\x72\x6a\xcd\x0b\x19"
10535                           "\x7c\x4e\x5b\x03\x39\x36\x97\xe1"
10536                           "\x26\x82\x6f\xb6\xbb\xde\x8e\xcc"
10537                           "\x1e\x08\x29\x85\x16\xe2\xc9\xed"
10538                           "\x03\xff\x3c\x1b\x78\x60\xf6\xde"
10539                           "\x76\xd4\xce\xcd\x94\xc8\x11\x98"
10540                           "\x55\xef\x52\x97\xca\x67\xe9\xf3"
10541                           "\xe7\xff\x72\xb1\xe9\x97\x85\xca"
10542                           "\x0a\x7e\x77\x20\xc5\xb3\x6d\xc6"
10543                           "\xd7\x2c\xac\x95\x74\xc8\xcb\xbc"
10544                           "\x2f\x80\x1e\x23\xe5\x6f\xd3\x44"
10545                           "\xb0\x7f\x22\x15\x4b\xeb\xa0\xf0"
10546                           "\x8c\xe8\x89\x1e\x64\x3e\xd9\x95"
10547                           "\xc9\x4d\x9a\x69\xc9\xf1\xb5\xf4"
10548                           "\x99\x02\x7a\x78\x57\x2a\xee\xbd"
10549                           "\x74\xd2\x0c\xc3\x98\x81\xc2\x13"
10550                           "\xee\x77\x0b\x10\x10\xe4\xbe\xa7"
10551                           "\x18\x84\x69\x77\xae\x11\x9f\x7a"
10552                           "\x02\x3a\xb5\x8c\xca\x0a\xd7\x52"
10553                           "\xaf\xe6\x56\xbb\x3c\x17\x25\x6a"
10554                           "\x9f\x6e\x9b\xf1\x9f\xdd\x5a\x38"
10555                           "\xfc\x82\xbb\xe8\x72\xc5\x53\x9e"
10556                           "\xdb\x60\x9e\xf4\xf7\x9c\x20\x3e"
10557                           "\xbb\x14\x0f\x2e\x58\x3c\xb2\xad"
10558                           "\x15\xb4\xaa\x5b\x65\x50\x16\xa8"
10559                           "\x44\x92\x77\xdb\xd4\x77\xef\x2c"
10560                           "\x8d\x6c\x01\x7d\xb7\x38\xb1\x8d"
10561                           "\xeb\x4a\x42\x7d\x19\x23\xce\x3f"
10562                           "\xf2\x62\x73\x57\x79\xa4\x18\xf2"
10563                           "\x0a\x28\x2d\xf9\x20\x14\x7b\xea"
10564                           "\xbe\x42\x1e\xe5\x31\x9d\x05\x68",
10565                 .ilen   = 512,
10566                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
10567                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10568                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10569                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10570                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10571                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10572                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10573                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10574                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10575                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10576                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10577                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10578                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10579                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10580                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10581                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10582                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10583                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10584                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10585                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10586                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10587                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10588                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10589                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10590                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10591                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10592                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10593                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10594                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10595                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10596                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10597                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
10598                           "\x00\x01\x02\x03\x04\x05\x06\x07"
10599                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10600                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10601                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10602                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10603                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10604                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10605                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10606                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10607                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10608                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10609                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10610                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10611                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10612                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10613                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10614                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10615                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10616                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10617                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10618                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10619                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10620                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10621                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10622                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10623                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10624                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10625                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10626                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10627                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10628                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10629                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10630                 .rlen   = 512,
10631         }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
10632                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
10633                           "\x23\x53\x60\x28\x74\x71\x35\x26"
10634                           "\x62\x49\x77\x57\x24\x70\x93\x69"
10635                           "\x99\x59\x57\x49\x66\x96\x76\x27"
10636                           "\x31\x41\x59\x26\x53\x58\x97\x93"
10637                           "\x23\x84\x62\x64\x33\x83\x27\x95"
10638                           "\x02\x88\x41\x97\x16\x93\x99\x37"
10639                           "\x51\x05\x82\x09\x74\x94\x45\x92",
10640                 .klen   = 64,
10641                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
10642                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10643                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10644                           "\x00\x00\x00\x00\x00\x00\x00\x00",
10645                 .input  = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
10646                           "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
10647                           "\xea\x00\x80\x3f\x5e\x48\x23\x57"
10648                           "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
10649                           "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
10650                           "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
10651                           "\x68\x0a\x86\xac\x35\xad\xfc\x33"
10652                           "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
10653                           "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
10654                           "\xb1\x08\xfd\x10\x98\xba\xec\x70"
10655                           "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
10656                           "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
10657                           "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
10658                           "\xae\xba\x12\x29\x61\xd0\x3a\x75"
10659                           "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
10660                           "\x00\x02\x08\x87\x89\x14\x29\xca"
10661                           "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
10662                           "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
10663                           "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
10664                           "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
10665                           "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
10666                           "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
10667                           "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
10668                           "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
10669                           "\x93\xec\x05\xc5\x2e\x04\x93\xef"
10670                           "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
10671                           "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
10672                           "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
10673                           "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
10674                           "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
10675                           "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
10676                           "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
10677                           "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
10678                           "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
10679                           "\xbc\x48\x14\x57\x77\x8f\x61\x60"
10680                           "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
10681                           "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
10682                           "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
10683                           "\xf4\xc3\x33\xec\x44\x23\x88\x51"
10684                           "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
10685                           "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
10686                           "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
10687                           "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
10688                           "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
10689                           "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
10690                           "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
10691                           "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
10692                           "\x92\x5f\xed\xc4\xae\x74\xff\xac"
10693                           "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
10694                           "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
10695                           "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
10696                           "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
10697                           "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
10698                           "\x94\x30\x54\xff\x84\x01\x14\x93"
10699                           "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
10700                           "\x53\x76\x44\x1a\x77\xed\x43\x85"
10701                           "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
10702                           "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
10703                           "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
10704                           "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
10705                           "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
10706                           "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
10707                           "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
10708                           "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
10709                 .ilen   = 512,
10710                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
10711                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10712                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10713                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10714                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10715                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10716                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10717                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10718                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10719                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10720                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10721                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10722                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10723                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10724                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10725                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10726                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10727                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10728                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10729                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10730                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10731                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10732                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10733                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10734                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10735                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10736                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10737                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10738                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10739                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10740                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10741                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
10742                           "\x00\x01\x02\x03\x04\x05\x06\x07"
10743                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10744                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10745                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10746                           "\x20\x21\x22\x23\x24\x25\x26\x27"
10747                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10748                           "\x30\x31\x32\x33\x34\x35\x36\x37"
10749                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10750                           "\x40\x41\x42\x43\x44\x45\x46\x47"
10751                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10752                           "\x50\x51\x52\x53\x54\x55\x56\x57"
10753                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10754                           "\x60\x61\x62\x63\x64\x65\x66\x67"
10755                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10756                           "\x70\x71\x72\x73\x74\x75\x76\x77"
10757                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10758                           "\x80\x81\x82\x83\x84\x85\x86\x87"
10759                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10760                           "\x90\x91\x92\x93\x94\x95\x96\x97"
10761                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10762                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10763                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10764                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10765                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10766                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10767                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10768                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10769                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10770                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10771                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10772                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10773                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10774                 .rlen   = 512,
10775                 .also_non_np = 1,
10776                 .np     = 2,
10777                 .tap    = { 512 - 16, 16 },
10778         }
10779 };
10780
10781
10782 static struct cipher_testvec aes_ctr_enc_tv_template[] = {
10783         { /* From NIST Special Publication 800-38A, Appendix F.5 */
10784                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
10785                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
10786                 .klen   = 16,
10787                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10788                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10789                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10790                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10791                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10792                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10793                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10794                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10795                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10796                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10797                 .ilen   = 64,
10798                 .result = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
10799                           "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
10800                           "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
10801                           "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
10802                           "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
10803                           "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
10804                           "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
10805                           "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
10806                 .rlen   = 64,
10807         }, {
10808                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
10809                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
10810                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
10811                 .klen   = 24,
10812                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10813                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10814                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10815                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10816                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10817                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10818                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10819                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10820                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10821                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10822                 .ilen   = 64,
10823                 .result = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
10824                           "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
10825                           "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
10826                           "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
10827                           "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
10828                           "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
10829                           "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
10830                           "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
10831                 .rlen   = 64,
10832         }, {
10833                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
10834                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
10835                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
10836                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
10837                 .klen   = 32,
10838                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10839                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10840                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10841                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10842                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10843                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10844                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10845                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10846                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10847                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10848                 .ilen   = 64,
10849                 .result = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
10850                           "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
10851                           "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
10852                           "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
10853                           "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
10854                           "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
10855                           "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
10856                           "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
10857                 .rlen   = 64,
10858         }
10859 };
10860
10861 static struct cipher_testvec aes_ctr_dec_tv_template[] = {
10862         { /* From NIST Special Publication 800-38A, Appendix F.5 */
10863                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
10864                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
10865                 .klen   = 16,
10866                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10867                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10868                 .input  = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
10869                           "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
10870                           "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
10871                           "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
10872                           "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
10873                           "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
10874                           "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
10875                           "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
10876                 .ilen   = 64,
10877                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10878                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10879                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10880                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10881                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10882                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10883                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10884                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10885                 .rlen   = 64,
10886         }, {
10887                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
10888                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
10889                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
10890                 .klen   = 24,
10891                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10892                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10893                 .input  = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
10894                           "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
10895                           "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
10896                           "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
10897                           "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
10898                           "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
10899                           "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
10900                           "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
10901                 .ilen   = 64,
10902                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10903                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10904                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10905                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10906                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10907                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10908                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10909                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10910                 .rlen   = 64,
10911         }, {
10912                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
10913                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
10914                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
10915                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
10916                 .klen   = 32,
10917                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10918                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
10919                 .input  = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
10920                           "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
10921                           "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
10922                           "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
10923                           "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
10924                           "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
10925                           "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
10926                           "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
10927                 .ilen   = 64,
10928                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
10929                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
10930                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
10931                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
10932                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
10933                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
10934                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
10935                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
10936                 .rlen   = 64,
10937         }
10938 };
10939
10940 static struct cipher_testvec aes_ctr_rfc3686_enc_tv_template[] = {
10941         { /* From RFC 3686 */
10942                 .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
10943                           "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
10944                           "\x00\x00\x00\x30",
10945                 .klen   = 20,
10946                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
10947                 .input  = "Single block msg",
10948                 .ilen   = 16,
10949                 .result = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
10950                           "\x2d\x61\x75\xa3\x26\x13\x11\xb8",
10951                 .rlen   = 16,
10952         }, {
10953                 .key    = "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
10954                           "\x43\xd6\xce\x1f\x32\x53\x91\x63"
10955                           "\x00\x6c\xb6\xdb",
10956                 .klen   = 20,
10957                 .iv     = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
10958                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10959                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10960                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10961                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
10962                 .ilen   = 32,
10963                 .result = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
10964                           "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
10965                           "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
10966                           "\xfc\xe6\x30\xdf\x91\x41\xbe\x28",
10967                 .rlen   = 32,
10968         }, {
10969                 .key    = "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
10970                           "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
10971                           "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
10972                           "\x00\x00\x00\x48",
10973                 .klen   = 28,
10974                 .iv     = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
10975                 .input  = "Single block msg",
10976                 .ilen   = 16,
10977                 .result = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
10978                           "\x4e\x79\x35\xa0\x03\xcb\xe9\x28",
10979                 .rlen   = 16,
10980         }, {
10981                 .key    = "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
10982                           "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
10983                           "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
10984                           "\x00\x96\xb0\x3b",
10985                 .klen   = 28,
10986                 .iv     = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
10987                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10988                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10989                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10990                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
10991                 .ilen   = 32,
10992                 .result = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
10993                           "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
10994                           "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
10995                           "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00",
10996                 .rlen   = 32,
10997         }, {
10998                 .key    = "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
10999                           "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
11000                           "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
11001                           "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
11002                           "\x00\x00\x00\x60",
11003                 .klen   = 36,
11004                 .iv     = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
11005                 .input  = "Single block msg",
11006                 .ilen   = 16,
11007                 .result = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
11008                           "\x56\x08\x63\xdc\x71\xe3\xe0\xc0",
11009                 .rlen   = 16,
11010         }, {
11011                 .key    = "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
11012                           "\x07\x96\x36\x58\x79\xef\xf8\x86"
11013                           "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
11014                           "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
11015                           "\x00\xfa\xac\x24",
11016                 .klen   = 36,
11017                 .iv     = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
11018                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
11019                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
11020                           "\x10\x11\x12\x13\x14\x15\x16\x17"
11021                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
11022                 .ilen   = 32,
11023                 .result = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
11024                           "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
11025                           "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
11026                           "\x55\x30\x83\x1d\x93\x44\xaf\x1c",
11027                 .rlen   = 32,
11028         }, {
11029         // generated using Crypto++
11030                 .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
11031                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
11032                         "\x10\x11\x12\x13\x14\x15\x16\x17"
11033                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
11034                         "\x00\x00\x00\x00",
11035                 .klen = 32 + 4,
11036                 .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
11037                 .input =
11038                         "\x00\x01\x02\x03\x04\x05\x06\x07"
11039                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
11040                         "\x10\x11\x12\x13\x14\x15\x16\x17"
11041                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
11042                         "\x20\x21\x22\x23\x24\x25\x26\x27"
11043                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
11044                         "\x30\x31\x32\x33\x34\x35\x36\x37"
11045                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
11046                         "\x40\x41\x42\x43\x44\x45\x46\x47"
11047                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
11048                         "\x50\x51\x52\x53\x54\x55\x56\x57"
11049                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
11050                         "\x60\x61\x62\x63\x64\x65\x66\x67"
11051                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
11052                         "\x70\x71\x72\x73\x74\x75\x76\x77"
11053                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
11054                         "\x80\x81\x82\x83\x84\x85\x86\x87"
11055                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
11056                         "\x90\x91\x92\x93\x94\x95\x96\x97"
11057                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
11058                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
11059                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
11060                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
11061                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
11062                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
11063                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
11064                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
11065                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
11066                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
11067                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
11068                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
11069                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
11070                         "\x00\x03\x06\x09\x0c\x0f\x12\x15"
11071                         "\x18\x1b\x1e\x21\x24\x27\x2a\x2d"
11072                         "\x30\x33\x36\x39\x3c\x3f\x42\x45"
11073                         "\x48\x4b\x4e\x51\x54\x57\x5a\x5d"
11074                         "\x60\x63\x66\x69\x6c\x6f\x72\x75"
11075                         "\x78\x7b\x7e\x81\x84\x87\x8a\x8d"
11076                         "\x90\x93\x96\x99\x9c\x9f\xa2\xa5"
11077                         "\xa8\xab\xae\xb1\xb4\xb7\xba\xbd"
11078                         "\xc0\xc3\xc6\xc9\xcc\xcf\xd2\xd5"
11079                         "\xd8\xdb\xde\xe1\xe4\xe7\xea\xed"
11080                         "\xf0\xf3\xf6\xf9\xfc\xff\x02\x05"
11081                         "\x08\x0b\x0e\x11\x14\x17\x1a\x1d"
11082                         "\x20\x23\x26\x29\x2c\x2f\x32\x35"
11083                         "\x38\x3b\x3e\x41\x44\x47\x4a\x4d"
11084                         "\x50\x53\x56\x59\x5c\x5f\x62\x65"
11085                         "\x68\x6b\x6e\x71\x74\x77\x7a\x7d"
11086                         "\x80\x83\x86\x89\x8c\x8f\x92\x95"
11087                         "\x98\x9b\x9e\xa1\xa4\xa7\xaa\xad"
11088                         "\xb0\xb3\xb6\xb9\xbc\xbf\xc2\xc5"
11089                         "\xc8\xcb\xce\xd1\xd4\xd7\xda\xdd"
11090                         "\xe0\xe3\xe6\xe9\xec\xef\xf2\xf5"
11091                         "\xf8\xfb\xfe\x01\x04\x07\x0a\x0d"
11092                         "\x10\x13\x16\x19\x1c\x1f\x22\x25"
11093                         "\x28\x2b\x2e\x31\x34\x37\x3a\x3d"
11094                         "\x40\x43\x46\x49\x4c\x4f\x52\x55"
11095                         "\x58\x5b\x5e\x61\x64\x67\x6a\x6d"
11096                         "\x70\x73\x76\x79\x7c\x7f\x82\x85"
11097                         "\x88\x8b\x8e\x91\x94\x97\x9a\x9d"
11098                         "\xa0\xa3\xa6\xa9\xac\xaf\xb2\xb5"
11099                         "\xb8\xbb\xbe\xc1\xc4\xc7\xca\xcd"
11100                         "\xd0\xd3\xd6\xd9\xdc\xdf\xe2\xe5"
11101                         "\xe8\xeb\xee\xf1\xf4\xf7\xfa\xfd"
11102                         "\x00\x05\x0a\x0f\x14\x19\x1e\x23"
11103                         "\x28\x2d\x32\x37\x3c\x41\x46\x4b"
11104                         "\x50\x55\x5a\x5f\x64\x69\x6e\x73"
11105                         "\x78\x7d\x82\x87\x8c\x91\x96\x9b"
11106                         "\xa0\xa5\xaa\xaf\xb4\xb9\xbe\xc3"
11107                         "\xc8\xcd\xd2\xd7\xdc\xe1\xe6\xeb"
11108                         "\xf0\xf5\xfa\xff\x04\x09\x0e\x13"
11109                         "\x18\x1d\x22\x27\x2c\x31\x36\x3b"
11110                         "\x40\x45\x4a\x4f\x54\x59\x5e\x63"
11111                         "\x68\x6d\x72\x77\x7c\x81\x86\x8b"
11112                         "\x90\x95\x9a\x9f\xa4\xa9\xae\xb3"
11113                         "\xb8\xbd\xc2\xc7\xcc\xd1\xd6\xdb"
11114                         "\xe0\xe5\xea\xef\xf4\xf9\xfe\x03"
11115                         "\x08\x0d\x12\x17\x1c\x21\x26\x2b"
11116                         "\x30\x35\x3a\x3f\x44\x49\x4e\x53"
11117                         "\x58\x5d\x62\x67\x6c\x71\x76\x7b"
11118                         "\x80\x85\x8a\x8f\x94\x99\x9e\xa3"
11119                         "\xa8\xad\xb2\xb7\xbc\xc1\xc6\xcb"
11120                         "\xd0\xd5\xda\xdf\xe4\xe9\xee\xf3"
11121                         "\xf8\xfd\x02\x07\x0c\x11\x16\x1b"
11122                         "\x20\x25\x2a\x2f\x34\x39\x3e\x43"
11123                         "\x48\x4d\x52\x57\x5c\x61\x66\x6b"
11124                         "\x70\x75\x7a\x7f\x84\x89\x8e\x93"
11125                         "\x98\x9d\xa2\xa7\xac\xb1\xb6\xbb"
11126                         "\xc0\xc5\xca\xcf\xd4\xd9\xde\xe3"
11127                         "\xe8\xed\xf2\xf7\xfc\x01\x06\x0b"
11128                         "\x10\x15\x1a\x1f\x24\x29\x2e\x33"
11129                         "\x38\x3d\x42\x47\x4c\x51\x56\x5b"
11130                         "\x60\x65\x6a\x6f\x74\x79\x7e\x83"
11131                         "\x88\x8d\x92\x97\x9c\xa1\xa6\xab"
11132                         "\xb0\xb5\xba\xbf\xc4\xc9\xce\xd3"
11133                         "\xd8\xdd\xe2\xe7\xec\xf1\xf6\xfb"
11134                         "\x00\x07\x0e\x15\x1c\x23\x2a\x31"
11135                         "\x38\x3f\x46\x4d\x54\x5b\x62\x69"
11136                         "\x70\x77\x7e\x85\x8c\x93\x9a\xa1"
11137                         "\xa8\xaf\xb6\xbd\xc4\xcb\xd2\xd9"
11138                         "\xe0\xe7\xee\xf5\xfc\x03\x0a\x11"
11139                         "\x18\x1f\x26\x2d\x34\x3b\x42\x49"
11140                         "\x50\x57\x5e\x65\x6c\x73\x7a\x81"
11141                         "\x88\x8f\x96\x9d\xa4\xab\xb2\xb9"
11142                         "\xc0\xc7\xce\xd5\xdc\xe3\xea\xf1"
11143                         "\xf8\xff\x06\x0d\x14\x1b\x22\x29"
11144                         "\x30\x37\x3e\x45\x4c\x53\x5a\x61"
11145                         "\x68\x6f\x76\x7d\x84\x8b\x92\x99"
11146                         "\xa0\xa7\xae\xb5\xbc\xc3\xca\xd1"
11147                         "\xd8\xdf\xe6\xed\xf4\xfb\x02\x09"
11148                         "\x10\x17\x1e\x25\x2c\x33\x3a\x41"
11149                         "\x48\x4f\x56\x5d\x64\x6b\x72\x79"
11150                         "\x80\x87\x8e\x95\x9c\xa3\xaa\xb1"
11151                         "\xb8\xbf\xc6\xcd\xd4\xdb\xe2\xe9"
11152                         "\xf0\xf7\xfe\x05\x0c\x13\x1a\x21"
11153                         "\x28\x2f\x36\x3d\x44\x4b\x52\x59"
11154                         "\x60\x67\x6e\x75\x7c\x83\x8a\x91"
11155                         "\x98\x9f\xa6\xad\xb4\xbb\xc2\xc9"
11156                         "\xd0\xd7\xde\xe5\xec\xf3\xfa\x01"
11157                         "\x08\x0f\x16\x1d\x24\x2b\x32\x39"
11158                         "\x40\x47\x4e\x55\x5c\x63\x6a\x71"
11159                         "\x78\x7f\x86\x8d\x94\x9b\xa2\xa9"
11160                         "\xb0\xb7\xbe\xc5\xcc\xd3\xda\xe1"
11161                         "\xe8\xef\xf6\xfd\x04\x0b\x12\x19"
11162                         "\x20\x27\x2e\x35\x3c\x43\x4a\x51"
11163                         "\x58\x5f\x66\x6d\x74\x7b\x82\x89"
11164                         "\x90\x97\x9e\xa5\xac\xb3\xba\xc1"
11165                         "\xc8\xcf\xd6\xdd\xe4\xeb\xf2\xf9"
11166                         "\x00\x09\x12\x1b\x24\x2d\x36\x3f"
11167                         "\x48\x51\x5a\x63\x6c\x75\x7e\x87"
11168                         "\x90\x99\xa2\xab\xb4\xbd\xc6\xcf"
11169                         "\xd8\xe1\xea\xf3\xfc\x05\x0e\x17"
11170                         "\x20\x29\x32\x3b\x44\x4d\x56\x5f"
11171                         "\x68\x71\x7a\x83\x8c\x95\x9e\xa7"
11172                         "\xb0\xb9\xc2\xcb\xd4\xdd\xe6\xef"
11173                         "\xf8\x01\x0a\x13\x1c\x25\x2e\x37"
11174                         "\x40\x49\x52\x5b\x64\x6d\x76\x7f"
11175                         "\x88\x91\x9a\xa3\xac\xb5\xbe\xc7"
11176                         "\xd0\xd9\xe2\xeb\xf4\xfd\x06\x0f"
11177                         "\x18\x21\x2a\x33\x3c\x45\x4e\x57"
11178                         "\x60\x69\x72\x7b\x84\x8d\x96\x9f"
11179                         "\xa8\xb1\xba\xc3\xcc\xd5\xde\xe7"
11180                         "\xf0\xf9\x02\x0b\x14\x1d\x26\x2f"
11181                         "\x38\x41\x4a\x53\x5c\x65\x6e\x77"
11182                         "\x80\x89\x92\x9b\xa4\xad\xb6\xbf"
11183                         "\xc8\xd1\xda\xe3\xec\xf5\xfe\x07"
11184                         "\x10\x19\x22\x2b\x34\x3d\x46\x4f"
11185                         "\x58\x61\x6a\x73\x7c\x85\x8e\x97"
11186                         "\xa0\xa9\xb2\xbb\xc4\xcd\xd6\xdf"
11187                         "\xe8\xf1\xfa\x03\x0c\x15\x1e\x27"
11188                         "\x30\x39\x42\x4b\x54\x5d\x66\x6f"
11189                         "\x78\x81\x8a\x93\x9c\xa5\xae\xb7"
11190                         "\xc0\xc9\xd2\xdb\xe4\xed\xf6\xff"
11191                         "\x08\x11\x1a\x23\x2c\x35\x3e\x47"
11192                         "\x50\x59\x62\x6b\x74\x7d\x86\x8f"
11193                         "\x98\xa1\xaa\xb3\xbc\xc5\xce\xd7"
11194                         "\xe0\xe9\xf2\xfb\x04\x0d\x16\x1f"
11195                         "\x28\x31\x3a\x43\x4c\x55\x5e\x67"
11196                         "\x70\x79\x82\x8b\x94\x9d\xa6\xaf"
11197                         "\xb8\xc1\xca\xd3\xdc\xe5\xee\xf7"
11198                         "\x00\x0b\x16\x21\x2c\x37\x42\x4d"
11199                         "\x58\x63\x6e\x79\x84\x8f\x9a\xa5"
11200                         "\xb0\xbb\xc6\xd1\xdc\xe7\xf2\xfd"
11201                         "\x08\x13\x1e\x29\x34\x3f\x4a\x55"
11202                         "\x60\x6b\x76\x81\x8c\x97\xa2\xad"
11203                         "\xb8\xc3\xce\xd9\xe4\xef\xfa\x05"
11204                         "\x10\x1b\x26\x31\x3c\x47\x52\x5d"
11205                         "\x68\x73\x7e\x89\x94\x9f\xaa\xb5"
11206                         "\xc0\xcb\xd6\xe1\xec\xf7\x02\x0d"
11207                         "\x18\x23\x2e\x39\x44\x4f\x5a\x65"
11208                         "\x70\x7b\x86\x91\x9c\xa7\xb2\xbd"
11209                         "\xc8\xd3\xde\xe9\xf4\xff\x0a\x15"
11210                         "\x20\x2b\x36\x41\x4c\x57\x62\x6d"
11211                         "\x78\x83\x8e\x99\xa4\xaf\xba\xc5"
11212                         "\xd0\xdb\xe6\xf1\xfc\x07\x12\x1d"
11213                         "\x28\x33\x3e\x49\x54\x5f\x6a\x75"
11214                         "\x80\x8b\x96\xa1\xac\xb7\xc2\xcd"
11215                         "\xd8\xe3\xee\xf9\x04\x0f\x1a\x25"
11216                         "\x30\x3b\x46\x51\x5c\x67\x72\x7d"
11217                         "\x88\x93\x9e\xa9\xb4\xbf\xca\xd5"
11218                         "\xe0\xeb\xf6\x01\x0c\x17\x22\x2d"
11219                         "\x38\x43\x4e\x59\x64\x6f\x7a\x85"
11220                         "\x90\x9b\xa6\xb1\xbc\xc7\xd2\xdd"
11221                         "\xe8\xf3\xfe\x09\x14\x1f\x2a\x35"
11222                         "\x40\x4b\x56\x61\x6c\x77\x82\x8d"
11223                         "\x98\xa3\xae\xb9\xc4\xcf\xda\xe5"
11224                         "\xf0\xfb\x06\x11\x1c\x27\x32\x3d"
11225                         "\x48\x53\x5e\x69\x74\x7f\x8a\x95"
11226                         "\xa0\xab\xb6\xc1\xcc\xd7\xe2\xed"
11227                         "\xf8\x03\x0e\x19\x24\x2f\x3a\x45"
11228                         "\x50\x5b\x66\x71\x7c\x87\x92\x9d"
11229                         "\xa8\xb3\xbe\xc9\xd4\xdf\xea\xf5"
11230                         "\x00\x0d\x1a\x27\x34\x41\x4e\x5b"
11231                         "\x68\x75\x82\x8f\x9c\xa9\xb6\xc3"
11232                         "\xd0\xdd\xea\xf7\x04\x11\x1e\x2b"
11233                         "\x38\x45\x52\x5f\x6c\x79\x86\x93"
11234                         "\xa0\xad\xba\xc7\xd4\xe1\xee\xfb"
11235                         "\x08\x15\x22\x2f\x3c\x49\x56\x63"
11236                         "\x70\x7d\x8a\x97\xa4\xb1\xbe\xcb"
11237                         "\xd8\xe5\xf2\xff\x0c\x19\x26\x33"
11238                         "\x40\x4d\x5a\x67\x74\x81\x8e\x9b"
11239                         "\xa8\xb5\xc2\xcf\xdc\xe9\xf6\x03"
11240                         "\x10\x1d\x2a\x37\x44\x51\x5e\x6b"
11241                         "\x78\x85\x92\x9f\xac\xb9\xc6\xd3"
11242                         "\xe0\xed\xfa\x07\x14\x21\x2e\x3b"
11243                         "\x48\x55\x62\x6f\x7c\x89\x96\xa3"
11244                         "\xb0\xbd\xca\xd7\xe4\xf1\xfe\x0b"
11245                         "\x18\x25\x32\x3f\x4c\x59\x66\x73"
11246                         "\x80\x8d\x9a\xa7\xb4\xc1\xce\xdb"
11247                         "\xe8\xf5\x02\x0f\x1c\x29\x36\x43"
11248                         "\x50\x5d\x6a\x77\x84\x91\x9e\xab"
11249                         "\xb8\xc5\xd2\xdf\xec\xf9\x06\x13"
11250                         "\x20\x2d\x3a\x47\x54\x61\x6e\x7b"
11251                         "\x88\x95\xa2\xaf\xbc\xc9\xd6\xe3"
11252                         "\xf0\xfd\x0a\x17\x24\x31\x3e\x4b"
11253                         "\x58\x65\x72\x7f\x8c\x99\xa6\xb3"
11254                         "\xc0\xcd\xda\xe7\xf4\x01\x0e\x1b"
11255                         "\x28\x35\x42\x4f\x5c\x69\x76\x83"
11256                         "\x90\x9d\xaa\xb7\xc4\xd1\xde\xeb"
11257                         "\xf8\x05\x12\x1f\x2c\x39\x46\x53"
11258                         "\x60\x6d\x7a\x87\x94\xa1\xae\xbb"
11259                         "\xc8\xd5\xe2\xef\xfc\x09\x16\x23"
11260                         "\x30\x3d\x4a\x57\x64\x71\x7e\x8b"
11261                         "\x98\xa5\xb2\xbf\xcc\xd9\xe6\xf3"
11262                         "\x00\x0f\x1e\x2d\x3c\x4b\x5a\x69"
11263                         "\x78\x87\x96\xa5\xb4\xc3\xd2\xe1"
11264                         "\xf0\xff\x0e\x1d\x2c\x3b\x4a\x59"
11265                         "\x68\x77\x86\x95\xa4\xb3\xc2\xd1"
11266                         "\xe0\xef\xfe\x0d\x1c\x2b\x3a\x49"
11267                         "\x58\x67\x76\x85\x94\xa3\xb2\xc1"
11268                         "\xd0\xdf\xee\xfd\x0c\x1b\x2a\x39"
11269                         "\x48\x57\x66\x75\x84\x93\xa2\xb1"
11270                         "\xc0\xcf\xde\xed\xfc\x0b\x1a\x29"
11271                         "\x38\x47\x56\x65\x74\x83\x92\xa1"
11272                         "\xb0\xbf\xce\xdd\xec\xfb\x0a\x19"
11273                         "\x28\x37\x46\x55\x64\x73\x82\x91"
11274                         "\xa0\xaf\xbe\xcd\xdc\xeb\xfa\x09"
11275                         "\x18\x27\x36\x45\x54\x63\x72\x81"
11276                         "\x90\x9f\xae\xbd\xcc\xdb\xea\xf9"
11277                         "\x08\x17\x26\x35\x44\x53\x62\x71"
11278                         "\x80\x8f\x9e\xad\xbc\xcb\xda\xe9"
11279                         "\xf8\x07\x16\x25\x34\x43\x52\x61"
11280                         "\x70\x7f\x8e\x9d\xac\xbb\xca\xd9"
11281                         "\xe8\xf7\x06\x15\x24\x33\x42\x51"
11282                         "\x60\x6f\x7e\x8d\x9c\xab\xba\xc9"
11283                         "\xd8\xe7\xf6\x05\x14\x23\x32\x41"
11284                         "\x50\x5f\x6e\x7d\x8c\x9b\xaa\xb9"
11285                         "\xc8\xd7\xe6\xf5\x04\x13\x22\x31"
11286                         "\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9"
11287                         "\xb8\xc7\xd6\xe5\xf4\x03\x12\x21"
11288                         "\x30\x3f\x4e\x5d\x6c\x7b\x8a\x99"
11289                         "\xa8\xb7\xc6\xd5\xe4\xf3\x02\x11"
11290                         "\x20\x2f\x3e\x4d\x5c\x6b\x7a\x89"
11291                         "\x98\xa7\xb6\xc5\xd4\xe3\xf2\x01"
11292                         "\x10\x1f\x2e\x3d\x4c\x5b\x6a\x79"
11293                         "\x88\x97\xa6\xb5\xc4\xd3\xe2\xf1"
11294                         "\x00\x11\x22\x33\x44\x55\x66\x77"
11295                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff"
11296                         "\x10\x21\x32\x43\x54\x65\x76\x87"
11297                         "\x98\xa9\xba\xcb\xdc\xed\xfe\x0f"
11298                         "\x20\x31\x42\x53\x64\x75\x86\x97"
11299                         "\xa8\xb9\xca\xdb\xec\xfd\x0e\x1f"
11300                         "\x30\x41\x52\x63\x74\x85\x96\xa7"
11301                         "\xb8\xc9\xda\xeb\xfc\x0d\x1e\x2f"
11302                         "\x40\x51\x62\x73\x84\x95\xa6\xb7"
11303                         "\xc8\xd9\xea\xfb\x0c\x1d\x2e\x3f"
11304                         "\x50\x61\x72\x83\x94\xa5\xb6\xc7"
11305                         "\xd8\xe9\xfa\x0b\x1c\x2d\x3e\x4f"
11306                         "\x60\x71\x82\x93\xa4\xb5\xc6\xd7"
11307                         "\xe8\xf9\x0a\x1b\x2c\x3d\x4e\x5f"
11308                         "\x70\x81\x92\xa3\xb4\xc5\xd6\xe7"
11309                         "\xf8\x09\x1a\x2b\x3c\x4d\x5e\x6f"
11310                         "\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7"
11311                         "\x08\x19\x2a\x3b\x4c\x5d\x6e\x7f"
11312                         "\x90\xa1\xb2\xc3\xd4\xe5\xf6\x07"
11313                         "\x18\x29\x3a\x4b\x5c\x6d\x7e\x8f"
11314                         "\xa0\xb1\xc2\xd3\xe4\xf5\x06\x17"
11315                         "\x28\x39\x4a\x5b\x6c\x7d\x8e\x9f"
11316                         "\xb0\xc1\xd2\xe3\xf4\x05\x16\x27"
11317                         "\x38\x49\x5a\x6b\x7c\x8d\x9e\xaf"
11318                         "\xc0\xd1\xe2\xf3\x04\x15\x26\x37"
11319                         "\x48\x59\x6a\x7b\x8c\x9d\xae\xbf"
11320                         "\xd0\xe1\xf2\x03\x14\x25\x36\x47"
11321                         "\x58\x69\x7a\x8b\x9c\xad\xbe\xcf"
11322                         "\xe0\xf1\x02\x13\x24\x35\x46\x57"
11323                         "\x68\x79\x8a\x9b\xac\xbd\xce\xdf"
11324                         "\xf0\x01\x12\x23\x34\x45\x56\x67"
11325                         "\x78\x89\x9a\xab\xbc\xcd\xde\xef"
11326                         "\x00\x13\x26\x39\x4c\x5f\x72\x85"
11327                         "\x98\xab\xbe\xd1\xe4\xf7\x0a\x1d"
11328                         "\x30\x43\x56\x69\x7c\x8f\xa2\xb5"
11329                         "\xc8\xdb\xee\x01\x14\x27\x3a\x4d"
11330                         "\x60\x73\x86\x99\xac\xbf\xd2\xe5"
11331                         "\xf8\x0b\x1e\x31\x44\x57\x6a\x7d"
11332                         "\x90\xa3\xb6\xc9\xdc\xef\x02\x15"
11333                         "\x28\x3b\x4e\x61\x74\x87\x9a\xad"
11334                         "\xc0\xd3\xe6\xf9\x0c\x1f\x32\x45"
11335                         "\x58\x6b\x7e\x91\xa4\xb7\xca\xdd"
11336                         "\xf0\x03\x16\x29\x3c\x4f\x62\x75"
11337                         "\x88\x9b\xae\xc1\xd4\xe7\xfa\x0d"
11338                         "\x20\x33\x46\x59\x6c\x7f\x92\xa5"
11339                         "\xb8\xcb\xde\xf1\x04\x17\x2a\x3d"
11340                         "\x50\x63\x76\x89\x9c\xaf\xc2\xd5"
11341                         "\xe8\xfb\x0e\x21\x34\x47\x5a\x6d"
11342                         "\x80\x93\xa6\xb9\xcc\xdf\xf2\x05"
11343                         "\x18\x2b\x3e\x51\x64\x77\x8a\x9d"
11344                         "\xb0\xc3\xd6\xe9\xfc\x0f\x22\x35"
11345                         "\x48\x5b\x6e\x81\x94\xa7\xba\xcd"
11346                         "\xe0\xf3\x06\x19\x2c\x3f\x52\x65"
11347                         "\x78\x8b\x9e\xb1\xc4\xd7\xea\xfd"
11348                         "\x10\x23\x36\x49\x5c\x6f\x82\x95"
11349                         "\xa8\xbb\xce\xe1\xf4\x07\x1a\x2d"
11350                         "\x40\x53\x66\x79\x8c\x9f\xb2\xc5"
11351                         "\xd8\xeb\xfe\x11\x24\x37\x4a\x5d"
11352                         "\x70\x83\x96\xa9\xbc\xcf\xe2\xf5"
11353                         "\x08\x1b\x2e\x41\x54\x67\x7a\x8d"
11354                         "\xa0\xb3\xc6\xd9\xec\xff\x12\x25"
11355                         "\x38\x4b\x5e\x71\x84\x97\xaa\xbd"
11356                         "\xd0\xe3\xf6\x09\x1c\x2f\x42\x55"
11357                         "\x68\x7b\x8e\xa1\xb4\xc7\xda\xed"
11358                         "\x00\x15\x2a\x3f\x54\x69\x7e\x93"
11359                         "\xa8\xbd\xd2\xe7\xfc\x11\x26\x3b"
11360                         "\x50\x65\x7a\x8f\xa4\xb9\xce\xe3"
11361                         "\xf8\x0d\x22\x37\x4c\x61\x76\x8b"
11362                         "\xa0\xb5\xca\xdf\xf4\x09\x1e\x33"
11363                         "\x48\x5d\x72\x87\x9c\xb1\xc6\xdb"
11364                         "\xf0\x05\x1a\x2f\x44\x59\x6e\x83"
11365                         "\x98\xad\xc2\xd7\xec\x01\x16\x2b"
11366                         "\x40\x55\x6a\x7f\x94\xa9\xbe\xd3"
11367                         "\xe8\xfd\x12\x27\x3c\x51\x66\x7b"
11368                         "\x90\xa5\xba\xcf\xe4\xf9\x0e\x23"
11369                         "\x38\x4d\x62\x77\x8c\xa1\xb6\xcb"
11370                         "\xe0\xf5\x0a\x1f\x34\x49\x5e\x73"
11371                         "\x88\x9d\xb2\xc7\xdc\xf1\x06\x1b"
11372                         "\x30\x45\x5a\x6f\x84\x99\xae\xc3"
11373                         "\xd8\xed\x02\x17\x2c\x41\x56\x6b"
11374                         "\x80\x95\xaa\xbf\xd4\xe9\xfe\x13"
11375                         "\x28\x3d\x52\x67\x7c\x91\xa6\xbb"
11376                         "\xd0\xe5\xfa\x0f\x24\x39\x4e\x63"
11377                         "\x78\x8d\xa2\xb7\xcc\xe1\xf6\x0b"
11378                         "\x20\x35\x4a\x5f\x74\x89\x9e\xb3"
11379                         "\xc8\xdd\xf2\x07\x1c\x31\x46\x5b"
11380                         "\x70\x85\x9a\xaf\xc4\xd9\xee\x03"
11381                         "\x18\x2d\x42\x57\x6c\x81\x96\xab"
11382                         "\xc0\xd5\xea\xff\x14\x29\x3e\x53"
11383                         "\x68\x7d\x92\xa7\xbc\xd1\xe6\xfb"
11384                         "\x10\x25\x3a\x4f\x64\x79\x8e\xa3"
11385                         "\xb8\xcd\xe2\xf7\x0c\x21\x36\x4b"
11386                         "\x60\x75\x8a\x9f\xb4\xc9\xde\xf3"
11387                         "\x08\x1d\x32\x47\x5c\x71\x86\x9b"
11388                         "\xb0\xc5\xda\xef\x04\x19\x2e\x43"
11389                         "\x58\x6d\x82\x97\xac\xc1\xd6\xeb"
11390                         "\x00\x17\x2e\x45\x5c\x73\x8a\xa1"
11391                         "\xb8\xcf\xe6\xfd\x14\x2b\x42\x59"
11392                         "\x70\x87\x9e\xb5\xcc\xe3\xfa\x11"
11393                         "\x28\x3f\x56\x6d\x84\x9b\xb2\xc9"
11394                         "\xe0\xf7\x0e\x25\x3c\x53\x6a\x81"
11395                         "\x98\xaf\xc6\xdd\xf4\x0b\x22\x39"
11396                         "\x50\x67\x7e\x95\xac\xc3\xda\xf1"
11397                         "\x08\x1f\x36\x4d\x64\x7b\x92\xa9"
11398                         "\xc0\xd7\xee\x05\x1c\x33\x4a\x61"
11399                         "\x78\x8f\xa6\xbd\xd4\xeb\x02\x19"
11400                         "\x30\x47\x5e\x75\x8c\xa3\xba\xd1"
11401                         "\xe8\xff\x16\x2d\x44\x5b\x72\x89"
11402                         "\xa0\xb7\xce\xe5\xfc\x13\x2a\x41"
11403                         "\x58\x6f\x86\x9d\xb4\xcb\xe2\xf9"
11404                         "\x10\x27\x3e\x55\x6c\x83\x9a\xb1"
11405                         "\xc8\xdf\xf6\x0d\x24\x3b\x52\x69"
11406                         "\x80\x97\xae\xc5\xdc\xf3\x0a\x21"
11407                         "\x38\x4f\x66\x7d\x94\xab\xc2\xd9"
11408                         "\xf0\x07\x1e\x35\x4c\x63\x7a\x91"
11409                         "\xa8\xbf\xd6\xed\x04\x1b\x32\x49"
11410                         "\x60\x77\x8e\xa5\xbc\xd3\xea\x01"
11411                         "\x18\x2f\x46\x5d\x74\x8b\xa2\xb9"
11412                         "\xd0\xe7\xfe\x15\x2c\x43\x5a\x71"
11413                         "\x88\x9f\xb6\xcd\xe4\xfb\x12\x29"
11414                         "\x40\x57\x6e\x85\x9c\xb3\xca\xe1"
11415                         "\xf8\x0f\x26\x3d\x54\x6b\x82\x99"
11416                         "\xb0\xc7\xde\xf5\x0c\x23\x3a\x51"
11417                         "\x68\x7f\x96\xad\xc4\xdb\xf2\x09"
11418                         "\x20\x37\x4e\x65\x7c\x93\xaa\xc1"
11419                         "\xd8\xef\x06\x1d\x34\x4b\x62\x79"
11420                         "\x90\xa7\xbe\xd5\xec\x03\x1a\x31"
11421                         "\x48\x5f\x76\x8d\xa4\xbb\xd2\xe9"
11422                         "\x00\x19\x32\x4b\x64\x7d\x96\xaf"
11423                         "\xc8\xe1\xfa\x13\x2c\x45\x5e\x77"
11424                         "\x90\xa9\xc2\xdb\xf4\x0d\x26\x3f"
11425                         "\x58\x71\x8a\xa3\xbc\xd5\xee\x07"
11426                         "\x20\x39\x52\x6b\x84\x9d\xb6\xcf"
11427                         "\xe8\x01\x1a\x33\x4c\x65\x7e\x97"
11428                         "\xb0\xc9\xe2\xfb\x14\x2d\x46\x5f"
11429                         "\x78\x91\xaa\xc3\xdc\xf5\x0e\x27"
11430                         "\x40\x59\x72\x8b\xa4\xbd\xd6\xef"
11431                         "\x08\x21\x3a\x53\x6c\x85\x9e\xb7"
11432                         "\xd0\xe9\x02\x1b\x34\x4d\x66\x7f"
11433                         "\x98\xb1\xca\xe3\xfc\x15\x2e\x47"
11434                         "\x60\x79\x92\xab\xc4\xdd\xf6\x0f"
11435                         "\x28\x41\x5a\x73\x8c\xa5\xbe\xd7"
11436                         "\xf0\x09\x22\x3b\x54\x6d\x86\x9f"
11437                         "\xb8\xd1\xea\x03\x1c\x35\x4e\x67"
11438                         "\x80\x99\xb2\xcb\xe4\xfd\x16\x2f"
11439                         "\x48\x61\x7a\x93\xac\xc5\xde\xf7"
11440                         "\x10\x29\x42\x5b\x74\x8d\xa6\xbf"
11441                         "\xd8\xf1\x0a\x23\x3c\x55\x6e\x87"
11442                         "\xa0\xb9\xd2\xeb\x04\x1d\x36\x4f"
11443                         "\x68\x81\x9a\xb3\xcc\xe5\xfe\x17"
11444                         "\x30\x49\x62\x7b\x94\xad\xc6\xdf"
11445                         "\xf8\x11\x2a\x43\x5c\x75\x8e\xa7"
11446                         "\xc0\xd9\xf2\x0b\x24\x3d\x56\x6f"
11447                         "\x88\xa1\xba\xd3\xec\x05\x1e\x37"
11448                         "\x50\x69\x82\x9b\xb4\xcd\xe6\xff"
11449                         "\x18\x31\x4a\x63\x7c\x95\xae\xc7"
11450                         "\xe0\xf9\x12\x2b\x44\x5d\x76\x8f"
11451                         "\xa8\xc1\xda\xf3\x0c\x25\x3e\x57"
11452                         "\x70\x89\xa2\xbb\xd4\xed\x06\x1f"
11453                         "\x38\x51\x6a\x83\x9c\xb5\xce\xe7"
11454                         "\x00\x1b\x36\x51\x6c\x87\xa2\xbd"
11455                         "\xd8\xf3\x0e\x29\x44\x5f\x7a\x95"
11456                         "\xb0\xcb\xe6\x01\x1c\x37\x52\x6d"
11457                         "\x88\xa3\xbe\xd9\xf4\x0f\x2a\x45"
11458                         "\x60\x7b\x96\xb1\xcc\xe7\x02\x1d"
11459                         "\x38\x53\x6e\x89\xa4\xbf\xda\xf5"
11460                         "\x10\x2b\x46\x61\x7c\x97\xb2\xcd"
11461                         "\xe8\x03\x1e\x39\x54\x6f\x8a\xa5"
11462                         "\xc0\xdb\xf6\x11\x2c\x47\x62\x7d"
11463                         "\x98\xb3\xce\xe9\x04\x1f\x3a\x55"
11464                         "\x70\x8b\xa6\xc1\xdc\xf7\x12\x2d"
11465                         "\x48\x63\x7e\x99\xb4\xcf\xea\x05"
11466                         "\x20\x3b\x56\x71\x8c\xa7\xc2\xdd"
11467                         "\xf8\x13\x2e\x49\x64\x7f\x9a\xb5"
11468                         "\xd0\xeb\x06\x21\x3c\x57\x72\x8d"
11469                         "\xa8\xc3\xde\xf9\x14\x2f\x4a\x65"
11470                         "\x80\x9b\xb6\xd1\xec\x07\x22\x3d"
11471                         "\x58\x73\x8e\xa9\xc4\xdf\xfa\x15"
11472                         "\x30\x4b\x66\x81\x9c\xb7\xd2\xed"
11473                         "\x08\x23\x3e\x59\x74\x8f\xaa\xc5"
11474                         "\xe0\xfb\x16\x31\x4c\x67\x82\x9d"
11475                         "\xb8\xd3\xee\x09\x24\x3f\x5a\x75"
11476                         "\x90\xab\xc6\xe1\xfc\x17\x32\x4d"
11477                         "\x68\x83\x9e\xb9\xd4\xef\x0a\x25"
11478                         "\x40\x5b\x76\x91\xac\xc7\xe2\xfd"
11479                         "\x18\x33\x4e\x69\x84\x9f\xba\xd5"
11480                         "\xf0\x0b\x26\x41\x5c\x77\x92\xad"
11481                         "\xc8\xe3\xfe\x19\x34\x4f\x6a\x85"
11482                         "\xa0\xbb\xd6\xf1\x0c\x27\x42\x5d"
11483                         "\x78\x93\xae\xc9\xe4\xff\x1a\x35"
11484                         "\x50\x6b\x86\xa1\xbc\xd7\xf2\x0d"
11485                         "\x28\x43\x5e\x79\x94\xaf\xca\xe5"
11486                         "\x00\x1d\x3a\x57\x74\x91\xae\xcb"
11487                         "\xe8\x05\x22\x3f\x5c\x79\x96\xb3"
11488                         "\xd0\xed\x0a\x27\x44\x61\x7e\x9b"
11489                         "\xb8\xd5\xf2\x0f\x2c\x49\x66\x83"
11490                         "\xa0\xbd\xda\xf7\x14\x31\x4e\x6b"
11491                         "\x88\xa5\xc2\xdf\xfc\x19\x36\x53"
11492                         "\x70\x8d\xaa\xc7\xe4\x01\x1e\x3b"
11493                         "\x58\x75\x92\xaf\xcc\xe9\x06\x23"
11494                         "\x40\x5d\x7a\x97\xb4\xd1\xee\x0b"
11495                         "\x28\x45\x62\x7f\x9c\xb9\xd6\xf3"
11496                         "\x10\x2d\x4a\x67\x84\xa1\xbe\xdb"
11497                         "\xf8\x15\x32\x4f\x6c\x89\xa6\xc3"
11498                         "\xe0\xfd\x1a\x37\x54\x71\x8e\xab"
11499                         "\xc8\xe5\x02\x1f\x3c\x59\x76\x93"
11500                         "\xb0\xcd\xea\x07\x24\x41\x5e\x7b"
11501                         "\x98\xb5\xd2\xef\x0c\x29\x46\x63"
11502                         "\x80\x9d\xba\xd7\xf4\x11\x2e\x4b"
11503                         "\x68\x85\xa2\xbf\xdc\xf9\x16\x33"
11504                         "\x50\x6d\x8a\xa7\xc4\xe1\xfe\x1b"
11505                         "\x38\x55\x72\x8f\xac\xc9\xe6\x03"
11506                         "\x20\x3d\x5a\x77\x94\xb1\xce\xeb"
11507                         "\x08\x25\x42\x5f\x7c\x99\xb6\xd3"
11508                         "\xf0\x0d\x2a\x47\x64\x81\x9e\xbb"
11509                         "\xd8\xf5\x12\x2f\x4c\x69\x86\xa3"
11510                         "\xc0\xdd\xfa\x17\x34\x51\x6e\x8b"
11511                         "\xa8\xc5\xe2\xff\x1c\x39\x56\x73"
11512                         "\x90\xad\xca\xe7\x04\x21\x3e\x5b"
11513                         "\x78\x95\xb2\xcf\xec\x09\x26\x43"
11514                         "\x60\x7d\x9a\xb7\xd4\xf1\x0e\x2b"
11515                         "\x48\x65\x82\x9f\xbc\xd9\xf6\x13"
11516                         "\x30\x4d\x6a\x87\xa4\xc1\xde\xfb"
11517                         "\x18\x35\x52\x6f\x8c\xa9\xc6\xe3"
11518                         "\x00\x1f\x3e\x5d\x7c\x9b\xba\xd9"
11519                         "\xf8\x17\x36\x55\x74\x93\xb2\xd1"
11520                         "\xf0\x0f\x2e\x4d\x6c\x8b\xaa\xc9"
11521                         "\xe8\x07\x26\x45\x64\x83\xa2\xc1"
11522                         "\xe0\xff\x1e\x3d\x5c\x7b\x9a\xb9"
11523                         "\xd8\xf7\x16\x35\x54\x73\x92\xb1"
11524                         "\xd0\xef\x0e\x2d\x4c\x6b\x8a\xa9"
11525                         "\xc8\xe7\x06\x25\x44\x63\x82\xa1"
11526                         "\xc0\xdf\xfe\x1d\x3c\x5b\x7a\x99"
11527                         "\xb8\xd7\xf6\x15\x34\x53\x72\x91"
11528                         "\xb0\xcf\xee\x0d\x2c\x4b\x6a\x89"
11529                         "\xa8\xc7\xe6\x05\x24\x43\x62\x81"
11530                         "\xa0\xbf\xde\xfd\x1c\x3b\x5a\x79"
11531                         "\x98\xb7\xd6\xf5\x14\x33\x52\x71"
11532                         "\x90\xaf\xce\xed\x0c\x2b\x4a\x69"
11533                         "\x88\xa7\xc6\xe5\x04\x23\x42\x61"
11534                         "\x80\x9f\xbe\xdd\xfc\x1b\x3a\x59"
11535                         "\x78\x97\xb6\xd5\xf4\x13\x32\x51"
11536                         "\x70\x8f\xae\xcd\xec\x0b\x2a\x49"
11537                         "\x68\x87\xa6\xc5\xe4\x03\x22\x41"
11538                         "\x60\x7f\x9e\xbd\xdc\xfb\x1a\x39"
11539                         "\x58\x77\x96\xb5\xd4\xf3\x12\x31"
11540                         "\x50\x6f\x8e\xad\xcc\xeb\x0a\x29"
11541                         "\x48\x67\x86\xa5\xc4\xe3\x02\x21"
11542                         "\x40\x5f\x7e\x9d\xbc\xdb\xfa\x19"
11543                         "\x38\x57\x76\x95\xb4\xd3\xf2\x11"
11544                         "\x30\x4f\x6e\x8d\xac\xcb\xea\x09"
11545                         "\x28\x47\x66\x85\xa4\xc3\xe2\x01"
11546                         "\x20\x3f\x5e\x7d\x9c\xbb\xda\xf9"
11547                         "\x18\x37\x56\x75\x94\xb3\xd2\xf1"
11548                         "\x10\x2f\x4e\x6d\x8c\xab\xca\xe9"
11549                         "\x08\x27\x46\x65\x84\xa3\xc2\xe1"
11550                         "\x00\x21\x42\x63",
11551                 .ilen = 4100,
11552                 .result =
11553                         "\xf0\x5c\x74\xad\x4e\xbc\x99\xe2"
11554                         "\xae\xff\x91\x3a\x44\xcf\x38\x32"
11555                         "\x1e\xad\xa7\xcd\xa1\x39\x95\xaa"
11556                         "\x10\xb1\xb3\x2e\x04\x31\x8f\x86"
11557                         "\xf2\x62\x74\x70\x0c\xa4\x46\x08"
11558                         "\xa8\xb7\x99\xa8\xe9\xd2\x73\x79"
11559                         "\x7e\x6e\xd4\x8f\x1e\xc7\x8e\x31"
11560                         "\x0b\xfa\x4b\xce\xfd\xf3\x57\x71"
11561                         "\xe9\x46\x03\xa5\x3d\x34\x00\xe2"
11562                         "\x18\xff\x75\x6d\x06\x2d\x00\xab"
11563                         "\xb9\x3e\x6c\x59\xc5\x84\x06\xb5"
11564                         "\x8b\xd0\x89\x9c\x4a\x79\x16\xc6"
11565                         "\x3d\x74\x54\xfa\x44\xcd\x23\x26"
11566                         "\x5c\xcf\x7e\x28\x92\x32\xbf\xdf"
11567                         "\xa7\x20\x3c\x74\x58\x2a\x9a\xde"
11568                         "\x61\x00\x1c\x4f\xff\x59\xc4\x22"
11569                         "\xac\x3c\xd0\xe8\x6c\xf9\x97\x1b"
11570                         "\x58\x9b\xad\x71\xe8\xa9\xb5\x0d"
11571                         "\xee\x2f\x04\x1f\x7f\xbc\x99\xee"
11572                         "\x84\xff\x42\x60\xdc\x3a\x18\xa5"
11573                         "\x81\xf9\xef\xdc\x7a\x0f\x65\x41"
11574                         "\x2f\xa3\xd3\xf9\xc2\xcb\xc0\x4d"
11575                         "\x8f\xd3\x76\x96\xad\x49\x6d\x38"
11576                         "\x3d\x39\x0b\x6c\x80\xb7\x54\x69"
11577                         "\xf0\x2c\x90\x02\x29\x0d\x1c\x12"
11578                         "\xad\x55\xc3\x8b\x68\xd9\xcc\xb3"
11579                         "\xb2\x64\x33\x90\x5e\xca\x4b\xe2"
11580                         "\xfb\x75\xdc\x63\xf7\x9f\x82\x74"
11581                         "\xf0\xc9\xaa\x7f\xe9\x2a\x9b\x33"
11582                         "\xbc\x88\x00\x7f\xca\xb2\x1f\x14"
11583                         "\xdb\xc5\x8e\x7b\x11\x3c\x3e\x08"
11584                         "\xf3\x83\xe8\xe0\x94\x86\x2e\x92"
11585                         "\x78\x6b\x01\xc9\xc7\x83\xba\x21"
11586                         "\x6a\x25\x15\x33\x4e\x45\x08\xec"
11587                         "\x35\xdb\xe0\x6e\x31\x51\x79\xa9"
11588                         "\x42\x44\x65\xc1\xa0\xf1\xf9\x2a"
11589                         "\x70\xd5\xb6\xc6\xc1\x8c\x39\xfc"
11590                         "\x25\xa6\x55\xd9\xdd\x2d\x4c\xec"
11591                         "\x49\xc6\xeb\x0e\xa8\x25\x2a\x16"
11592                         "\x1b\x66\x84\xda\xe2\x92\xe5\xc0"
11593                         "\xc8\x53\x07\xaf\x80\x84\xec\xfd"
11594                         "\xcd\xd1\x6e\xcd\x6f\x6a\xf5\x36"
11595                         "\xc5\x15\xe5\x25\x7d\x77\xd1\x1a"
11596                         "\x93\x36\xa9\xcf\x7c\xa4\x54\x4a"
11597                         "\x06\x51\x48\x4e\xf6\x59\x87\xd2"
11598                         "\x04\x02\xef\xd3\x44\xde\x76\x31"
11599                         "\xb3\x34\x17\x1b\x9d\x66\x11\x9f"
11600                         "\x1e\xcc\x17\xe9\xc7\x3c\x1b\xe7"
11601                         "\xcb\x50\x08\xfc\xdc\x2b\x24\xdb"
11602                         "\x65\x83\xd0\x3b\xe3\x30\xea\x94"
11603                         "\x6c\xe7\xe8\x35\x32\xc7\xdb\x64"
11604                         "\xb4\x01\xab\x36\x2c\x77\x13\xaf"
11605                         "\xf8\x2b\x88\x3f\x54\x39\xc4\x44"
11606                         "\xfe\xef\x6f\x68\x34\xbe\x0f\x05"
11607                         "\x16\x6d\xf6\x0a\x30\xe7\xe3\xed"
11608                         "\xc4\xde\x3c\x1b\x13\xd8\xdb\xfe"
11609                         "\x41\x62\xe5\x28\xd4\x8d\xa3\xc7"
11610                         "\x93\x97\xc6\x48\x45\x1d\x9f\x83"
11611                         "\xdf\x4b\x40\x3e\x42\x25\x87\x80"
11612                         "\x4c\x7d\xa8\xd4\x98\x23\x95\x75"
11613                         "\x41\x8c\xda\x41\x9b\xd4\xa7\x06"
11614                         "\xb5\xf1\x71\x09\x53\xbe\xca\xbf"
11615                         "\x32\x03\xed\xf0\x50\x1c\x56\x39"
11616                         "\x5b\xa4\x75\x18\xf7\x9b\x58\xef"
11617                         "\x53\xfc\x2a\x38\x23\x15\x75\xcd"
11618                         "\x45\xe5\x5a\x82\x55\xba\x21\xfa"
11619                         "\xd4\xbd\xc6\x94\x7c\xc5\x80\x12"
11620                         "\xf7\x4b\x32\xc4\x9a\x82\xd8\x28"
11621                         "\x8f\xd9\xc2\x0f\x60\x03\xbe\x5e"
11622                         "\x21\xd6\x5f\x58\xbf\x5c\xb1\x32"
11623                         "\x82\x8d\xa9\xe5\xf2\x66\x1a\xc0"
11624                         "\xa0\xbc\x58\x2f\x71\xf5\x2f\xed"
11625                         "\xd1\x26\xb9\xd8\x49\x5a\x07\x19"
11626                         "\x01\x7c\x59\xb0\xf8\xa4\xb7\xd3"
11627                         "\x7b\x1a\x8c\x38\xf4\x50\xa4\x59"
11628                         "\xb0\xcc\x41\x0b\x88\x7f\xe5\x31"
11629                         "\xb3\x42\xba\xa2\x7e\xd4\x32\x71"
11630                         "\x45\x87\x48\xa9\xc2\xf2\x89\xb3"
11631                         "\xe4\xa7\x7e\x52\x15\x61\xfa\xfe"
11632                         "\xc9\xdd\x81\xeb\x13\xab\xab\xc3"
11633                         "\x98\x59\xd8\x16\x3d\x14\x7a\x1c"
11634                         "\x3c\x41\x9a\x16\x16\x9b\xd2\xd2"
11635                         "\x69\x3a\x29\x23\xac\x86\x32\xa5"
11636                         "\x48\x9c\x9e\xf3\x47\x77\x81\x70"
11637                         "\x24\xe8\x85\xd2\xf5\xb5\xfa\xff"
11638                         "\x59\x6a\xd3\x50\x59\x43\x59\xde"
11639                         "\xd9\xf1\x55\xa5\x0c\xc3\x1a\x1a"
11640                         "\x18\x34\x0d\x1a\x63\x33\xed\x10"
11641                         "\xe0\x1d\x2a\x18\xd2\xc0\x54\xa8"
11642                         "\xca\xb5\x9a\xd3\xdd\xca\x45\x84"
11643                         "\x50\xe7\x0f\xfe\xa4\x99\x5a\xbe"
11644                         "\x43\x2d\x9a\xcb\x92\x3f\x5a\x1d"
11645                         "\x85\xd8\xc9\xdf\x68\xc9\x12\x80"
11646                         "\x56\x0c\xdc\x00\xdc\x3a\x7d\x9d"
11647                         "\xa3\xa2\xe8\x4d\xbf\xf9\x70\xa0"
11648                         "\xa4\x13\x4f\x6b\xaf\x0a\x89\x7f"
11649                         "\xda\xf0\xbf\x9b\xc8\x1d\xe5\xf8"
11650                         "\x2e\x8b\x07\xb5\x73\x1b\xcc\xa2"
11651                         "\xa6\xad\x30\xbc\x78\x3c\x5b\x10"
11652                         "\xfa\x5e\x62\x2d\x9e\x64\xb3\x33"
11653                         "\xce\xf9\x1f\x86\xe7\x8b\xa2\xb8"
11654                         "\xe8\x99\x57\x8c\x11\xed\x66\xd9"
11655                         "\x3c\x72\xb9\xc3\xe6\x4e\x17\x3a"
11656                         "\x6a\xcb\x42\x24\x06\xed\x3e\x4e"
11657                         "\xa3\xe8\x6a\x94\xda\x0d\x4e\xd5"
11658                         "\x14\x19\xcf\xb6\x26\xd8\x2e\xcc"
11659                         "\x64\x76\x38\x49\x4d\xfe\x30\x6d"
11660                         "\xe4\xc8\x8c\x7b\xc4\xe0\x35\xba"
11661                         "\x22\x6e\x76\xe1\x1a\xf2\x53\xc3"
11662                         "\x28\xa2\x82\x1f\x61\x69\xad\xc1"
11663                         "\x7b\x28\x4b\x1e\x6c\x85\x95\x9b"
11664                         "\x51\xb5\x17\x7f\x12\x69\x8c\x24"
11665                         "\xd5\xc7\x5a\x5a\x11\x54\xff\x5a"
11666                         "\xf7\x16\xc3\x91\xa6\xf0\xdc\x0a"
11667                         "\xb6\xa7\x4a\x0d\x7a\x58\xfe\xa5"
11668                         "\xf5\xcb\x8f\x7b\x0e\xea\x57\xe7"
11669                         "\xbd\x79\xd6\x1c\x88\x23\x6c\xf2"
11670                         "\x4d\x29\x77\x53\x35\x6a\x00\x8d"
11671                         "\xcd\xa3\x58\xbe\x77\x99\x18\xf8"
11672                         "\xe6\xe1\x8f\xe9\x37\x8f\xe3\xe2"
11673                         "\x5a\x8a\x93\x25\xaf\xf3\x78\x80"
11674                         "\xbe\xa6\x1b\xc6\xac\x8b\x1c\x91"
11675                         "\x58\xe1\x9f\x89\x35\x9d\x1d\x21"
11676                         "\x29\x9f\xf4\x99\x02\x27\x0f\xa8"
11677                         "\x4f\x79\x94\x2b\x33\x2c\xda\xa2"
11678                         "\x26\x39\x83\x94\xef\x27\xd8\x53"
11679                         "\x8f\x66\x0d\xe4\x41\x7d\x34\xcd"
11680                         "\x43\x7c\x95\x0a\x53\xef\x66\xda"
11681                         "\x7e\x9b\xf3\x93\xaf\xd0\x73\x71"
11682                         "\xba\x40\x9b\x74\xf8\xd7\xd7\x41"
11683                         "\x6d\xaf\x72\x9c\x8d\x21\x87\x3c"
11684                         "\xfd\x0a\x90\xa9\x47\x96\x9e\xd3"
11685                         "\x88\xee\x73\xcf\x66\x2f\x52\x56"
11686                         "\x6d\xa9\x80\x4c\xe2\x6f\x62\x88"
11687                         "\x3f\x0e\x54\x17\x48\x80\x5d\xd3"
11688                         "\xc3\xda\x25\x3d\xa1\xc8\xcb\x9f"
11689                         "\x9b\x70\xb3\xa1\xeb\x04\x52\xa1"
11690                         "\xf2\x22\x0f\xfc\xc8\x18\xfa\xf9"
11691                         "\x85\x9c\xf1\xac\xeb\x0c\x02\x46"
11692                         "\x75\xd2\xf5\x2c\xe3\xd2\x59\x94"
11693                         "\x12\xf3\x3c\xfc\xd7\x92\xfa\x36"
11694                         "\xba\x61\x34\x38\x7c\xda\x48\x3e"
11695                         "\x08\xc9\x39\x23\x5e\x02\x2c\x1a"
11696                         "\x18\x7e\xb4\xd9\xfd\x9e\x40\x02"
11697                         "\xb1\x33\x37\x32\xe7\xde\xd6\xd0"
11698                         "\x7c\x58\x65\x4b\xf8\x34\x27\x9c"
11699                         "\x44\xb4\xbd\xe9\xe9\x4c\x78\x7d"
11700                         "\x4b\x9f\xce\xb1\xcd\x47\xa5\x37"
11701                         "\xe5\x6d\xbd\xb9\x43\x94\x0a\xd4"
11702                         "\xd6\xf9\x04\x5f\xb5\x66\x6c\x1a"
11703                         "\x35\x12\xe3\x36\x28\x27\x36\x58"
11704                         "\x01\x2b\x79\xe4\xba\x6d\x10\x7d"
11705                         "\x65\xdf\x84\x95\xf4\xd5\xb6\x8f"
11706                         "\x2b\x9f\x96\x00\x86\x60\xf0\x21"
11707                         "\x76\xa8\x6a\x8c\x28\x1c\xb3\x6b"
11708                         "\x97\xd7\xb6\x53\x2a\xcc\xab\x40"
11709                         "\x9d\x62\x79\x58\x52\xe6\x65\xb7"
11710                         "\xab\x55\x67\x9c\x89\x7c\x03\xb0"
11711                         "\x73\x59\xc5\x81\xf5\x18\x17\x5c"
11712                         "\x89\xf3\x78\x35\x44\x62\x78\x72"
11713                         "\xd0\x96\xeb\x31\xe7\x87\x77\x14"
11714                         "\x99\x51\xf2\x59\x26\x9e\xb5\xa6"
11715                         "\x45\xfe\x6e\xbd\x07\x4c\x94\x5a"
11716                         "\xa5\x7d\xfc\xf1\x2b\x77\xe2\xfe"
11717                         "\x17\xd4\x84\xa0\xac\xb5\xc7\xda"
11718                         "\xa9\x1a\xb6\xf3\x74\x11\xb4\x9d"
11719                         "\xfb\x79\x2e\x04\x2d\x50\x28\x83"
11720                         "\xbf\xc6\x52\xd3\x34\xd6\xe8\x7a"
11721                         "\xb6\xea\xe7\xa8\x6c\x15\x1e\x2c"
11722                         "\x57\xbc\x48\x4e\x5f\x5c\xb6\x92"
11723                         "\xd2\x49\x77\x81\x6d\x90\x70\xae"
11724                         "\x98\xa1\x03\x0d\x6b\xb9\x77\x14"
11725                         "\xf1\x4e\x23\xd3\xf8\x68\xbd\xc2"
11726                         "\xfe\x04\xb7\x5c\xc5\x17\x60\x8f"
11727                         "\x65\x54\xa4\x7a\x42\xdc\x18\x0d"
11728                         "\xb5\xcf\x0f\xd3\xc7\x91\x66\x1b"
11729                         "\x45\x42\x27\x75\x50\xe5\xee\xb8"
11730                         "\x7f\x33\x2c\xba\x4a\x92\x4d\x2c"
11731                         "\x3c\xe3\x0d\x80\x01\xba\x0d\x29"
11732                         "\xd8\x3c\xe9\x13\x16\x57\xe6\xea"
11733                         "\x94\x52\xe7\x00\x4d\x30\xb0\x0f"
11734                         "\x35\xb8\xb8\xa7\xb1\xb5\x3b\x44"
11735                         "\xe1\x2f\xfd\x88\xed\x43\xe7\x52"
11736                         "\x10\x93\xb3\x8a\x30\x6b\x0a\xf7"
11737                         "\x23\xc6\x50\x9d\x4a\xb0\xde\xc3"
11738                         "\xdc\x9b\x2f\x01\x56\x36\x09\xc5"
11739                         "\x2f\x6b\xfe\xf1\xd8\x27\x45\x03"
11740                         "\x30\x5e\x5c\x5b\xb4\x62\x0e\x1a"
11741                         "\xa9\x21\x2b\x92\x94\x87\x62\x57"
11742                         "\x4c\x10\x74\x1a\xf1\x0a\xc5\x84"
11743                         "\x3b\x9e\x72\x02\xd7\xcc\x09\x56"
11744                         "\xbd\x54\xc1\xf0\xc3\xe3\xb3\xf8"
11745                         "\xd2\x0d\x61\xcb\xef\xce\x0d\x05"
11746                         "\xb0\x98\xd9\x8e\x4f\xf9\xbc\x93"
11747                         "\xa6\xea\xc8\xcf\x10\x53\x4b\xf1"
11748                         "\xec\xfc\x89\xf9\x64\xb0\x22\xbf"
11749                         "\x9e\x55\x46\x9f\x7c\x50\x8e\x84"
11750                         "\x54\x20\x98\xd7\x6c\x40\x1e\xdb"
11751                         "\x69\x34\x78\x61\x24\x21\x9c\x8a"
11752                         "\xb3\x62\x31\x8b\x6e\xf5\x2a\x35"
11753                         "\x86\x13\xb1\x6c\x64\x2e\x41\xa5"
11754                         "\x05\xf2\x42\xba\xd2\x3a\x0d\x8e"
11755                         "\x8a\x59\x94\x3c\xcf\x36\x27\x82"
11756                         "\xc2\x45\xee\x58\xcd\x88\xb4\xec"
11757                         "\xde\xb2\x96\x0a\xaf\x38\x6f\x88"
11758                         "\xd7\xd8\xe1\xdf\xb9\x96\xa9\x0a"
11759                         "\xb1\x95\x28\x86\x20\xe9\x17\x49"
11760                         "\xa2\x29\x38\xaa\xa5\xe9\x6e\xf1"
11761                         "\x19\x27\xc0\xd5\x2a\x22\xc3\x0b"
11762                         "\xdb\x7c\x73\x10\xb9\xba\x89\x76"
11763                         "\x54\xae\x7d\x71\xb3\x93\xf6\x32"
11764                         "\xe6\x47\x43\x55\xac\xa0\x0d\xc2"
11765                         "\x93\x27\x4a\x8e\x0e\x74\x15\xc7"
11766                         "\x0b\x85\xd9\x0c\xa9\x30\x7a\x3e"
11767                         "\xea\x8f\x85\x6d\x3a\x12\x4f\x72"
11768                         "\x69\x58\x7a\x80\xbb\xb5\x97\xf3"
11769                         "\xcf\x70\xd2\x5d\xdd\x4d\x21\x79"
11770                         "\x54\x4d\xe4\x05\xe8\xbd\xc2\x62"
11771                         "\xb1\x3b\x77\x1c\xd6\x5c\xf3\xa0"
11772                         "\x79\x00\xa8\x6c\x29\xd9\x18\x24"
11773                         "\x36\xa2\x46\xc0\x96\x65\x7f\xbd"
11774                         "\x2a\xed\x36\x16\x0c\xaa\x9f\xf4"
11775                         "\xc5\xb4\xe2\x12\xed\x69\xed\x4f"
11776                         "\x26\x2c\x39\x52\x89\x98\xe7\x2c"
11777                         "\x99\xa4\x9e\xa3\x9b\x99\x46\x7a"
11778                         "\x3a\xdc\xa8\x59\xa3\xdb\xc3\x3b"
11779                         "\x95\x0d\x3b\x09\x6e\xee\x83\x5d"
11780                         "\x32\x4d\xed\xab\xfa\x98\x14\x4e"
11781                         "\xc3\x15\x45\x53\x61\xc4\x93\xbd"
11782                         "\x90\xf4\x99\x95\x4c\xe6\x76\x92"
11783                         "\x29\x90\x46\x30\x92\x69\x7d\x13"
11784                         "\xf2\xa5\xcd\x69\x49\x44\xb2\x0f"
11785                         "\x63\x40\x36\x5f\x09\xe2\x78\xf8"
11786                         "\x91\xe3\xe2\xfa\x10\xf7\xc8\x24"
11787                         "\xa8\x89\x32\x5c\x37\x25\x1d\xb2"
11788                         "\xea\x17\x8a\x0a\xa9\x64\xc3\x7c"
11789                         "\x3c\x7c\xbd\xc6\x79\x34\xe7\xe2"
11790                         "\x85\x8e\xbf\xf8\xde\x92\xa0\xae"
11791                         "\x20\xc4\xf6\xbb\x1f\x38\x19\x0e"
11792                         "\xe8\x79\x9c\xa1\x23\xe9\x54\x7e"
11793                         "\x37\x2f\xe2\x94\x32\xaf\xa0\x23"
11794                         "\x49\xe4\xc0\xb3\xac\x00\x8f\x36"
11795                         "\x05\xc4\xa6\x96\xec\x05\x98\x4f"
11796                         "\x96\x67\x57\x1f\x20\x86\x1b\x2d"
11797                         "\x69\xe4\x29\x93\x66\x5f\xaf\x6b"
11798                         "\x88\x26\x2c\x67\x02\x4b\x52\xd0"
11799                         "\x83\x7a\x43\x1f\xc0\x71\x15\x25"
11800                         "\x77\x65\x08\x60\x11\x76\x4c\x8d"
11801                         "\xed\xa9\x27\xc6\xb1\x2a\x2c\x6a"
11802                         "\x4a\x97\xf5\xc6\xb7\x70\x42\xd3"
11803                         "\x03\xd1\x24\x95\xec\x6d\xab\x38"
11804                         "\x72\xce\xe2\x8b\x33\xd7\x51\x09"
11805                         "\xdc\x45\xe0\x09\x96\x32\xf3\xc4"
11806                         "\x84\xdc\x73\x73\x2d\x1b\x11\x98"
11807                         "\xc5\x0e\x69\x28\x94\xc7\xb5\x4d"
11808                         "\xc8\x8a\xd0\xaa\x13\x2e\x18\x74"
11809                         "\xdd\xd1\x1e\xf3\x90\xe8\xfc\x9a"
11810                         "\x72\x4a\x0e\xd1\xe4\xfb\x0d\x96"
11811                         "\xd1\x0c\x79\x85\x1b\x1c\xfe\xe1"
11812                         "\x62\x8f\x7a\x73\x32\xab\xc8\x18"
11813                         "\x69\xe3\x34\x30\xdf\x13\xa6\xe5"
11814                         "\xe8\x0e\x67\x7f\x81\x11\xb4\x60"
11815                         "\xc7\xbd\x79\x65\x50\xdc\xc4\x5b"
11816                         "\xde\x39\xa4\x01\x72\x63\xf3\xd1"
11817                         "\x64\x4e\xdf\xfc\x27\x92\x37\x0d"
11818                         "\x57\xcd\x11\x4f\x11\x04\x8e\x1d"
11819                         "\x16\xf7\xcd\x92\x9a\x99\x30\x14"
11820                         "\xf1\x7c\x67\x1b\x1f\x41\x0b\xe8"
11821                         "\x32\xe8\xb8\xc1\x4f\x54\x86\x4f"
11822                         "\xe5\x79\x81\x73\xcd\x43\x59\x68"
11823                         "\x73\x02\x3b\x78\x21\x72\x43\x00"
11824                         "\x49\x17\xf7\x00\xaf\x68\x24\x53"
11825                         "\x05\x0a\xc3\x33\xe0\x33\x3f\x69"
11826                         "\xd2\x84\x2f\x0b\xed\xde\x04\xf4"
11827                         "\x11\x94\x13\x69\x51\x09\x28\xde"
11828                         "\x57\x5c\xef\xdc\x9a\x49\x1c\x17"
11829                         "\x97\xf3\x96\xc1\x7f\x5d\x2e\x7d"
11830                         "\x55\xb8\xb3\x02\x09\xb3\x1f\xe7"
11831                         "\xc9\x8d\xa3\x36\x34\x8a\x77\x13"
11832                         "\x30\x63\x4c\xa5\xcd\xc3\xe0\x7e"
11833                         "\x05\xa1\x7b\x0c\xcb\x74\x47\x31"
11834                         "\x62\x03\x43\xf1\x87\xb4\xb0\x85"
11835                         "\x87\x8e\x4b\x25\xc7\xcf\xae\x4b"
11836                         "\x36\x46\x3e\x62\xbc\x6f\xeb\x5f"
11837                         "\x73\xac\xe6\x07\xee\xc1\xa1\xd6"
11838                         "\xc4\xab\xc9\xd6\x89\x45\xe1\xf1"
11839                         "\x04\x4e\x1a\x6f\xbb\x4f\x3a\xa3"
11840                         "\xa0\xcb\xa3\x0a\xd8\x71\x35\x55"
11841                         "\xe4\xbc\x2e\x04\x06\xe6\xff\x5b"
11842                         "\x1c\xc0\x11\x7c\xc5\x17\xf3\x38"
11843                         "\xcf\xe9\xba\x0f\x0e\xef\x02\xc2"
11844                         "\x8d\xc6\xbc\x4b\x67\x20\x95\xd7"
11845                         "\x2c\x45\x5b\x86\x44\x8c\x6f\x2e"
11846                         "\x7e\x9f\x1c\x77\xba\x6b\x0e\xa3"
11847                         "\x69\xdc\xab\x24\x57\x60\x47\xc1"
11848                         "\xd1\xa5\x9d\x23\xe6\xb1\x37\xfe"
11849                         "\x93\xd2\x4c\x46\xf9\x0c\xc6\xfb"
11850                         "\xd6\x9d\x99\x69\xab\x7a\x07\x0c"
11851                         "\x65\xe7\xc4\x08\x96\xe2\xa5\x01"
11852                         "\x3f\x46\x07\x05\x7e\xe8\x9a\x90"
11853                         "\x50\xdc\xe9\x7a\xea\xa1\x39\x6e"
11854                         "\x66\xe4\x6f\xa5\x5f\xb2\xd9\x5b"
11855                         "\xf5\xdb\x2a\x32\xf0\x11\x6f\x7c"
11856                         "\x26\x10\x8f\x3d\x80\xe9\x58\xf7"
11857                         "\xe0\xa8\x57\xf8\xdb\x0e\xce\x99"
11858                         "\x63\x19\x3d\xd5\xec\x1b\x77\x69"
11859                         "\x98\xf6\xe4\x5f\x67\x17\x4b\x09"
11860                         "\x85\x62\x82\x70\x18\xe2\x9a\x78"
11861                         "\xe2\x62\xbd\xb4\xf1\x42\xc6\xfb"
11862                         "\x08\xd0\xbd\xeb\x4e\x09\xf2\xc8"
11863                         "\x1e\xdc\x3d\x32\x21\x56\x9c\x4f"
11864                         "\x35\xf3\x61\x06\x72\x84\xc4\x32"
11865                         "\xf2\xf1\xfa\x0b\x2f\xc3\xdb\x02"
11866                         "\x04\xc2\xde\x57\x64\x60\x8d\xcf"
11867                         "\xcb\x86\x5d\x97\x3e\xb1\x9c\x01"
11868                         "\xd6\x28\x8f\x99\xbc\x46\xeb\x05"
11869                         "\xaf\x7e\xb8\x21\x2a\x56\x85\x1c"
11870                         "\xb3\x71\xa0\xde\xca\x96\xf1\x78"
11871                         "\x49\xa2\x99\x81\x80\x5c\x01\xf5"
11872                         "\xa0\xa2\x56\x63\xe2\x70\x07\xa5"
11873                         "\x95\xd6\x85\xeb\x36\x9e\xa9\x51"
11874                         "\x66\x56\x5f\x1d\x02\x19\xe2\xf6"
11875                         "\x4f\x73\x38\x09\x75\x64\x48\xe0"
11876                         "\xf1\x7e\x0e\xe8\x9d\xf9\xed\x94"
11877                         "\xfe\x16\x26\x62\x49\x74\xf4\xb0"
11878                         "\xd4\xa9\x6c\xb0\xfd\x53\xe9\x81"
11879                         "\xe0\x7a\xbf\xcf\xb5\xc4\x01\x81"
11880                         "\x79\x99\x77\x01\x3b\xe9\xa2\xb6"
11881                         "\xe6\x6a\x8a\x9e\x56\x1c\x8d\x1e"
11882                         "\x8f\x06\x55\x2c\x6c\xdc\x92\x87"
11883                         "\x64\x3b\x4b\x19\xa1\x13\x64\x1d"
11884                         "\x4a\xe9\xc0\x00\xb8\x95\xef\x6b"
11885                         "\x1a\x86\x6d\x37\x52\x02\xc2\xe0"
11886                         "\xc8\xbb\x42\x0c\x02\x21\x4a\xc9"
11887                         "\xef\xa0\x54\xe4\x5e\x16\x53\x81"
11888                         "\x70\x62\x10\xaf\xde\xb8\xb5\xd3"
11889                         "\xe8\x5e\x6c\xc3\x8a\x3e\x18\x07"
11890                         "\xf2\x2f\x7d\xa7\xe1\x3d\x4e\xb4"
11891                         "\x26\xa7\xa3\x93\x86\xb2\x04\x1e"
11892                         "\x53\x5d\x86\xd6\xde\x65\xca\xe3"
11893                         "\x4e\xc1\xcf\xef\xc8\x70\x1b\x83"
11894                         "\x13\xdd\x18\x8b\x0d\x76\xd2\xf6"
11895                         "\x37\x7a\x93\x7a\x50\x11\x9f\x96"
11896                         "\x86\x25\xfd\xac\xdc\xbe\x18\x93"
11897                         "\x19\x6b\xec\x58\x4f\xb9\x75\xa7"
11898                         "\xdd\x3f\x2f\xec\xc8\x5a\x84\xab"
11899                         "\xd5\xe4\x8a\x07\xf6\x4d\x23\xd6"
11900                         "\x03\xfb\x03\x6a\xea\x66\xbf\xd4"
11901                         "\xb1\x34\xfb\x78\xe9\x55\xdc\x7c"
11902                         "\x3d\x9c\xe5\x9a\xac\xc3\x7a\x80"
11903                         "\x24\x6d\xa0\xef\x25\x7c\xb7\xea"
11904                         "\xce\x4d\x5f\x18\x60\xce\x87\x22"
11905                         "\x66\x2f\xd5\xdd\xdd\x02\x21\x75"
11906                         "\x82\xa0\x1f\x58\xc6\xd3\x62\xf7"
11907                         "\x32\xd8\xaf\x1e\x07\x77\x51\x96"
11908                         "\xd5\x6b\x1e\x7e\x80\x02\xe8\x67"
11909                         "\xea\x17\x0b\x10\xd2\x3f\x28\x25"
11910                         "\x4f\x05\x77\x02\x14\x69\xf0\x2c"
11911                         "\xbe\x0c\xf1\x74\x30\xd1\xb9\x9b"
11912                         "\xfc\x8c\xbb\x04\x16\xd9\xba\xc3"
11913                         "\xbc\x91\x8a\xc4\x30\xa4\xb0\x12"
11914                         "\x4c\x21\x87\xcb\xc9\x1d\x16\x96"
11915                         "\x07\x6f\x23\x54\xb9\x6f\x79\xe5"
11916                         "\x64\xc0\x64\xda\xb1\xae\xdd\x60"
11917                         "\x6c\x1a\x9d\xd3\x04\x8e\x45\xb0"
11918                         "\x92\x61\xd0\x48\x81\xed\x5e\x1d"
11919                         "\xa0\xc9\xa4\x33\xc7\x13\x51\x5d"
11920                         "\x7f\x83\x73\xb6\x70\x18\x65\x3e"
11921                         "\x2f\x0e\x7a\x12\x39\x98\xab\xd8"
11922                         "\x7e\x6f\xa3\xd1\xba\x56\xad\xbd"
11923                         "\xf0\x03\x01\x1c\x85\x35\x9f\xeb"
11924                         "\x19\x63\xa1\xaf\xfe\x2d\x35\x50"
11925                         "\x39\xa0\x65\x7c\x95\x7e\x6b\xfe"
11926                         "\xc1\xac\x07\x7c\x98\x4f\xbe\x57"
11927                         "\xa7\x22\xec\xe2\x7e\x29\x09\x53"
11928                         "\xe8\xbf\xb4\x7e\x3f\x8f\xfc\x14"
11929                         "\xce\x54\xf9\x18\x58\xb5\xff\x44"
11930                         "\x05\x9d\xce\x1b\xb6\x82\x23\xc8"
11931                         "\x2e\xbc\x69\xbb\x4a\x29\x0f\x65"
11932                         "\x94\xf0\x63\x06\x0e\xef\x8c\xbd"
11933                         "\xff\xfd\xb0\x21\x6e\x57\x05\x75"
11934                         "\xda\xd5\xc4\xeb\x8d\x32\xf7\x50"
11935                         "\xd3\x6f\x22\xed\x5f\x8e\xa2\x5b"
11936                         "\x80\x8c\xc8\x78\x40\x24\x4b\x89"
11937                         "\x30\xce\x7a\x97\x0e\xc4\xaf\xef"
11938                         "\x9b\xb4\xcd\x66\x74\x14\x04\x2b"
11939                         "\xf7\xce\x0b\x1c\x6e\xc2\x78\x8c"
11940                         "\xca\xc5\xd0\x1c\x95\x4a\x91\x2d"
11941                         "\xa7\x20\xeb\x86\x52\xb7\x67\xd8"
11942                         "\x0c\xd6\x04\x14\xde\x51\x74\x75"
11943                         "\xe7\x11\xb4\x87\xa3\x3d\x2d\xad"
11944                         "\x4f\xef\xa0\x0f\x70\x00\x6d\x13"
11945                         "\x19\x1d\x41\x50\xe9\xd8\xf0\x32"
11946                         "\x71\xbc\xd3\x11\xf2\xac\xbe\xaf"
11947                         "\x75\x46\x65\x4e\x07\x34\x37\xa3"
11948                         "\x89\xfe\x75\xd4\x70\x4c\xc6\x3f"
11949                         "\x69\x24\x0e\x38\x67\x43\x8c\xde"
11950                         "\x06\xb5\xb8\xe7\xc4\xf0\x41\x8f"
11951                         "\xf0\xbd\x2f\x0b\xb9\x18\xf8\xde"
11952                         "\x64\xb1\xdb\xee\x00\x50\x77\xe1"
11953                         "\xc7\xff\xa6\xfa\xdd\x70\xf4\xe3"
11954                         "\x93\xe9\x77\x35\x3d\x4b\x2f\x2b"
11955                         "\x6d\x55\xf0\xfc\x88\x54\x4e\x89"
11956                         "\xc1\x8a\x23\x31\x2d\x14\x2a\xb8"
11957                         "\x1b\x15\xdd\x9e\x6e\x7b\xda\x05"
11958                         "\x91\x7d\x62\x64\x96\x72\xde\xfc"
11959                         "\xc1\xec\xf0\x23\x51\x6f\xdb\x5b"
11960                         "\x1d\x08\x57\xce\x09\xb8\xf6\xcd"
11961                         "\x8d\x95\xf2\x20\xbf\x0f\x20\x57"
11962                         "\x98\x81\x84\x4f\x15\x5c\x76\xe7"
11963                         "\x3e\x0a\x3a\x6c\xc4\x8a\xbe\x78"
11964                         "\x74\x77\xc3\x09\x4b\x5d\x48\xe4"
11965                         "\xc8\xcb\x0b\xea\x17\x28\xcf\xcf"
11966                         "\x31\x32\x44\xa4\xe5\x0e\x1a\x98"
11967                         "\x94\xc4\xf0\xff\xae\x3e\x44\xe8"
11968                         "\xa5\xb3\xb5\x37\x2f\xe8\xaf\x6f"
11969                         "\x28\xc1\x37\x5f\x31\xd2\xb9\x33"
11970                         "\xb1\xb2\x52\x94\x75\x2c\x29\x59"
11971                         "\x06\xc2\x25\xe8\x71\x65\x4e\xed"
11972                         "\xc0\x9c\xb1\xbb\x25\xdc\x6c\xe7"
11973                         "\x4b\xa5\x7a\x54\x7a\x60\xff\x7a"
11974                         "\xe0\x50\x40\x96\x35\x63\xe4\x0b"
11975                         "\x76\xbd\xa4\x65\x00\x1b\x57\x88"
11976                         "\xae\xed\x39\x88\x42\x11\x3c\xed"
11977                         "\x85\x67\x7d\xb9\x68\x82\xe9\x43"
11978                         "\x3c\x47\x53\xfa\xe8\xf8\x9f\x1f"
11979                         "\x9f\xef\x0f\xf7\x30\xd9\x30\x0e"
11980                         "\xb9\x9f\x69\x18\x2f\x7e\xf8\xf8"
11981                         "\xf8\x8c\x0f\xd4\x02\x4d\xea\xcd"
11982                         "\x0a\x9c\x6f\x71\x6d\x5a\x4c\x60"
11983                         "\xce\x20\x56\x32\xc6\xc5\x99\x1f"
11984                         "\x09\xe6\x4e\x18\x1a\x15\x13\xa8"
11985                         "\x7d\xb1\x6b\xc0\xb2\x6d\xf8\x26"
11986                         "\x66\xf8\x3d\x18\x74\x70\x66\x7a"
11987                         "\x34\x17\xde\xba\x47\xf1\x06\x18"
11988                         "\xcb\xaf\xeb\x4a\x1e\x8f\xa7\x77"
11989                         "\xe0\x3b\x78\x62\x66\xc9\x10\xea"
11990                         "\x1f\xb7\x29\x0a\x45\xa1\x1d\x1e"
11991                         "\x1d\xe2\x65\x61\x50\x9c\xd7\x05"
11992                         "\xf2\x0b\x5b\x12\x61\x02\xc8\xe5"
11993                         "\x63\x4f\x20\x0c\x07\x17\x33\x5e"
11994                         "\x03\x9a\x53\x0f\x2e\x55\xfe\x50"
11995                         "\x43\x7d\xd0\xb6\x7e\x5a\xda\xae"
11996                         "\x58\xef\x15\xa9\x83\xd9\x46\xb1"
11997                         "\x42\xaa\xf5\x02\x6c\xce\x92\x06"
11998                         "\x1b\xdb\x66\x45\x91\x79\xc2\x2d"
11999                         "\xe6\x53\xd3\x14\xfd\xbb\x44\x63"
12000                         "\xc6\xd7\x3d\x7a\x0c\x75\x78\x9d"
12001                         "\x5c\xa6\x39\xb3\xe5\x63\xca\x8b"
12002                         "\xfe\xd3\xef\x60\x83\xf6\x8e\x70"
12003                         "\xb6\x67\xc7\x77\xed\x23\xef\x4c"
12004                         "\xf0\xed\x2d\x07\x59\x6f\xc1\x01"
12005                         "\x34\x37\x08\xab\xd9\x1f\x09\xb1"
12006                         "\xce\x5b\x17\xff\x74\xf8\x9c\xd5"
12007                         "\x2c\x56\x39\x79\x0f\x69\x44\x75"
12008                         "\x58\x27\x01\xc4\xbf\xa7\xa1\x1d"
12009                         "\x90\x17\x77\x86\x5a\x3f\xd9\xd1"
12010                         "\x0e\xa0\x10\xf8\xec\x1e\xa5\x7f"
12011                         "\x5e\x36\xd1\xe3\x04\x2c\x70\xf7"
12012                         "\x8e\xc0\x98\x2f\x6c\x94\x2b\x41"
12013                         "\xb7\x60\x00\xb7\x2e\xb8\x02\x8d"
12014                         "\xb8\xb0\xd3\x86\xba\x1d\xd7\x90"
12015                         "\xd6\xb6\xe1\xfc\xd7\xd8\x28\x06"
12016                         "\x63\x9b\xce\x61\x24\x79\xc0\x70"
12017                         "\x52\xd0\xb6\xd4\x28\x95\x24\x87"
12018                         "\x03\x1f\xb7\x9a\xda\xa3\xfb\x52"
12019                         "\x5b\x68\xe7\x4c\x8c\x24\xe1\x42"
12020                         "\xf7\xd5\xfd\xad\x06\x32\x9f\xba"
12021                         "\xc1\xfc\xdd\xc6\xfc\xfc\xb3\x38"
12022                         "\x74\x56\x58\x40\x02\x37\x52\x2c"
12023                         "\x55\xcc\xb3\x9e\x7a\xe9\xd4\x38"
12024                         "\x41\x5e\x0c\x35\xe2\x11\xd1\x13"
12025                         "\xf8\xb7\x8d\x72\x6b\x22\x2a\xb0"
12026                         "\xdb\x08\xba\x35\xb9\x3f\xc8\xd3"
12027                         "\x24\x90\xec\x58\xd2\x09\xc7\x2d"
12028                         "\xed\x38\x80\x36\x72\x43\x27\x49"
12029                         "\x4a\x80\x8a\xa2\xe8\xd3\xda\x30"
12030                         "\x7d\xb6\x82\x37\x86\x92\x86\x3e"
12031                         "\x08\xb2\x28\x5a\x55\x44\x24\x7d"
12032                         "\x40\x48\x8a\xb6\x89\x58\x08\xa0"
12033                         "\xd6\x6d\x3a\x17\xbf\xf6\x54\xa2"
12034                         "\xf5\xd3\x8c\x0f\x78\x12\x57\x8b"
12035                         "\xd5\xc2\xfd\x58\x5b\x7f\x38\xe3"
12036                         "\xcc\xb7\x7c\x48\xb3\x20\xe8\x81"
12037                         "\x14\x32\x45\x05\xe0\xdb\x9f\x75"
12038                         "\x85\xb4\x6a\xfc\x95\xe3\x54\x22"
12039                         "\x12\xee\x30\xfe\xd8\x30\xef\x34"
12040                         "\x50\xab\x46\x30\x98\x2f\xb7\xc0"
12041                         "\x15\xa2\x83\xb6\xf2\x06\x21\xa2"
12042                         "\xc3\x26\x37\x14\xd1\x4d\xb5\x10"
12043                         "\x52\x76\x4d\x6a\xee\xb5\x2b\x15"
12044                         "\xb7\xf9\x51\xe8\x2a\xaf\xc7\xfa"
12045                         "\x77\xaf\xb0\x05\x4d\xd1\x68\x8e"
12046                         "\x74\x05\x9f\x9d\x93\xa5\x3e\x7f"
12047                         "\x4e\x5f\x9d\xcb\x09\xc7\x83\xe3"
12048                         "\x02\x9d\x27\x1f\xef\x85\x05\x8d"
12049                         "\xec\x55\x88\x0f\x0d\x7c\x4c\xe8"
12050                         "\xa1\x75\xa0\xd8\x06\x47\x14\xef"
12051                         "\xaa\x61\xcf\x26\x15\xad\xd8\xa3"
12052                         "\xaa\x75\xf2\x78\x4a\x5a\x61\xdf"
12053                         "\x8b\xc7\x04\xbc\xb2\x32\xd2\x7e"
12054                         "\x42\xee\xb4\x2f\x51\xff\x7b\x2e"
12055                         "\xd3\x02\xe8\xdc\x5d\x0d\x50\xdc"
12056                         "\xae\xb7\x46\xf9\xa8\xe6\xd0\x16"
12057                         "\xcc\xe6\x2c\x81\xc7\xad\xe9\xf0"
12058                         "\x05\x72\x6d\x3d\x0a\x7a\xa9\x02"
12059                         "\xac\x82\x93\x6e\xb6\x1c\x28\xfc"
12060                         "\x44\x12\xfb\x73\x77\xd4\x13\x39"
12061                         "\x29\x88\x8a\xf3\x5c\xa6\x36\xa0"
12062                         "\x2a\xed\x7e\xb1\x1d\xd6\x4c\x6b"
12063                         "\x41\x01\x18\x5d\x5d\x07\x97\xa6"
12064                         "\x4b\xef\x31\x18\xea\xac\xb1\x84"
12065                         "\x21\xed\xda\x86",
12066                 .rlen = 4100,
12067                 .np     = 2,
12068                 .tap    = { 4064, 36 },
12069         },
12070 };
12071
12072 static struct cipher_testvec aes_ctr_rfc3686_dec_tv_template[] = {
12073         { /* From RFC 3686 */
12074                 .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
12075                           "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
12076                           "\x00\x00\x00\x30",
12077                 .klen   = 20,
12078                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
12079                 .input  = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
12080                           "\x2d\x61\x75\xa3\x26\x13\x11\xb8",
12081                 .ilen   = 16,
12082                 .result = "Single block msg",
12083                 .rlen   = 16,
12084         }, {
12085                 .key    = "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
12086                           "\x43\xd6\xce\x1f\x32\x53\x91\x63"
12087                           "\x00\x6c\xb6\xdb",
12088                 .klen   = 20,
12089                 .iv     = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
12090                 .input  = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
12091                           "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
12092                           "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
12093                           "\xfc\xe6\x30\xdf\x91\x41\xbe\x28",
12094                 .ilen   = 32,
12095                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
12096                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12097                           "\x10\x11\x12\x13\x14\x15\x16\x17"
12098                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
12099                 .rlen   = 32,
12100         }, {
12101                 .key    = "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
12102                           "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
12103                           "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
12104                           "\x00\x00\x00\x48",
12105                 .klen   = 28,
12106                 .iv     = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
12107                 .input  = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
12108                           "\x4e\x79\x35\xa0\x03\xcb\xe9\x28",
12109                 .ilen   = 16,
12110                 .result = "Single block msg",
12111                 .rlen   = 16,
12112         }, {
12113                 .key    = "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
12114                           "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
12115                           "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
12116                           "\x00\x96\xb0\x3b",
12117                 .klen   = 28,
12118                 .iv     = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
12119                 .input  = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
12120                           "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
12121                           "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
12122                           "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00",
12123                 .ilen   = 32,
12124                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
12125                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12126                           "\x10\x11\x12\x13\x14\x15\x16\x17"
12127                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
12128                 .rlen   = 32,
12129         }, {
12130                 .key    = "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
12131                           "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
12132                           "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
12133                           "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
12134                           "\x00\x00\x00\x60",
12135                 .klen   = 36,
12136                 .iv     = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
12137                 .input  = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
12138                           "\x56\x08\x63\xdc\x71\xe3\xe0\xc0",
12139                 .ilen   = 16,
12140                 .result = "Single block msg",
12141                 .rlen   = 16,
12142         }, {
12143                 .key    = "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
12144                           "\x07\x96\x36\x58\x79\xef\xf8\x86"
12145                           "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
12146                           "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
12147                           "\x00\xfa\xac\x24",
12148                 .klen   = 36,
12149                 .iv     = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
12150                 .input  = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
12151                           "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
12152                           "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
12153                           "\x55\x30\x83\x1d\x93\x44\xaf\x1c",
12154                 .ilen   = 32,
12155                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
12156                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12157                           "\x10\x11\x12\x13\x14\x15\x16\x17"
12158                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
12159                 .rlen   = 32,
12160         },
12161 };
12162
12163 static struct cipher_testvec aes_ofb_enc_tv_template[] = {
12164          /* From NIST Special Publication 800-38A, Appendix F.5 */
12165         {
12166                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
12167                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
12168                 .klen   = 16,
12169                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
12170                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
12171                 .input = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
12172                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
12173                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
12174                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
12175                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
12176                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
12177                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
12178                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
12179                 .ilen   = 64,
12180                 .result = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
12181                           "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
12182                           "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
12183                           "\x3c\x52\xda\xc5\x4e\xd8\x25"
12184                           "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
12185                           "\x44\xf7\xa8\x22\x60\xed\xcc"
12186                           "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
12187                           "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
12188                 .rlen   = 64,
12189         }
12190 };
12191
12192 static struct cipher_testvec aes_ofb_dec_tv_template[] = {
12193          /* From NIST Special Publication 800-38A, Appendix F.5 */
12194         {
12195                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
12196                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
12197                 .klen   = 16,
12198                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
12199                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
12200                 .input = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
12201                           "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
12202                           "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
12203                           "\x3c\x52\xda\xc5\x4e\xd8\x25"
12204                           "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
12205                           "\x44\xf7\xa8\x22\x60\xed\xcc"
12206                           "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
12207                           "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
12208                 .ilen   = 64,
12209                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
12210                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
12211                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
12212                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
12213                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
12214                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
12215                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
12216                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
12217                 .rlen   = 64,
12218         }
12219 };
12220
12221 static struct aead_testvec aes_gcm_enc_tv_template[] = {
12222         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
12223                 .key    = zeroed_string,
12224                 .klen   = 16,
12225                 .result = "\x58\xe2\xfc\xce\xfa\x7e\x30\x61"
12226                           "\x36\x7f\x1d\x57\xa4\xe7\x45\x5a",
12227                 .rlen   = 16,
12228         }, {
12229                 .key    = zeroed_string,
12230                 .klen   = 16,
12231                 .input  = zeroed_string,
12232                 .ilen   = 16,
12233                 .result = "\x03\x88\xda\xce\x60\xb6\xa3\x92"
12234                           "\xf3\x28\xc2\xb9\x71\xb2\xfe\x78"
12235                           "\xab\x6e\x47\xd4\x2c\xec\x13\xbd"
12236                           "\xf5\x3a\x67\xb2\x12\x57\xbd\xdf",
12237                 .rlen   = 32,
12238         }, {
12239                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12240                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12241                 .klen   = 16,
12242                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12243                           "\xde\xca\xf8\x88",
12244                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12245                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12246                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12247                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12248                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12249                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12250                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12251                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
12252                 .ilen   = 64,
12253                 .result = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
12254                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
12255                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
12256                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
12257                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
12258                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
12259                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
12260                           "\x3d\x58\xe0\x91\x47\x3f\x59\x85"
12261                           "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6"
12262                           "\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4",
12263                 .rlen   = 80,
12264         }, {
12265                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12266                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12267                 .klen   = 16,
12268                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12269                           "\xde\xca\xf8\x88",
12270                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12271                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12272                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12273                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12274                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12275                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12276                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12277                           "\xba\x63\x7b\x39",
12278                 .ilen   = 60,
12279                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12280                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12281                           "\xab\xad\xda\xd2",
12282                 .alen   = 20,
12283                 .result = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
12284                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
12285                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
12286                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
12287                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
12288                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
12289                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
12290                           "\x3d\x58\xe0\x91"
12291                           "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb"
12292                           "\x94\xfa\xe9\x5a\xe7\x12\x1a\x47",
12293                 .rlen   = 76,
12294         }, {
12295                 .key    = zeroed_string,
12296                 .klen   = 24,
12297                 .result = "\xcd\x33\xb2\x8a\xc7\x73\xf7\x4b"
12298                           "\xa0\x0e\xd1\xf3\x12\x57\x24\x35",
12299                 .rlen   = 16,
12300         }, {
12301                 .key    = zeroed_string,
12302                 .klen   = 24,
12303                 .input  = zeroed_string,
12304                 .ilen   = 16,
12305                 .result = "\x98\xe7\x24\x7c\x07\xf0\xfe\x41"
12306                           "\x1c\x26\x7e\x43\x84\xb0\xf6\x00"
12307                           "\x2f\xf5\x8d\x80\x03\x39\x27\xab"
12308                           "\x8e\xf4\xd4\x58\x75\x14\xf0\xfb",
12309                 .rlen   = 32,
12310         }, {
12311                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12312                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12313                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
12314                 .klen   = 24,
12315                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12316                           "\xde\xca\xf8\x88",
12317                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12318                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12319                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12320                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12321                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12322                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12323                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12324                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
12325                 .ilen   = 64,
12326                 .result = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
12327                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
12328                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
12329                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
12330                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
12331                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
12332                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
12333                           "\xcc\xda\x27\x10\xac\xad\xe2\x56"
12334                           "\x99\x24\xa7\xc8\x58\x73\x36\xbf"
12335                           "\xb1\x18\x02\x4d\xb8\x67\x4a\x14",
12336                 .rlen   = 80,
12337         }, {
12338                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12339                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12340                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
12341                 .klen   = 24,
12342                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12343                           "\xde\xca\xf8\x88",
12344                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12345                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12346                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12347                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12348                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12349                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12350                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12351                           "\xba\x63\x7b\x39",
12352                 .ilen   = 60,
12353                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12354                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12355                           "\xab\xad\xda\xd2",
12356                 .alen   = 20,
12357                 .result = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
12358                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
12359                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
12360                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
12361                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
12362                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
12363                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
12364                           "\xcc\xda\x27\x10"
12365                           "\x25\x19\x49\x8e\x80\xf1\x47\x8f"
12366                           "\x37\xba\x55\xbd\x6d\x27\x61\x8c",
12367                 .rlen   = 76,
12368                 .np     = 2,
12369                 .tap    = { 32, 28 },
12370                 .anp    = 2,
12371                 .atap   = { 8, 12 }
12372         }, {
12373                 .key    = zeroed_string,
12374                 .klen   = 32,
12375                 .result = "\x53\x0f\x8a\xfb\xc7\x45\x36\xb9"
12376                           "\xa9\x63\xb4\xf1\xc4\xcb\x73\x8b",
12377                 .rlen   = 16,
12378         }
12379 };
12380
12381 static struct aead_testvec aes_gcm_dec_tv_template[] = {
12382         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
12383                 .key    = zeroed_string,
12384                 .klen   = 32,
12385                 .input  = "\xce\xa7\x40\x3d\x4d\x60\x6b\x6e"
12386                           "\x07\x4e\xc5\xd3\xba\xf3\x9d\x18"
12387                           "\xd0\xd1\xc8\xa7\x99\x99\x6b\xf0"
12388                           "\x26\x5b\x98\xb5\xd4\x8a\xb9\x19",
12389                 .ilen   = 32,
12390                 .result  = zeroed_string,
12391                 .rlen   = 16,
12392         }, {
12393                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12394                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12395                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12396                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12397                 .klen   = 32,
12398                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12399                           "\xde\xca\xf8\x88",
12400                 .input  = "\x52\x2d\xc1\xf0\x99\x56\x7d\x07"
12401                           "\xf4\x7f\x37\xa3\x2a\x84\x42\x7d"
12402                           "\x64\x3a\x8c\xdc\xbf\xe5\xc0\xc9"
12403                           "\x75\x98\xa2\xbd\x25\x55\xd1\xaa"
12404                           "\x8c\xb0\x8e\x48\x59\x0d\xbb\x3d"
12405                           "\xa7\xb0\x8b\x10\x56\x82\x88\x38"
12406                           "\xc5\xf6\x1e\x63\x93\xba\x7a\x0a"
12407                           "\xbc\xc9\xf6\x62\x89\x80\x15\xad"
12408                           "\xb0\x94\xda\xc5\xd9\x34\x71\xbd"
12409                           "\xec\x1a\x50\x22\x70\xe3\xcc\x6c",
12410                 .ilen   = 80,
12411                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12412                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12413                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12414                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12415                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12416                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12417                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12418                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
12419                 .rlen   = 64,
12420         }, {
12421                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12422                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12423                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12424                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12425                 .klen   = 32,
12426                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12427                           "\xde\xca\xf8\x88",
12428                 .input  = "\x52\x2d\xc1\xf0\x99\x56\x7d\x07"
12429                           "\xf4\x7f\x37\xa3\x2a\x84\x42\x7d"
12430                           "\x64\x3a\x8c\xdc\xbf\xe5\xc0\xc9"
12431                           "\x75\x98\xa2\xbd\x25\x55\xd1\xaa"
12432                           "\x8c\xb0\x8e\x48\x59\x0d\xbb\x3d"
12433                           "\xa7\xb0\x8b\x10\x56\x82\x88\x38"
12434                           "\xc5\xf6\x1e\x63\x93\xba\x7a\x0a"
12435                           "\xbc\xc9\xf6\x62"
12436                           "\x76\xfc\x6e\xce\x0f\x4e\x17\x68"
12437                           "\xcd\xdf\x88\x53\xbb\x2d\x55\x1b",
12438                 .ilen   = 76,
12439                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12440                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12441                           "\xab\xad\xda\xd2",
12442                 .alen   = 20,
12443                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12444                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12445                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12446                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12447                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12448                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12449                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12450                           "\xba\x63\x7b\x39",
12451                 .rlen   = 60,
12452                 .np     = 2,
12453                 .tap    = { 48, 28 },
12454                 .anp    = 3,
12455                 .atap   = { 8, 8, 4 }
12456         }, {
12457                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12458                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12459                 .klen   = 16,
12460                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12461                           "\xde\xca\xf8\x88",
12462                 .input  = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
12463                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
12464                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
12465                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
12466                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
12467                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
12468                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
12469                           "\x3d\x58\xe0\x91\x47\x3f\x59\x85"
12470                           "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6"
12471                           "\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4",
12472                 .ilen   = 80,
12473                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12474                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12475                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12476                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12477                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12478                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12479                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12480                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
12481                 .rlen   = 64,
12482         }, {
12483                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12484                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
12485                 .klen   = 16,
12486                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12487                           "\xde\xca\xf8\x88",
12488                 .input  = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
12489                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
12490                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
12491                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
12492                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
12493                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
12494                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
12495                           "\x3d\x58\xe0\x91"
12496                           "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb"
12497                           "\x94\xfa\xe9\x5a\xe7\x12\x1a\x47",
12498                 .ilen   = 76,
12499                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12500                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12501                           "\xab\xad\xda\xd2",
12502                 .alen   = 20,
12503                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12504                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12505                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12506                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12507                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12508                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12509                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12510                           "\xba\x63\x7b\x39",
12511                 .rlen   = 60,
12512         }, {
12513                 .key    = zeroed_string,
12514                 .klen   = 24,
12515                 .input  = "\x98\xe7\x24\x7c\x07\xf0\xfe\x41"
12516                           "\x1c\x26\x7e\x43\x84\xb0\xf6\x00"
12517                           "\x2f\xf5\x8d\x80\x03\x39\x27\xab"
12518                           "\x8e\xf4\xd4\x58\x75\x14\xf0\xfb",
12519                 .ilen   = 32,
12520                 .result  = zeroed_string,
12521                 .rlen   = 16,
12522         }, {
12523                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12524                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12525                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
12526                 .klen   = 24,
12527                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12528                           "\xde\xca\xf8\x88",
12529                 .input  = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
12530                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
12531                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
12532                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
12533                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
12534                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
12535                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
12536                           "\xcc\xda\x27\x10\xac\xad\xe2\x56"
12537                           "\x99\x24\xa7\xc8\x58\x73\x36\xbf"
12538                           "\xb1\x18\x02\x4d\xb8\x67\x4a\x14",
12539                 .ilen   = 80,
12540                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12541                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12542                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12543                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12544                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12545                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12546                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12547                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
12548                 .rlen   = 64,
12549         }, {
12550                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12551                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12552                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
12553                 .klen   = 24,
12554                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
12555                           "\xde\xca\xf8\x88",
12556                 .input  = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
12557                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
12558                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
12559                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
12560                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
12561                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
12562                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
12563                           "\xcc\xda\x27\x10"
12564                           "\x25\x19\x49\x8e\x80\xf1\x47\x8f"
12565                           "\x37\xba\x55\xbd\x6d\x27\x61\x8c",
12566                 .ilen   = 76,
12567                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12568                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
12569                           "\xab\xad\xda\xd2",
12570                 .alen   = 20,
12571                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
12572                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
12573                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
12574                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
12575                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
12576                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
12577                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
12578                           "\xba\x63\x7b\x39",
12579                 .rlen   = 60,
12580         }
12581 };
12582
12583 static struct aead_testvec aes_gcm_rfc4106_enc_tv_template[] = {
12584         { /* Generated using Crypto++ */
12585                 .key    = zeroed_string,
12586                 .klen   = 20,
12587                 .iv     = zeroed_string,
12588                 .input  = zeroed_string,
12589                 .ilen   = 16,
12590                 .assoc  = zeroed_string,
12591                 .alen   = 8,
12592                 .result = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
12593                           "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
12594                           "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
12595                           "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
12596                 .rlen   = 32,
12597         },{
12598                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12599                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12600                           "\x00\x00\x00\x00",
12601                 .klen   = 20,
12602                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12603                           "\x00\x00\x00\x00",
12604                 .input  = zeroed_string,
12605                 .ilen   = 16,
12606                 .assoc  = zeroed_string,
12607                 .alen   = 8,
12608                 .result = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
12609                           "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
12610                           "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
12611                           "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
12612                 .rlen   = 32,
12613
12614         }, {
12615                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12616                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12617                           "\x00\x00\x00\x00",
12618                 .klen   = 20,
12619                 .iv     = zeroed_string,
12620                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
12621                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12622                 .ilen   = 16,
12623                 .assoc  = zeroed_string,
12624                 .alen   = 8,
12625                 .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
12626                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
12627                           "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
12628                           "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
12629                 .rlen   = 32,
12630         }, {
12631                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12632                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12633                           "\x00\x00\x00\x00",
12634                 .klen   = 20,
12635                 .iv     = zeroed_string,
12636                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
12637                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12638                 .ilen   = 16,
12639                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12640                 .alen   = 8,
12641                 .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
12642                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
12643                           "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
12644                           "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
12645                 .rlen   = 32,
12646         }, {
12647                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12648                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12649                           "\x00\x00\x00\x00",
12650                 .klen   = 20,
12651                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12652                           "\x00\x00\x00\x00",
12653                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
12654                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12655                 .ilen   = 16,
12656                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12657                 .alen   = 8,
12658                 .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
12659                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
12660                           "\x64\x50\xF9\x32\x13\xFB\x74\x61"
12661                           "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
12662                 .rlen   = 32,
12663         }, {
12664                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12665                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12666                           "\x00\x00\x00\x00",
12667                 .klen   = 20,
12668                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12669                           "\x00\x00\x00\x00",
12670                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
12671                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12672                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12673                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12674                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12675                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12676                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12677                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12678                 .ilen   = 64,
12679                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12680                 .alen   = 8,
12681                 .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
12682                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
12683                           "\x98\x14\xA1\x42\x37\x80\xFD\x90"
12684                           "\x68\x12\x01\xA8\x91\x89\xB9\x83"
12685                           "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
12686                           "\x94\x5F\x18\x12\xBA\x27\x09\x39"
12687                           "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
12688                           "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
12689                           "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
12690                           "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
12691                 .rlen   = 80,
12692         }, {
12693                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
12694                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12695                           "\x00\x00\x00\x00",
12696                 .klen   = 20,
12697                 .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
12698                           "\x00\x00\x00\x00",
12699                 .input  = "\xff\xff\xff\xff\xff\xff\xff\xff"
12700                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12701                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12702                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12703                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12704                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12705                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12706                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12707                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12708                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12709                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12710                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12711                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12712                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12713                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12714                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12715                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12716                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12717                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12718                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12719                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12720                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12721                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12722                           "\xff\xff\xff\xff\xff\xff\xff\xff",
12723                 .ilen   = 192,
12724                 .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
12725                           "\xaa\xaa\xaa\xaa",
12726                 .alen   = 12,
12727                 .result = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
12728                           "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
12729                           "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
12730                           "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
12731                           "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
12732                           "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
12733                           "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
12734                           "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
12735                           "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
12736                           "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
12737                           "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
12738                           "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
12739                           "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
12740                           "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
12741                           "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
12742                           "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
12743                           "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
12744                           "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
12745                           "\x7E\x13\x06\x82\x08\x17\xA4\x35"
12746                           "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
12747                           "\xA3\x05\x38\x95\x20\x1A\x47\x04"
12748                           "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
12749                           "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
12750                           "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
12751                           "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
12752                           "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
12753                 .rlen   = 208,
12754         }
12755 };
12756
12757 static struct aead_testvec aes_gcm_rfc4106_dec_tv_template[] = {
12758         { /* Generated using Crypto++ */
12759                 .key    = zeroed_string,
12760                 .klen   = 20,
12761                 .iv     = zeroed_string,
12762                 .input  = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
12763                           "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
12764                           "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
12765                           "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
12766                 .ilen   = 32,
12767                 .assoc  = zeroed_string,
12768                 .alen   = 8,
12769                 .result = zeroed_string,
12770                 .rlen   = 16,
12771
12772         },{
12773                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12774                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12775                           "\x00\x00\x00\x00",
12776                 .klen   = 20,
12777                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12778                           "\x00\x00\x00\x00",
12779                 .input  = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
12780                           "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
12781                           "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
12782                           "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
12783                 .ilen   = 32,
12784                 .assoc  = zeroed_string,
12785                 .alen   = 8,
12786                 .result = zeroed_string,
12787                 .rlen   = 16,
12788         }, {
12789                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12790                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12791                           "\x00\x00\x00\x00",
12792                 .klen   = 20,
12793                 .iv     = zeroed_string,
12794                 .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
12795                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
12796                           "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
12797                           "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
12798                 .ilen   = 32,
12799                 .assoc  = zeroed_string,
12800                 .alen   = 8,
12801                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
12802                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12803                 .rlen   = 16,
12804         }, {
12805                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12806                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12807                           "\x00\x00\x00\x00",
12808                 .klen   = 20,
12809                 .iv     = zeroed_string,
12810                 .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
12811                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
12812                           "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
12813                           "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
12814                 .ilen   = 32,
12815                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12816                 .alen   = 8,
12817                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
12818                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12819                 .rlen   = 16,
12820
12821         }, {
12822                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12823                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12824                           "\x00\x00\x00\x00",
12825                 .klen   = 20,
12826                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12827                           "\x00\x00\x00\x00",
12828                 .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
12829                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
12830                           "\x64\x50\xF9\x32\x13\xFB\x74\x61"
12831                           "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
12832                 .ilen   = 32,
12833                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12834                 .alen   = 8,
12835                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
12836                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12837                 .rlen   = 16,
12838         }, {
12839                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
12840                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
12841                           "\x00\x00\x00\x00",
12842                 .klen   = 20,
12843                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
12844                           "\x00\x00\x00\x00",
12845                 .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
12846                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
12847                           "\x98\x14\xA1\x42\x37\x80\xFD\x90"
12848                           "\x68\x12\x01\xA8\x91\x89\xB9\x83"
12849                           "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
12850                           "\x94\x5F\x18\x12\xBA\x27\x09\x39"
12851                           "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
12852                           "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
12853                           "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
12854                           "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
12855                 .ilen   = 80,
12856                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
12857                 .alen   = 8,
12858                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
12859                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12860                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12861                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12862                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12863                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12864                           "\x01\x01\x01\x01\x01\x01\x01\x01"
12865                           "\x01\x01\x01\x01\x01\x01\x01\x01",
12866                 .rlen   = 64,
12867         }, {
12868                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
12869                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12870                           "\x00\x00\x00\x00",
12871                 .klen   = 20,
12872                 .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
12873                           "\x00\x00\x00\x00",
12874                 .input  = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
12875                           "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
12876                           "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
12877                           "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
12878                           "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
12879                           "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
12880                           "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
12881                           "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
12882                           "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
12883                           "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
12884                           "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
12885                           "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
12886                           "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
12887                           "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
12888                           "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
12889                           "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
12890                           "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
12891                           "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
12892                           "\x7E\x13\x06\x82\x08\x17\xA4\x35"
12893                           "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
12894                           "\xA3\x05\x38\x95\x20\x1A\x47\x04"
12895                           "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
12896                           "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
12897                           "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
12898                           "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
12899                           "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
12900                 .ilen   = 208,
12901                 .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
12902                           "\xaa\xaa\xaa\xaa",
12903                 .alen   = 12,
12904                 .result = "\xff\xff\xff\xff\xff\xff\xff\xff"
12905                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12906                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12907                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12908                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12909                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12910                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12911                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12912                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12913                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12914                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12915                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12916                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12917                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12918                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12919                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12920                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12921                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12922                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12923                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12924                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12925                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12926                           "\xff\xff\xff\xff\xff\xff\xff\xff"
12927                           "\xff\xff\xff\xff\xff\xff\xff\xff",
12928                 .rlen   = 192,
12929
12930         }
12931 };
12932
12933 static struct aead_testvec aes_ccm_enc_tv_template[] = {
12934         { /* From RFC 3610 */
12935                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
12936                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
12937                 .klen   = 16,
12938                 .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
12939                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
12940                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
12941                 .alen   = 8,
12942                 .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12943                           "\x10\x11\x12\x13\x14\x15\x16\x17"
12944                           "\x18\x19\x1a\x1b\x1c\x1d\x1e",
12945                 .ilen   = 23,
12946                 .result = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
12947                           "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
12948                           "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
12949                           "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
12950                 .rlen   = 31,
12951         }, {
12952                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
12953                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
12954                 .klen   = 16,
12955                 .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
12956                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
12957                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
12958                           "\x08\x09\x0a\x0b",
12959                 .alen   = 12,
12960                 .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
12961                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
12962                           "\x1c\x1d\x1e\x1f",
12963                 .ilen   = 20,
12964                 .result = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
12965                           "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
12966                           "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
12967                           "\x7d\x9c\x2d\x93",
12968                 .rlen   = 28,
12969         }, {
12970                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
12971                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
12972                 .klen   = 16,
12973                 .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
12974                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
12975                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
12976                 .alen   = 8,
12977                 .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
12978                           "\x10\x11\x12\x13\x14\x15\x16\x17"
12979                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
12980                           "\x20",
12981                 .ilen   = 25,
12982                 .result = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
12983                           "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
12984                           "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
12985                           "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
12986                           "\x7e\x5f\x4e",
12987                 .rlen   = 35,
12988         }, {
12989                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
12990                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
12991                 .klen   = 16,
12992                 .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
12993                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
12994                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
12995                           "\x08\x09\x0a\x0b",
12996                 .alen   = 12,
12997                 .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
12998                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
12999                           "\x1c\x1d\x1e",
13000                 .ilen   = 19,
13001                 .result = "\x07\x34\x25\x94\x15\x77\x85\x15"
13002                           "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
13003                           "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
13004                           "\x4d\x99\x99\x88\xdd",
13005                 .rlen   = 29,
13006         }, {
13007                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13008                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13009                 .klen   = 16,
13010                 .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
13011                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13012                 .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
13013                 .alen   = 8,
13014                 .input  = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
13015                           "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
13016                           "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
13017                 .ilen   = 24,
13018                 .result = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
13019                           "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
13020                           "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
13021                           "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
13022                 .rlen   = 32,
13023         }, {
13024                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13025                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13026                 .klen   = 16,
13027                 .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
13028                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13029                 .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
13030                           "\x20\xea\x60\xc0",
13031                 .alen   = 12,
13032                 .input  = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
13033                           "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
13034                           "\x3a\x80\x3b\xa8\x7f",
13035                 .ilen   = 21,
13036                 .result = "\x00\x97\x69\xec\xab\xdf\x48\x62"
13037                           "\x55\x94\xc5\x92\x51\xe6\x03\x57"
13038                           "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
13039                           "\x5a\xe0\x70\x45\x51",
13040                 .rlen   = 29,
13041         }, {
13042                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13043                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13044                 .klen   = 16,
13045                 .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
13046                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13047                 .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
13048                 .alen   = 8,
13049                 .input  = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
13050                           "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
13051                           "\x98\x09\xd6\x7d\xbe\xdd\x18",
13052                 .ilen   = 23,
13053                 .result = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
13054                           "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
13055                           "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
13056                           "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
13057                           "\xba",
13058                 .rlen   = 33,
13059         },
13060 };
13061
13062 static struct aead_testvec aes_ccm_dec_tv_template[] = {
13063         { /* From RFC 3610 */
13064                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
13065                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
13066                 .klen   = 16,
13067                 .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
13068                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
13069                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
13070                 .alen   = 8,
13071                 .input  = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
13072                           "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
13073                           "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
13074                           "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
13075                 .ilen   = 31,
13076                 .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
13077                           "\x10\x11\x12\x13\x14\x15\x16\x17"
13078                           "\x18\x19\x1a\x1b\x1c\x1d\x1e",
13079                 .rlen   = 23,
13080         }, {
13081                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
13082                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
13083                 .klen   = 16,
13084                 .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
13085                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
13086                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
13087                           "\x08\x09\x0a\x0b",
13088                 .alen   = 12,
13089                 .input  = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
13090                           "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
13091                           "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
13092                           "\x7d\x9c\x2d\x93",
13093                 .ilen   = 28,
13094                 .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
13095                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
13096                           "\x1c\x1d\x1e\x1f",
13097                 .rlen   = 20,
13098         }, {
13099                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
13100                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
13101                 .klen   = 16,
13102                 .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
13103                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
13104                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
13105                 .alen   = 8,
13106                 .input  = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
13107                           "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
13108                           "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
13109                           "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
13110                           "\x7e\x5f\x4e",
13111                 .ilen   = 35,
13112                 .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
13113                           "\x10\x11\x12\x13\x14\x15\x16\x17"
13114                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
13115                           "\x20",
13116                 .rlen   = 25,
13117         }, {
13118                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
13119                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
13120                 .klen   = 16,
13121                 .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
13122                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
13123                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
13124                           "\x08\x09\x0a\x0b",
13125                 .alen   = 12,
13126                 .input  = "\x07\x34\x25\x94\x15\x77\x85\x15"
13127                           "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
13128                           "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
13129                           "\x4d\x99\x99\x88\xdd",
13130                 .ilen   = 29,
13131                 .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
13132                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
13133                           "\x1c\x1d\x1e",
13134                 .rlen   = 19,
13135         }, {
13136                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13137                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13138                 .klen   = 16,
13139                 .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
13140                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13141                 .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
13142                 .alen   = 8,
13143                 .input  = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
13144                           "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
13145                           "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
13146                           "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
13147                 .ilen   = 32,
13148                 .result = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
13149                           "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
13150                           "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
13151                 .rlen   = 24,
13152         }, {
13153                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13154                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13155                 .klen   = 16,
13156                 .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
13157                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13158                 .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
13159                           "\x20\xea\x60\xc0",
13160                 .alen   = 12,
13161                 .input  = "\x00\x97\x69\xec\xab\xdf\x48\x62"
13162                           "\x55\x94\xc5\x92\x51\xe6\x03\x57"
13163                           "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
13164                           "\x5a\xe0\x70\x45\x51",
13165                 .ilen   = 29,
13166                 .result = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
13167                           "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
13168                           "\x3a\x80\x3b\xa8\x7f",
13169                 .rlen   = 21,
13170         }, {
13171                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
13172                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
13173                 .klen   = 16,
13174                 .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
13175                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
13176                 .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
13177                 .alen   = 8,
13178                 .input  = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
13179                           "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
13180                           "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
13181                           "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
13182                           "\xba",
13183                 .ilen   = 33,
13184                 .result = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
13185                           "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
13186                           "\x98\x09\xd6\x7d\xbe\xdd\x18",
13187                 .rlen   = 23,
13188         },
13189 };
13190
13191 /*
13192  * rfc4309 refers to section 8 of rfc3610 for test vectors, but they all
13193  * use a 13-byte nonce, we only support an 11-byte nonce. Similarly, all of
13194  * Special Publication 800-38C's test vectors also use nonce lengths our
13195  * implementation doesn't support. The following are taken from fips cavs
13196  * fax files on hand at Red Hat.
13197  *
13198  * nb: actual key lengths are (klen - 3), the last 3 bytes are actually
13199  * part of the nonce which combine w/the iv, but need to be input this way.
13200  */
13201 static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[] = {
13202         {
13203                 .key    = "\x83\xac\x54\x66\xc2\xeb\xe5\x05"
13204                           "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e"
13205                           "\x96\xac\x59",
13206                 .klen   = 19,
13207                 .iv     = "\x30\x07\xa1\xe2\xa2\xc7\x55\x24",
13208                 .alen   = 0,
13209                 .input  = "\x19\xc8\x81\xf6\xe9\x86\xff\x93"
13210                           "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e"
13211                           "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c"
13212                           "\x35\x2e\xad\xe0\x62\xf9\x91\xa1",
13213                 .ilen   = 32,
13214                 .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8"
13215                           "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1"
13216                           "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a"
13217                           "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32"
13218                           "\xda\x24\xea\xd9\xa1\x39\x98\xfd"
13219                           "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8",
13220                 .rlen   = 48,
13221         }, {
13222                 .key    = "\x1e\x2c\x7e\x01\x41\x9a\xef\xc0"
13223                           "\x0d\x58\x96\x6e\x5c\xa2\x4b\xd3"
13224                           "\x4f\xa3\x19",
13225                 .klen   = 19,
13226                 .iv     = "\xd3\x01\x5a\xd8\x30\x60\x15\x56",
13227                 .assoc  = "\xda\xe6\x28\x9c\x45\x2d\xfd\x63"
13228                           "\x5e\xda\x4c\xb6\xe6\xfc\xf9\xb7"
13229                           "\x0c\x56\xcb\xe4\xe0\x05\x7a\xe1"
13230                           "\x0a\x63\x09\x78\xbc\x2c\x55\xde",
13231                 .alen   = 32,
13232                 .input  = "\x87\xa3\x36\xfd\x96\xb3\x93\x78"
13233                           "\xa9\x28\x63\xba\x12\xa3\x14\x85"
13234                           "\x57\x1e\x06\xc9\x7b\x21\xef\x76"
13235                           "\x7f\x38\x7e\x8e\x29\xa4\x3e\x7e",
13236                 .ilen   = 32,
13237                 .result = "\x8a\x1e\x11\xf0\x02\x6b\xe2\x19"
13238                           "\xfc\x70\xc4\x6d\x8e\xb7\x99\xab"
13239                           "\xc5\x4b\xa2\xac\xd3\xf3\x48\xff"
13240                           "\x3b\xb5\xce\x53\xef\xde\xbb\x02"
13241                           "\xa9\x86\x15\x6c\x13\xfe\xda\x0a"
13242                           "\x22\xb8\x29\x3d\xd8\x39\x9a\x23",
13243                 .rlen   = 48,
13244         }, {
13245                 .key    = "\xf4\x6b\xc2\x75\x62\xfe\xb4\xe1"
13246                           "\xa3\xf0\xff\xdd\x4e\x4b\x12\x75"
13247                           "\x53\x14\x73\x66\x8d\x88\xf6\x80"
13248                           "\xa0\x20\x35",
13249                 .klen   = 27,
13250                 .iv     = "\x26\xf2\x21\x8d\x50\x20\xda\xe2",
13251                 .assoc  = "\x5b\x9e\x13\x67\x02\x5e\xef\xc1"
13252                           "\x6c\xf9\xd7\x1e\x52\x8f\x7a\x47"
13253                           "\xe9\xd4\xcf\x20\x14\x6e\xf0\x2d"
13254                           "\xd8\x9e\x2b\x56\x10\x23\x56\xe7",
13255                 .alen   = 32,
13256                 .ilen   = 0,
13257                 .result = "\x36\xea\x7a\x70\x08\xdc\x6a\xbc"
13258                           "\xad\x0c\x7a\x63\xf6\x61\xfd\x9b",
13259                 .rlen   = 16,
13260         }, {
13261                 .key    = "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42"
13262                           "\xef\x7a\xd3\xce\xfc\x84\x60\x62"
13263                           "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01"
13264                           "\xd6\x3c\x8c",
13265                 .klen   = 27,
13266                 .iv     = "\x86\x84\xb6\xcd\xef\x09\x2e\x94",
13267                 .assoc  = "\x02\x65\x78\x3c\xe9\x21\x30\x91"
13268                           "\xb1\xb9\xda\x76\x9a\x78\x6d\x95"
13269                           "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c"
13270                           "\xe3\x00\x73\x69\x84\x69\x87\x79",
13271                 .alen   = 32,
13272                 .input  = "\x9f\xd2\x02\x4b\x52\x49\x31\x3c"
13273                           "\x43\x69\x3a\x2d\x8e\x70\xad\x7e"
13274                           "\xe0\xe5\x46\x09\x80\x89\x13\xb2"
13275                           "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b",
13276                 .ilen   = 32,
13277                 .result = "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62"
13278                           "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f"
13279                           "\x9b\x6a\x09\x70\xc1\x51\x83\xc2"
13280                           "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e"
13281                           "\xc7\x79\x11\x58\xe5\x6b\x20\x40"
13282                           "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1",
13283                 .rlen   = 48,
13284         }, {
13285                 .key    = "\xe0\x8d\x99\x71\x60\xd7\x97\x1a"
13286                           "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a"
13287                           "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e"
13288                           "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b"
13289                           "\x1e\x29\x91",
13290                 .klen   = 35,
13291                 .iv     = "\xad\x8e\xc1\x53\x0a\xcf\x2d\xbe",
13292                 .assoc  = "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b"
13293                           "\x78\x2b\x94\x02\x29\x0f\x42\x27"
13294                           "\x6b\x75\xcb\x98\x34\x08\x7e\x79"
13295                           "\xe4\x3e\x49\x0d\x84\x8b\x22\x87",
13296                 .alen   = 32,
13297                 .input  = "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f"
13298                           "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66"
13299                           "\xbf\x17\x99\x62\x4a\x39\x27\x1f"
13300                           "\x1d\xdc\x24\xae\x19\x2f\x98\x4c",
13301                 .ilen   = 32,
13302                 .result = "\x19\xb8\x61\x33\x45\x2b\x43\x96"
13303                           "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6"
13304                           "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f"
13305                           "\xf0\x62\x17\x34\xf2\x1e\x8d\x75"
13306                           "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d",
13307                 .rlen   = 40,
13308         }, {
13309                 .key    = "\x7c\xc8\x18\x3b\x8d\x99\xe0\x7c"
13310                           "\x45\x41\xb8\xbd\x5c\xa7\xc2\x32"
13311                           "\x8a\xb8\x02\x59\xa4\xfe\xa9\x2c"
13312                           "\x09\x75\x9a\x9b\x3c\x9b\x27\x39"
13313                           "\xf9\xd9\x4e",
13314                 .klen   = 35,
13315                 .iv     = "\x63\xb5\x3d\x9d\x43\xf6\x1e\x50",
13316                 .assoc  = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b"
13317                           "\x13\x02\x01\x0c\x83\x4c\x96\x35"
13318                           "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94"
13319                           "\xb0\x39\x36\xe6\x8f\x57\xe0\x13",
13320                 .alen   = 32,
13321                 .input  = "\x3b\x6c\x29\x36\xb6\xef\x07\xa6"
13322                           "\x83\x72\x07\x4f\xcf\xfa\x66\x89"
13323                           "\x5f\xca\xb1\xba\xd5\x8f\x2c\x27"
13324                           "\x30\xdb\x75\x09\x93\xd4\x65\xe4",
13325                 .ilen   = 32,
13326                 .result = "\xb0\x88\x5a\x33\xaa\xe5\xc7\x1d"
13327                           "\x85\x23\xc7\xc6\x2f\xf4\x1e\x3d"
13328                           "\xcc\x63\x44\x25\x07\x78\x4f\x9e"
13329                           "\x96\xb8\x88\xeb\xbc\x48\x1f\x06"
13330                           "\x39\xaf\x39\xac\xd8\x4a\x80\x39"
13331                           "\x7b\x72\x8a\xf7",
13332                 .rlen   = 44,
13333         }, {
13334                 .key    = "\xab\xd0\xe9\x33\x07\x26\xe5\x83"
13335                           "\x8c\x76\x95\xd4\xb6\xdc\xf3\x46"
13336                           "\xf9\x8f\xad\xe3\x02\x13\x83\x77"
13337                           "\x3f\xb0\xf1\xa1\xa1\x22\x0f\x2b"
13338                           "\x24\xa7\x8b",
13339                 .klen   = 35,
13340                 .iv     = "\x07\xcb\xcc\x0e\xe6\x33\xbf\xf5",
13341                 .assoc  = "\xd4\xdb\x30\x1d\x03\xfe\xfd\x5f"
13342                           "\x87\xd4\x8c\xb6\xb6\xf1\x7a\x5d"
13343                           "\xab\x90\x65\x8d\x8e\xca\x4d\x4f"
13344                           "\x16\x0c\x40\x90\x4b\xc7\x36\x73",
13345                 .alen   = 32,
13346                 .input  = "\xf5\xc6\x7d\x48\xc1\xb7\xe6\x92"
13347                           "\x97\x5a\xca\xc4\xa9\x6d\xf9\x3d"
13348                           "\x6c\xde\xbc\xf1\x90\xea\x6a\xb2"
13349                           "\x35\x86\x36\xaf\x5c\xfe\x4b\x3a",
13350                 .ilen   = 32,
13351                 .result = "\x83\x6f\x40\x87\x72\xcf\xc1\x13"
13352                           "\xef\xbb\x80\x21\x04\x6c\x58\x09"
13353                           "\x07\x1b\xfc\xdf\xc0\x3f\x5b\xc7"
13354                           "\xe0\x79\xa8\x6e\x71\x7c\x3f\xcf"
13355                           "\x5c\xda\xb2\x33\xe5\x13\xe2\x0d"
13356                           "\x74\xd1\xef\xb5\x0f\x3a\xb5\xf8",
13357                 .rlen   = 48,
13358         },
13359 };
13360
13361 static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = {
13362         {
13363                 .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
13364                           "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
13365                           "\xc6\xfb\x7d",
13366                 .klen   = 19,
13367                 .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
13368                 .alen   = 0,
13369                 .input  = "\xd5\xe8\x93\x9f\xc7\x89\x2e\x2b",
13370                 .ilen   = 8,
13371                 .result = "\x00",
13372                 .rlen   = 0,
13373                 .novrfy = 1,
13374         }, {
13375                 .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
13376                           "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
13377                           "\xaf\x94\x87",
13378                 .klen   = 19,
13379                 .iv     = "\x78\x35\x82\x81\x7f\x88\x94\x68",
13380                 .alen   = 0,
13381                 .input  = "\x41\x3c\xb8\x87\x73\xcb\xf3\xf3",
13382                 .ilen   = 8,
13383                 .result = "\x00",
13384                 .rlen   = 0,
13385         }, {
13386                 .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
13387                           "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
13388                           "\xc6\xfb\x7d",
13389                 .klen   = 19,
13390                 .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
13391                 .assoc  = "\xf3\x94\x87\x78\x35\x82\x81\x7f"
13392                           "\x88\x94\x68\xb1\x78\x6b\x2b\xd6"
13393                           "\x04\x1f\x4e\xed\x78\xd5\x33\x66"
13394                           "\xd8\x94\x99\x91\x81\x54\x62\x57",
13395                 .alen   = 32,
13396                 .input  = "\xf0\x7c\x29\x02\xae\x1c\x2f\x55"
13397                           "\xd0\xd1\x3d\x1a\xa3\x6d\xe4\x0a"
13398                           "\x86\xb0\x87\x6b\x62\x33\x8c\x34"
13399                           "\xce\xab\x57\xcc\x79\x0b\xe0\x6f"
13400                           "\x5c\x3e\x48\x1f\x6c\x46\xf7\x51"
13401                           "\x8b\x84\x83\x2a\xc1\x05\xb8\xc5",
13402                 .ilen   = 48,
13403                 .result = "\x50\x82\x3e\x07\xe2\x1e\xb6\xfb"
13404                           "\x33\xe4\x73\xce\xd2\xfb\x95\x79"
13405                           "\xe8\xb4\xb5\x77\x11\x10\x62\x6f"
13406                           "\x6a\x82\xd1\x13\xec\xf5\xd0\x48",
13407                 .rlen   = 32,
13408                 .novrfy = 1,
13409         }, {
13410                 .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
13411                           "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
13412                           "\x05\xe0\xc9",
13413                 .klen   = 19,
13414                 .iv     = "\x0f\xed\x34\xea\x97\xd4\x3b\xdf",
13415                 .assoc  = "\x49\x5c\x50\x1f\x1d\x94\xcc\x81"
13416                           "\xba\xb7\xb6\x03\xaf\xa5\xc1\xa1"
13417                           "\xd8\x5c\x42\x68\xe0\x6c\xda\x89"
13418                           "\x05\xac\x56\xac\x1b\x2a\xd3\x86",
13419                 .alen   = 32,
13420                 .input  = "\x39\xbe\x7d\x15\x62\x77\xf3\x3c"
13421                           "\xad\x83\x52\x6d\x71\x03\x25\x1c"
13422                           "\xed\x81\x3a\x9a\x16\x7d\x19\x80"
13423                           "\x72\x04\x72\xd0\xf6\xff\x05\x0f"
13424                           "\xb7\x14\x30\x00\x32\x9e\xa0\xa6"
13425                           "\x9e\x5a\x18\xa1\xb8\xfe\xdb\xd3",
13426                 .ilen   = 48,
13427                 .result = "\x75\x05\xbe\xc2\xd9\x1e\xde\x60"
13428                           "\x47\x3d\x8c\x7d\xbd\xb5\xd9\xb7"
13429                           "\xf2\xae\x61\x05\x8f\x82\x24\x3f"
13430                           "\x9c\x67\x91\xe1\x38\x4f\xe4\x0c",
13431                 .rlen   = 32,
13432         }, {
13433                 .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
13434                           "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
13435                           "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
13436                           "\xee\x49\x83",
13437                 .klen   = 27,
13438                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
13439                 .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
13440                           "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
13441                           "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
13442                           "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
13443                 .alen   = 32,
13444                 .input  = "\x71\x99\xfa\xf4\x44\x12\x68\x9b",
13445                 .ilen   = 8,
13446                 .result = "\x00",
13447                 .rlen   = 0,
13448         }, {
13449                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
13450                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
13451                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
13452                           "\xee\x49\x83",
13453                 .klen   = 27,
13454                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
13455                 .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
13456                           "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
13457                           "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
13458                           "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
13459                 .alen   = 32,
13460                 .input  = "\xfb\xe5\x5d\x34\xbe\xe5\xe8\xe7"
13461                           "\x5a\xef\x2f\xbf\x1f\x7f\xd4\xb2"
13462                           "\x66\xca\x61\x1e\x96\x7a\x61\xb3"
13463                           "\x1c\x16\x45\x52\xba\x04\x9c\x9f"
13464                           "\xb1\xd2\x40\xbc\x52\x7c\x6f\xb1",
13465                 .ilen   = 40,
13466                 .result = "\x85\x34\x66\x42\xc8\x92\x0f\x36"
13467                           "\x58\xe0\x6b\x91\x3c\x98\x5c\xbb"
13468                           "\x0a\x85\xcc\x02\xad\x7a\x96\xe9"
13469                           "\x65\x43\xa4\xc3\x0f\xdc\x55\x81",
13470                 .rlen   = 32,
13471         }, {
13472                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
13473                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
13474                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
13475                           "\xd1\xfc\x57",
13476                 .klen   = 27,
13477                 .iv     = "\x9c\xfe\xb8\x9c\xad\x71\xaa\x1f",
13478                 .assoc  = "\x86\x67\xa5\xa9\x14\x5f\x0d\xc6"
13479                           "\xff\x14\xc7\x44\xbf\x6c\x3a\xc3"
13480                           "\xff\xb6\x81\xbd\xe2\xd5\x06\xc7"
13481                           "\x3c\xa1\x52\x13\x03\x8a\x23\x3a",
13482                 .alen   = 32,
13483                 .input  = "\x3f\x66\xb0\x9d\xe5\x4b\x38\x00"
13484                           "\xc6\x0e\x6e\xe5\xd6\x98\xa6\x37"
13485                           "\x8c\x26\x33\xc6\xb2\xa2\x17\xfa"
13486                           "\x64\x19\xc0\x30\xd7\xfc\x14\x6b"
13487                           "\xe3\x33\xc2\x04\xb0\x37\xbe\x3f"
13488                           "\xa9\xb4\x2d\x68\x03\xa3\x44\xef",
13489                 .ilen   = 48,
13490                 .result = "\x02\x87\x4d\x28\x80\x6e\xb2\xed"
13491                           "\x99\x2a\xa8\xca\x04\x25\x45\x90"
13492                           "\x1d\xdd\x5a\xd9\xe4\xdb\x9c\x9c"
13493                           "\x49\xe9\x01\xfe\xa7\x80\x6d\x6b",
13494                 .rlen   = 32,
13495                 .novrfy = 1,
13496         }, {
13497                 .key    = "\xa4\x4b\x54\x29\x0a\xb8\x6d\x01"
13498                           "\x5b\x80\x2a\xcf\x25\xc4\xb7\x5c"
13499                           "\x20\x2c\xad\x30\xc2\x2b\x41\xfb"
13500                           "\x0e\x85\xbc\x33\xad\x0f\x2b\xff"
13501                           "\xee\x49\x83",
13502                 .klen   = 35,
13503                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
13504                 .alen   = 0,
13505                 .input  = "\x1f\xb8\x8f\xa3\xdd\x54\x00\xf2",
13506                 .ilen   = 8,
13507                 .result = "\x00",
13508                 .rlen   = 0,
13509         }, {
13510                 .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
13511                           "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
13512                           "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
13513                           "\xae\x8f\x11\x4c\xc2\x9c\x4a\xbb"
13514                           "\x85\x34\x66",
13515                 .klen   = 35,
13516                 .iv     = "\x42\xc8\x92\x0f\x36\x58\xe0\x6b",
13517                 .alen   = 0,
13518                 .input  = "\x48\x01\x5e\x02\x24\x04\x66\x47"
13519                           "\xa1\xea\x6f\xaf\xe8\xfc\xfb\xdd"
13520                           "\xa5\xa9\x87\x8d\x84\xee\x2e\x77"
13521                           "\xbb\x86\xb9\xf5\x5c\x6c\xff\xf6"
13522                           "\x72\xc3\x8e\xf7\x70\xb1\xb2\x07"
13523                           "\xbc\xa8\xa3\xbd\x83\x7c\x1d\x2a",
13524                 .ilen   = 48,
13525                 .result = "\xdc\x56\xf2\x71\xb0\xb1\xa0\x6c"
13526                           "\xf0\x97\x3a\xfb\x6d\xe7\x32\x99"
13527                           "\x3e\xaf\x70\x5e\xb2\x4d\xea\x39"
13528                           "\x89\xd4\x75\x7a\x63\xb1\xda\x93",
13529                 .rlen   = 32,
13530                 .novrfy = 1,
13531         }, {
13532                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
13533                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
13534                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
13535                           "\x0d\x1a\x53\x3b\xb5\xe3\xf8\x8b"
13536                           "\xcf\x76\x3f",
13537                 .klen   = 35,
13538                 .iv     = "\xd9\x95\x75\x8f\x44\x89\x40\x7b",
13539                 .assoc  = "\x8f\x86\x6c\x4d\x1d\xc5\x39\x88"
13540                           "\xc8\xf3\x5c\x52\x10\x63\x6f\x2b"
13541                           "\x8a\x2a\xc5\x6f\x30\x23\x58\x7b"
13542                           "\xfb\x36\x03\x11\xb4\xd9\xf2\xfe",
13543                 .alen   = 32,
13544                 .input  = "\x48\x58\xd6\xf3\xad\x63\x58\xbf"
13545                           "\xae\xc7\x5e\xae\x83\x8f\x7b\xe4"
13546                           "\x78\x5c\x4c\x67\x71\x89\x94\xbf"
13547                           "\x47\xf1\x63\x7e\x1c\x59\xbd\xc5"
13548                           "\x7f\x44\x0a\x0c\x01\x18\x07\x92"
13549                           "\xe1\xd3\x51\xce\x32\x6d\x0c\x5b",
13550                 .ilen   = 48,
13551                 .result = "\xc2\x54\xc8\xde\x78\x87\x77\x40"
13552                           "\x49\x71\xe4\xb7\xe7\xcb\x76\x61"
13553                           "\x0a\x41\xb9\xe9\xc0\x76\x54\xab"
13554                           "\x04\x49\x3b\x19\x93\x57\x25\x5d",
13555                 .rlen   = 32,
13556         },
13557 };
13558
13559 /*
13560  * ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode)
13561  * test vectors, taken from Appendix B.2.9 and B.2.10:
13562  *     http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf
13563  * Only AES-128 is supported at this time.
13564  */
13565 #define ANSI_CPRNG_AES_TEST_VECTORS     6
13566
13567 static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
13568         {
13569                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
13570                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
13571                 .klen   = 16,
13572                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
13573                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xf9",
13574                 .dtlen  = 16,
13575                 .v      = "\x80\x00\x00\x00\x00\x00\x00\x00"
13576                           "\x00\x00\x00\x00\x00\x00\x00\x00",
13577                 .vlen   = 16,
13578                 .result = "\x59\x53\x1e\xd1\x3b\xb0\xc0\x55"
13579                           "\x84\x79\x66\x85\xc1\x2f\x76\x41",
13580                 .rlen   = 16,
13581                 .loops  = 1,
13582         }, {
13583                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
13584                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
13585                 .klen   = 16,
13586                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
13587                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfa",
13588                 .dtlen  = 16,
13589                 .v      = "\xc0\x00\x00\x00\x00\x00\x00\x00"
13590                           "\x00\x00\x00\x00\x00\x00\x00\x00",
13591                 .vlen   = 16,
13592                 .result = "\x7c\x22\x2c\xf4\xca\x8f\xa2\x4c"
13593                           "\x1c\x9c\xb6\x41\xa9\xf3\x22\x0d",
13594                 .rlen   = 16,
13595                 .loops  = 1,
13596         }, {
13597                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
13598                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
13599                 .klen   = 16,
13600                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
13601                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfb",
13602                 .dtlen  = 16,
13603                 .v      = "\xe0\x00\x00\x00\x00\x00\x00\x00"
13604                           "\x00\x00\x00\x00\x00\x00\x00\x00",
13605                 .vlen   = 16,
13606                 .result = "\x8a\xaa\x00\x39\x66\x67\x5b\xe5"
13607                           "\x29\x14\x28\x81\xa9\x4d\x4e\xc7",
13608                 .rlen   = 16,
13609                 .loops  = 1,
13610         }, {
13611                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
13612                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
13613                 .klen   = 16,
13614                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
13615                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfc",
13616                 .dtlen  = 16,
13617                 .v      = "\xf0\x00\x00\x00\x00\x00\x00\x00"
13618                           "\x00\x00\x00\x00\x00\x00\x00\x00",
13619                 .vlen   = 16,
13620                 .result = "\x88\xdd\xa4\x56\x30\x24\x23\xe5"
13621                           "\xf6\x9d\xa5\x7e\x7b\x95\xc7\x3a",
13622                 .rlen   = 16,
13623                 .loops  = 1,
13624         }, {
13625                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
13626                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
13627                 .klen   = 16,
13628                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
13629                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfd",
13630                 .dtlen  = 16,
13631                 .v      = "\xf8\x00\x00\x00\x00\x00\x00\x00"
13632                           "\x00\x00\x00\x00\x00\x00\x00\x00",
13633                 .vlen   = 16,
13634                 .result = "\x05\x25\x92\x46\x61\x79\xd2\xcb"
13635                           "\x78\xc4\x0b\x14\x0a\x5a\x9a\xc8",
13636                 .rlen   = 16,
13637                 .loops  = 1,
13638         }, {    /* Monte Carlo Test */
13639                 .key    = "\x9f\x5b\x51\x20\x0b\xf3\x34\xb5"
13640                           "\xd8\x2b\xe8\xc3\x72\x55\xc8\x48",
13641                 .klen   = 16,
13642                 .dt     = "\x63\x76\xbb\xe5\x29\x02\xba\x3b"
13643                           "\x67\xc9\x25\xfa\x70\x1f\x11\xac",
13644                 .dtlen  = 16,
13645                 .v      = "\x57\x2c\x8e\x76\x87\x26\x47\x97"
13646                           "\x7e\x74\xfb\xdd\xc4\x95\x01\xd1",
13647                 .vlen   = 16,
13648                 .result = "\x48\xe9\xbd\x0d\x06\xee\x18\xfb"
13649                           "\xe4\x57\x90\xd5\xc3\xfc\x9b\x73",
13650                 .rlen   = 16,
13651                 .loops  = 10000,
13652         },
13653 };
13654
13655 /* Cast5 test vectors from RFC 2144 */
13656 #define CAST5_ENC_TEST_VECTORS          4
13657 #define CAST5_DEC_TEST_VECTORS          4
13658 #define CAST5_CBC_ENC_TEST_VECTORS      1
13659 #define CAST5_CBC_DEC_TEST_VECTORS      1
13660 #define CAST5_CTR_ENC_TEST_VECTORS      1
13661 #define CAST5_CTR_DEC_TEST_VECTORS      1
13662
13663 static struct cipher_testvec cast5_enc_tv_template[] = {
13664         {
13665                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
13666                           "\x23\x45\x67\x89\x34\x56\x78\x9a",
13667                 .klen   = 16,
13668                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13669                 .ilen   = 8,
13670                 .result = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
13671                 .rlen   = 8,
13672         }, {
13673                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
13674                           "\x23\x45",
13675                 .klen   = 10,
13676                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13677                 .ilen   = 8,
13678                 .result = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
13679                 .rlen   = 8,
13680         }, {
13681                 .key    = "\x01\x23\x45\x67\x12",
13682                 .klen   = 5,
13683                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13684                 .ilen   = 8,
13685                 .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
13686                 .rlen   = 8,
13687         }, { /* Generated from TF test vectors */
13688                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
13689                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
13690                 .klen   = 16,
13691                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
13692                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
13693                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
13694                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
13695                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
13696                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
13697                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
13698                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
13699                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
13700                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
13701                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
13702                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
13703                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
13704                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
13705                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
13706                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
13707                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
13708                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
13709                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
13710                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
13711                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
13712                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
13713                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
13714                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
13715                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
13716                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
13717                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
13718                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
13719                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
13720                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
13721                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
13722                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
13723                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
13724                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
13725                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
13726                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
13727                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
13728                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
13729                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
13730                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
13731                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
13732                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
13733                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
13734                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
13735                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
13736                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
13737                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
13738                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
13739                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
13740                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
13741                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
13742                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
13743                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
13744                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
13745                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
13746                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
13747                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
13748                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
13749                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
13750                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
13751                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
13752                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
13753                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
13754                 .ilen   = 496,
13755                 .result = "\x8D\xFC\x81\x9C\xCB\xAA\x5A\x1C"
13756                           "\x7E\x95\xCF\x40\xAB\x4D\x6F\xEA"
13757                           "\xD3\xD9\xB0\x9A\xB7\xC7\xE0\x2E"
13758                           "\xD1\x39\x34\x92\x8F\xFA\x14\xF1"
13759                           "\xD5\xD2\x7B\x59\x1F\x35\x28\xC2"
13760                           "\x20\xD9\x42\x06\xC9\x0B\x10\x04"
13761                           "\xF8\x79\xCD\x32\x86\x75\x4C\xB6"
13762                           "\x7B\x1C\x52\xB1\x91\x64\x22\x4B"
13763                           "\x13\xC7\xAE\x98\x0E\xB5\xCF\x6F"
13764                           "\x3F\xF4\x43\x96\x73\x0D\xA2\x05"
13765                           "\xDB\xFD\x28\x90\x2C\x56\xB9\x37"
13766                           "\x5B\x69\x0C\xAD\x84\x67\xFF\x15"
13767                           "\x4A\xD4\xA7\xD3\xDD\x99\x47\x3A"
13768                           "\xED\x34\x35\x78\x6B\x91\xC9\x32"
13769                           "\xE1\xBF\xBC\xB4\x04\x85\x6A\x39"
13770                           "\xC0\xBA\x51\xD0\x0F\x4E\xD1\xE2"
13771                           "\x1C\xFD\x0E\x05\x07\xF4\x10\xED"
13772                           "\xA2\x17\xFF\xF5\x64\xC6\x1A\x22"
13773                           "\xAD\x78\xE7\xD7\x11\xE9\x99\xB9"
13774                           "\xAA\xEC\x6F\xF8\x3B\xBF\xCE\x77"
13775                           "\x93\xE8\xAD\x1D\x50\x6C\xAE\xBC"
13776                           "\xBA\x5C\x80\xD1\x91\x65\x51\x1B"
13777                           "\xE8\x0A\xCD\x99\x96\x71\x3D\xB6"
13778                           "\x78\x75\x37\x55\xC1\xF5\x90\x40"
13779                           "\x34\xF4\x7E\xC8\xCC\x3A\x5F\x6E"
13780                           "\x36\xA1\xA1\xC2\x3A\x72\x42\x8E"
13781                           "\x0E\x37\x88\xE8\xCE\x83\xCB\xAD"
13782                           "\xE0\x69\x77\x50\xC7\x0C\x99\xCA"
13783                           "\x19\x5B\x30\x25\x9A\xEF\x9B\x0C"
13784                           "\xEF\x8F\x74\x4C\xCF\x49\x4E\xB9"
13785                           "\xC5\xAE\x9E\x2E\x78\x9A\xB9\x48"
13786                           "\xD5\x81\xE4\x37\x1D\xBF\x27\xD9"
13787                           "\xC5\xD6\x65\x43\x45\x8C\xBB\xB6"
13788                           "\x55\xF4\x06\xBB\x49\x53\x8B\x1B"
13789                           "\x07\xA9\x96\x69\x5B\xCB\x0F\xBC"
13790                           "\x93\x85\x90\x0F\x0A\x68\x40\x2A"
13791                           "\x95\xED\x2D\x88\xBF\x71\xD0\xBB"
13792                           "\xEC\xB0\x77\x6C\x79\xFC\x3C\x05"
13793                           "\x49\x3F\xB8\x24\xEF\x8E\x09\xA2"
13794                           "\x1D\xEF\x92\x02\x96\xD4\x7F\xC8"
13795                           "\x03\xB2\xCA\xDB\x17\x5C\x52\xCF"
13796                           "\xDD\x70\x37\x63\xAA\xA5\x83\x20"
13797                           "\x52\x02\xF6\xB9\xE7\x6E\x0A\xB6"
13798                           "\x79\x03\xA0\xDA\xA3\x79\x21\xBD"
13799                           "\xE3\x37\x3A\xC0\xF7\x2C\x32\xBE"
13800                           "\x8B\xE8\xA6\x00\xC7\x32\xD5\x06"
13801                           "\xBB\xE3\xAB\x06\x21\x82\xB8\x32"
13802                           "\x31\x34\x2A\xA7\x1F\x64\x99\xBF"
13803                           "\xFA\xDA\x3D\x75\xF7\x48\xD5\x48"
13804                           "\x4B\x52\x7E\xF6\x7C\xAB\x67\x59"
13805                           "\xC5\xDC\xA8\xC6\x63\x85\x4A\xDF"
13806                           "\xF0\x40\x5F\xCF\xE3\x58\x52\x67"
13807                           "\x7A\x24\x32\xC5\xEC\x9E\xA9\x6F"
13808                           "\x58\x56\xDD\x94\x1F\x71\x8D\xF4"
13809                           "\x6E\xFF\x2C\xA7\xA5\xD8\xBA\xAF"
13810                           "\x1D\x8B\xA2\x46\xB5\xC4\x9F\x57"
13811                           "\x8D\xD8\xB3\x3C\x02\x0D\xBB\x84"
13812                           "\xC7\xBD\xB4\x9A\x6E\xBB\xB1\x37"
13813                           "\x95\x79\xC4\xA7\xEA\x1D\xDC\x33"
13814                           "\x5D\x0B\x3F\x03\x8F\x30\xF9\xAE"
13815                           "\x4F\xFE\x24\x9C\x9A\x02\xE5\x57"
13816                           "\xF5\xBC\x25\xD6\x02\x56\x57\x1C",
13817                 .rlen   = 496,
13818                 .also_non_np = 1,
13819                 .np     = 2,
13820                 .tap    = { 496 - 16, 16 },
13821         },
13822 };
13823
13824 static struct cipher_testvec cast5_dec_tv_template[] = {
13825         {
13826                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
13827                           "\x23\x45\x67\x89\x34\x56\x78\x9a",
13828                 .klen   = 16,
13829                 .input  = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
13830                 .ilen   = 8,
13831                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13832                 .rlen   = 8,
13833         }, {
13834                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
13835                           "\x23\x45",
13836                 .klen   = 10,
13837                 .input  = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
13838                 .ilen   = 8,
13839                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13840                 .rlen   = 8,
13841         }, {
13842                 .key    = "\x01\x23\x45\x67\x12",
13843                 .klen   = 5,
13844                 .input  = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
13845                 .ilen   = 8,
13846                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
13847                 .rlen   = 8,
13848         }, { /* Generated from TF test vectors */
13849                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
13850                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
13851                 .klen   = 16,
13852                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
13853                 .input  = "\x8D\xFC\x81\x9C\xCB\xAA\x5A\x1C"
13854                           "\x7E\x95\xCF\x40\xAB\x4D\x6F\xEA"
13855                           "\xD3\xD9\xB0\x9A\xB7\xC7\xE0\x2E"
13856                           "\xD1\x39\x34\x92\x8F\xFA\x14\xF1"
13857                           "\xD5\xD2\x7B\x59\x1F\x35\x28\xC2"
13858                           "\x20\xD9\x42\x06\xC9\x0B\x10\x04"
13859                           "\xF8\x79\xCD\x32\x86\x75\x4C\xB6"
13860                           "\x7B\x1C\x52\xB1\x91\x64\x22\x4B"
13861                           "\x13\xC7\xAE\x98\x0E\xB5\xCF\x6F"
13862                           "\x3F\xF4\x43\x96\x73\x0D\xA2\x05"
13863                           "\xDB\xFD\x28\x90\x2C\x56\xB9\x37"
13864                           "\x5B\x69\x0C\xAD\x84\x67\xFF\x15"
13865                           "\x4A\xD4\xA7\xD3\xDD\x99\x47\x3A"
13866                           "\xED\x34\x35\x78\x6B\x91\xC9\x32"
13867                           "\xE1\xBF\xBC\xB4\x04\x85\x6A\x39"
13868                           "\xC0\xBA\x51\xD0\x0F\x4E\xD1\xE2"
13869                           "\x1C\xFD\x0E\x05\x07\xF4\x10\xED"
13870                           "\xA2\x17\xFF\xF5\x64\xC6\x1A\x22"
13871                           "\xAD\x78\xE7\xD7\x11\xE9\x99\xB9"
13872                           "\xAA\xEC\x6F\xF8\x3B\xBF\xCE\x77"
13873                           "\x93\xE8\xAD\x1D\x50\x6C\xAE\xBC"
13874                           "\xBA\x5C\x80\xD1\x91\x65\x51\x1B"
13875                           "\xE8\x0A\xCD\x99\x96\x71\x3D\xB6"
13876                           "\x78\x75\x37\x55\xC1\xF5\x90\x40"
13877                           "\x34\xF4\x7E\xC8\xCC\x3A\x5F\x6E"
13878                           "\x36\xA1\xA1\xC2\x3A\x72\x42\x8E"
13879                           "\x0E\x37\x88\xE8\xCE\x83\xCB\xAD"
13880                           "\xE0\x69\x77\x50\xC7\x0C\x99\xCA"
13881                           "\x19\x5B\x30\x25\x9A\xEF\x9B\x0C"
13882                           "\xEF\x8F\x74\x4C\xCF\x49\x4E\xB9"
13883                           "\xC5\xAE\x9E\x2E\x78\x9A\xB9\x48"
13884                           "\xD5\x81\xE4\x37\x1D\xBF\x27\xD9"
13885                           "\xC5\xD6\x65\x43\x45\x8C\xBB\xB6"
13886                           "\x55\xF4\x06\xBB\x49\x53\x8B\x1B"
13887                           "\x07\xA9\x96\x69\x5B\xCB\x0F\xBC"
13888                           "\x93\x85\x90\x0F\x0A\x68\x40\x2A"
13889                           "\x95\xED\x2D\x88\xBF\x71\xD0\xBB"
13890                           "\xEC\xB0\x77\x6C\x79\xFC\x3C\x05"
13891                           "\x49\x3F\xB8\x24\xEF\x8E\x09\xA2"
13892                           "\x1D\xEF\x92\x02\x96\xD4\x7F\xC8"
13893                           "\x03\xB2\xCA\xDB\x17\x5C\x52\xCF"
13894                           "\xDD\x70\x37\x63\xAA\xA5\x83\x20"
13895                           "\x52\x02\xF6\xB9\xE7\x6E\x0A\xB6"
13896                           "\x79\x03\xA0\xDA\xA3\x79\x21\xBD"
13897                           "\xE3\x37\x3A\xC0\xF7\x2C\x32\xBE"
13898                           "\x8B\xE8\xA6\x00\xC7\x32\xD5\x06"
13899                           "\xBB\xE3\xAB\x06\x21\x82\xB8\x32"
13900                           "\x31\x34\x2A\xA7\x1F\x64\x99\xBF"
13901                           "\xFA\xDA\x3D\x75\xF7\x48\xD5\x48"
13902                           "\x4B\x52\x7E\xF6\x7C\xAB\x67\x59"
13903                           "\xC5\xDC\xA8\xC6\x63\x85\x4A\xDF"
13904                           "\xF0\x40\x5F\xCF\xE3\x58\x52\x67"
13905                           "\x7A\x24\x32\xC5\xEC\x9E\xA9\x6F"
13906                           "\x58\x56\xDD\x94\x1F\x71\x8D\xF4"
13907                           "\x6E\xFF\x2C\xA7\xA5\xD8\xBA\xAF"
13908                           "\x1D\x8B\xA2\x46\xB5\xC4\x9F\x57"
13909                           "\x8D\xD8\xB3\x3C\x02\x0D\xBB\x84"
13910                           "\xC7\xBD\xB4\x9A\x6E\xBB\xB1\x37"
13911                           "\x95\x79\xC4\xA7\xEA\x1D\xDC\x33"
13912                           "\x5D\x0B\x3F\x03\x8F\x30\xF9\xAE"
13913                           "\x4F\xFE\x24\x9C\x9A\x02\xE5\x57"
13914                           "\xF5\xBC\x25\xD6\x02\x56\x57\x1C",
13915                 .ilen   = 496,
13916                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
13917                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
13918                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
13919                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
13920                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
13921                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
13922                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
13923                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
13924                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
13925                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
13926                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
13927                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
13928                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
13929                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
13930                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
13931                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
13932                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
13933                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
13934                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
13935                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
13936                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
13937                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
13938                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
13939                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
13940                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
13941                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
13942                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
13943                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
13944                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
13945                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
13946                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
13947                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
13948                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
13949                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
13950                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
13951                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
13952                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
13953                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
13954                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
13955                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
13956                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
13957                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
13958                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
13959                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
13960                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
13961                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
13962                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
13963                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
13964                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
13965                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
13966                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
13967                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
13968                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
13969                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
13970                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
13971                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
13972                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
13973                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
13974                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
13975                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
13976                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
13977                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
13978                 .rlen   = 496,
13979                 .also_non_np = 1,
13980                 .np     = 2,
13981                 .tap    = { 496 - 16, 16 },
13982         },
13983 };
13984
13985 static struct cipher_testvec cast5_cbc_enc_tv_template[] = {
13986         { /* Generated from TF test vectors */
13987                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
13988                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
13989                 .klen   = 16,
13990                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
13991                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
13992                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
13993                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
13994                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
13995                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
13996                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
13997                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
13998                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
13999                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14000                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14001                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14002                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14003                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14004                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14005                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14006                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14007                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14008                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14009                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14010                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14011                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14012                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14013                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14014                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14015                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14016                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14017                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14018                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14019                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14020                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14021                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14022                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14023                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14024                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14025                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14026                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14027                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14028                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14029                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14030                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14031                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14032                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14033                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14034                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14035                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14036                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14037                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14038                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14039                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14040                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14041                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14042                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14043                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14044                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14045                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14046                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14047                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14048                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14049                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14050                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14051                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14052                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14053                 .ilen   = 496,
14054                 .result = "\x05\x28\xCE\x61\x90\x80\xE1\x78"
14055                           "\xB9\x2A\x97\x7C\xB0\x83\xD8\x1A"
14056                           "\xDE\x58\x7F\xD7\xFD\x72\xB8\xFB"
14057                           "\xDA\xF0\x6E\x77\x14\x47\x82\xBA"
14058                           "\x29\x0E\x25\x6E\xB4\x39\xD9\x7F"
14059                           "\x05\xA7\xA7\x3A\xC1\x5D\x9E\x39"
14060                           "\xA7\xFB\x0D\x05\x00\xF3\x58\x67"
14061                           "\x60\xEC\x73\x77\x46\x85\x9B\x6A"
14062                           "\x08\x3E\xBE\x59\xFB\xE4\x96\x34"
14063                           "\xB4\x05\x49\x1A\x97\x43\xAD\xA0"
14064                           "\xA9\x1E\x6E\x74\xF1\x94\xEC\xA8"
14065                           "\xB5\x8A\x20\xEA\x89\x6B\x19\xAA"
14066                           "\xA7\xF1\x33\x67\x90\x23\x0D\xEE"
14067                           "\x81\xD5\x78\x4F\xD3\x63\xEA\x46"
14068                           "\xB5\xB2\x6E\xBB\xCA\x76\x06\x10"
14069                           "\x96\x2A\x0A\xBA\xF9\x41\x5A\x1D"
14070                           "\x36\x7C\x56\x14\x54\x83\xFA\xA1"
14071                           "\x27\xDD\xBA\x8A\x90\x29\xD6\xA6"
14072                           "\xFA\x48\x3E\x1E\x23\x6E\x98\xA8"
14073                           "\xA7\xD9\x67\x92\x5C\x13\xB4\x71"
14074                           "\xA8\xAA\x89\x4A\xA4\xB3\x49\x7C"
14075                           "\x7D\x7F\xCE\x6F\x29\x2E\x7E\x37"
14076                           "\xC8\x52\x60\xD9\xE7\xCA\x60\x98"
14077                           "\xED\xCD\xE8\x60\x83\xAD\x34\x4D"
14078                           "\x96\x4A\x99\x2B\xB7\x14\x75\x66"
14079                           "\x6C\x2C\x1A\xBA\x4B\xBB\x49\x56"
14080                           "\xE1\x86\xA2\x0E\xD0\xF0\x07\xD3"
14081                           "\x18\x38\x09\x9C\x0E\x8B\x86\x07"
14082                           "\x90\x12\x37\x49\x27\x98\x69\x18"
14083                           "\xB0\xCC\xFB\xD3\xBD\x04\xA0\x85"
14084                           "\x4B\x22\x97\x07\xB6\x97\xE9\x95"
14085                           "\x0F\x88\x36\xA9\x44\x00\xC6\xE9"
14086                           "\x27\x53\x5C\x5B\x1F\xD3\xE2\xEE"
14087                           "\xD0\xCD\x63\x30\xA9\xC0\xDD\x49"
14088                           "\xFE\x16\xA4\x07\x0D\xE2\x5D\x97"
14089                           "\xDE\x89\xBA\x2E\xF3\xA9\x5E\xBE"
14090                           "\x03\x55\x0E\x02\x41\x4A\x45\x06"
14091                           "\xBE\xEA\x32\xF2\xDC\x91\x5C\x20"
14092                           "\x94\x02\x30\xD2\xFC\x29\xFA\x8E"
14093                           "\x34\xA0\x31\xB8\x34\xBA\xAE\x54"
14094                           "\xB5\x88\x1F\xDC\x43\xDC\x22\x9F"
14095                           "\xDC\xCE\xD3\xFA\xA4\xA8\xBC\x8A"
14096                           "\xC7\x5A\x43\x21\xA5\xB1\xDB\xC3"
14097                           "\x84\x3B\xB4\x9B\xB5\xA7\xF1\x0A"
14098                           "\xB6\x37\x21\x19\x55\xC2\xBD\x99"
14099                           "\x49\x24\xBB\x7C\xB3\x8E\xEF\xD2"
14100                           "\x3A\xCF\xA0\x31\x28\x0E\x25\xA2"
14101                           "\x11\xB4\x18\x17\x1A\x65\x92\x56"
14102                           "\xE8\xE0\x52\x9C\x61\x18\x2A\xB1"
14103                           "\x1A\x01\x22\x45\x17\x62\x52\x6C"
14104                           "\x91\x44\xCF\x98\xC7\xC0\x79\x26"
14105                           "\x32\x66\x6F\x23\x7F\x94\x36\x88"
14106                           "\x3C\xC9\xD0\xB7\x45\x30\x31\x86"
14107                           "\x3D\xC6\xA3\x98\x62\x84\x1A\x8B"
14108                           "\x16\x88\xC7\xA3\xE9\x4F\xE0\x86"
14109                           "\xA4\x93\xA8\x34\x5A\xCA\xDF\xCA"
14110                           "\x46\x38\xD2\xF4\xE0\x2D\x1E\xC9"
14111                           "\x7C\xEF\x53\xB7\x60\x72\x41\xBF"
14112                           "\x29\x00\x87\x02\xAF\x44\x4C\xB7"
14113                           "\x8C\xF5\x3F\x19\xF4\x80\x45\xA7"
14114                           "\x15\x5F\xDB\xE9\xB1\x83\xD2\xE6"
14115                           "\x1D\x18\x66\x44\x5B\x8F\x14\xEB",
14116                 .rlen   = 496,
14117                 .also_non_np = 1,
14118                 .np     = 2,
14119                 .tap    = { 496 - 16, 16 },
14120         },
14121 };
14122
14123 static struct cipher_testvec cast5_cbc_dec_tv_template[] = {
14124         { /* Generated from TF test vectors */
14125                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14126                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14127                 .klen   = 16,
14128                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14129                 .input  = "\x05\x28\xCE\x61\x90\x80\xE1\x78"
14130                           "\xB9\x2A\x97\x7C\xB0\x83\xD8\x1A"
14131                           "\xDE\x58\x7F\xD7\xFD\x72\xB8\xFB"
14132                           "\xDA\xF0\x6E\x77\x14\x47\x82\xBA"
14133                           "\x29\x0E\x25\x6E\xB4\x39\xD9\x7F"
14134                           "\x05\xA7\xA7\x3A\xC1\x5D\x9E\x39"
14135                           "\xA7\xFB\x0D\x05\x00\xF3\x58\x67"
14136                           "\x60\xEC\x73\x77\x46\x85\x9B\x6A"
14137                           "\x08\x3E\xBE\x59\xFB\xE4\x96\x34"
14138                           "\xB4\x05\x49\x1A\x97\x43\xAD\xA0"
14139                           "\xA9\x1E\x6E\x74\xF1\x94\xEC\xA8"
14140                           "\xB5\x8A\x20\xEA\x89\x6B\x19\xAA"
14141                           "\xA7\xF1\x33\x67\x90\x23\x0D\xEE"
14142                           "\x81\xD5\x78\x4F\xD3\x63\xEA\x46"
14143                           "\xB5\xB2\x6E\xBB\xCA\x76\x06\x10"
14144                           "\x96\x2A\x0A\xBA\xF9\x41\x5A\x1D"
14145                           "\x36\x7C\x56\x14\x54\x83\xFA\xA1"
14146                           "\x27\xDD\xBA\x8A\x90\x29\xD6\xA6"
14147                           "\xFA\x48\x3E\x1E\x23\x6E\x98\xA8"
14148                           "\xA7\xD9\x67\x92\x5C\x13\xB4\x71"
14149                           "\xA8\xAA\x89\x4A\xA4\xB3\x49\x7C"
14150                           "\x7D\x7F\xCE\x6F\x29\x2E\x7E\x37"
14151                           "\xC8\x52\x60\xD9\xE7\xCA\x60\x98"
14152                           "\xED\xCD\xE8\x60\x83\xAD\x34\x4D"
14153                           "\x96\x4A\x99\x2B\xB7\x14\x75\x66"
14154                           "\x6C\x2C\x1A\xBA\x4B\xBB\x49\x56"
14155                           "\xE1\x86\xA2\x0E\xD0\xF0\x07\xD3"
14156                           "\x18\x38\x09\x9C\x0E\x8B\x86\x07"
14157                           "\x90\x12\x37\x49\x27\x98\x69\x18"
14158                           "\xB0\xCC\xFB\xD3\xBD\x04\xA0\x85"
14159                           "\x4B\x22\x97\x07\xB6\x97\xE9\x95"
14160                           "\x0F\x88\x36\xA9\x44\x00\xC6\xE9"
14161                           "\x27\x53\x5C\x5B\x1F\xD3\xE2\xEE"
14162                           "\xD0\xCD\x63\x30\xA9\xC0\xDD\x49"
14163                           "\xFE\x16\xA4\x07\x0D\xE2\x5D\x97"
14164                           "\xDE\x89\xBA\x2E\xF3\xA9\x5E\xBE"
14165                           "\x03\x55\x0E\x02\x41\x4A\x45\x06"
14166                           "\xBE\xEA\x32\xF2\xDC\x91\x5C\x20"
14167                           "\x94\x02\x30\xD2\xFC\x29\xFA\x8E"
14168                           "\x34\xA0\x31\xB8\x34\xBA\xAE\x54"
14169                           "\xB5\x88\x1F\xDC\x43\xDC\x22\x9F"
14170                           "\xDC\xCE\xD3\xFA\xA4\xA8\xBC\x8A"
14171                           "\xC7\x5A\x43\x21\xA5\xB1\xDB\xC3"
14172                           "\x84\x3B\xB4\x9B\xB5\xA7\xF1\x0A"
14173                           "\xB6\x37\x21\x19\x55\xC2\xBD\x99"
14174                           "\x49\x24\xBB\x7C\xB3\x8E\xEF\xD2"
14175                           "\x3A\xCF\xA0\x31\x28\x0E\x25\xA2"
14176                           "\x11\xB4\x18\x17\x1A\x65\x92\x56"
14177                           "\xE8\xE0\x52\x9C\x61\x18\x2A\xB1"
14178                           "\x1A\x01\x22\x45\x17\x62\x52\x6C"
14179                           "\x91\x44\xCF\x98\xC7\xC0\x79\x26"
14180                           "\x32\x66\x6F\x23\x7F\x94\x36\x88"
14181                           "\x3C\xC9\xD0\xB7\x45\x30\x31\x86"
14182                           "\x3D\xC6\xA3\x98\x62\x84\x1A\x8B"
14183                           "\x16\x88\xC7\xA3\xE9\x4F\xE0\x86"
14184                           "\xA4\x93\xA8\x34\x5A\xCA\xDF\xCA"
14185                           "\x46\x38\xD2\xF4\xE0\x2D\x1E\xC9"
14186                           "\x7C\xEF\x53\xB7\x60\x72\x41\xBF"
14187                           "\x29\x00\x87\x02\xAF\x44\x4C\xB7"
14188                           "\x8C\xF5\x3F\x19\xF4\x80\x45\xA7"
14189                           "\x15\x5F\xDB\xE9\xB1\x83\xD2\xE6"
14190                           "\x1D\x18\x66\x44\x5B\x8F\x14\xEB",
14191                 .ilen   = 496,
14192                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14193                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14194                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14195                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14196                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14197                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14198                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14199                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14200                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14201                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14202                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14203                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14204                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14205                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14206                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14207                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14208                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14209                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14210                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14211                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14212                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14213                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14214                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14215                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14216                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14217                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14218                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14219                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14220                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14221                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14222                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14223                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14224                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14225                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14226                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14227                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14228                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14229                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14230                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14231                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14232                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14233                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14234                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14235                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14236                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14237                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14238                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14239                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14240                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14241                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14242                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14243                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14244                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14245                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14246                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14247                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14248                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14249                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14250                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14251                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14252                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14253                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14254                 .rlen   = 496,
14255                 .also_non_np = 1,
14256                 .np     = 2,
14257                 .tap    = { 496 - 16, 16 },
14258         },
14259 };
14260
14261 static struct cipher_testvec cast5_ctr_enc_tv_template[] = {
14262         { /* Generated from TF test vectors */
14263                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14264                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14265                 .klen   = 16,
14266                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14267                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14268                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14269                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14270                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14271                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14272                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14273                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14274                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14275                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14276                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14277                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14278                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14279                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14280                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14281                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14282                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14283                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14284                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14285                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14286                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14287                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14288                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14289                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14290                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14291                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14292                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14293                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14294                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14295                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14296                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14297                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14298                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14299                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14300                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14301                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14302                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14303                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14304                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14305                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14306                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14307                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14308                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14309                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14310                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14311                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14312                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14313                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14314                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14315                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14316                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14317                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14318                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14319                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14320                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14321                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14322                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14323                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14324                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14325                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14326                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14327                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14328                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14329                 .ilen   = 496,
14330                 .result = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
14331                           "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
14332                           "\x0C\x63\xA5\x55\xE3\xF8\x1C\x7F"
14333                           "\xDC\x59\xF9\xA0\x52\xAD\x83\xDF"
14334                           "\xD5\x3B\x53\x4A\xAA\x1F\x49\x44"
14335                           "\xE8\x20\xCC\xF8\x97\xE6\xE0\x3C"
14336                           "\x5A\xD2\x83\xEC\xEE\x25\x3F\xCF"
14337                           "\x0D\xC2\x79\x80\x99\x6E\xFF\x7B"
14338                           "\x64\xB0\x7B\x86\x29\x1D\x9F\x17"
14339                           "\x10\xA5\xA5\xEB\x16\x55\x9E\xE3"
14340                           "\x88\x18\x52\x56\x48\x58\xD1\x6B"
14341                           "\xE8\x74\x6E\x48\xB0\x2E\x69\x63"
14342                           "\x32\xAA\xAC\x26\x55\x45\x94\xDE"
14343                           "\x30\x26\x26\xE6\x08\x82\x2F\x5F"
14344                           "\xA7\x15\x94\x07\x75\x2D\xC6\x3A"
14345                           "\x1B\xA0\x39\xFB\xBA\xB9\x06\x56"
14346                           "\xF6\x9F\xF1\x2F\x9B\xF3\x89\x8B"
14347                           "\x08\xC8\x9D\x5E\x6B\x95\x09\xC7"
14348                           "\x98\xB7\x62\xA4\x1D\x25\xFA\xC5"
14349                           "\x62\xC8\x5D\x6B\xB4\x85\x88\x7F"
14350                           "\x3B\x29\xF9\xB4\x32\x62\x69\xBF"
14351                           "\x32\xB8\xEB\xFD\x0E\x26\xAA\xA3"
14352                           "\x44\x67\x90\x20\xAC\x41\xDF\x43"
14353                           "\xC6\xC7\x19\x9F\x2C\x28\x74\xEB"
14354                           "\x3E\x7F\x7A\x80\x5B\xE4\x08\x60"
14355                           "\xC7\xC9\x71\x34\x44\xCE\x05\xFD"
14356                           "\xA8\x91\xA8\x44\x5E\xD3\x89\x2C"
14357                           "\xAE\x59\x0F\x07\x88\x79\x53\x26"
14358                           "\xAF\xAC\xCB\x1D\x6F\x08\x25\x62"
14359                           "\xD0\x82\x65\x66\xE4\x2A\x29\x1C"
14360                           "\x9C\x64\x5F\x49\x9D\xF8\x62\xF9"
14361                           "\xED\xC4\x13\x52\x75\xDC\xE4\xF9"
14362                           "\x68\x0F\x8A\xCD\xA6\x8D\x75\xAA"
14363                           "\x49\xA1\x86\x86\x37\x5C\x6B\x3D"
14364                           "\x56\xE5\x6F\xBE\x27\xC0\x10\xF8"
14365                           "\x3C\x4D\x17\x35\x14\xDC\x1C\xA0"
14366                           "\x6E\xAE\xD1\x10\xDD\x83\x06\xC2"
14367                           "\x23\xD3\xC7\x27\x15\x04\x2C\x27"
14368                           "\xDD\x1F\x2E\x97\x09\x9C\x33\x7D"
14369                           "\xAC\x50\x1B\x2E\xC9\x52\x0C\x14"
14370                           "\x4B\x78\xC4\xDE\x07\x6A\x12\x02"
14371                           "\x6E\xD7\x4B\x91\xB9\x88\x4D\x02"
14372                           "\xC3\xB5\x04\xBC\xE0\x67\xCA\x18"
14373                           "\x22\xA1\xAE\x9A\x21\xEF\xB2\x06"
14374                           "\x35\xCD\xEC\x37\x70\x2D\xFC\x1E"
14375                           "\xA8\x31\xE7\xFC\xE5\x8E\x88\x66"
14376                           "\x16\xB5\xC8\x45\x21\x37\xBD\x24"
14377                           "\xA9\xD5\x36\x12\x9F\x6E\x67\x80"
14378                           "\x87\x54\xD5\xAF\x97\xE1\x15\xA7"
14379                           "\x11\xF0\x63\x7B\xE1\x44\x14\x1C"
14380                           "\x06\x32\x05\x8C\x6C\xDB\x9B\x36"
14381                           "\x6A\x6B\xAD\x3A\x27\x55\x20\x4C"
14382                           "\x76\x36\x43\xE8\x16\x60\xB5\xF3"
14383                           "\xDF\x5A\xC6\xA5\x69\x78\x59\x51"
14384                           "\x54\x68\x65\x06\x84\xDE\x3D\xAE"
14385                           "\x38\x91\xBD\xCC\xA2\x8A\xEC\xE6"
14386                           "\x9E\x83\xAE\x1E\x8E\x34\x5D\xDE"
14387                           "\x91\xCE\x8F\xED\x40\xF7\xC8\x8B"
14388                           "\x9A\x13\x4C\xAD\x89\x97\x9E\xD1"
14389                           "\x91\x01\xD7\x21\x23\x28\x1E\xCC"
14390                           "\x8C\x98\xDB\xDE\xFC\x72\x94\xAA"
14391                           "\xC0\x0D\x96\xAA\x23\xF8\xFE\x13",
14392                 .rlen   = 496,
14393                 .also_non_np = 1,
14394                 .np     = 2,
14395                 .tap    = { 496 - 16, 16 },
14396         },
14397 };
14398
14399 static struct cipher_testvec cast5_ctr_dec_tv_template[] = {
14400         { /* Generated from TF test vectors */
14401                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14402                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14403                 .klen   = 16,
14404                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14405                 .input  = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
14406                           "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
14407                           "\x0C\x63\xA5\x55\xE3\xF8\x1C\x7F"
14408                           "\xDC\x59\xF9\xA0\x52\xAD\x83\xDF"
14409                           "\xD5\x3B\x53\x4A\xAA\x1F\x49\x44"
14410                           "\xE8\x20\xCC\xF8\x97\xE6\xE0\x3C"
14411                           "\x5A\xD2\x83\xEC\xEE\x25\x3F\xCF"
14412                           "\x0D\xC2\x79\x80\x99\x6E\xFF\x7B"
14413                           "\x64\xB0\x7B\x86\x29\x1D\x9F\x17"
14414                           "\x10\xA5\xA5\xEB\x16\x55\x9E\xE3"
14415                           "\x88\x18\x52\x56\x48\x58\xD1\x6B"
14416                           "\xE8\x74\x6E\x48\xB0\x2E\x69\x63"
14417                           "\x32\xAA\xAC\x26\x55\x45\x94\xDE"
14418                           "\x30\x26\x26\xE6\x08\x82\x2F\x5F"
14419                           "\xA7\x15\x94\x07\x75\x2D\xC6\x3A"
14420                           "\x1B\xA0\x39\xFB\xBA\xB9\x06\x56"
14421                           "\xF6\x9F\xF1\x2F\x9B\xF3\x89\x8B"
14422                           "\x08\xC8\x9D\x5E\x6B\x95\x09\xC7"
14423                           "\x98\xB7\x62\xA4\x1D\x25\xFA\xC5"
14424                           "\x62\xC8\x5D\x6B\xB4\x85\x88\x7F"
14425                           "\x3B\x29\xF9\xB4\x32\x62\x69\xBF"
14426                           "\x32\xB8\xEB\xFD\x0E\x26\xAA\xA3"
14427                           "\x44\x67\x90\x20\xAC\x41\xDF\x43"
14428                           "\xC6\xC7\x19\x9F\x2C\x28\x74\xEB"
14429                           "\x3E\x7F\x7A\x80\x5B\xE4\x08\x60"
14430                           "\xC7\xC9\x71\x34\x44\xCE\x05\xFD"
14431                           "\xA8\x91\xA8\x44\x5E\xD3\x89\x2C"
14432                           "\xAE\x59\x0F\x07\x88\x79\x53\x26"
14433                           "\xAF\xAC\xCB\x1D\x6F\x08\x25\x62"
14434                           "\xD0\x82\x65\x66\xE4\x2A\x29\x1C"
14435                           "\x9C\x64\x5F\x49\x9D\xF8\x62\xF9"
14436                           "\xED\xC4\x13\x52\x75\xDC\xE4\xF9"
14437                           "\x68\x0F\x8A\xCD\xA6\x8D\x75\xAA"
14438                           "\x49\xA1\x86\x86\x37\x5C\x6B\x3D"
14439                           "\x56\xE5\x6F\xBE\x27\xC0\x10\xF8"
14440                           "\x3C\x4D\x17\x35\x14\xDC\x1C\xA0"
14441                           "\x6E\xAE\xD1\x10\xDD\x83\x06\xC2"
14442                           "\x23\xD3\xC7\x27\x15\x04\x2C\x27"
14443                           "\xDD\x1F\x2E\x97\x09\x9C\x33\x7D"
14444                           "\xAC\x50\x1B\x2E\xC9\x52\x0C\x14"
14445                           "\x4B\x78\xC4\xDE\x07\x6A\x12\x02"
14446                           "\x6E\xD7\x4B\x91\xB9\x88\x4D\x02"
14447                           "\xC3\xB5\x04\xBC\xE0\x67\xCA\x18"
14448                           "\x22\xA1\xAE\x9A\x21\xEF\xB2\x06"
14449                           "\x35\xCD\xEC\x37\x70\x2D\xFC\x1E"
14450                           "\xA8\x31\xE7\xFC\xE5\x8E\x88\x66"
14451                           "\x16\xB5\xC8\x45\x21\x37\xBD\x24"
14452                           "\xA9\xD5\x36\x12\x9F\x6E\x67\x80"
14453                           "\x87\x54\xD5\xAF\x97\xE1\x15\xA7"
14454                           "\x11\xF0\x63\x7B\xE1\x44\x14\x1C"
14455                           "\x06\x32\x05\x8C\x6C\xDB\x9B\x36"
14456                           "\x6A\x6B\xAD\x3A\x27\x55\x20\x4C"
14457                           "\x76\x36\x43\xE8\x16\x60\xB5\xF3"
14458                           "\xDF\x5A\xC6\xA5\x69\x78\x59\x51"
14459                           "\x54\x68\x65\x06\x84\xDE\x3D\xAE"
14460                           "\x38\x91\xBD\xCC\xA2\x8A\xEC\xE6"
14461                           "\x9E\x83\xAE\x1E\x8E\x34\x5D\xDE"
14462                           "\x91\xCE\x8F\xED\x40\xF7\xC8\x8B"
14463                           "\x9A\x13\x4C\xAD\x89\x97\x9E\xD1"
14464                           "\x91\x01\xD7\x21\x23\x28\x1E\xCC"
14465                           "\x8C\x98\xDB\xDE\xFC\x72\x94\xAA"
14466                           "\xC0\x0D\x96\xAA\x23\xF8\xFE\x13",
14467                 .ilen   = 496,
14468                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14469                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14470                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14471                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14472                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14473                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14474                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14475                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14476                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14477                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14478                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14479                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14480                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14481                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14482                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14483                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14484                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14485                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14486                           "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14487                           "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14488                           "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14489                           "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14490                           "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14491                           "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14492                           "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14493                           "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14494                           "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14495                           "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14496                           "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14497                           "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14498                           "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14499                           "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14500                           "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14501                           "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14502                           "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14503                           "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14504                           "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14505                           "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14506                           "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14507                           "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14508                           "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14509                           "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14510                           "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14511                           "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14512                           "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14513                           "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14514                           "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14515                           "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14516                           "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14517                           "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14518                           "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14519                           "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14520                           "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14521                           "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14522                           "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14523                           "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14524                           "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14525                           "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14526                           "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14527                           "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14528                           "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14529                           "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14530                 .rlen   = 496,
14531                 .also_non_np = 1,
14532                 .np     = 2,
14533                 .tap    = { 496 - 16, 16 },
14534         },
14535 };
14536
14537 /*
14538  * ARC4 test vectors from OpenSSL
14539  */
14540 #define ARC4_ENC_TEST_VECTORS   7
14541 #define ARC4_DEC_TEST_VECTORS   7
14542
14543 static struct cipher_testvec arc4_enc_tv_template[] = {
14544         {
14545                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14546                 .klen   = 8,
14547                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14548                 .ilen   = 8,
14549                 .result = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
14550                 .rlen   = 8,
14551         }, {
14552                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14553                 .klen   = 8,
14554                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
14555                 .ilen   = 8,
14556                 .result = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
14557                 .rlen   = 8,
14558         }, {
14559                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
14560                 .klen   = 8,
14561                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
14562                 .ilen   = 8,
14563                 .result = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
14564                 .rlen   = 8,
14565         }, {
14566                 .key    = "\xef\x01\x23\x45",
14567                 .klen   = 4,
14568                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
14569                           "\x00\x00\x00\x00\x00\x00\x00\x00"
14570                           "\x00\x00\x00\x00",
14571                 .ilen   = 20,
14572                 .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
14573                           "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
14574                           "\x36\xb6\x78\x58",
14575                 .rlen   = 20,
14576         }, {
14577                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14578                 .klen   = 8,
14579                 .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14580                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14581                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14582                           "\x12\x34\x56\x78",
14583                 .ilen   = 28,
14584                 .result = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
14585                           "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
14586                           "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
14587                           "\x40\x01\x1e\xcf",
14588                 .rlen   = 28,
14589         }, {
14590                 .key    = "\xef\x01\x23\x45",
14591                 .klen   = 4,
14592                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
14593                           "\x00\x00",
14594                 .ilen   = 10,
14595                 .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
14596                           "\xbd\x61",
14597                 .rlen   = 10,
14598         }, {
14599                 .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
14600                         "\x00\x00\x00\x00\x00\x00\x00\x00",
14601                 .klen   = 16,
14602                 .input  = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
14603                 .ilen   = 8,
14604                 .result = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
14605                 .rlen   = 8,
14606         },
14607 };
14608
14609 static struct cipher_testvec arc4_dec_tv_template[] = {
14610         {
14611                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14612                 .klen   = 8,
14613                 .input  = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
14614                 .ilen   = 8,
14615                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14616                 .rlen   = 8,
14617         }, {
14618                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14619                 .klen   = 8,
14620                 .input  = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
14621                 .ilen   = 8,
14622                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
14623                 .rlen   = 8,
14624         }, {
14625                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
14626                 .klen   = 8,
14627                 .input  = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
14628                 .ilen   = 8,
14629                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
14630                 .rlen   = 8,
14631         }, {
14632                 .key    = "\xef\x01\x23\x45",
14633                 .klen   = 4,
14634                 .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
14635                           "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
14636                           "\x36\xb6\x78\x58",
14637                 .ilen   = 20,
14638                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
14639                           "\x00\x00\x00\x00\x00\x00\x00\x00"
14640                           "\x00\x00\x00\x00",
14641                 .rlen   = 20,
14642         }, {
14643                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
14644                 .klen   = 8,
14645                 .input  = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
14646                           "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
14647                           "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
14648                           "\x40\x01\x1e\xcf",
14649                 .ilen   = 28,
14650                 .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14651                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14652                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
14653                           "\x12\x34\x56\x78",
14654                 .rlen   = 28,
14655         }, {
14656                 .key    = "\xef\x01\x23\x45",
14657                 .klen   = 4,
14658                 .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
14659                           "\xbd\x61",
14660                 .ilen   = 10,
14661                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
14662                           "\x00\x00",
14663                 .rlen   = 10,
14664         }, {
14665                 .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
14666                         "\x00\x00\x00\x00\x00\x00\x00\x00",
14667                 .klen   = 16,
14668                 .input  = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
14669                 .ilen   = 8,
14670                 .result = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
14671                 .rlen   = 8,
14672         },
14673 };
14674
14675 /*
14676  * TEA test vectors
14677  */
14678 #define TEA_ENC_TEST_VECTORS    4
14679 #define TEA_DEC_TEST_VECTORS    4
14680
14681 static struct cipher_testvec tea_enc_tv_template[] = {
14682         {
14683                 .key    = zeroed_string,
14684                 .klen   = 16,
14685                 .input  = zeroed_string,
14686                 .ilen   = 8,
14687                 .result = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
14688                 .rlen   = 8,
14689         }, {
14690                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
14691                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
14692                 .klen   = 16,
14693                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
14694                 .ilen   = 8,
14695                 .result = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
14696                 .rlen   = 8,
14697         }, {
14698                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
14699                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
14700                 .klen   = 16,
14701                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
14702                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
14703                 .ilen   = 16,
14704                 .result = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
14705                           "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
14706                 .rlen   = 16,
14707         }, {
14708                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
14709                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
14710                 .klen   = 16,
14711                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
14712                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
14713                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
14714                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
14715                 .ilen   = 32,
14716                 .result = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
14717                           "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
14718                           "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
14719                           "\x07\x89\x73\xc2\x45\x92\xc6\x90",
14720                 .rlen   = 32,
14721         }
14722 };
14723
14724 static struct cipher_testvec tea_dec_tv_template[] = {
14725         {
14726                 .key    = zeroed_string,
14727                 .klen   = 16,
14728                 .input  = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
14729                 .ilen   = 8,
14730                 .result = zeroed_string,
14731                 .rlen   = 8,
14732         }, {
14733                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
14734                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
14735                 .klen   = 16,
14736                 .input  = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
14737                 .ilen   = 8,
14738                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
14739                 .rlen   = 8,
14740         }, {
14741                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
14742                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
14743                 .klen   = 16,
14744                 .input  = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
14745                           "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
14746                 .ilen   = 16,
14747                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
14748                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
14749                 .rlen   = 16,
14750         }, {
14751                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
14752                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
14753                 .klen   = 16,
14754                 .input  = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
14755                           "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
14756                           "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
14757                           "\x07\x89\x73\xc2\x45\x92\xc6\x90",
14758                 .ilen   = 32,
14759                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
14760                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
14761                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
14762                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
14763                 .rlen   = 32,
14764         }
14765 };
14766
14767 /*
14768  * XTEA test vectors
14769  */
14770 #define XTEA_ENC_TEST_VECTORS   4
14771 #define XTEA_DEC_TEST_VECTORS   4
14772
14773 static struct cipher_testvec xtea_enc_tv_template[] = {
14774         {
14775                 .key    = zeroed_string,
14776                 .klen   = 16,
14777                 .input  = zeroed_string,
14778                 .ilen   = 8,
14779                 .result = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
14780                 .rlen   = 8,
14781         }, {
14782                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
14783                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
14784                 .klen   = 16,
14785                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
14786                 .ilen   = 8,
14787                 .result = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
14788                 .rlen   = 8,
14789         }, {
14790                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
14791                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
14792                 .klen   = 16,
14793                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
14794                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
14795                 .ilen   = 16,
14796                 .result = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
14797                           "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
14798                 .rlen   = 16,
14799         }, {
14800                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
14801                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
14802                 .klen   = 16,
14803                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
14804                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
14805                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
14806                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
14807                 .ilen   = 32,
14808                 .result = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
14809                           "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
14810                           "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
14811                           "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
14812                 .rlen   = 32,
14813         }
14814 };
14815
14816 static struct cipher_testvec xtea_dec_tv_template[] = {
14817         {
14818                 .key    = zeroed_string,
14819                 .klen   = 16,
14820                 .input  = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
14821                 .ilen   = 8,
14822                 .result = zeroed_string,
14823                 .rlen   = 8,
14824         }, {
14825                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
14826                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
14827                 .klen   = 16,
14828                 .input  = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
14829                 .ilen   = 8,
14830                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
14831                 .rlen   = 8,
14832         }, {
14833                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
14834                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
14835                 .klen   = 16,
14836                 .input  = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
14837                           "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
14838                 .ilen   = 16,
14839                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
14840                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
14841                 .rlen   = 16,
14842         }, {
14843                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
14844                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
14845                 .klen   = 16,
14846                 .input  = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
14847                           "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
14848                           "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
14849                           "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
14850                 .ilen   = 32,
14851                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
14852                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
14853                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
14854                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
14855                 .rlen   = 32,
14856         }
14857 };
14858
14859 /*
14860  * KHAZAD test vectors.
14861  */
14862 #define KHAZAD_ENC_TEST_VECTORS 5
14863 #define KHAZAD_DEC_TEST_VECTORS 5
14864
14865 static struct cipher_testvec khazad_enc_tv_template[] = {
14866         {
14867                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
14868                           "\x00\x00\x00\x00\x00\x00\x00\x00",
14869                 .klen   = 16,
14870                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
14871                 .ilen   = 8,
14872                 .result = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
14873                 .rlen   = 8,
14874         }, {
14875                 .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
14876                           "\x38\x38\x38\x38\x38\x38\x38\x38",
14877                 .klen   = 16,
14878                 .input  = "\x38\x38\x38\x38\x38\x38\x38\x38",
14879                 .ilen   = 8,
14880                 .result = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
14881                 .rlen   = 8,
14882         }, {
14883                 .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
14884                         "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
14885                 .klen   = 16,
14886                 .input  = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
14887                 .ilen   = 8,
14888                 .result = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
14889                 .rlen   = 8,
14890         }, {
14891                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14892                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14893                 .klen   = 16,
14894                 .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14895                 .ilen   = 8,
14896                 .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
14897                 .rlen   = 8,
14898         }, {
14899                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14900                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14901                 .klen   = 16,
14902                 .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14903                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14904                 .ilen   = 16,
14905                 .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
14906                         "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
14907                 .rlen   = 16,
14908         },
14909 };
14910
14911 static struct cipher_testvec khazad_dec_tv_template[] = {
14912         {
14913                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
14914                           "\x00\x00\x00\x00\x00\x00\x00\x00",
14915                 .klen   = 16,
14916                 .input  = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
14917                 .ilen   = 8,
14918                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
14919                 .rlen   = 8,
14920         }, {
14921                 .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
14922                           "\x38\x38\x38\x38\x38\x38\x38\x38",
14923                 .klen   = 16,
14924                 .input  = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
14925                 .ilen   = 8,
14926                 .result = "\x38\x38\x38\x38\x38\x38\x38\x38",
14927                 .rlen   = 8,
14928         }, {
14929                 .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
14930                         "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
14931                 .klen   = 16,
14932                 .input  = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
14933                 .ilen   = 8,
14934                 .result = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
14935                 .rlen   = 8,
14936         }, {
14937                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14938                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14939                 .klen   = 16,
14940                 .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
14941                 .ilen   = 8,
14942                 .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14943                 .rlen   = 8,
14944         }, {
14945                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14946                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14947                 .klen   = 16,
14948                 .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
14949                         "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
14950                 .ilen   = 16,
14951                 .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
14952                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
14953                 .rlen   = 16,
14954         },
14955 };
14956
14957 /*
14958  * Anubis test vectors.
14959  */
14960
14961 #define ANUBIS_ENC_TEST_VECTORS                 5
14962 #define ANUBIS_DEC_TEST_VECTORS                 5
14963 #define ANUBIS_CBC_ENC_TEST_VECTORS             2
14964 #define ANUBIS_CBC_DEC_TEST_VECTORS             2
14965
14966 static struct cipher_testvec anubis_enc_tv_template[] = {
14967         {
14968                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
14969                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
14970                 .klen   = 16,
14971                 .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
14972                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
14973                 .ilen   = 16,
14974                 .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
14975                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
14976                 .rlen   = 16,
14977         }, {
14978
14979                 .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
14980                           "\x03\x03\x03\x03\x03\x03\x03\x03"
14981                           "\x03\x03\x03\x03",
14982                 .klen   = 20,
14983                 .input  = "\x03\x03\x03\x03\x03\x03\x03\x03"
14984                           "\x03\x03\x03\x03\x03\x03\x03\x03",
14985                 .ilen   = 16,
14986                 .result = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
14987                           "\x87\x41\x6f\x82\x0a\x98\x64\xae",
14988                 .rlen   = 16,
14989         }, {
14990                 .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
14991                           "\x24\x24\x24\x24\x24\x24\x24\x24"
14992                           "\x24\x24\x24\x24\x24\x24\x24\x24"
14993                           "\x24\x24\x24\x24",
14994                 .klen   = 28,
14995                 .input  = "\x24\x24\x24\x24\x24\x24\x24\x24"
14996                           "\x24\x24\x24\x24\x24\x24\x24\x24",
14997                 .ilen   = 16,
14998                 .result = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
14999                           "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
15000                 .rlen   = 16,
15001         }, {
15002                 .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
15003                           "\x25\x25\x25\x25\x25\x25\x25\x25"
15004                           "\x25\x25\x25\x25\x25\x25\x25\x25"
15005                           "\x25\x25\x25\x25\x25\x25\x25\x25",
15006                 .klen   = 32,
15007                 .input  = "\x25\x25\x25\x25\x25\x25\x25\x25"
15008                           "\x25\x25\x25\x25\x25\x25\x25\x25",
15009                 .ilen   = 16,
15010                 .result = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
15011                         "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
15012                 .rlen   = 16,
15013         }, {
15014                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
15015                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15016                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15017                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15018                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15019                 .klen   = 40,
15020                 .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
15021                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15022                 .ilen   = 16,
15023                 .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
15024                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
15025                 .rlen   = 16,
15026         },
15027 };
15028
15029 static struct cipher_testvec anubis_dec_tv_template[] = {
15030         {
15031                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15032                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15033                 .klen   = 16,
15034                 .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
15035                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
15036                 .ilen   = 16,
15037                 .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15038                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15039                 .rlen   = 16,
15040         }, {
15041
15042                 .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
15043                           "\x03\x03\x03\x03\x03\x03\x03\x03"
15044                           "\x03\x03\x03\x03",
15045                 .klen   = 20,
15046                 .input  = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
15047                           "\x87\x41\x6f\x82\x0a\x98\x64\xae",
15048                 .ilen   = 16,
15049                 .result = "\x03\x03\x03\x03\x03\x03\x03\x03"
15050                           "\x03\x03\x03\x03\x03\x03\x03\x03",
15051                 .rlen   = 16,
15052         }, {
15053                 .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
15054                           "\x24\x24\x24\x24\x24\x24\x24\x24"
15055                           "\x24\x24\x24\x24\x24\x24\x24\x24"
15056                           "\x24\x24\x24\x24",
15057                 .klen   = 28,
15058                 .input  = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
15059                           "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
15060                 .ilen   = 16,
15061                 .result = "\x24\x24\x24\x24\x24\x24\x24\x24"
15062                           "\x24\x24\x24\x24\x24\x24\x24\x24",
15063                 .rlen   = 16,
15064         }, {
15065                 .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
15066                           "\x25\x25\x25\x25\x25\x25\x25\x25"
15067                           "\x25\x25\x25\x25\x25\x25\x25\x25"
15068                           "\x25\x25\x25\x25\x25\x25\x25\x25",
15069                 .klen   = 32,
15070                 .input  = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
15071                         "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
15072                 .ilen   = 16,
15073                 .result = "\x25\x25\x25\x25\x25\x25\x25\x25"
15074                           "\x25\x25\x25\x25\x25\x25\x25\x25",
15075                 .rlen   = 16,
15076         }, {
15077                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
15078                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15079                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15080                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15081                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15082                 .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
15083                          "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
15084                 .klen   = 40,
15085                 .ilen   = 16,
15086                 .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
15087                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15088                 .rlen   = 16,
15089         },
15090 };
15091
15092 static struct cipher_testvec anubis_cbc_enc_tv_template[] = {
15093         {
15094                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15095                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15096                 .klen   = 16,
15097                 .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15098                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15099                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15100                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15101                 .ilen   = 32,
15102                 .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
15103                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
15104                           "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
15105                           "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
15106                 .rlen   = 32,
15107         }, {
15108                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
15109                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15110                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15111                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15112                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15113                 .klen   = 40,
15114                 .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
15115                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15116                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15117                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15118                 .ilen   = 32,
15119                 .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
15120                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
15121                           "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
15122                           "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
15123                 .rlen   = 32,
15124         },
15125 };
15126
15127 static struct cipher_testvec anubis_cbc_dec_tv_template[] = {
15128         {
15129                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15130                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15131                 .klen   = 16,
15132                 .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
15133                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
15134                           "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
15135                           "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
15136                 .ilen   = 32,
15137                 .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15138                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15139                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
15140                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
15141                 .rlen   = 32,
15142         }, {
15143                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
15144                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15145                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15146                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15147                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15148                 .klen   = 40,
15149                 .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
15150                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
15151                           "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
15152                           "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
15153                 .ilen   = 32,
15154                 .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
15155                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15156                           "\x35\x35\x35\x35\x35\x35\x35\x35"
15157                           "\x35\x35\x35\x35\x35\x35\x35\x35",
15158                 .rlen   = 32,
15159         },
15160 };
15161
15162 /*
15163  * XETA test vectors
15164  */
15165 #define XETA_ENC_TEST_VECTORS   4
15166 #define XETA_DEC_TEST_VECTORS   4
15167
15168 static struct cipher_testvec xeta_enc_tv_template[] = {
15169         {
15170                 .key    = zeroed_string,
15171                 .klen   = 16,
15172                 .input  = zeroed_string,
15173                 .ilen   = 8,
15174                 .result = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
15175                 .rlen   = 8,
15176         }, {
15177                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
15178                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
15179                 .klen   = 16,
15180                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
15181                 .ilen   = 8,
15182                 .result = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
15183                 .rlen   = 8,
15184         }, {
15185                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
15186                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
15187                 .klen   = 16,
15188                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
15189                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
15190                 .ilen   = 16,
15191                 .result = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
15192                           "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
15193                 .rlen   = 16,
15194         }, {
15195                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
15196                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
15197                 .klen   = 16,
15198                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
15199                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
15200                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
15201                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
15202                 .ilen   = 32,
15203                 .result = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
15204                           "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
15205                           "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
15206                           "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
15207                 .rlen   = 32,
15208         }
15209 };
15210
15211 static struct cipher_testvec xeta_dec_tv_template[] = {
15212         {
15213                 .key    = zeroed_string,
15214                 .klen   = 16,
15215                 .input  = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
15216                 .ilen   = 8,
15217                 .result = zeroed_string,
15218                 .rlen   = 8,
15219         }, {
15220                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
15221                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
15222                 .klen   = 16,
15223                 .input  = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
15224                 .ilen   = 8,
15225                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
15226                 .rlen   = 8,
15227         }, {
15228                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
15229                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
15230                 .klen   = 16,
15231                 .input  = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
15232                           "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
15233                 .ilen   = 16,
15234                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
15235                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
15236                 .rlen   = 16,
15237         }, {
15238                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
15239                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
15240                 .klen   = 16,
15241                 .input  = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
15242                           "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
15243                           "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
15244                           "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
15245                 .ilen   = 32,
15246                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
15247                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
15248                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
15249                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
15250                 .rlen   = 32,
15251         }
15252 };
15253
15254 /*
15255  * FCrypt test vectors
15256  */
15257 #define FCRYPT_ENC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_enc_tv_template)
15258 #define FCRYPT_DEC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_dec_tv_template)
15259
15260 static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = {
15261         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
15262                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
15263                 .klen   = 8,
15264                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
15265                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
15266                 .ilen   = 8,
15267                 .result = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
15268                 .rlen   = 8,
15269         }, {
15270                 .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
15271                 .klen   = 8,
15272                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
15273                 .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
15274                 .ilen   = 8,
15275                 .result = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
15276                 .rlen   = 8,
15277         }, { /* From Arla */
15278                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15279                 .klen   = 8,
15280                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15281                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
15282                 .ilen   = 48,
15283                 .result = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
15284                           "\xee\xac\x98\x62\x44\x51\xe4\x84"
15285                           "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
15286                           "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
15287                           "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
15288                           "\xf8\x91\x3c\xac\x44\x22\x92\xef",
15289                 .rlen   = 48,
15290         }, {
15291                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15292                 .klen   = 8,
15293                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15294                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
15295                 .ilen   = 48,
15296                 .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
15297                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
15298                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
15299                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
15300                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
15301                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
15302                 .rlen   = 48,
15303         }, { /* split-page version */
15304                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15305                 .klen   = 8,
15306                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15307                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
15308                 .ilen   = 48,
15309                 .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
15310                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
15311                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
15312                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
15313                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
15314                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
15315                 .rlen   = 48,
15316                 .np     = 2,
15317                 .tap    = { 20, 28 },
15318         }
15319 };
15320
15321 static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = {
15322         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
15323                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
15324                 .klen   = 8,
15325                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
15326                 .input  = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
15327                 .ilen   = 8,
15328                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
15329                 .rlen   = 8,
15330         }, {
15331                 .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
15332                 .klen   = 8,
15333                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
15334                 .input  = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
15335                 .ilen   = 8,
15336                 .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
15337                 .rlen   = 8,
15338         }, { /* From Arla */
15339                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15340                 .klen   = 8,
15341                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15342                 .input  = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
15343                           "\xee\xac\x98\x62\x44\x51\xe4\x84"
15344                           "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
15345                           "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
15346                           "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
15347                           "\xf8\x91\x3c\xac\x44\x22\x92\xef",
15348                 .ilen   = 48,
15349                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
15350                 .rlen   = 48,
15351         }, {
15352                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15353                 .klen   = 8,
15354                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15355                 .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
15356                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
15357                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
15358                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
15359                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
15360                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
15361                 .ilen   = 48,
15362                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
15363                 .rlen   = 48,
15364         }, { /* split-page version */
15365                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15366                 .klen   = 8,
15367                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
15368                 .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
15369                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
15370                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
15371                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
15372                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
15373                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
15374                 .ilen   = 48,
15375                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
15376                 .rlen   = 48,
15377                 .np     = 2,
15378                 .tap    = { 20, 28 },
15379         }
15380 };
15381
15382 /*
15383  * CAMELLIA test vectors.
15384  */
15385 #define CAMELLIA_ENC_TEST_VECTORS 4
15386 #define CAMELLIA_DEC_TEST_VECTORS 4
15387 #define CAMELLIA_CBC_ENC_TEST_VECTORS 3
15388 #define CAMELLIA_CBC_DEC_TEST_VECTORS 3
15389 #define CAMELLIA_CTR_ENC_TEST_VECTORS 2
15390 #define CAMELLIA_CTR_DEC_TEST_VECTORS 2
15391 #define CAMELLIA_LRW_ENC_TEST_VECTORS 8
15392 #define CAMELLIA_LRW_DEC_TEST_VECTORS 8
15393 #define CAMELLIA_XTS_ENC_TEST_VECTORS 5
15394 #define CAMELLIA_XTS_DEC_TEST_VECTORS 5
15395
15396 static struct cipher_testvec camellia_enc_tv_template[] = {
15397         {
15398                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15399                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15400                 .klen   = 16,
15401                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15402                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15403                 .ilen   = 16,
15404                 .result = "\x67\x67\x31\x38\x54\x96\x69\x73"
15405                           "\x08\x57\x06\x56\x48\xea\xbe\x43",
15406                 .rlen   = 16,
15407         }, {
15408                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15409                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
15410                           "\x00\x11\x22\x33\x44\x55\x66\x77",
15411                 .klen   = 24,
15412                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15413                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15414                 .ilen   = 16,
15415                 .result = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
15416                           "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
15417                 .rlen   = 16,
15418         }, {
15419                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15420                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
15421                           "\x00\x11\x22\x33\x44\x55\x66\x77"
15422                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
15423                 .klen   = 32,
15424                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15425                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15426                 .ilen   = 16,
15427                 .result = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
15428                           "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
15429                 .rlen   = 16,
15430         },
15431         { /* Generated with Crypto++ */
15432                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
15433                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
15434                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
15435                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
15436                 .klen   = 32,
15437                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15438                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15439                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15440                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15441                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15442                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15443                 .ilen   = 48,
15444                 .result = "\xED\xCD\xDB\xB8\x68\xCE\xBD\xEA"
15445                           "\x9D\x9D\xCD\x9F\x4F\xFC\x4D\xB7"
15446                           "\xA5\xFF\x6F\x43\x0F\xBA\x32\x04"
15447                           "\xB3\xC2\xB9\x03\xAA\x91\x56\x29"
15448                           "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9"
15449                           "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A",
15450                 .rlen   = 48,
15451                 .also_non_np = 1,
15452                 .np     = 2,
15453                 .tap    = { 48 - 16, 16 },
15454         },
15455 };
15456
15457 static struct cipher_testvec camellia_dec_tv_template[] = {
15458         {
15459                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15460                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15461                 .klen   = 16,
15462                 .input  = "\x67\x67\x31\x38\x54\x96\x69\x73"
15463                           "\x08\x57\x06\x56\x48\xea\xbe\x43",
15464                 .ilen   = 16,
15465                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15466                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15467                 .rlen   = 16,
15468         }, {
15469                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15470                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
15471                           "\x00\x11\x22\x33\x44\x55\x66\x77",
15472                 .klen   = 24,
15473                 .input  = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
15474                           "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
15475                 .ilen   = 16,
15476                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15477                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15478                 .rlen   = 16,
15479         }, {
15480                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15481                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
15482                           "\x00\x11\x22\x33\x44\x55\x66\x77"
15483                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
15484                 .klen   = 32,
15485                 .input  = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
15486                           "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
15487                 .ilen   = 16,
15488                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
15489                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
15490                 .rlen   = 16,
15491         },
15492         { /* Generated with Crypto++ */
15493                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
15494                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
15495                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
15496                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
15497                 .klen   = 32,
15498                 .input  = "\xED\xCD\xDB\xB8\x68\xCE\xBD\xEA"
15499                           "\x9D\x9D\xCD\x9F\x4F\xFC\x4D\xB7"
15500                           "\xA5\xFF\x6F\x43\x0F\xBA\x32\x04"
15501                           "\xB3\xC2\xB9\x03\xAA\x91\x56\x29"
15502                           "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9"
15503                           "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A",
15504                 .ilen   = 48,
15505                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15506                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15507                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15508                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15509                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15510                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15511                 .rlen   = 48,
15512                 .also_non_np = 1,
15513                 .np     = 2,
15514                 .tap    = { 48 - 16, 16 },
15515         },
15516 };
15517
15518 static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
15519         {
15520                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
15521                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
15522                 .klen   = 16,
15523                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
15524                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
15525                 .input  = "Single block msg",
15526                 .ilen   = 16,
15527                 .result = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
15528                           "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
15529                 .rlen   = 16,
15530         }, {
15531                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
15532                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
15533                 .klen   = 16,
15534                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
15535                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
15536                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
15537                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
15538                           "\x10\x11\x12\x13\x14\x15\x16\x17"
15539                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
15540                 .ilen   = 32,
15541                 .result = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
15542                           "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
15543                           "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
15544                           "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
15545                 .rlen   = 32,
15546         },
15547         { /* Generated with Crypto++ */
15548                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15549                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15550                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15551                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15552                 .klen   = 32,
15553                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15554                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15555                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15556                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15557                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15558                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15559                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15560                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15561                 .ilen   = 48,
15562                 .result = "\xCD\x3E\x2A\x3B\x3E\x94\xC5\x77"
15563                           "\xBA\xBB\x5B\xB1\xDE\x7B\xA4\x40"
15564                           "\x88\x39\xE3\xFD\x94\x4B\x25\x58"
15565                           "\xE1\x4B\xC4\x18\x7A\xFD\x17\x2B"
15566                           "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27"
15567                           "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01",
15568                 .rlen   = 48,
15569                 .also_non_np = 1,
15570                 .np     = 2,
15571                 .tap    = { 48 - 16, 16 },
15572         },
15573 };
15574
15575 static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
15576         {
15577                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
15578                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
15579                 .klen   = 16,
15580                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
15581                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
15582                 .input  = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
15583                           "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
15584                 .ilen   = 16,
15585                 .result = "Single block msg",
15586                 .rlen   = 16,
15587         }, {
15588                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
15589                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
15590                 .klen   = 16,
15591                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
15592                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
15593                 .input = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
15594                           "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
15595                           "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
15596                           "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
15597                 .ilen   = 32,
15598                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
15599                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
15600                           "\x10\x11\x12\x13\x14\x15\x16\x17"
15601                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
15602                 .rlen   = 32,
15603         },
15604         { /* Generated with Crypto++ */
15605                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15606                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15607                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15608                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15609                 .klen   = 32,
15610                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15611                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15612                 .input  = "\xCD\x3E\x2A\x3B\x3E\x94\xC5\x77"
15613                           "\xBA\xBB\x5B\xB1\xDE\x7B\xA4\x40"
15614                           "\x88\x39\xE3\xFD\x94\x4B\x25\x58"
15615                           "\xE1\x4B\xC4\x18\x7A\xFD\x17\x2B"
15616                           "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27"
15617                           "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01",
15618                 .ilen   = 48,
15619                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15620                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15621                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15622                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15623                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15624                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15625                 .rlen   = 48,
15626                 .also_non_np = 1,
15627                 .np     = 2,
15628                 .tap    = { 48 - 16, 16 },
15629         },
15630 };
15631
15632 static struct cipher_testvec camellia_ctr_enc_tv_template[] = {
15633         { /* Generated with Crypto++ */
15634                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15635                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15636                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15637                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15638                 .klen   = 32,
15639                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15640                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15641                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15642                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15643                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15644                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15645                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15646                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15647                 .ilen   = 48,
15648                 .result = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
15649                           "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
15650                           "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
15651                           "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
15652                           "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
15653                           "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C",
15654                 .rlen   = 48,
15655         },
15656         { /* Generated with Crypto++ */
15657                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15658                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15659                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15660                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15661                 .klen   = 32,
15662                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15663                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15664                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15665                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15666                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15667                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15668                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15669                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
15670                           "\xDF\x76\x0D",
15671                 .ilen   = 51,
15672                 .result = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
15673                           "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
15674                           "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
15675                           "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
15676                           "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
15677                           "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C"
15678                           "\x1E\x43\xEF",
15679                 .rlen   = 51,
15680                 .also_non_np = 1,
15681                 .np     = 2,
15682                 .tap    = { 51 - 16, 16 },
15683         },
15684 };
15685
15686 static struct cipher_testvec camellia_ctr_dec_tv_template[] = {
15687         { /* Generated with Crypto++ */
15688                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15689                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15690                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15691                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15692                 .klen   = 32,
15693                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15694                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15695                 .input  = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
15696                           "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
15697                           "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
15698                           "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
15699                           "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
15700                           "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C",
15701                 .ilen   = 48,
15702                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15703                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15704                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15705                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15706                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15707                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
15708                 .rlen   = 48,
15709         },
15710         { /* Generated with Crypto++ */
15711                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15712                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
15713                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
15714                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
15715                 .klen   = 32,
15716                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
15717                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
15718                 .input  = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
15719                           "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
15720                           "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
15721                           "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
15722                           "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
15723                           "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C"
15724                           "\x1E\x43\xEF",
15725                 .ilen   = 51,
15726                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15727                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15728                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15729                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15730                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15731                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
15732                           "\xDF\x76\x0D",
15733                 .rlen   = 51,
15734                 .also_non_np = 1,
15735                 .np     = 2,
15736                 .tap    = { 51 - 16, 16 },
15737         },
15738
15739 };
15740
15741 static struct cipher_testvec camellia_lrw_enc_tv_template[] = {
15742         /* Generated from AES-LRW test vectors */
15743         {
15744                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
15745                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
15746                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
15747                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
15748                 .klen   = 32,
15749                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15750                           "\x00\x00\x00\x00\x00\x00\x00\x01",
15751                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15752                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15753                 .ilen   = 16,
15754                 .result = "\x92\x68\x19\xd7\xb7\x5b\x0a\x31"
15755                           "\x97\xcc\x72\xbe\x99\x17\xeb\x3e",
15756                 .rlen   = 16,
15757         }, {
15758                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
15759                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
15760                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
15761                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
15762                 .klen   = 32,
15763                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15764                           "\x00\x00\x00\x00\x00\x00\x00\x02",
15765                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15766                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15767                 .ilen   = 16,
15768                 .result = "\x73\x09\xb7\x50\xb6\x77\x30\x50"
15769                           "\x5c\x8a\x9c\x26\x77\x9d\xfc\x4a",
15770                 .rlen   = 16,
15771         }, {
15772                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
15773                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
15774                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
15775                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
15776                 .klen   = 32,
15777                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15778                           "\x00\x00\x00\x02\x00\x00\x00\x00",
15779                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15780                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15781                 .ilen   = 16,
15782                 .result = "\x90\xae\x83\xe0\x22\xb9\x60\x91"
15783                           "\xfa\xa9\xb7\x98\xe3\xed\x87\x01",
15784                 .rlen   = 16,
15785         }, {
15786                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
15787                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
15788                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
15789                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
15790                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
15791                 .klen   = 40,
15792                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15793                           "\x00\x00\x00\x00\x00\x00\x00\x01",
15794                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15795                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15796                 .ilen   = 16,
15797                 .result = "\x99\xe9\x6e\xd4\xc9\x21\xa5\xf0"
15798                           "\xd8\x83\xef\xd9\x07\x16\x5f\x35",
15799                 .rlen   = 16,
15800         }, {
15801                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
15802                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
15803                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
15804                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
15805                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
15806                 .klen   = 40,
15807                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15808                           "\x00\x00\x00\x02\x00\x00\x00\x00",
15809                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15810                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15811                 .ilen   = 16,
15812                 .result = "\x42\x88\xf4\xcb\x21\x11\x6d\x8e"
15813                           "\xde\x1a\xf2\x29\xf1\x4a\xe0\x15",
15814                 .rlen   = 16,
15815         }, {
15816                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
15817                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
15818                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
15819                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
15820                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
15821                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
15822                 .klen   = 48,
15823                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15824                           "\x00\x00\x00\x00\x00\x00\x00\x01",
15825                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15826                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15827                 .ilen   = 16,
15828                 .result = "\x40\xaa\x34\x86\x4a\x8f\x78\xb9"
15829                           "\xdb\xdb\x0f\x3d\x48\x70\xbe\x8d",
15830                 .rlen   = 16,
15831         }, {
15832                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
15833                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
15834                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
15835                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
15836                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
15837                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
15838                 .klen   = 48,
15839                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15840                           "\x00\x00\x00\x02\x00\x00\x00\x00",
15841                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
15842                           "\x38\x39\x41\x42\x43\x44\x45\x46",
15843                 .ilen   = 16,
15844                 .result = "\x04\xab\x28\x37\x31\x7a\x26\xab"
15845                           "\xa1\x70\x1b\x9c\xe7\xdd\x83\xff",
15846                 .rlen   = 16,
15847         }, {
15848                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
15849                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
15850                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
15851                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
15852                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
15853                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
15854                 .klen   = 48,
15855                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
15856                           "\x00\x00\x00\x00\x00\x00\x00\x01",
15857                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
15858                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
15859                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
15860                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
15861                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
15862                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
15863                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
15864                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
15865                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
15866                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
15867                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
15868                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
15869                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
15870                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
15871                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
15872                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
15873                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
15874                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
15875                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
15876                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
15877                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
15878                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
15879                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
15880                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
15881                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
15882                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
15883                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
15884                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
15885                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
15886                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
15887                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
15888                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
15889                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
15890                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
15891                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
15892                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
15893                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
15894                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
15895                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
15896                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
15897                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
15898                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
15899                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
15900                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
15901                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
15902                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
15903                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
15904                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
15905                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
15906                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
15907                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
15908                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
15909                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
15910                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
15911                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
15912                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
15913                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
15914                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
15915                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
15916                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
15917                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
15918                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
15919                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
15920                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
15921                 .ilen   = 512,
15922                 .result = "\x90\x69\x8e\xf2\x14\x86\x59\xf9"
15923                           "\xec\xe7\xfa\x3f\x48\x9d\x7f\x96"
15924                           "\x67\x76\xac\x2c\xd2\x63\x18\x93"
15925                           "\x13\xf8\xf1\xf6\x71\x77\xb3\xee"
15926                           "\x93\xb2\xcc\xf3\x26\xc1\x16\x4f"
15927                           "\xd4\xe8\x43\xc1\x68\xa3\x3e\x06"
15928                           "\x38\x51\xff\xa8\xb9\xa4\xeb\xb1"
15929                           "\x62\xdd\x78\x81\xea\x1d\xef\x04"
15930                           "\x1d\x07\xc1\x67\xc8\xd6\x77\xa1"
15931                           "\x84\x95\xf4\x9a\xd9\xbc\x2d\xe2"
15932                           "\xf6\x80\xfc\x91\x2a\xbc\x42\xa0"
15933                           "\x40\x41\x69\xaa\x71\xc0\x37\xec"
15934                           "\x39\xf3\xf2\xec\x82\xc3\x88\x79"
15935                           "\xbc\xc3\xaa\xb7\xcf\x6a\x72\x80"
15936                           "\x4c\xf4\x84\x8f\x13\x9e\x94\x5c"
15937                           "\xe5\xb2\x91\xbb\x92\x51\x4d\xf1"
15938                           "\xd6\x0d\x71\x6b\x7a\xc2\x2f\x12"
15939                           "\x6f\x75\xc7\x80\x99\x50\x84\xcf"
15940                           "\xa8\xeb\xd6\xe1\x1c\x59\x81\x7e"
15941                           "\xb9\xb3\xde\x7a\x93\x14\x12\xa2"
15942                           "\xf7\x43\xb3\x9d\x1a\x87\x65\x91"
15943                           "\x42\x08\x40\x82\x06\x1c\x2d\x55"
15944                           "\x6e\x48\xd5\x74\x07\x6e\x9d\x80"
15945                           "\xeb\xb4\x97\xa1\x36\xdf\xfa\x74"
15946                           "\x79\x7f\x5a\x75\xe7\x71\xc8\x8c"
15947                           "\x7e\xf8\x3a\x77\xcd\x32\x05\xf9"
15948                           "\x3d\xd4\xe9\xa2\xbb\xc4\x8b\x83"
15949                           "\x42\x5c\x82\xfa\xe9\x4b\x96\x3b"
15950                           "\x7f\x89\x8b\xf9\xf1\x87\xda\xf0"
15951                           "\x87\xef\x13\x5d\xf0\xe2\xc5\xc1"
15952                           "\xed\x14\xa9\x57\x19\x63\x40\x04"
15953                           "\x24\xeb\x6e\x19\xd1\x3d\x70\x78"
15954                           "\xeb\xda\x55\x70\x2c\x4f\x41\x5b"
15955                           "\x56\x9f\x1a\xd3\xac\xf1\xc0\xc3"
15956                           "\x21\xec\xd7\xd2\x55\x32\x7c\x2e"
15957                           "\x3c\x48\x8e\xb4\x85\x35\x47\xfe"
15958                           "\xe2\x88\x79\x98\x6a\xc9\x8d\xff"
15959                           "\xe9\x89\x6e\xb8\xe2\x97\x00\xbd"
15960                           "\xa4\x8f\xba\xd0\x8c\xcb\x79\x99"
15961                           "\xb3\xb2\xb2\x7a\xc3\xb7\xef\x75"
15962                           "\x23\x52\x76\xc3\x50\x6e\x66\xf8"
15963                           "\xa2\xe2\xce\xba\x40\x21\x3f\xc9"
15964                           "\x0a\x32\x7f\xf7\x08\x8c\x66\xcf"
15965                           "\xd3\xdf\x57\x59\x83\xb8\xe1\x85"
15966                           "\xd6\x8f\xfb\x48\x1f\x3a\xc4\x2f"
15967                           "\xb4\x2d\x58\xab\xd8\x7f\x5e\x3a"
15968                           "\xbc\x62\x3e\xe2\x6a\x52\x0d\x76"
15969                           "\x2f\x1c\x1a\x30\xed\x95\x2a\x44"
15970                           "\x35\xa5\x83\x04\x84\x01\x99\x56"
15971                           "\xb7\xe3\x10\x96\xfa\xdc\x19\xdd"
15972                           "\xe2\x7f\xcb\xa0\x49\x1b\xff\x4c"
15973                           "\x73\xf6\xbb\x94\x00\xe8\xa9\x3d"
15974                           "\xe2\x20\xe9\x3f\xfa\x07\x5d\x77"
15975                           "\x06\xd5\x4f\x4d\x02\xb8\x40\x1b"
15976                           "\x30\xed\x1a\x50\x19\xef\xc4\x2c"
15977                           "\x02\xd9\xc5\xd3\x11\x33\x37\xe5"
15978                           "\x2b\xa3\x95\xa6\xee\xd8\x74\x1d"
15979                           "\x68\xa0\xeb\xbf\xdd\x5e\x99\x96"
15980                           "\x91\xc3\x94\x24\xa5\x12\xa2\x37"
15981                           "\xb3\xac\xcf\x2a\xfd\x55\x34\xfe"
15982                           "\x79\x92\x3e\xe6\x1b\x49\x57\x5d"
15983                           "\x93\x6c\x01\xf7\xcc\x4e\x20\xd1"
15984                           "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9"
15985                           "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95",
15986                 .rlen   = 512,
15987                 .also_non_np = 1,
15988                 .np     = 2,
15989                 .tap    = { 512 - 16, 16 },
15990         },
15991 };
15992
15993 static struct cipher_testvec camellia_lrw_dec_tv_template[] = {
15994         /* Generated from AES-LRW test vectors */
15995         /* same as enc vectors with input and result reversed */
15996         {
15997                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
15998                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
15999                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
16000                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
16001                 .klen   = 32,
16002                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16003                           "\x00\x00\x00\x00\x00\x00\x00\x01",
16004                 .input  = "\x92\x68\x19\xd7\xb7\x5b\x0a\x31"
16005                           "\x97\xcc\x72\xbe\x99\x17\xeb\x3e",
16006                 .ilen   = 16,
16007                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16008                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16009                 .rlen   = 16,
16010         }, {
16011                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
16012                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
16013                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
16014                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
16015                 .klen   = 32,
16016                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16017                           "\x00\x00\x00\x00\x00\x00\x00\x02",
16018                 .input  = "\x73\x09\xb7\x50\xb6\x77\x30\x50"
16019                           "\x5c\x8a\x9c\x26\x77\x9d\xfc\x4a",
16020                 .ilen   = 16,
16021                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16022                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16023                 .rlen   = 16,
16024         }, {
16025                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
16026                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
16027                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
16028                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
16029                 .klen   = 32,
16030                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16031                           "\x00\x00\x00\x02\x00\x00\x00\x00",
16032                 .input  = "\x90\xae\x83\xe0\x22\xb9\x60\x91"
16033                           "\xfa\xa9\xb7\x98\xe3\xed\x87\x01",
16034                 .ilen   = 16,
16035                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16036                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16037                 .rlen   = 16,
16038         }, {
16039                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
16040                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
16041                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
16042                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
16043                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
16044                 .klen   = 40,
16045                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16046                           "\x00\x00\x00\x00\x00\x00\x00\x01",
16047                 .input  = "\x99\xe9\x6e\xd4\xc9\x21\xa5\xf0"
16048                           "\xd8\x83\xef\xd9\x07\x16\x5f\x35",
16049                 .ilen   = 16,
16050                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16051                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16052                 .rlen   = 16,
16053         }, {
16054                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
16055                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
16056                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
16057                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
16058                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
16059                 .klen   = 40,
16060                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16061                           "\x00\x00\x00\x02\x00\x00\x00\x00",
16062                 .input  = "\x42\x88\xf4\xcb\x21\x11\x6d\x8e"
16063                           "\xde\x1a\xf2\x29\xf1\x4a\xe0\x15",
16064                 .ilen   = 16,
16065                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16066                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16067                 .rlen   = 16,
16068         }, {
16069                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
16070                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
16071                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
16072                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
16073                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
16074                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
16075                 .klen   = 48,
16076                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16077                           "\x00\x00\x00\x00\x00\x00\x00\x01",
16078                 .input  = "\x40\xaa\x34\x86\x4a\x8f\x78\xb9"
16079                           "\xdb\xdb\x0f\x3d\x48\x70\xbe\x8d",
16080                 .ilen   = 16,
16081                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16082                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16083                 .rlen   = 16,
16084         }, {
16085                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
16086                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
16087                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
16088                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
16089                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
16090                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
16091                 .klen   = 48,
16092                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16093                           "\x00\x00\x00\x02\x00\x00\x00\x00",
16094                 .input  = "\x04\xab\x28\x37\x31\x7a\x26\xab"
16095                           "\xa1\x70\x1b\x9c\xe7\xdd\x83\xff",
16096                 .ilen   = 16,
16097                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
16098                           "\x38\x39\x41\x42\x43\x44\x45\x46",
16099                 .rlen   = 16,
16100         }, {
16101                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
16102                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
16103                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
16104                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
16105                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
16106                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
16107                 .klen   = 48,
16108                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16109                           "\x00\x00\x00\x00\x00\x00\x00\x01",
16110                 .input  = "\x90\x69\x8e\xf2\x14\x86\x59\xf9"
16111                           "\xec\xe7\xfa\x3f\x48\x9d\x7f\x96"
16112                           "\x67\x76\xac\x2c\xd2\x63\x18\x93"
16113                           "\x13\xf8\xf1\xf6\x71\x77\xb3\xee"
16114                           "\x93\xb2\xcc\xf3\x26\xc1\x16\x4f"
16115                           "\xd4\xe8\x43\xc1\x68\xa3\x3e\x06"
16116                           "\x38\x51\xff\xa8\xb9\xa4\xeb\xb1"
16117                           "\x62\xdd\x78\x81\xea\x1d\xef\x04"
16118                           "\x1d\x07\xc1\x67\xc8\xd6\x77\xa1"
16119                           "\x84\x95\xf4\x9a\xd9\xbc\x2d\xe2"
16120                           "\xf6\x80\xfc\x91\x2a\xbc\x42\xa0"
16121                           "\x40\x41\x69\xaa\x71\xc0\x37\xec"
16122                           "\x39\xf3\xf2\xec\x82\xc3\x88\x79"
16123                           "\xbc\xc3\xaa\xb7\xcf\x6a\x72\x80"
16124                           "\x4c\xf4\x84\x8f\x13\x9e\x94\x5c"
16125                           "\xe5\xb2\x91\xbb\x92\x51\x4d\xf1"
16126                           "\xd6\x0d\x71\x6b\x7a\xc2\x2f\x12"
16127                           "\x6f\x75\xc7\x80\x99\x50\x84\xcf"
16128                           "\xa8\xeb\xd6\xe1\x1c\x59\x81\x7e"
16129                           "\xb9\xb3\xde\x7a\x93\x14\x12\xa2"
16130                           "\xf7\x43\xb3\x9d\x1a\x87\x65\x91"
16131                           "\x42\x08\x40\x82\x06\x1c\x2d\x55"
16132                           "\x6e\x48\xd5\x74\x07\x6e\x9d\x80"
16133                           "\xeb\xb4\x97\xa1\x36\xdf\xfa\x74"
16134                           "\x79\x7f\x5a\x75\xe7\x71\xc8\x8c"
16135                           "\x7e\xf8\x3a\x77\xcd\x32\x05\xf9"
16136                           "\x3d\xd4\xe9\xa2\xbb\xc4\x8b\x83"
16137                           "\x42\x5c\x82\xfa\xe9\x4b\x96\x3b"
16138                           "\x7f\x89\x8b\xf9\xf1\x87\xda\xf0"
16139                           "\x87\xef\x13\x5d\xf0\xe2\xc5\xc1"
16140                           "\xed\x14\xa9\x57\x19\x63\x40\x04"
16141                           "\x24\xeb\x6e\x19\xd1\x3d\x70\x78"
16142                           "\xeb\xda\x55\x70\x2c\x4f\x41\x5b"
16143                           "\x56\x9f\x1a\xd3\xac\xf1\xc0\xc3"
16144                           "\x21\xec\xd7\xd2\x55\x32\x7c\x2e"
16145                           "\x3c\x48\x8e\xb4\x85\x35\x47\xfe"
16146                           "\xe2\x88\x79\x98\x6a\xc9\x8d\xff"
16147                           "\xe9\x89\x6e\xb8\xe2\x97\x00\xbd"
16148                           "\xa4\x8f\xba\xd0\x8c\xcb\x79\x99"
16149                           "\xb3\xb2\xb2\x7a\xc3\xb7\xef\x75"
16150                           "\x23\x52\x76\xc3\x50\x6e\x66\xf8"
16151                           "\xa2\xe2\xce\xba\x40\x21\x3f\xc9"
16152                           "\x0a\x32\x7f\xf7\x08\x8c\x66\xcf"
16153                           "\xd3\xdf\x57\x59\x83\xb8\xe1\x85"
16154                           "\xd6\x8f\xfb\x48\x1f\x3a\xc4\x2f"
16155                           "\xb4\x2d\x58\xab\xd8\x7f\x5e\x3a"
16156                           "\xbc\x62\x3e\xe2\x6a\x52\x0d\x76"
16157                           "\x2f\x1c\x1a\x30\xed\x95\x2a\x44"
16158                           "\x35\xa5\x83\x04\x84\x01\x99\x56"
16159                           "\xb7\xe3\x10\x96\xfa\xdc\x19\xdd"
16160                           "\xe2\x7f\xcb\xa0\x49\x1b\xff\x4c"
16161                           "\x73\xf6\xbb\x94\x00\xe8\xa9\x3d"
16162                           "\xe2\x20\xe9\x3f\xfa\x07\x5d\x77"
16163                           "\x06\xd5\x4f\x4d\x02\xb8\x40\x1b"
16164                           "\x30\xed\x1a\x50\x19\xef\xc4\x2c"
16165                           "\x02\xd9\xc5\xd3\x11\x33\x37\xe5"
16166                           "\x2b\xa3\x95\xa6\xee\xd8\x74\x1d"
16167                           "\x68\xa0\xeb\xbf\xdd\x5e\x99\x96"
16168                           "\x91\xc3\x94\x24\xa5\x12\xa2\x37"
16169                           "\xb3\xac\xcf\x2a\xfd\x55\x34\xfe"
16170                           "\x79\x92\x3e\xe6\x1b\x49\x57\x5d"
16171                           "\x93\x6c\x01\xf7\xcc\x4e\x20\xd1"
16172                           "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9"
16173                           "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95",
16174                 .ilen   = 512,
16175                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
16176                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
16177                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
16178                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
16179                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
16180                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
16181                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
16182                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
16183                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
16184                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
16185                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
16186                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
16187                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
16188                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
16189                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
16190                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
16191                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
16192                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
16193                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
16194                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
16195                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
16196                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
16197                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
16198                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
16199                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
16200                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
16201                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
16202                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
16203                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
16204                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
16205                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
16206                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
16207                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
16208                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
16209                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
16210                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
16211                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
16212                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
16213                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
16214                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
16215                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
16216                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
16217                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
16218                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
16219                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
16220                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
16221                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
16222                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
16223                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
16224                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
16225                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
16226                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
16227                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
16228                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
16229                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
16230                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
16231                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
16232                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
16233                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
16234                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
16235                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
16236                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
16237                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
16238                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
16239                 .rlen   = 512,
16240                 .also_non_np = 1,
16241                 .np     = 2,
16242                 .tap    = { 512 - 16, 16 },
16243         },
16244 };
16245
16246 static struct cipher_testvec camellia_xts_enc_tv_template[] = {
16247         /* Generated from AES-XTS test vectors */
16248         {
16249                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
16250                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16251                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16252                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16253                 .klen   = 32,
16254                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16255                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16256                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
16257                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16258                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16259                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16260                 .ilen   = 32,
16261                 .result = "\x06\xcb\xa5\xf1\x04\x63\xb2\x41"
16262                           "\xdc\xca\xfa\x09\xba\x74\xb9\x05"
16263                           "\x78\xba\xa4\xf8\x67\x4d\x7e\xad"
16264                           "\x20\x18\xf5\x0c\x41\x16\x2a\x61",
16265                 .rlen   = 32,
16266         }, {
16267                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
16268                           "\x11\x11\x11\x11\x11\x11\x11\x11"
16269                           "\x22\x22\x22\x22\x22\x22\x22\x22"
16270                           "\x22\x22\x22\x22\x22\x22\x22\x22",
16271                 .klen   = 32,
16272                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
16273                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16274                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
16275                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16276                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16277                           "\x44\x44\x44\x44\x44\x44\x44\x44",
16278                 .ilen   = 32,
16279                 .result = "\xc2\xb9\xdc\x44\x1d\xdf\xf2\x86"
16280                           "\x8d\x35\x42\x0a\xa5\x5e\x3d\x4f"
16281                           "\xb5\x37\x06\xff\xbd\xd4\x91\x70"
16282                           "\x80\x1f\xb2\x39\x10\x89\x44\xf5",
16283                 .rlen   = 32,
16284         }, {
16285                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
16286                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
16287                           "\x22\x22\x22\x22\x22\x22\x22\x22"
16288                           "\x22\x22\x22\x22\x22\x22\x22\x22",
16289                 .klen   = 32,
16290                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
16291                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16292                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
16293                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16294                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16295                           "\x44\x44\x44\x44\x44\x44\x44\x44",
16296                 .ilen   = 32,
16297                 .result = "\x52\x1f\x9d\xf5\x5a\x58\x5a\x7e"
16298                           "\x9f\xd0\x8e\x02\x9c\x9a\x6a\xa7"
16299                           "\xb4\x3b\xce\xe7\x17\xaa\x89\x6a"
16300                           "\x35\x3c\x6b\xb5\x61\x1c\x79\x38",
16301                 .rlen   = 32,
16302         }, {
16303                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
16304                           "\x23\x53\x60\x28\x74\x71\x35\x26"
16305                           "\x31\x41\x59\x26\x53\x58\x97\x93"
16306                           "\x23\x84\x62\x64\x33\x83\x27\x95",
16307                 .klen   = 32,
16308                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16309                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16310                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
16311                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16312                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16313                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16314                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16315                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16316                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16317                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16318                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16319                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16320                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16321                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16322                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16323                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16324                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16325                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16326                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16327                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16328                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16329                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16330                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16331                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16332                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16333                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16334                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16335                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16336                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16337                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16338                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16339                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16340                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16341                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
16342                           "\x00\x01\x02\x03\x04\x05\x06\x07"
16343                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16344                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16345                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16346                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16347                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16348                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16349                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16350                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16351                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16352                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16353                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16354                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16355                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16356                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16357                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16358                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16359                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16360                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16361                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16362                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16363                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16364                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16365                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16366                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16367                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16368                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16369                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16370                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16371                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16372                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16373                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
16374                 .ilen   = 512,
16375                 .result = "\xc7\xf9\x0a\xaa\xcb\xb5\x8f\x33"
16376                           "\x60\xc3\xe9\x47\x90\xb7\x50\x57"
16377                           "\xa3\xad\x81\x2f\xf5\x22\x96\x02"
16378                           "\xaa\x7f\xea\xac\x29\x78\xca\x2a"
16379                           "\x7c\xcd\x31\x1a\x3c\x40\x0a\x73"
16380                           "\x09\x66\xad\x72\x0e\x4d\x5d\x77"
16381                           "\xbc\xb8\x76\x80\x37\x59\xa9\x01"
16382                           "\x9e\xfb\xdb\x6c\x93\xef\xb6\x8d"
16383                           "\x1e\xc1\x94\xa8\xd4\xb5\xb0\x01"
16384                           "\xd5\x01\x97\x28\xcd\x7a\x1f\xe8"
16385                           "\x08\xda\x76\x00\x65\xcf\x7b\x31"
16386                           "\xc6\xfa\xf2\x3b\x00\xa7\x6a\x9e"
16387                           "\x6c\x43\x80\x87\xe0\xbb\x4e\xe5"
16388                           "\xdc\x8a\xdf\xc3\x1d\x1b\x41\x04"
16389                           "\xfb\x54\xdd\x29\x27\xc2\x65\x17"
16390                           "\x36\x88\xb0\x85\x8d\x73\x7e\x4b"
16391                           "\x1d\x16\x8a\x52\xbc\xa6\xbc\xa4"
16392                           "\x8c\xd1\x04\x16\xbf\x8c\x01\x0f"
16393                           "\x7e\x6b\x59\x15\x29\xd1\x9b\xd3"
16394                           "\x6c\xee\xac\xdc\x45\x58\xca\x5b"
16395                           "\x70\x0e\x6a\x12\x86\x82\x79\x9f"
16396                           "\x16\xd4\x9d\x67\xcd\x70\x65\x26"
16397                           "\x21\x72\x1e\xa1\x94\x8a\x83\x0c"
16398                           "\x92\x42\x58\x5e\xa2\xc5\x31\xf3"
16399                           "\x7b\xd1\x31\xd4\x15\x80\x31\x61"
16400                           "\x5c\x53\x10\xdd\xea\xc8\x83\x5c"
16401                           "\x7d\xa7\x05\x66\xcc\x1e\xbb\x05"
16402                           "\x47\xae\xb4\x0f\x84\xd8\xf6\xb5"
16403                           "\xa1\xc6\x52\x00\x52\xe8\xdc\xd9"
16404                           "\x16\x31\xb2\x47\x91\x67\xaa\x28"
16405                           "\x2c\x29\x85\xa3\xf7\xf2\x24\x93"
16406                           "\x23\x80\x1f\xa8\x1b\x82\x8d\xdc"
16407                           "\x9f\x0b\xcd\xb4\x3c\x20\xbc\xec"
16408                           "\x4f\xc7\xee\xf8\xfd\xd9\xfb\x7e"
16409                           "\x3f\x0d\x23\xfa\x3f\xa7\xcc\x66"
16410                           "\x1c\xfe\xa6\x86\xf6\xf7\x85\xc7"
16411                           "\x43\xc1\xd4\xfc\xe4\x79\xc9\x1d"
16412                           "\xf8\x89\xcd\x20\x27\x84\x5d\x5c"
16413                           "\x8e\x4f\x1f\xeb\x08\x21\x4f\xa3"
16414                           "\xe0\x7e\x0b\x9c\xe7\x42\xcf\xb7"
16415                           "\x3f\x43\xcc\x86\x71\x34\x6a\xd9"
16416                           "\x5e\xec\x8f\x36\xc9\x0a\x03\xfe"
16417                           "\x18\x41\xdc\x9e\x2e\x75\x20\x3e"
16418                           "\xcc\x77\xe0\x8f\xe8\x43\x37\x4c"
16419                           "\xed\x1a\x5a\xb3\xfa\x43\xc9\x71"
16420                           "\x9f\xc5\xce\xcf\xff\xe7\x77\x1e"
16421                           "\x35\x93\xde\x6b\xc0\x6a\x7e\xa9"
16422                           "\x34\xb8\x27\x74\x08\xda\xf2\x4a"
16423                           "\x23\x5b\x9f\x55\x3a\x57\x82\x52"
16424                           "\xea\x6d\xc3\xc7\xf2\xc8\xb5\xdc"
16425                           "\xc5\xb9\xbb\xaa\xf2\x29\x9f\x49"
16426                           "\x7a\xef\xfe\xdc\x9f\xc9\x28\xe2"
16427                           "\x96\x0b\x35\x84\x05\x0d\xd6\x2a"
16428                           "\xea\x5a\xbf\x69\xde\xee\x4f\x8f"
16429                           "\x84\xb9\xcf\xa7\x57\xea\xe0\xe8"
16430                           "\x96\xef\x0f\x0e\xec\xc7\xa6\x74"
16431                           "\xb1\xfe\x7a\x6d\x11\xdd\x0e\x15"
16432                           "\x4a\x1e\x73\x7f\x55\xea\xf6\xe1"
16433                           "\x5b\xb6\x71\xda\xb0\x0c\xba\x26"
16434                           "\x5c\x48\x38\x6d\x1c\x32\xb2\x7d"
16435                           "\x05\x87\xc2\x1e\x7e\x2d\xd4\x33"
16436                           "\xcc\x06\xdb\xe7\x82\x29\x63\xd1"
16437                           "\x52\x84\x4f\xee\x27\xe8\x02\xd4"
16438                           "\x34\x3c\x69\xc2\xbd\x20\xe6\x7a",
16439                 .rlen   = 512,
16440         }, {
16441                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
16442                           "\x23\x53\x60\x28\x74\x71\x35\x26"
16443                           "\x62\x49\x77\x57\x24\x70\x93\x69"
16444                           "\x99\x59\x57\x49\x66\x96\x76\x27"
16445                           "\x31\x41\x59\x26\x53\x58\x97\x93"
16446                           "\x23\x84\x62\x64\x33\x83\x27\x95"
16447                           "\x02\x88\x41\x97\x16\x93\x99\x37"
16448                           "\x51\x05\x82\x09\x74\x94\x45\x92",
16449                 .klen   = 64,
16450                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
16451                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16452                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
16453                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16454                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16455                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16456                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16457                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16458                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16459                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16460                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16461                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16462                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16463                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16464                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16465                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16466                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16467                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16468                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16469                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16470                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16471                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16472                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16473                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16474                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16475                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16476                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16477                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16478                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16479                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16480                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16481                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16482                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16483                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
16484                           "\x00\x01\x02\x03\x04\x05\x06\x07"
16485                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16486                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16487                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16488                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16489                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16490                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16491                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16492                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16493                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16494                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16495                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16496                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16497                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16498                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16499                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16500                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16501                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16502                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16503                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16504                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16505                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16506                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16507                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16508                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16509                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16510                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16511                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16512                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16513                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16514                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16515                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
16516                 .ilen   = 512,
16517                 .result = "\x49\xcd\xb8\xbf\x2f\x73\x37\x28"
16518                           "\x9a\x7f\x6e\x57\x55\xb8\x07\x88"
16519                           "\x4a\x0d\x8b\x55\x60\xed\xb6\x7b"
16520                           "\xf1\x74\xac\x96\x05\x7b\x32\xca"
16521                           "\xd1\x4e\xf1\x58\x29\x16\x24\x6c"
16522                           "\xf2\xb3\xe4\x88\x84\xac\x4d\xee"
16523                           "\x97\x07\x82\xf0\x07\x12\x38\x0a"
16524                           "\x67\x62\xaf\xfd\x85\x9f\x0a\x55"
16525                           "\xa5\x20\xc5\x60\xe4\x68\x53\xa4"
16526                           "\x0e\x2e\x65\xe3\xe4\x0c\x30\x7c"
16527                           "\x1c\x01\x4f\x55\xa9\x13\xeb\x25"
16528                           "\x21\x87\xbc\xd3\xe7\x67\x4f\x38"
16529                           "\xa8\x14\x25\x71\xe9\x2e\x4c\x21"
16530                           "\x41\x82\x0c\x45\x39\x35\xa8\x75"
16531                           "\x03\x29\x01\x84\x8c\xab\x48\xbe"
16532                           "\x11\x56\x22\x67\xb7\x67\x1a\x09"
16533                           "\xa1\x72\x25\x41\x3c\x39\x65\x80"
16534                           "\x7d\x2f\xf8\x2c\x73\x04\x58\x9d"
16535                           "\xdd\x16\x8b\x63\x70\x4e\xc5\x17"
16536                           "\x21\xe0\x84\x51\x4b\x6f\x05\x52"
16537                           "\xe3\x63\x34\xfa\xa4\xaf\x33\x20"
16538                           "\xc1\xae\x32\xc4\xb8\x2b\xdb\x76"
16539                           "\xd9\x02\x31\x2f\xa3\xc6\xd0\x7b"
16540                           "\xaf\x1b\x84\xe3\x9b\xbf\xa6\xe0"
16541                           "\xb8\x8a\x13\x88\x71\xf4\x11\xa5"
16542                           "\xe9\xa9\x10\x33\xe0\xbe\x49\x89"
16543                           "\x41\x22\xf5\x9d\x80\x3e\x3b\x76"
16544                           "\x01\x16\x50\x6e\x7c\x6a\x81\xe9"
16545                           "\x13\x2c\xde\xb2\x5f\x79\xba\xb2"
16546                           "\xb1\x75\xae\xd2\x07\x98\x4b\x69"
16547                           "\xae\x7d\x5b\x90\xc2\x6c\xe6\x98"
16548                           "\xd3\x4c\xa1\xa3\x9c\xc9\x33\x6a"
16549                           "\x0d\x23\xb1\x79\x25\x13\x4b\xe5"
16550                           "\xaf\x93\x20\x5c\x7f\x06\x7a\x34"
16551                           "\x0b\x78\xe3\x67\x26\xe0\xad\x95"
16552                           "\xc5\x4e\x26\x22\xcf\x73\x77\x62"
16553                           "\x3e\x10\xd7\x90\x4b\x52\x1c\xc9"
16554                           "\xef\x38\x52\x18\x0e\x29\x7e\xef"
16555                           "\x34\xfe\x31\x95\xc5\xbc\xa8\xe2"
16556                           "\xa8\x4e\x9f\xea\xa6\xf0\xfe\x5d"
16557                           "\xc5\x39\x86\xed\x2f\x6d\xa0\xfe"
16558                           "\x96\xcd\x41\x10\x78\x4e\x0c\xc9"
16559                           "\xc3\x6d\x0f\xb7\xe8\xe0\x62\xab"
16560                           "\x8b\xf1\x21\x89\xa1\x12\xaa\xfa"
16561                           "\x9d\x70\xbe\x4c\xa8\x98\x89\x01"
16562                           "\xb9\xe2\x61\xde\x0c\x4a\x0b\xaa"
16563                           "\x89\xf5\x14\x79\x18\x8f\x3b\x0d"
16564                           "\x21\x17\xf8\x59\x15\x24\x64\x22"
16565                           "\x57\x48\x80\xd5\x3d\x92\x30\x07"
16566                           "\xd9\xa1\x4a\x23\x16\x43\x48\x0e"
16567                           "\x2b\x2d\x1b\x87\xef\x7e\xbd\xfa"
16568                           "\x49\xbc\x7e\x68\x6e\xa8\x46\x95"
16569                           "\xad\x5e\xfe\x0a\xa8\xd3\x1a\x5d"
16570                           "\x6b\x84\xf3\x00\xba\x52\x05\x02"
16571                           "\xe3\x96\x4e\xb6\x79\x3f\x43\xd3"
16572                           "\x4d\x3f\xd6\xab\x0a\xc4\x75\x2d"
16573                           "\xd1\x08\xc3\x6a\xc8\x37\x29\xa0"
16574                           "\xcc\x9a\x05\xdd\x5c\xe1\xff\x66"
16575                           "\xf2\x7a\x1d\xf2\xaf\xa9\x48\x89"
16576                           "\xf5\x21\x0f\x02\x48\x83\x74\xbf"
16577                           "\x2e\xe6\x93\x7b\xa0\xf4\xb1\x2b"
16578                           "\xb1\x02\x0a\x5c\x79\x19\x3b\x75"
16579                           "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e"
16580                           "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95",
16581                 .rlen   = 512,
16582                 .also_non_np = 1,
16583                 .np     = 2,
16584                 .tap    = { 512 - 16, 16 },
16585         },
16586 };
16587
16588 static struct cipher_testvec camellia_xts_dec_tv_template[] = {
16589         /* Generated from AES-XTS test vectors */
16590         /* same as enc vectors with input and result reversed */
16591         {
16592                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
16593                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16594                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16595                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16596                 .klen   = 32,
16597                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16598                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16599                 .input  = "\x06\xcb\xa5\xf1\x04\x63\xb2\x41"
16600                           "\xdc\xca\xfa\x09\xba\x74\xb9\x05"
16601                           "\x78\xba\xa4\xf8\x67\x4d\x7e\xad"
16602                           "\x20\x18\xf5\x0c\x41\x16\x2a\x61",
16603                 .ilen   = 32,
16604                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
16605                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16606                           "\x00\x00\x00\x00\x00\x00\x00\x00"
16607                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16608                 .rlen   = 32,
16609         }, {
16610                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
16611                           "\x11\x11\x11\x11\x11\x11\x11\x11"
16612                           "\x22\x22\x22\x22\x22\x22\x22\x22"
16613                           "\x22\x22\x22\x22\x22\x22\x22\x22",
16614                 .klen   = 32,
16615                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
16616                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16617                 .input  = "\xc2\xb9\xdc\x44\x1d\xdf\xf2\x86"
16618                           "\x8d\x35\x42\x0a\xa5\x5e\x3d\x4f"
16619                           "\xb5\x37\x06\xff\xbd\xd4\x91\x70"
16620                           "\x80\x1f\xb2\x39\x10\x89\x44\xf5",
16621                 .ilen   = 32,
16622                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
16623                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16624                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16625                           "\x44\x44\x44\x44\x44\x44\x44\x44",
16626                 .rlen   = 32,
16627         }, {
16628                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
16629                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
16630                           "\x22\x22\x22\x22\x22\x22\x22\x22"
16631                           "\x22\x22\x22\x22\x22\x22\x22\x22",
16632                 .klen   = 32,
16633                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
16634                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16635                 .input  = "\x52\x1f\x9d\xf5\x5a\x58\x5a\x7e"
16636                           "\x9f\xd0\x8e\x02\x9c\x9a\x6a\xa7"
16637                           "\xb4\x3b\xce\xe7\x17\xaa\x89\x6a"
16638                           "\x35\x3c\x6b\xb5\x61\x1c\x79\x38",
16639                 .ilen   = 32,
16640                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
16641                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16642                           "\x44\x44\x44\x44\x44\x44\x44\x44"
16643                           "\x44\x44\x44\x44\x44\x44\x44\x44",
16644                 .rlen   = 32,
16645         }, {
16646                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
16647                           "\x23\x53\x60\x28\x74\x71\x35\x26"
16648                           "\x31\x41\x59\x26\x53\x58\x97\x93"
16649                           "\x23\x84\x62\x64\x33\x83\x27\x95",
16650                 .klen   = 32,
16651                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
16652                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16653                 .input  = "\xc7\xf9\x0a\xaa\xcb\xb5\x8f\x33"
16654                           "\x60\xc3\xe9\x47\x90\xb7\x50\x57"
16655                           "\xa3\xad\x81\x2f\xf5\x22\x96\x02"
16656                           "\xaa\x7f\xea\xac\x29\x78\xca\x2a"
16657                           "\x7c\xcd\x31\x1a\x3c\x40\x0a\x73"
16658                           "\x09\x66\xad\x72\x0e\x4d\x5d\x77"
16659                           "\xbc\xb8\x76\x80\x37\x59\xa9\x01"
16660                           "\x9e\xfb\xdb\x6c\x93\xef\xb6\x8d"
16661                           "\x1e\xc1\x94\xa8\xd4\xb5\xb0\x01"
16662                           "\xd5\x01\x97\x28\xcd\x7a\x1f\xe8"
16663                           "\x08\xda\x76\x00\x65\xcf\x7b\x31"
16664                           "\xc6\xfa\xf2\x3b\x00\xa7\x6a\x9e"
16665                           "\x6c\x43\x80\x87\xe0\xbb\x4e\xe5"
16666                           "\xdc\x8a\xdf\xc3\x1d\x1b\x41\x04"
16667                           "\xfb\x54\xdd\x29\x27\xc2\x65\x17"
16668                           "\x36\x88\xb0\x85\x8d\x73\x7e\x4b"
16669                           "\x1d\x16\x8a\x52\xbc\xa6\xbc\xa4"
16670                           "\x8c\xd1\x04\x16\xbf\x8c\x01\x0f"
16671                           "\x7e\x6b\x59\x15\x29\xd1\x9b\xd3"
16672                           "\x6c\xee\xac\xdc\x45\x58\xca\x5b"
16673                           "\x70\x0e\x6a\x12\x86\x82\x79\x9f"
16674                           "\x16\xd4\x9d\x67\xcd\x70\x65\x26"
16675                           "\x21\x72\x1e\xa1\x94\x8a\x83\x0c"
16676                           "\x92\x42\x58\x5e\xa2\xc5\x31\xf3"
16677                           "\x7b\xd1\x31\xd4\x15\x80\x31\x61"
16678                           "\x5c\x53\x10\xdd\xea\xc8\x83\x5c"
16679                           "\x7d\xa7\x05\x66\xcc\x1e\xbb\x05"
16680                           "\x47\xae\xb4\x0f\x84\xd8\xf6\xb5"
16681                           "\xa1\xc6\x52\x00\x52\xe8\xdc\xd9"
16682                           "\x16\x31\xb2\x47\x91\x67\xaa\x28"
16683                           "\x2c\x29\x85\xa3\xf7\xf2\x24\x93"
16684                           "\x23\x80\x1f\xa8\x1b\x82\x8d\xdc"
16685                           "\x9f\x0b\xcd\xb4\x3c\x20\xbc\xec"
16686                           "\x4f\xc7\xee\xf8\xfd\xd9\xfb\x7e"
16687                           "\x3f\x0d\x23\xfa\x3f\xa7\xcc\x66"
16688                           "\x1c\xfe\xa6\x86\xf6\xf7\x85\xc7"
16689                           "\x43\xc1\xd4\xfc\xe4\x79\xc9\x1d"
16690                           "\xf8\x89\xcd\x20\x27\x84\x5d\x5c"
16691                           "\x8e\x4f\x1f\xeb\x08\x21\x4f\xa3"
16692                           "\xe0\x7e\x0b\x9c\xe7\x42\xcf\xb7"
16693                           "\x3f\x43\xcc\x86\x71\x34\x6a\xd9"
16694                           "\x5e\xec\x8f\x36\xc9\x0a\x03\xfe"
16695                           "\x18\x41\xdc\x9e\x2e\x75\x20\x3e"
16696                           "\xcc\x77\xe0\x8f\xe8\x43\x37\x4c"
16697                           "\xed\x1a\x5a\xb3\xfa\x43\xc9\x71"
16698                           "\x9f\xc5\xce\xcf\xff\xe7\x77\x1e"
16699                           "\x35\x93\xde\x6b\xc0\x6a\x7e\xa9"
16700                           "\x34\xb8\x27\x74\x08\xda\xf2\x4a"
16701                           "\x23\x5b\x9f\x55\x3a\x57\x82\x52"
16702                           "\xea\x6d\xc3\xc7\xf2\xc8\xb5\xdc"
16703                           "\xc5\xb9\xbb\xaa\xf2\x29\x9f\x49"
16704                           "\x7a\xef\xfe\xdc\x9f\xc9\x28\xe2"
16705                           "\x96\x0b\x35\x84\x05\x0d\xd6\x2a"
16706                           "\xea\x5a\xbf\x69\xde\xee\x4f\x8f"
16707                           "\x84\xb9\xcf\xa7\x57\xea\xe0\xe8"
16708                           "\x96\xef\x0f\x0e\xec\xc7\xa6\x74"
16709                           "\xb1\xfe\x7a\x6d\x11\xdd\x0e\x15"
16710                           "\x4a\x1e\x73\x7f\x55\xea\xf6\xe1"
16711                           "\x5b\xb6\x71\xda\xb0\x0c\xba\x26"
16712                           "\x5c\x48\x38\x6d\x1c\x32\xb2\x7d"
16713                           "\x05\x87\xc2\x1e\x7e\x2d\xd4\x33"
16714                           "\xcc\x06\xdb\xe7\x82\x29\x63\xd1"
16715                           "\x52\x84\x4f\xee\x27\xe8\x02\xd4"
16716                           "\x34\x3c\x69\xc2\xbd\x20\xe6\x7a",
16717                 .ilen   = 512,
16718                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
16719                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16720                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16721                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16722                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16723                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16724                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16725                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16726                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16727                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16728                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16729                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16730                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16731                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16732                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16733                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16734                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16735                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16736                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16737                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16738                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16739                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16740                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16741                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16742                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16743                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16744                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16745                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16746                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16747                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16748                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16749                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
16750                           "\x00\x01\x02\x03\x04\x05\x06\x07"
16751                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16752                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16753                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16754                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16755                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16756                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16757                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16758                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16759                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16760                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16761                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16762                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16763                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16764                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16765                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16766                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16767                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16768                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16769                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16770                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16771                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16772                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16773                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16774                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16775                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16776                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16777                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16778                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16779                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16780                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16781                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
16782                 .rlen   = 512,
16783         }, {
16784                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
16785                           "\x23\x53\x60\x28\x74\x71\x35\x26"
16786                           "\x62\x49\x77\x57\x24\x70\x93\x69"
16787                           "\x99\x59\x57\x49\x66\x96\x76\x27"
16788                           "\x31\x41\x59\x26\x53\x58\x97\x93"
16789                           "\x23\x84\x62\x64\x33\x83\x27\x95"
16790                           "\x02\x88\x41\x97\x16\x93\x99\x37"
16791                           "\x51\x05\x82\x09\x74\x94\x45\x92",
16792                 .klen   = 64,
16793                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
16794                           "\x00\x00\x00\x00\x00\x00\x00\x00",
16795                 .input  = "\x49\xcd\xb8\xbf\x2f\x73\x37\x28"
16796                           "\x9a\x7f\x6e\x57\x55\xb8\x07\x88"
16797                           "\x4a\x0d\x8b\x55\x60\xed\xb6\x7b"
16798                           "\xf1\x74\xac\x96\x05\x7b\x32\xca"
16799                           "\xd1\x4e\xf1\x58\x29\x16\x24\x6c"
16800                           "\xf2\xb3\xe4\x88\x84\xac\x4d\xee"
16801                           "\x97\x07\x82\xf0\x07\x12\x38\x0a"
16802                           "\x67\x62\xaf\xfd\x85\x9f\x0a\x55"
16803                           "\xa5\x20\xc5\x60\xe4\x68\x53\xa4"
16804                           "\x0e\x2e\x65\xe3\xe4\x0c\x30\x7c"
16805                           "\x1c\x01\x4f\x55\xa9\x13\xeb\x25"
16806                           "\x21\x87\xbc\xd3\xe7\x67\x4f\x38"
16807                           "\xa8\x14\x25\x71\xe9\x2e\x4c\x21"
16808                           "\x41\x82\x0c\x45\x39\x35\xa8\x75"
16809                           "\x03\x29\x01\x84\x8c\xab\x48\xbe"
16810                           "\x11\x56\x22\x67\xb7\x67\x1a\x09"
16811                           "\xa1\x72\x25\x41\x3c\x39\x65\x80"
16812                           "\x7d\x2f\xf8\x2c\x73\x04\x58\x9d"
16813                           "\xdd\x16\x8b\x63\x70\x4e\xc5\x17"
16814                           "\x21\xe0\x84\x51\x4b\x6f\x05\x52"
16815                           "\xe3\x63\x34\xfa\xa4\xaf\x33\x20"
16816                           "\xc1\xae\x32\xc4\xb8\x2b\xdb\x76"
16817                           "\xd9\x02\x31\x2f\xa3\xc6\xd0\x7b"
16818                           "\xaf\x1b\x84\xe3\x9b\xbf\xa6\xe0"
16819                           "\xb8\x8a\x13\x88\x71\xf4\x11\xa5"
16820                           "\xe9\xa9\x10\x33\xe0\xbe\x49\x89"
16821                           "\x41\x22\xf5\x9d\x80\x3e\x3b\x76"
16822                           "\x01\x16\x50\x6e\x7c\x6a\x81\xe9"
16823                           "\x13\x2c\xde\xb2\x5f\x79\xba\xb2"
16824                           "\xb1\x75\xae\xd2\x07\x98\x4b\x69"
16825                           "\xae\x7d\x5b\x90\xc2\x6c\xe6\x98"
16826                           "\xd3\x4c\xa1\xa3\x9c\xc9\x33\x6a"
16827                           "\x0d\x23\xb1\x79\x25\x13\x4b\xe5"
16828                           "\xaf\x93\x20\x5c\x7f\x06\x7a\x34"
16829                           "\x0b\x78\xe3\x67\x26\xe0\xad\x95"
16830                           "\xc5\x4e\x26\x22\xcf\x73\x77\x62"
16831                           "\x3e\x10\xd7\x90\x4b\x52\x1c\xc9"
16832                           "\xef\x38\x52\x18\x0e\x29\x7e\xef"
16833                           "\x34\xfe\x31\x95\xc5\xbc\xa8\xe2"
16834                           "\xa8\x4e\x9f\xea\xa6\xf0\xfe\x5d"
16835                           "\xc5\x39\x86\xed\x2f\x6d\xa0\xfe"
16836                           "\x96\xcd\x41\x10\x78\x4e\x0c\xc9"
16837                           "\xc3\x6d\x0f\xb7\xe8\xe0\x62\xab"
16838                           "\x8b\xf1\x21\x89\xa1\x12\xaa\xfa"
16839                           "\x9d\x70\xbe\x4c\xa8\x98\x89\x01"
16840                           "\xb9\xe2\x61\xde\x0c\x4a\x0b\xaa"
16841                           "\x89\xf5\x14\x79\x18\x8f\x3b\x0d"
16842                           "\x21\x17\xf8\x59\x15\x24\x64\x22"
16843                           "\x57\x48\x80\xd5\x3d\x92\x30\x07"
16844                           "\xd9\xa1\x4a\x23\x16\x43\x48\x0e"
16845                           "\x2b\x2d\x1b\x87\xef\x7e\xbd\xfa"
16846                           "\x49\xbc\x7e\x68\x6e\xa8\x46\x95"
16847                           "\xad\x5e\xfe\x0a\xa8\xd3\x1a\x5d"
16848                           "\x6b\x84\xf3\x00\xba\x52\x05\x02"
16849                           "\xe3\x96\x4e\xb6\x79\x3f\x43\xd3"
16850                           "\x4d\x3f\xd6\xab\x0a\xc4\x75\x2d"
16851                           "\xd1\x08\xc3\x6a\xc8\x37\x29\xa0"
16852                           "\xcc\x9a\x05\xdd\x5c\xe1\xff\x66"
16853                           "\xf2\x7a\x1d\xf2\xaf\xa9\x48\x89"
16854                           "\xf5\x21\x0f\x02\x48\x83\x74\xbf"
16855                           "\x2e\xe6\x93\x7b\xa0\xf4\xb1\x2b"
16856                           "\xb1\x02\x0a\x5c\x79\x19\x3b\x75"
16857                           "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e"
16858                           "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95",
16859                 .ilen   = 512,
16860                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
16861                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16862                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16863                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16864                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16865                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16866                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16867                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16868                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16869                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16870                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16871                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16872                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16873                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16874                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16875                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16876                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16877                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16878                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16879                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16880                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16881                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16882                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16883                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16884                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16885                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16886                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16887                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16888                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16889                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16890                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16891                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
16892                           "\x00\x01\x02\x03\x04\x05\x06\x07"
16893                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
16894                           "\x10\x11\x12\x13\x14\x15\x16\x17"
16895                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
16896                           "\x20\x21\x22\x23\x24\x25\x26\x27"
16897                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
16898                           "\x30\x31\x32\x33\x34\x35\x36\x37"
16899                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
16900                           "\x40\x41\x42\x43\x44\x45\x46\x47"
16901                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
16902                           "\x50\x51\x52\x53\x54\x55\x56\x57"
16903                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
16904                           "\x60\x61\x62\x63\x64\x65\x66\x67"
16905                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
16906                           "\x70\x71\x72\x73\x74\x75\x76\x77"
16907                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
16908                           "\x80\x81\x82\x83\x84\x85\x86\x87"
16909                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
16910                           "\x90\x91\x92\x93\x94\x95\x96\x97"
16911                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
16912                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
16913                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
16914                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
16915                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
16916                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
16917                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
16918                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
16919                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
16920                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
16921                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
16922                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
16923                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
16924                 .rlen   = 512,
16925                 .also_non_np = 1,
16926                 .np     = 2,
16927                 .tap    = { 512 - 16, 16 },
16928         },
16929 };
16930
16931 /*
16932  * SEED test vectors
16933  */
16934 #define SEED_ENC_TEST_VECTORS   4
16935 #define SEED_DEC_TEST_VECTORS   4
16936
16937 static struct cipher_testvec seed_enc_tv_template[] = {
16938         {
16939                 .key    = zeroed_string,
16940                 .klen   = 16,
16941                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
16942                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
16943                 .ilen   = 16,
16944                 .result = "\x5e\xba\xc6\xe0\x05\x4e\x16\x68"
16945                           "\x19\xaf\xf1\xcc\x6d\x34\x6c\xdb",
16946                 .rlen   = 16,
16947         }, {
16948                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
16949                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
16950                 .klen   = 16,
16951                 .input  = zeroed_string,
16952                 .ilen   = 16,
16953                 .result = "\xc1\x1f\x22\xf2\x01\x40\x50\x50"
16954                           "\x84\x48\x35\x97\xe4\x37\x0f\x43",
16955                 .rlen   = 16,
16956         }, {
16957                 .key    = "\x47\x06\x48\x08\x51\xe6\x1b\xe8"
16958                           "\x5d\x74\xbf\xb3\xfd\x95\x61\x85",
16959                 .klen   = 16,
16960                 .input  = "\x83\xa2\xf8\xa2\x88\x64\x1f\xb9"
16961                           "\xa4\xe9\xa5\xcc\x2f\x13\x1c\x7d",
16962                 .ilen   = 16,
16963                 .result = "\xee\x54\xd1\x3e\xbc\xae\x70\x6d"
16964                           "\x22\x6b\xc3\x14\x2c\xd4\x0d\x4a",
16965                 .rlen   = 16,
16966         }, {
16967                 .key    = "\x28\xdb\xc3\xbc\x49\xff\xd8\x7d"
16968                           "\xcf\xa5\x09\xb1\x1d\x42\x2b\xe7",
16969                 .klen   = 16,
16970                 .input  = "\xb4\x1e\x6b\xe2\xeb\xa8\x4a\x14"
16971                           "\x8e\x2e\xed\x84\x59\x3c\x5e\xc7",
16972                 .ilen   = 16,
16973                 .result = "\x9b\x9b\x7b\xfc\xd1\x81\x3c\xb9"
16974                           "\x5d\x0b\x36\x18\xf4\x0f\x51\x22",
16975                 .rlen   = 16,
16976         }
16977 };
16978
16979 static struct cipher_testvec seed_dec_tv_template[] = {
16980         {
16981                 .key    = zeroed_string,
16982                 .klen   = 16,
16983                 .input  = "\x5e\xba\xc6\xe0\x05\x4e\x16\x68"
16984                           "\x19\xaf\xf1\xcc\x6d\x34\x6c\xdb",
16985                 .ilen   = 16,
16986                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
16987                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
16988                 .rlen   = 16,
16989         }, {
16990                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
16991                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
16992                 .klen   = 16,
16993                 .input  = "\xc1\x1f\x22\xf2\x01\x40\x50\x50"
16994                           "\x84\x48\x35\x97\xe4\x37\x0f\x43",
16995                 .ilen   = 16,
16996                 .result = zeroed_string,
16997                 .rlen   = 16,
16998         }, {
16999                 .key    = "\x47\x06\x48\x08\x51\xe6\x1b\xe8"
17000                           "\x5d\x74\xbf\xb3\xfd\x95\x61\x85",
17001                 .klen   = 16,
17002                 .input  = "\xee\x54\xd1\x3e\xbc\xae\x70\x6d"
17003                           "\x22\x6b\xc3\x14\x2c\xd4\x0d\x4a",
17004                 .ilen   = 16,
17005                 .result = "\x83\xa2\xf8\xa2\x88\x64\x1f\xb9"
17006                           "\xa4\xe9\xa5\xcc\x2f\x13\x1c\x7d",
17007                 .rlen   = 16,
17008         }, {
17009                 .key    = "\x28\xdb\xc3\xbc\x49\xff\xd8\x7d"
17010                           "\xcf\xa5\x09\xb1\x1d\x42\x2b\xe7",
17011                 .klen   = 16,
17012                 .input  = "\x9b\x9b\x7b\xfc\xd1\x81\x3c\xb9"
17013                           "\x5d\x0b\x36\x18\xf4\x0f\x51\x22",
17014                 .ilen   = 16,
17015                 .result = "\xb4\x1e\x6b\xe2\xeb\xa8\x4a\x14"
17016                           "\x8e\x2e\xed\x84\x59\x3c\x5e\xc7",
17017                 .rlen   = 16,
17018         }
17019 };
17020
17021 #define SALSA20_STREAM_ENC_TEST_VECTORS 5
17022 static struct cipher_testvec salsa20_stream_enc_tv_template[] = {
17023         /*
17024         * Testvectors from verified.test-vectors submitted to ECRYPT.
17025         * They are truncated to size 39, 64, 111, 129 to test a variety
17026         * of input length.
17027         */
17028         { /* Set 3, vector 0 */
17029                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
17030                         "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
17031                 .klen   = 16,
17032                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
17033                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
17034                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17035                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17036                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17037                         "\x00\x00\x00\x00\x00\x00\x00",
17038                 .ilen   = 39,
17039                 .result = "\x2D\xD5\xC3\xF7\xBA\x2B\x20\xF7"
17040                          "\x68\x02\x41\x0C\x68\x86\x88\x89"
17041                          "\x5A\xD8\xC1\xBD\x4E\xA6\xC9\xB1"
17042                          "\x40\xFB\x9B\x90\xE2\x10\x49\xBF"
17043                          "\x58\x3F\x52\x79\x70\xEB\xC1",
17044                 .rlen   = 39,
17045         }, { /* Set 5, vector 0 */
17046                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
17047                         "\x00\x00\x00\x00\x00\x00\x00\x00",
17048                 .klen   = 16,
17049                 .iv     = "\x80\x00\x00\x00\x00\x00\x00\x00",
17050                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
17051                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17052                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17053                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17054                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17055                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17056                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17057                         "\x00\x00\x00\x00\x00\x00\x00\x00",
17058                 .ilen   = 64,
17059                 .result = "\xB6\x6C\x1E\x44\x46\xDD\x95\x57"
17060                          "\xE5\x78\xE2\x23\xB0\xB7\x68\x01"
17061                          "\x7B\x23\xB2\x67\xBB\x02\x34\xAE"
17062                          "\x46\x26\xBF\x44\x3F\x21\x97\x76"
17063                          "\x43\x6F\xB1\x9F\xD0\xE8\x86\x6F"
17064                          "\xCD\x0D\xE9\xA9\x53\x8F\x4A\x09"
17065                          "\xCA\x9A\xC0\x73\x2E\x30\xBC\xF9"
17066                          "\x8E\x4F\x13\xE4\xB9\xE2\x01\xD9",
17067                 .rlen   = 64,
17068         }, { /* Set 3, vector 27 */
17069                 .key    = "\x1B\x1C\x1D\x1E\x1F\x20\x21\x22"
17070                         "\x23\x24\x25\x26\x27\x28\x29\x2A"
17071                         "\x2B\x2C\x2D\x2E\x2F\x30\x31\x32"
17072                         "\x33\x34\x35\x36\x37\x38\x39\x3A",
17073                 .klen   = 32,
17074                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
17075                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
17076                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17077                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17078                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17079                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17080                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17081                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17082                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17083                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17084                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17085                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17086                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17087                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17088                         "\x00\x00\x00\x00\x00\x00\x00",
17089                 .ilen   = 111,
17090                 .result = "\xAE\x39\x50\x8E\xAC\x9A\xEC\xE7"
17091                          "\xBF\x97\xBB\x20\xB9\xDE\xE4\x1F"
17092                          "\x87\xD9\x47\xF8\x28\x91\x35\x98"
17093                          "\xDB\x72\xCC\x23\x29\x48\x56\x5E"
17094                          "\x83\x7E\x0B\xF3\x7D\x5D\x38\x7B"
17095                          "\x2D\x71\x02\xB4\x3B\xB5\xD8\x23"
17096                          "\xB0\x4A\xDF\x3C\xEC\xB6\xD9\x3B"
17097                          "\x9B\xA7\x52\xBE\xC5\xD4\x50\x59"
17098                          "\x15\x14\xB4\x0E\x40\xE6\x53\xD1"
17099                          "\x83\x9C\x5B\xA0\x92\x29\x6B\x5E"
17100                          "\x96\x5B\x1E\x2F\xD3\xAC\xC1\x92"
17101                          "\xB1\x41\x3F\x19\x2F\xC4\x3B\xC6"
17102                          "\x95\x46\x45\x54\xE9\x75\x03\x08"
17103                          "\x44\xAF\xE5\x8A\x81\x12\x09",
17104                 .rlen   = 111,
17105         }, { /* Set 5, vector 27 */
17106                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
17107                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17108                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17109                         "\x00\x00\x00\x00\x00\x00\x00\x00",
17110                 .klen   = 32,
17111                 .iv     = "\x00\x00\x00\x10\x00\x00\x00\x00",
17112                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
17113                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17114                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17115                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17116                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17117                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17118                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17119                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17120                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17121                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17122                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17123                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17124                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17125                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17126                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17127                         "\x00\x00\x00\x00\x00\x00\x00\x00"
17128                         "\x00",
17129                 .ilen   = 129,
17130                 .result = "\xD2\xDB\x1A\x5C\xF1\xC1\xAC\xDB"
17131                          "\xE8\x1A\x7A\x43\x40\xEF\x53\x43"
17132                          "\x5E\x7F\x4B\x1A\x50\x52\x3F\x8D"
17133                          "\x28\x3D\xCF\x85\x1D\x69\x6E\x60"
17134                          "\xF2\xDE\x74\x56\x18\x1B\x84\x10"
17135                          "\xD4\x62\xBA\x60\x50\xF0\x61\xF2"
17136                          "\x1C\x78\x7F\xC1\x24\x34\xAF\x58"
17137                          "\xBF\x2C\x59\xCA\x90\x77\xF3\xB0"
17138                          "\x5B\x4A\xDF\x89\xCE\x2C\x2F\xFC"
17139                          "\x67\xF0\xE3\x45\xE8\xB3\xB3\x75"
17140                          "\xA0\x95\x71\xA1\x29\x39\x94\xCA"
17141                          "\x45\x2F\xBD\xCB\x10\xB6\xBE\x9F"
17142                          "\x8E\xF9\xB2\x01\x0A\x5A\x0A\xB7"
17143                          "\x6B\x9D\x70\x8E\x4B\xD6\x2F\xCD"
17144                          "\x2E\x40\x48\x75\xE9\xE2\x21\x45"
17145                          "\x0B\xC9\xB6\xB5\x66\xBC\x9A\x59"
17146                          "\x5A",
17147                 .rlen   = 129,
17148         }, { /* large test vector generated using Crypto++ */
17149                 .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
17150                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
17151                         "\x10\x11\x12\x13\x14\x15\x16\x17"
17152                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
17153                 .klen = 32,
17154                 .iv =   "\x00\x00\x00\x00\x00\x00\x00\x00"
17155                         "\x00\x00\x00\x00\x00\x00\x00\x00",
17156                 .input =
17157                         "\x00\x01\x02\x03\x04\x05\x06\x07"
17158                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
17159                         "\x10\x11\x12\x13\x14\x15\x16\x17"
17160                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
17161                         "\x20\x21\x22\x23\x24\x25\x26\x27"
17162                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
17163                         "\x30\x31\x32\x33\x34\x35\x36\x37"
17164                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
17165                         "\x40\x41\x42\x43\x44\x45\x46\x47"
17166                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
17167                         "\x50\x51\x52\x53\x54\x55\x56\x57"
17168                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
17169                         "\x60\x61\x62\x63\x64\x65\x66\x67"
17170                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
17171                         "\x70\x71\x72\x73\x74\x75\x76\x77"
17172                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
17173                         "\x80\x81\x82\x83\x84\x85\x86\x87"
17174                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
17175                         "\x90\x91\x92\x93\x94\x95\x96\x97"
17176                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
17177                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
17178                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
17179                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
17180                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
17181                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
17182                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
17183                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
17184                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
17185                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
17186                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
17187                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
17188                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
17189                         "\x00\x03\x06\x09\x0c\x0f\x12\x15"
17190                         "\x18\x1b\x1e\x21\x24\x27\x2a\x2d"
17191                         "\x30\x33\x36\x39\x3c\x3f\x42\x45"
17192                         "\x48\x4b\x4e\x51\x54\x57\x5a\x5d"
17193                         "\x60\x63\x66\x69\x6c\x6f\x72\x75"
17194                         "\x78\x7b\x7e\x81\x84\x87\x8a\x8d"
17195                         "\x90\x93\x96\x99\x9c\x9f\xa2\xa5"
17196                         "\xa8\xab\xae\xb1\xb4\xb7\xba\xbd"
17197                         "\xc0\xc3\xc6\xc9\xcc\xcf\xd2\xd5"
17198                         "\xd8\xdb\xde\xe1\xe4\xe7\xea\xed"
17199                         "\xf0\xf3\xf6\xf9\xfc\xff\x02\x05"
17200                         "\x08\x0b\x0e\x11\x14\x17\x1a\x1d"
17201                         "\x20\x23\x26\x29\x2c\x2f\x32\x35"
17202                         "\x38\x3b\x3e\x41\x44\x47\x4a\x4d"
17203                         "\x50\x53\x56\x59\x5c\x5f\x62\x65"
17204                         "\x68\x6b\x6e\x71\x74\x77\x7a\x7d"
17205                         "\x80\x83\x86\x89\x8c\x8f\x92\x95"
17206                         "\x98\x9b\x9e\xa1\xa4\xa7\xaa\xad"
17207                         "\xb0\xb3\xb6\xb9\xbc\xbf\xc2\xc5"
17208                         "\xc8\xcb\xce\xd1\xd4\xd7\xda\xdd"
17209                         "\xe0\xe3\xe6\xe9\xec\xef\xf2\xf5"
17210                         "\xf8\xfb\xfe\x01\x04\x07\x0a\x0d"
17211                         "\x10\x13\x16\x19\x1c\x1f\x22\x25"
17212                         "\x28\x2b\x2e\x31\x34\x37\x3a\x3d"
17213                         "\x40\x43\x46\x49\x4c\x4f\x52\x55"
17214                         "\x58\x5b\x5e\x61\x64\x67\x6a\x6d"
17215                         "\x70\x73\x76\x79\x7c\x7f\x82\x85"
17216                         "\x88\x8b\x8e\x91\x94\x97\x9a\x9d"
17217                         "\xa0\xa3\xa6\xa9\xac\xaf\xb2\xb5"
17218                         "\xb8\xbb\xbe\xc1\xc4\xc7\xca\xcd"
17219                         "\xd0\xd3\xd6\xd9\xdc\xdf\xe2\xe5"
17220                         "\xe8\xeb\xee\xf1\xf4\xf7\xfa\xfd"
17221                         "\x00\x05\x0a\x0f\x14\x19\x1e\x23"
17222                         "\x28\x2d\x32\x37\x3c\x41\x46\x4b"
17223                         "\x50\x55\x5a\x5f\x64\x69\x6e\x73"
17224                         "\x78\x7d\x82\x87\x8c\x91\x96\x9b"
17225                         "\xa0\xa5\xaa\xaf\xb4\xb9\xbe\xc3"
17226                         "\xc8\xcd\xd2\xd7\xdc\xe1\xe6\xeb"
17227                         "\xf0\xf5\xfa\xff\x04\x09\x0e\x13"
17228                         "\x18\x1d\x22\x27\x2c\x31\x36\x3b"
17229                         "\x40\x45\x4a\x4f\x54\x59\x5e\x63"
17230                         "\x68\x6d\x72\x77\x7c\x81\x86\x8b"
17231                         "\x90\x95\x9a\x9f\xa4\xa9\xae\xb3"
17232                         "\xb8\xbd\xc2\xc7\xcc\xd1\xd6\xdb"
17233                         "\xe0\xe5\xea\xef\xf4\xf9\xfe\x03"
17234                         "\x08\x0d\x12\x17\x1c\x21\x26\x2b"
17235                         "\x30\x35\x3a\x3f\x44\x49\x4e\x53"
17236                         "\x58\x5d\x62\x67\x6c\x71\x76\x7b"
17237                         "\x80\x85\x8a\x8f\x94\x99\x9e\xa3"
17238                         "\xa8\xad\xb2\xb7\xbc\xc1\xc6\xcb"
17239                         "\xd0\xd5\xda\xdf\xe4\xe9\xee\xf3"
17240                         "\xf8\xfd\x02\x07\x0c\x11\x16\x1b"
17241                         "\x20\x25\x2a\x2f\x34\x39\x3e\x43"
17242                         "\x48\x4d\x52\x57\x5c\x61\x66\x6b"
17243                         "\x70\x75\x7a\x7f\x84\x89\x8e\x93"
17244                         "\x98\x9d\xa2\xa7\xac\xb1\xb6\xbb"
17245                         "\xc0\xc5\xca\xcf\xd4\xd9\xde\xe3"
17246                         "\xe8\xed\xf2\xf7\xfc\x01\x06\x0b"
17247                         "\x10\x15\x1a\x1f\x24\x29\x2e\x33"
17248                         "\x38\x3d\x42\x47\x4c\x51\x56\x5b"
17249                         "\x60\x65\x6a\x6f\x74\x79\x7e\x83"
17250                         "\x88\x8d\x92\x97\x9c\xa1\xa6\xab"
17251                         "\xb0\xb5\xba\xbf\xc4\xc9\xce\xd3"
17252                         "\xd8\xdd\xe2\xe7\xec\xf1\xf6\xfb"
17253                         "\x00\x07\x0e\x15\x1c\x23\x2a\x31"
17254                         "\x38\x3f\x46\x4d\x54\x5b\x62\x69"
17255                         "\x70\x77\x7e\x85\x8c\x93\x9a\xa1"
17256                         "\xa8\xaf\xb6\xbd\xc4\xcb\xd2\xd9"
17257                         "\xe0\xe7\xee\xf5\xfc\x03\x0a\x11"
17258                         "\x18\x1f\x26\x2d\x34\x3b\x42\x49"
17259                         "\x50\x57\x5e\x65\x6c\x73\x7a\x81"
17260                         "\x88\x8f\x96\x9d\xa4\xab\xb2\xb9"
17261                         "\xc0\xc7\xce\xd5\xdc\xe3\xea\xf1"
17262                         "\xf8\xff\x06\x0d\x14\x1b\x22\x29"
17263                         "\x30\x37\x3e\x45\x4c\x53\x5a\x61"
17264                         "\x68\x6f\x76\x7d\x84\x8b\x92\x99"
17265                         "\xa0\xa7\xae\xb5\xbc\xc3\xca\xd1"
17266                         "\xd8\xdf\xe6\xed\xf4\xfb\x02\x09"
17267                         "\x10\x17\x1e\x25\x2c\x33\x3a\x41"
17268                         "\x48\x4f\x56\x5d\x64\x6b\x72\x79"
17269                         "\x80\x87\x8e\x95\x9c\xa3\xaa\xb1"
17270                         "\xb8\xbf\xc6\xcd\xd4\xdb\xe2\xe9"
17271                         "\xf0\xf7\xfe\x05\x0c\x13\x1a\x21"
17272                         "\x28\x2f\x36\x3d\x44\x4b\x52\x59"
17273                         "\x60\x67\x6e\x75\x7c\x83\x8a\x91"
17274                         "\x98\x9f\xa6\xad\xb4\xbb\xc2\xc9"
17275                         "\xd0\xd7\xde\xe5\xec\xf3\xfa\x01"
17276                         "\x08\x0f\x16\x1d\x24\x2b\x32\x39"
17277                         "\x40\x47\x4e\x55\x5c\x63\x6a\x71"
17278                         "\x78\x7f\x86\x8d\x94\x9b\xa2\xa9"
17279                         "\xb0\xb7\xbe\xc5\xcc\xd3\xda\xe1"
17280                         "\xe8\xef\xf6\xfd\x04\x0b\x12\x19"
17281                         "\x20\x27\x2e\x35\x3c\x43\x4a\x51"
17282                         "\x58\x5f\x66\x6d\x74\x7b\x82\x89"
17283                         "\x90\x97\x9e\xa5\xac\xb3\xba\xc1"
17284                         "\xc8\xcf\xd6\xdd\xe4\xeb\xf2\xf9"
17285                         "\x00\x09\x12\x1b\x24\x2d\x36\x3f"
17286                         "\x48\x51\x5a\x63\x6c\x75\x7e\x87"
17287                         "\x90\x99\xa2\xab\xb4\xbd\xc6\xcf"
17288                         "\xd8\xe1\xea\xf3\xfc\x05\x0e\x17"
17289                         "\x20\x29\x32\x3b\x44\x4d\x56\x5f"
17290                         "\x68\x71\x7a\x83\x8c\x95\x9e\xa7"
17291                         "\xb0\xb9\xc2\xcb\xd4\xdd\xe6\xef"
17292                         "\xf8\x01\x0a\x13\x1c\x25\x2e\x37"
17293                         "\x40\x49\x52\x5b\x64\x6d\x76\x7f"
17294                         "\x88\x91\x9a\xa3\xac\xb5\xbe\xc7"
17295                         "\xd0\xd9\xe2\xeb\xf4\xfd\x06\x0f"
17296                         "\x18\x21\x2a\x33\x3c\x45\x4e\x57"
17297                         "\x60\x69\x72\x7b\x84\x8d\x96\x9f"
17298                         "\xa8\xb1\xba\xc3\xcc\xd5\xde\xe7"
17299                         "\xf0\xf9\x02\x0b\x14\x1d\x26\x2f"
17300                         "\x38\x41\x4a\x53\x5c\x65\x6e\x77"
17301                         "\x80\x89\x92\x9b\xa4\xad\xb6\xbf"
17302                         "\xc8\xd1\xda\xe3\xec\xf5\xfe\x07"
17303                         "\x10\x19\x22\x2b\x34\x3d\x46\x4f"
17304                         "\x58\x61\x6a\x73\x7c\x85\x8e\x97"
17305                         "\xa0\xa9\xb2\xbb\xc4\xcd\xd6\xdf"
17306                         "\xe8\xf1\xfa\x03\x0c\x15\x1e\x27"
17307                         "\x30\x39\x42\x4b\x54\x5d\x66\x6f"
17308                         "\x78\x81\x8a\x93\x9c\xa5\xae\xb7"
17309                         "\xc0\xc9\xd2\xdb\xe4\xed\xf6\xff"
17310                         "\x08\x11\x1a\x23\x2c\x35\x3e\x47"
17311                         "\x50\x59\x62\x6b\x74\x7d\x86\x8f"
17312                         "\x98\xa1\xaa\xb3\xbc\xc5\xce\xd7"
17313                         "\xe0\xe9\xf2\xfb\x04\x0d\x16\x1f"
17314                         "\x28\x31\x3a\x43\x4c\x55\x5e\x67"
17315                         "\x70\x79\x82\x8b\x94\x9d\xa6\xaf"
17316                         "\xb8\xc1\xca\xd3\xdc\xe5\xee\xf7"
17317                         "\x00\x0b\x16\x21\x2c\x37\x42\x4d"
17318                         "\x58\x63\x6e\x79\x84\x8f\x9a\xa5"
17319                         "\xb0\xbb\xc6\xd1\xdc\xe7\xf2\xfd"
17320                         "\x08\x13\x1e\x29\x34\x3f\x4a\x55"
17321                         "\x60\x6b\x76\x81\x8c\x97\xa2\xad"
17322                         "\xb8\xc3\xce\xd9\xe4\xef\xfa\x05"
17323                         "\x10\x1b\x26\x31\x3c\x47\x52\x5d"
17324                         "\x68\x73\x7e\x89\x94\x9f\xaa\xb5"
17325                         "\xc0\xcb\xd6\xe1\xec\xf7\x02\x0d"
17326                         "\x18\x23\x2e\x39\x44\x4f\x5a\x65"
17327                         "\x70\x7b\x86\x91\x9c\xa7\xb2\xbd"
17328                         "\xc8\xd3\xde\xe9\xf4\xff\x0a\x15"
17329                         "\x20\x2b\x36\x41\x4c\x57\x62\x6d"
17330                         "\x78\x83\x8e\x99\xa4\xaf\xba\xc5"
17331                         "\xd0\xdb\xe6\xf1\xfc\x07\x12\x1d"
17332                         "\x28\x33\x3e\x49\x54\x5f\x6a\x75"
17333                         "\x80\x8b\x96\xa1\xac\xb7\xc2\xcd"
17334                         "\xd8\xe3\xee\xf9\x04\x0f\x1a\x25"
17335                         "\x30\x3b\x46\x51\x5c\x67\x72\x7d"
17336                         "\x88\x93\x9e\xa9\xb4\xbf\xca\xd5"
17337                         "\xe0\xeb\xf6\x01\x0c\x17\x22\x2d"
17338                         "\x38\x43\x4e\x59\x64\x6f\x7a\x85"
17339                         "\x90\x9b\xa6\xb1\xbc\xc7\xd2\xdd"
17340                         "\xe8\xf3\xfe\x09\x14\x1f\x2a\x35"
17341                         "\x40\x4b\x56\x61\x6c\x77\x82\x8d"
17342                         "\x98\xa3\xae\xb9\xc4\xcf\xda\xe5"
17343                         "\xf0\xfb\x06\x11\x1c\x27\x32\x3d"
17344                         "\x48\x53\x5e\x69\x74\x7f\x8a\x95"
17345                         "\xa0\xab\xb6\xc1\xcc\xd7\xe2\xed"
17346                         "\xf8\x03\x0e\x19\x24\x2f\x3a\x45"
17347                         "\x50\x5b\x66\x71\x7c\x87\x92\x9d"
17348                         "\xa8\xb3\xbe\xc9\xd4\xdf\xea\xf5"
17349                         "\x00\x0d\x1a\x27\x34\x41\x4e\x5b"
17350                         "\x68\x75\x82\x8f\x9c\xa9\xb6\xc3"
17351                         "\xd0\xdd\xea\xf7\x04\x11\x1e\x2b"
17352                         "\x38\x45\x52\x5f\x6c\x79\x86\x93"
17353                         "\xa0\xad\xba\xc7\xd4\xe1\xee\xfb"
17354                         "\x08\x15\x22\x2f\x3c\x49\x56\x63"
17355                         "\x70\x7d\x8a\x97\xa4\xb1\xbe\xcb"
17356                         "\xd8\xe5\xf2\xff\x0c\x19\x26\x33"
17357                         "\x40\x4d\x5a\x67\x74\x81\x8e\x9b"
17358                         "\xa8\xb5\xc2\xcf\xdc\xe9\xf6\x03"
17359                         "\x10\x1d\x2a\x37\x44\x51\x5e\x6b"
17360                         "\x78\x85\x92\x9f\xac\xb9\xc6\xd3"
17361                         "\xe0\xed\xfa\x07\x14\x21\x2e\x3b"
17362                         "\x48\x55\x62\x6f\x7c\x89\x96\xa3"
17363                         "\xb0\xbd\xca\xd7\xe4\xf1\xfe\x0b"
17364                         "\x18\x25\x32\x3f\x4c\x59\x66\x73"
17365                         "\x80\x8d\x9a\xa7\xb4\xc1\xce\xdb"
17366                         "\xe8\xf5\x02\x0f\x1c\x29\x36\x43"
17367                         "\x50\x5d\x6a\x77\x84\x91\x9e\xab"
17368                         "\xb8\xc5\xd2\xdf\xec\xf9\x06\x13"
17369                         "\x20\x2d\x3a\x47\x54\x61\x6e\x7b"
17370                         "\x88\x95\xa2\xaf\xbc\xc9\xd6\xe3"
17371                         "\xf0\xfd\x0a\x17\x24\x31\x3e\x4b"
17372                         "\x58\x65\x72\x7f\x8c\x99\xa6\xb3"
17373                         "\xc0\xcd\xda\xe7\xf4\x01\x0e\x1b"
17374                         "\x28\x35\x42\x4f\x5c\x69\x76\x83"
17375                         "\x90\x9d\xaa\xb7\xc4\xd1\xde\xeb"
17376                         "\xf8\x05\x12\x1f\x2c\x39\x46\x53"
17377                         "\x60\x6d\x7a\x87\x94\xa1\xae\xbb"
17378                         "\xc8\xd5\xe2\xef\xfc\x09\x16\x23"
17379                         "\x30\x3d\x4a\x57\x64\x71\x7e\x8b"
17380                         "\x98\xa5\xb2\xbf\xcc\xd9\xe6\xf3"
17381                         "\x00\x0f\x1e\x2d\x3c\x4b\x5a\x69"
17382                         "\x78\x87\x96\xa5\xb4\xc3\xd2\xe1"
17383                         "\xf0\xff\x0e\x1d\x2c\x3b\x4a\x59"
17384                         "\x68\x77\x86\x95\xa4\xb3\xc2\xd1"
17385                         "\xe0\xef\xfe\x0d\x1c\x2b\x3a\x49"
17386                         "\x58\x67\x76\x85\x94\xa3\xb2\xc1"
17387                         "\xd0\xdf\xee\xfd\x0c\x1b\x2a\x39"
17388                         "\x48\x57\x66\x75\x84\x93\xa2\xb1"
17389                         "\xc0\xcf\xde\xed\xfc\x0b\x1a\x29"
17390                         "\x38\x47\x56\x65\x74\x83\x92\xa1"
17391                         "\xb0\xbf\xce\xdd\xec\xfb\x0a\x19"
17392                         "\x28\x37\x46\x55\x64\x73\x82\x91"
17393                         "\xa0\xaf\xbe\xcd\xdc\xeb\xfa\x09"
17394                         "\x18\x27\x36\x45\x54\x63\x72\x81"
17395                         "\x90\x9f\xae\xbd\xcc\xdb\xea\xf9"
17396                         "\x08\x17\x26\x35\x44\x53\x62\x71"
17397                         "\x80\x8f\x9e\xad\xbc\xcb\xda\xe9"
17398                         "\xf8\x07\x16\x25\x34\x43\x52\x61"
17399                         "\x70\x7f\x8e\x9d\xac\xbb\xca\xd9"
17400                         "\xe8\xf7\x06\x15\x24\x33\x42\x51"
17401                         "\x60\x6f\x7e\x8d\x9c\xab\xba\xc9"
17402                         "\xd8\xe7\xf6\x05\x14\x23\x32\x41"
17403                         "\x50\x5f\x6e\x7d\x8c\x9b\xaa\xb9"
17404                         "\xc8\xd7\xe6\xf5\x04\x13\x22\x31"
17405                         "\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9"
17406                         "\xb8\xc7\xd6\xe5\xf4\x03\x12\x21"
17407                         "\x30\x3f\x4e\x5d\x6c\x7b\x8a\x99"
17408                         "\xa8\xb7\xc6\xd5\xe4\xf3\x02\x11"
17409                         "\x20\x2f\x3e\x4d\x5c\x6b\x7a\x89"
17410                         "\x98\xa7\xb6\xc5\xd4\xe3\xf2\x01"
17411                         "\x10\x1f\x2e\x3d\x4c\x5b\x6a\x79"
17412                         "\x88\x97\xa6\xb5\xc4\xd3\xe2\xf1"
17413                         "\x00\x11\x22\x33\x44\x55\x66\x77"
17414                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff"
17415                         "\x10\x21\x32\x43\x54\x65\x76\x87"
17416                         "\x98\xa9\xba\xcb\xdc\xed\xfe\x0f"
17417                         "\x20\x31\x42\x53\x64\x75\x86\x97"
17418                         "\xa8\xb9\xca\xdb\xec\xfd\x0e\x1f"
17419                         "\x30\x41\x52\x63\x74\x85\x96\xa7"
17420                         "\xb8\xc9\xda\xeb\xfc\x0d\x1e\x2f"
17421                         "\x40\x51\x62\x73\x84\x95\xa6\xb7"
17422                         "\xc8\xd9\xea\xfb\x0c\x1d\x2e\x3f"
17423                         "\x50\x61\x72\x83\x94\xa5\xb6\xc7"
17424                         "\xd8\xe9\xfa\x0b\x1c\x2d\x3e\x4f"
17425                         "\x60\x71\x82\x93\xa4\xb5\xc6\xd7"
17426                         "\xe8\xf9\x0a\x1b\x2c\x3d\x4e\x5f"
17427                         "\x70\x81\x92\xa3\xb4\xc5\xd6\xe7"
17428                         "\xf8\x09\x1a\x2b\x3c\x4d\x5e\x6f"
17429                         "\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7"
17430                         "\x08\x19\x2a\x3b\x4c\x5d\x6e\x7f"
17431                         "\x90\xa1\xb2\xc3\xd4\xe5\xf6\x07"
17432                         "\x18\x29\x3a\x4b\x5c\x6d\x7e\x8f"
17433                         "\xa0\xb1\xc2\xd3\xe4\xf5\x06\x17"
17434                         "\x28\x39\x4a\x5b\x6c\x7d\x8e\x9f"
17435                         "\xb0\xc1\xd2\xe3\xf4\x05\x16\x27"
17436                         "\x38\x49\x5a\x6b\x7c\x8d\x9e\xaf"
17437                         "\xc0\xd1\xe2\xf3\x04\x15\x26\x37"
17438                         "\x48\x59\x6a\x7b\x8c\x9d\xae\xbf"
17439                         "\xd0\xe1\xf2\x03\x14\x25\x36\x47"
17440                         "\x58\x69\x7a\x8b\x9c\xad\xbe\xcf"
17441                         "\xe0\xf1\x02\x13\x24\x35\x46\x57"
17442                         "\x68\x79\x8a\x9b\xac\xbd\xce\xdf"
17443                         "\xf0\x01\x12\x23\x34\x45\x56\x67"
17444                         "\x78\x89\x9a\xab\xbc\xcd\xde\xef"
17445                         "\x00\x13\x26\x39\x4c\x5f\x72\x85"
17446                         "\x98\xab\xbe\xd1\xe4\xf7\x0a\x1d"
17447                         "\x30\x43\x56\x69\x7c\x8f\xa2\xb5"
17448                         "\xc8\xdb\xee\x01\x14\x27\x3a\x4d"
17449                         "\x60\x73\x86\x99\xac\xbf\xd2\xe5"
17450                         "\xf8\x0b\x1e\x31\x44\x57\x6a\x7d"
17451                         "\x90\xa3\xb6\xc9\xdc\xef\x02\x15"
17452                         "\x28\x3b\x4e\x61\x74\x87\x9a\xad"
17453                         "\xc0\xd3\xe6\xf9\x0c\x1f\x32\x45"
17454                         "\x58\x6b\x7e\x91\xa4\xb7\xca\xdd"
17455                         "\xf0\x03\x16\x29\x3c\x4f\x62\x75"
17456                         "\x88\x9b\xae\xc1\xd4\xe7\xfa\x0d"
17457                         "\x20\x33\x46\x59\x6c\x7f\x92\xa5"
17458                         "\xb8\xcb\xde\xf1\x04\x17\x2a\x3d"
17459                         "\x50\x63\x76\x89\x9c\xaf\xc2\xd5"
17460                         "\xe8\xfb\x0e\x21\x34\x47\x5a\x6d"
17461                         "\x80\x93\xa6\xb9\xcc\xdf\xf2\x05"
17462                         "\x18\x2b\x3e\x51\x64\x77\x8a\x9d"
17463                         "\xb0\xc3\xd6\xe9\xfc\x0f\x22\x35"
17464                         "\x48\x5b\x6e\x81\x94\xa7\xba\xcd"
17465                         "\xe0\xf3\x06\x19\x2c\x3f\x52\x65"
17466                         "\x78\x8b\x9e\xb1\xc4\xd7\xea\xfd"
17467                         "\x10\x23\x36\x49\x5c\x6f\x82\x95"
17468                         "\xa8\xbb\xce\xe1\xf4\x07\x1a\x2d"
17469                         "\x40\x53\x66\x79\x8c\x9f\xb2\xc5"
17470                         "\xd8\xeb\xfe\x11\x24\x37\x4a\x5d"
17471                         "\x70\x83\x96\xa9\xbc\xcf\xe2\xf5"
17472                         "\x08\x1b\x2e\x41\x54\x67\x7a\x8d"
17473                         "\xa0\xb3\xc6\xd9\xec\xff\x12\x25"
17474                         "\x38\x4b\x5e\x71\x84\x97\xaa\xbd"
17475                         "\xd0\xe3\xf6\x09\x1c\x2f\x42\x55"
17476                         "\x68\x7b\x8e\xa1\xb4\xc7\xda\xed"
17477                         "\x00\x15\x2a\x3f\x54\x69\x7e\x93"
17478                         "\xa8\xbd\xd2\xe7\xfc\x11\x26\x3b"
17479                         "\x50\x65\x7a\x8f\xa4\xb9\xce\xe3"
17480                         "\xf8\x0d\x22\x37\x4c\x61\x76\x8b"
17481                         "\xa0\xb5\xca\xdf\xf4\x09\x1e\x33"
17482                         "\x48\x5d\x72\x87\x9c\xb1\xc6\xdb"
17483                         "\xf0\x05\x1a\x2f\x44\x59\x6e\x83"
17484                         "\x98\xad\xc2\xd7\xec\x01\x16\x2b"
17485                         "\x40\x55\x6a\x7f\x94\xa9\xbe\xd3"
17486                         "\xe8\xfd\x12\x27\x3c\x51\x66\x7b"
17487                         "\x90\xa5\xba\xcf\xe4\xf9\x0e\x23"
17488                         "\x38\x4d\x62\x77\x8c\xa1\xb6\xcb"
17489                         "\xe0\xf5\x0a\x1f\x34\x49\x5e\x73"
17490                         "\x88\x9d\xb2\xc7\xdc\xf1\x06\x1b"
17491                         "\x30\x45\x5a\x6f\x84\x99\xae\xc3"
17492                         "\xd8\xed\x02\x17\x2c\x41\x56\x6b"
17493                         "\x80\x95\xaa\xbf\xd4\xe9\xfe\x13"
17494                         "\x28\x3d\x52\x67\x7c\x91\xa6\xbb"
17495                         "\xd0\xe5\xfa\x0f\x24\x39\x4e\x63"
17496                         "\x78\x8d\xa2\xb7\xcc\xe1\xf6\x0b"
17497                         "\x20\x35\x4a\x5f\x74\x89\x9e\xb3"
17498                         "\xc8\xdd\xf2\x07\x1c\x31\x46\x5b"
17499                         "\x70\x85\x9a\xaf\xc4\xd9\xee\x03"
17500                         "\x18\x2d\x42\x57\x6c\x81\x96\xab"
17501                         "\xc0\xd5\xea\xff\x14\x29\x3e\x53"
17502                         "\x68\x7d\x92\xa7\xbc\xd1\xe6\xfb"
17503                         "\x10\x25\x3a\x4f\x64\x79\x8e\xa3"
17504                         "\xb8\xcd\xe2\xf7\x0c\x21\x36\x4b"
17505                         "\x60\x75\x8a\x9f\xb4\xc9\xde\xf3"
17506                         "\x08\x1d\x32\x47\x5c\x71\x86\x9b"
17507                         "\xb0\xc5\xda\xef\x04\x19\x2e\x43"
17508                         "\x58\x6d\x82\x97\xac\xc1\xd6\xeb"
17509                         "\x00\x17\x2e\x45\x5c\x73\x8a\xa1"
17510                         "\xb8\xcf\xe6\xfd\x14\x2b\x42\x59"
17511                         "\x70\x87\x9e\xb5\xcc\xe3\xfa\x11"
17512                         "\x28\x3f\x56\x6d\x84\x9b\xb2\xc9"
17513                         "\xe0\xf7\x0e\x25\x3c\x53\x6a\x81"
17514                         "\x98\xaf\xc6\xdd\xf4\x0b\x22\x39"
17515                         "\x50\x67\x7e\x95\xac\xc3\xda\xf1"
17516                         "\x08\x1f\x36\x4d\x64\x7b\x92\xa9"
17517                         "\xc0\xd7\xee\x05\x1c\x33\x4a\x61"
17518                         "\x78\x8f\xa6\xbd\xd4\xeb\x02\x19"
17519                         "\x30\x47\x5e\x75\x8c\xa3\xba\xd1"
17520                         "\xe8\xff\x16\x2d\x44\x5b\x72\x89"
17521                         "\xa0\xb7\xce\xe5\xfc\x13\x2a\x41"
17522                         "\x58\x6f\x86\x9d\xb4\xcb\xe2\xf9"
17523                         "\x10\x27\x3e\x55\x6c\x83\x9a\xb1"
17524                         "\xc8\xdf\xf6\x0d\x24\x3b\x52\x69"
17525                         "\x80\x97\xae\xc5\xdc\xf3\x0a\x21"
17526                         "\x38\x4f\x66\x7d\x94\xab\xc2\xd9"
17527                         "\xf0\x07\x1e\x35\x4c\x63\x7a\x91"
17528                         "\xa8\xbf\xd6\xed\x04\x1b\x32\x49"
17529                         "\x60\x77\x8e\xa5\xbc\xd3\xea\x01"
17530                         "\x18\x2f\x46\x5d\x74\x8b\xa2\xb9"
17531                         "\xd0\xe7\xfe\x15\x2c\x43\x5a\x71"
17532                         "\x88\x9f\xb6\xcd\xe4\xfb\x12\x29"
17533                         "\x40\x57\x6e\x85\x9c\xb3\xca\xe1"
17534                         "\xf8\x0f\x26\x3d\x54\x6b\x82\x99"
17535                         "\xb0\xc7\xde\xf5\x0c\x23\x3a\x51"
17536                         "\x68\x7f\x96\xad\xc4\xdb\xf2\x09"
17537                         "\x20\x37\x4e\x65\x7c\x93\xaa\xc1"
17538                         "\xd8\xef\x06\x1d\x34\x4b\x62\x79"
17539                         "\x90\xa7\xbe\xd5\xec\x03\x1a\x31"
17540                         "\x48\x5f\x76\x8d\xa4\xbb\xd2\xe9"
17541                         "\x00\x19\x32\x4b\x64\x7d\x96\xaf"
17542                         "\xc8\xe1\xfa\x13\x2c\x45\x5e\x77"
17543                         "\x90\xa9\xc2\xdb\xf4\x0d\x26\x3f"
17544                         "\x58\x71\x8a\xa3\xbc\xd5\xee\x07"
17545                         "\x20\x39\x52\x6b\x84\x9d\xb6\xcf"
17546                         "\xe8\x01\x1a\x33\x4c\x65\x7e\x97"
17547                         "\xb0\xc9\xe2\xfb\x14\x2d\x46\x5f"
17548                         "\x78\x91\xaa\xc3\xdc\xf5\x0e\x27"
17549                         "\x40\x59\x72\x8b\xa4\xbd\xd6\xef"
17550                         "\x08\x21\x3a\x53\x6c\x85\x9e\xb7"
17551                         "\xd0\xe9\x02\x1b\x34\x4d\x66\x7f"
17552                         "\x98\xb1\xca\xe3\xfc\x15\x2e\x47"
17553                         "\x60\x79\x92\xab\xc4\xdd\xf6\x0f"
17554                         "\x28\x41\x5a\x73\x8c\xa5\xbe\xd7"
17555                         "\xf0\x09\x22\x3b\x54\x6d\x86\x9f"
17556                         "\xb8\xd1\xea\x03\x1c\x35\x4e\x67"
17557                         "\x80\x99\xb2\xcb\xe4\xfd\x16\x2f"
17558                         "\x48\x61\x7a\x93\xac\xc5\xde\xf7"
17559                         "\x10\x29\x42\x5b\x74\x8d\xa6\xbf"
17560                         "\xd8\xf1\x0a\x23\x3c\x55\x6e\x87"
17561                         "\xa0\xb9\xd2\xeb\x04\x1d\x36\x4f"
17562                         "\x68\x81\x9a\xb3\xcc\xe5\xfe\x17"
17563                         "\x30\x49\x62\x7b\x94\xad\xc6\xdf"
17564                         "\xf8\x11\x2a\x43\x5c\x75\x8e\xa7"
17565                         "\xc0\xd9\xf2\x0b\x24\x3d\x56\x6f"
17566                         "\x88\xa1\xba\xd3\xec\x05\x1e\x37"
17567                         "\x50\x69\x82\x9b\xb4\xcd\xe6\xff"
17568                         "\x18\x31\x4a\x63\x7c\x95\xae\xc7"
17569                         "\xe0\xf9\x12\x2b\x44\x5d\x76\x8f"
17570                         "\xa8\xc1\xda\xf3\x0c\x25\x3e\x57"
17571                         "\x70\x89\xa2\xbb\xd4\xed\x06\x1f"
17572                         "\x38\x51\x6a\x83\x9c\xb5\xce\xe7"
17573                         "\x00\x1b\x36\x51\x6c\x87\xa2\xbd"
17574                         "\xd8\xf3\x0e\x29\x44\x5f\x7a\x95"
17575                         "\xb0\xcb\xe6\x01\x1c\x37\x52\x6d"
17576                         "\x88\xa3\xbe\xd9\xf4\x0f\x2a\x45"
17577                         "\x60\x7b\x96\xb1\xcc\xe7\x02\x1d"
17578                         "\x38\x53\x6e\x89\xa4\xbf\xda\xf5"
17579                         "\x10\x2b\x46\x61\x7c\x97\xb2\xcd"
17580                         "\xe8\x03\x1e\x39\x54\x6f\x8a\xa5"
17581                         "\xc0\xdb\xf6\x11\x2c\x47\x62\x7d"
17582                         "\x98\xb3\xce\xe9\x04\x1f\x3a\x55"
17583                         "\x70\x8b\xa6\xc1\xdc\xf7\x12\x2d"
17584                         "\x48\x63\x7e\x99\xb4\xcf\xea\x05"
17585                         "\x20\x3b\x56\x71\x8c\xa7\xc2\xdd"
17586                         "\xf8\x13\x2e\x49\x64\x7f\x9a\xb5"
17587                         "\xd0\xeb\x06\x21\x3c\x57\x72\x8d"
17588                         "\xa8\xc3\xde\xf9\x14\x2f\x4a\x65"
17589                         "\x80\x9b\xb6\xd1\xec\x07\x22\x3d"
17590                         "\x58\x73\x8e\xa9\xc4\xdf\xfa\x15"
17591                         "\x30\x4b\x66\x81\x9c\xb7\xd2\xed"
17592                         "\x08\x23\x3e\x59\x74\x8f\xaa\xc5"
17593                         "\xe0\xfb\x16\x31\x4c\x67\x82\x9d"
17594                         "\xb8\xd3\xee\x09\x24\x3f\x5a\x75"
17595                         "\x90\xab\xc6\xe1\xfc\x17\x32\x4d"
17596                         "\x68\x83\x9e\xb9\xd4\xef\x0a\x25"
17597                         "\x40\x5b\x76\x91\xac\xc7\xe2\xfd"
17598                         "\x18\x33\x4e\x69\x84\x9f\xba\xd5"
17599                         "\xf0\x0b\x26\x41\x5c\x77\x92\xad"
17600                         "\xc8\xe3\xfe\x19\x34\x4f\x6a\x85"
17601                         "\xa0\xbb\xd6\xf1\x0c\x27\x42\x5d"
17602                         "\x78\x93\xae\xc9\xe4\xff\x1a\x35"
17603                         "\x50\x6b\x86\xa1\xbc\xd7\xf2\x0d"
17604                         "\x28\x43\x5e\x79\x94\xaf\xca\xe5"
17605                         "\x00\x1d\x3a\x57\x74\x91\xae\xcb"
17606                         "\xe8\x05\x22\x3f\x5c\x79\x96\xb3"
17607                         "\xd0\xed\x0a\x27\x44\x61\x7e\x9b"
17608                         "\xb8\xd5\xf2\x0f\x2c\x49\x66\x83"
17609                         "\xa0\xbd\xda\xf7\x14\x31\x4e\x6b"
17610                         "\x88\xa5\xc2\xdf\xfc\x19\x36\x53"
17611                         "\x70\x8d\xaa\xc7\xe4\x01\x1e\x3b"
17612                         "\x58\x75\x92\xaf\xcc\xe9\x06\x23"
17613                         "\x40\x5d\x7a\x97\xb4\xd1\xee\x0b"
17614                         "\x28\x45\x62\x7f\x9c\xb9\xd6\xf3"
17615                         "\x10\x2d\x4a\x67\x84\xa1\xbe\xdb"
17616                         "\xf8\x15\x32\x4f\x6c\x89\xa6\xc3"
17617                         "\xe0\xfd\x1a\x37\x54\x71\x8e\xab"
17618                         "\xc8\xe5\x02\x1f\x3c\x59\x76\x93"
17619                         "\xb0\xcd\xea\x07\x24\x41\x5e\x7b"
17620                         "\x98\xb5\xd2\xef\x0c\x29\x46\x63"
17621                         "\x80\x9d\xba\xd7\xf4\x11\x2e\x4b"
17622                         "\x68\x85\xa2\xbf\xdc\xf9\x16\x33"
17623                         "\x50\x6d\x8a\xa7\xc4\xe1\xfe\x1b"
17624                         "\x38\x55\x72\x8f\xac\xc9\xe6\x03"
17625                         "\x20\x3d\x5a\x77\x94\xb1\xce\xeb"
17626                         "\x08\x25\x42\x5f\x7c\x99\xb6\xd3"
17627                         "\xf0\x0d\x2a\x47\x64\x81\x9e\xbb"
17628                         "\xd8\xf5\x12\x2f\x4c\x69\x86\xa3"
17629                         "\xc0\xdd\xfa\x17\x34\x51\x6e\x8b"
17630                         "\xa8\xc5\xe2\xff\x1c\x39\x56\x73"
17631                         "\x90\xad\xca\xe7\x04\x21\x3e\x5b"
17632                         "\x78\x95\xb2\xcf\xec\x09\x26\x43"
17633                         "\x60\x7d\x9a\xb7\xd4\xf1\x0e\x2b"
17634                         "\x48\x65\x82\x9f\xbc\xd9\xf6\x13"
17635                         "\x30\x4d\x6a\x87\xa4\xc1\xde\xfb"
17636                         "\x18\x35\x52\x6f\x8c\xa9\xc6\xe3"
17637                         "\x00\x1f\x3e\x5d\x7c\x9b\xba\xd9"
17638                         "\xf8\x17\x36\x55\x74\x93\xb2\xd1"
17639                         "\xf0\x0f\x2e\x4d\x6c\x8b\xaa\xc9"
17640                         "\xe8\x07\x26\x45\x64\x83\xa2\xc1"
17641                         "\xe0\xff\x1e\x3d\x5c\x7b\x9a\xb9"
17642                         "\xd8\xf7\x16\x35\x54\x73\x92\xb1"
17643                         "\xd0\xef\x0e\x2d\x4c\x6b\x8a\xa9"
17644                         "\xc8\xe7\x06\x25\x44\x63\x82\xa1"
17645                         "\xc0\xdf\xfe\x1d\x3c\x5b\x7a\x99"
17646                         "\xb8\xd7\xf6\x15\x34\x53\x72\x91"
17647                         "\xb0\xcf\xee\x0d\x2c\x4b\x6a\x89"
17648                         "\xa8\xc7\xe6\x05\x24\x43\x62\x81"
17649                         "\xa0\xbf\xde\xfd\x1c\x3b\x5a\x79"
17650                         "\x98\xb7\xd6\xf5\x14\x33\x52\x71"
17651                         "\x90\xaf\xce\xed\x0c\x2b\x4a\x69"
17652                         "\x88\xa7\xc6\xe5\x04\x23\x42\x61"
17653                         "\x80\x9f\xbe\xdd\xfc\x1b\x3a\x59"
17654                         "\x78\x97\xb6\xd5\xf4\x13\x32\x51"
17655                         "\x70\x8f\xae\xcd\xec\x0b\x2a\x49"
17656                         "\x68\x87\xa6\xc5\xe4\x03\x22\x41"
17657                         "\x60\x7f\x9e\xbd\xdc\xfb\x1a\x39"
17658                         "\x58\x77\x96\xb5\xd4\xf3\x12\x31"
17659                         "\x50\x6f\x8e\xad\xcc\xeb\x0a\x29"
17660                         "\x48\x67\x86\xa5\xc4\xe3\x02\x21"
17661                         "\x40\x5f\x7e\x9d\xbc\xdb\xfa\x19"
17662                         "\x38\x57\x76\x95\xb4\xd3\xf2\x11"
17663                         "\x30\x4f\x6e\x8d\xac\xcb\xea\x09"
17664                         "\x28\x47\x66\x85\xa4\xc3\xe2\x01"
17665                         "\x20\x3f\x5e\x7d\x9c\xbb\xda\xf9"
17666                         "\x18\x37\x56\x75\x94\xb3\xd2\xf1"
17667                         "\x10\x2f\x4e\x6d\x8c\xab\xca\xe9"
17668                         "\x08\x27\x46\x65\x84\xa3\xc2\xe1"
17669                         "\x00\x21\x42\x63",
17670                 .ilen = 4100,
17671                 .result =
17672                         "\xb5\x81\xf5\x64\x18\x73\xe3\xf0"
17673                         "\x4c\x13\xf2\x77\x18\x60\x65\x5e"
17674                         "\x29\x01\xce\x98\x55\x53\xf9\x0c"
17675                         "\x2a\x08\xd5\x09\xb3\x57\x55\x56"
17676                         "\xc5\xe9\x56\x90\xcb\x6a\xa3\xc0"
17677                         "\xff\xc4\x79\xb4\xd2\x97\x5d\xc4"
17678                         "\x43\xd1\xfe\x94\x7b\x88\x06\x5a"
17679                         "\xb2\x9e\x2c\xfc\x44\x03\xb7\x90"
17680                         "\xa0\xc1\xba\x6a\x33\xb8\xc7\xb2"
17681                         "\x9d\xe1\x12\x4f\xc0\x64\xd4\x01"
17682                         "\xfe\x8c\x7a\x66\xf7\xe6\x5a\x91"
17683                         "\xbb\xde\x56\x86\xab\x65\x21\x30"
17684                         "\x00\x84\x65\x24\xa5\x7d\x85\xb4"
17685                         "\xe3\x17\xed\x3a\xb7\x6f\xb4\x0b"
17686                         "\x0b\xaf\x15\xae\x5a\x8f\xf2\x0c"
17687                         "\x2f\x27\xf4\x09\xd8\xd2\x96\xb7"
17688                         "\x71\xf2\xc5\x99\x4d\x7e\x7f\x75"
17689                         "\x77\x89\x30\x8b\x59\xdb\xa2\xb2"
17690                         "\xa0\xf3\x19\x39\x2b\xc5\x7e\x3f"
17691                         "\x4f\xd9\xd3\x56\x28\x97\x44\xdc"
17692                         "\xc0\x8b\x77\x24\xd9\x52\xe7\xc5"
17693                         "\xaf\xf6\x7d\x59\xb2\x44\x05\x1d"
17694                         "\xb1\xb0\x11\xa5\x0f\xec\x33\xe1"
17695                         "\x6d\x1b\x4e\x1f\xff\x57\x91\xb4"
17696                         "\x5b\x9a\x96\xc5\x53\xbc\xae\x20"
17697                         "\x3c\xbb\x14\xe2\xe8\x22\x33\xc1"
17698                         "\x5e\x76\x9e\x46\x99\xf6\x2a\x15"
17699                         "\xc6\x97\x02\xa0\x66\x43\xd1\xa6"
17700                         "\x31\xa6\x9f\xfb\xf4\xd3\x69\xe5"
17701                         "\xcd\x76\x95\xb8\x7a\x82\x7f\x21"
17702                         "\x45\xff\x3f\xce\x55\xf6\x95\x10"
17703                         "\x08\x77\x10\x43\xc6\xf3\x09\xe5"
17704                         "\x68\xe7\x3c\xad\x00\x52\x45\x0d"
17705                         "\xfe\x2d\xc6\xc2\x94\x8c\x12\x1d"
17706                         "\xe6\x25\xae\x98\x12\x8e\x19\x9c"
17707                         "\x81\x68\xb1\x11\xf6\x69\xda\xe3"
17708                         "\x62\x08\x18\x7a\x25\x49\x28\xac"
17709                         "\xba\x71\x12\x0b\xe4\xa2\xe5\xc7"
17710                         "\x5d\x8e\xec\x49\x40\x21\xbf\x5a"
17711                         "\x98\xf3\x02\x68\x55\x03\x7f\x8a"
17712                         "\xe5\x94\x0c\x32\x5c\x07\x82\x63"
17713                         "\xaf\x6f\x91\x40\x84\x8e\x52\x25"
17714                         "\xd0\xb0\x29\x53\x05\xe2\x50\x7a"
17715                         "\x34\xeb\xc9\x46\x20\xa8\x3d\xde"
17716                         "\x7f\x16\x5f\x36\xc5\x2e\xdc\xd1"
17717                         "\x15\x47\xc7\x50\x40\x6d\x91\xc5"
17718                         "\xe7\x93\x95\x1a\xd3\x57\xbc\x52"
17719                         "\x33\xee\x14\x19\x22\x52\x89\xa7"
17720                         "\x4a\x25\x56\x77\x4b\xca\xcf\x0a"
17721                         "\xe1\xf5\x35\x85\x30\x7e\x59\x4a"
17722                         "\xbd\x14\x5b\xdf\xe3\x46\xcb\xac"
17723                         "\x1f\x6c\x96\x0e\xf4\x81\xd1\x99"
17724                         "\xca\x88\x63\x3d\x02\x58\x6b\xa9"
17725                         "\xe5\x9f\xb3\x00\xb2\x54\xc6\x74"
17726                         "\x1c\xbf\x46\xab\x97\xcc\xf8\x54"
17727                         "\x04\x07\x08\x52\xe6\xc0\xda\x93"
17728                         "\x74\x7d\x93\x99\x5d\x78\x68\xa6"
17729                         "\x2e\x6b\xd3\x6a\x69\xcc\x12\x6b"
17730                         "\xd4\xc7\xa5\xc6\xe7\xf6\x03\x04"
17731                         "\x5d\xcd\x61\x5e\x17\x40\xdc\xd1"
17732                         "\x5c\xf5\x08\xdf\x5c\x90\x85\xa4"
17733                         "\xaf\xf6\x78\xbb\x0d\xf1\xf4\xa4"
17734                         "\x54\x26\x72\x9e\x61\xfa\x86\xcf"
17735                         "\xe8\x9e\xa1\xe0\xc7\x48\x23\xae"
17736                         "\x5a\x90\xae\x75\x0a\x74\x18\x89"
17737                         "\x05\xb1\x92\xb2\x7f\xd0\x1b\xa6"
17738                         "\x62\x07\x25\x01\xc7\xc2\x4f\xf9"
17739                         "\xe8\xfe\x63\x95\x80\x07\xb4\x26"
17740                         "\xcc\xd1\x26\xb6\xc4\x3f\x9e\xcb"
17741                         "\x8e\x3b\x2e\x44\x16\xd3\x10\x9a"
17742                         "\x95\x08\xeb\xc8\xcb\xeb\xbf\x6f"
17743                         "\x0b\xcd\x1f\xc8\xca\x86\xaa\xec"
17744                         "\x33\xe6\x69\xf4\x45\x25\x86\x3a"
17745                         "\x22\x94\x4f\x00\x23\x6a\x44\xc2"
17746                         "\x49\x97\x33\xab\x36\x14\x0a\x70"
17747                         "\x24\xc3\xbe\x04\x3b\x79\xa0\xf9"
17748                         "\xb8\xe7\x76\x29\x22\x83\xd7\xf2"
17749                         "\x94\xf4\x41\x49\xba\x5f\x7b\x07"
17750                         "\xb5\xfb\xdb\x03\x1a\x9f\xb6\x4c"
17751                         "\xc2\x2e\x37\x40\x49\xc3\x38\x16"
17752                         "\xe2\x4f\x77\x82\xb0\x68\x4c\x71"
17753                         "\x1d\x57\x61\x9c\xd9\x4e\x54\x99"
17754                         "\x47\x13\x28\x73\x3c\xbb\x00\x90"
17755                         "\xf3\x4d\xc9\x0e\xfd\xe7\xb1\x71"
17756                         "\xd3\x15\x79\xbf\xcc\x26\x2f\xbd"
17757                         "\xad\x6c\x50\x69\x6c\x3e\x6d\x80"
17758                         "\x9a\xea\x78\xaf\x19\xb2\x0d\x4d"
17759                         "\xad\x04\x07\xae\x22\x90\x4a\x93"
17760                         "\x32\x0e\x36\x9b\x1b\x46\xba\x3b"
17761                         "\xb4\xac\xc6\xd1\xa2\x31\x53\x3b"
17762                         "\x2a\x3d\x45\xfe\x03\x61\x10\x85"
17763                         "\x17\x69\xa6\x78\xcc\x6c\x87\x49"
17764                         "\x53\xf9\x80\x10\xde\x80\xa2\x41"
17765                         "\x6a\xc3\x32\x02\xad\x6d\x3c\x56"
17766                         "\x00\x71\x51\x06\xa7\xbd\xfb\xef"
17767                         "\x3c\xb5\x9f\xfc\x48\x7d\x53\x7c"
17768                         "\x66\xb0\x49\x23\xc4\x47\x10\x0e"
17769                         "\xe5\x6c\x74\x13\xe6\xc5\x3f\xaa"
17770                         "\xde\xff\x07\x44\xdd\x56\x1b\xad"
17771                         "\x09\x77\xfb\x5b\x12\xb8\x0d\x38"
17772                         "\x17\x37\x35\x7b\x9b\xbc\xfe\xd4"
17773                         "\x7e\x8b\xda\x7e\x5b\x04\xa7\x22"
17774                         "\xa7\x31\xa1\x20\x86\xc7\x1b\x99"
17775                         "\xdb\xd1\x89\xf4\x94\xa3\x53\x69"
17776                         "\x8d\xe7\xe8\x74\x11\x8d\x74\xd6"
17777                         "\x07\x37\x91\x9f\xfd\x67\x50\x3a"
17778                         "\xc9\xe1\xf4\x36\xd5\xa0\x47\xd1"
17779                         "\xf9\xe5\x39\xa3\x31\xac\x07\x36"
17780                         "\x23\xf8\x66\x18\x14\x28\x34\x0f"
17781                         "\xb8\xd0\xe7\x29\xb3\x04\x4b\x55"
17782                         "\x01\x41\xb2\x75\x8d\xcb\x96\x85"
17783                         "\x3a\xfb\xab\x2b\x9e\xfa\x58\x20"
17784                         "\x44\x1f\xc0\x14\x22\x75\x61\xe8"
17785                         "\xaa\x19\xcf\xf1\x82\x56\xf4\xd7"
17786                         "\x78\x7b\x3d\x5f\xb3\x9e\x0b\x8a"
17787                         "\x57\x50\xdb\x17\x41\x65\x4d\xa3"
17788                         "\x02\xc9\x9c\x9c\x53\xfb\x39\x39"
17789                         "\x9b\x1d\x72\x24\xda\xb7\x39\xbe"
17790                         "\x13\x3b\xfa\x29\xda\x9e\x54\x64"
17791                         "\x6e\xba\xd8\xa1\xcb\xb3\x36\xfa"
17792                         "\xcb\x47\x85\xe9\x61\x38\xbc\xbe"
17793                         "\xc5\x00\x38\x2a\x54\xf7\xc4\xb9"
17794                         "\xb3\xd3\x7b\xa0\xa0\xf8\x72\x7f"
17795                         "\x8c\x8e\x82\x0e\xc6\x1c\x75\x9d"
17796                         "\xca\x8e\x61\x87\xde\xad\x80\xd2"
17797                         "\xf5\xf9\x80\xef\x15\x75\xaf\xf5"
17798                         "\x80\xfb\xff\x6d\x1e\x25\xb7\x40"
17799                         "\x61\x6a\x39\x5a\x6a\xb5\x31\xab"
17800                         "\x97\x8a\x19\x89\x44\x40\xc0\xa6"
17801                         "\xb4\x4e\x30\x32\x7b\x13\xe7\x67"
17802                         "\xa9\x8b\x57\x04\xc2\x01\xa6\xf4"
17803                         "\x28\x99\xad\x2c\x76\xa3\x78\xc2"
17804                         "\x4a\xe6\xca\x5c\x50\x6a\xc1\xb0"
17805                         "\x62\x4b\x10\x8e\x7c\x17\x43\xb3"
17806                         "\x17\x66\x1c\x3e\x8d\x69\xf0\x5a"
17807                         "\x71\xf5\x97\xdc\xd1\x45\xdd\x28"
17808                         "\xf3\x5d\xdf\x53\x7b\x11\xe5\xbc"
17809                         "\x4c\xdb\x1b\x51\x6b\xe9\xfb\x3d"
17810                         "\xc1\xc3\x2c\xb9\x71\xf5\xb6\xb2"
17811                         "\x13\x36\x79\x80\x53\xe8\xd3\xa6"
17812                         "\x0a\xaf\xfd\x56\x97\xf7\x40\x8e"
17813                         "\x45\xce\xf8\xb0\x9e\x5c\x33\x82"
17814                         "\xb0\x44\x56\xfc\x05\x09\xe9\x2a"
17815                         "\xac\x26\x80\x14\x1d\xc8\x3a\x35"
17816                         "\x4c\x82\x97\xfd\x76\xb7\xa9\x0a"
17817                         "\x35\x58\x79\x8e\x0f\x66\xea\xaf"
17818                         "\x51\x6c\x09\xa9\x6e\x9b\xcb\x9a"
17819                         "\x31\x47\xa0\x2f\x7c\x71\xb4\x4a"
17820                         "\x11\xaa\x8c\x66\xc5\x64\xe6\x3a"
17821                         "\x54\xda\x24\x6a\xc4\x41\x65\x46"
17822                         "\x82\xa0\x0a\x0f\x5f\xfb\x25\xd0"
17823                         "\x2c\x91\xa7\xee\xc4\x81\x07\x86"
17824                         "\x75\x5e\x33\x69\x97\xe4\x2c\xa8"
17825                         "\x9d\x9f\x0b\x6a\xbe\xad\x98\xda"
17826                         "\x6d\x94\x41\xda\x2c\x1e\x89\xc4"
17827                         "\xc2\xaf\x1e\x00\x05\x0b\x83\x60"
17828                         "\xbd\x43\xea\x15\x23\x7f\xb9\xac"
17829                         "\xee\x4f\x2c\xaf\x2a\xf3\xdf\xd0"
17830                         "\xf3\x19\x31\xbb\x4a\x74\x84\x17"
17831                         "\x52\x32\x2c\x7d\x61\xe4\xcb\xeb"
17832                         "\x80\x38\x15\x52\xcb\x6f\xea\xe5"
17833                         "\x73\x9c\xd9\x24\x69\xc6\x95\x32"
17834                         "\x21\xc8\x11\xe4\xdc\x36\xd7\x93"
17835                         "\x38\x66\xfb\xb2\x7f\x3a\xb9\xaf"
17836                         "\x31\xdd\x93\x75\x78\x8a\x2c\x94"
17837                         "\x87\x1a\x58\xec\x9e\x7d\x4d\xba"
17838                         "\xe1\xe5\x4d\xfc\xbc\xa4\x2a\x14"
17839                         "\xef\xcc\xa7\xec\xab\x43\x09\x18"
17840                         "\xd3\xab\x68\xd1\x07\x99\x44\x47"
17841                         "\xd6\x83\x85\x3b\x30\xea\xa9\x6b"
17842                         "\x63\xea\xc4\x07\xfb\x43\x2f\xa4"
17843                         "\xaa\xb0\xab\x03\x89\xce\x3f\x8c"
17844                         "\x02\x7c\x86\x54\xbc\x88\xaf\x75"
17845                         "\xd2\xdc\x63\x17\xd3\x26\xf6\x96"
17846                         "\xa9\x3c\xf1\x61\x8c\x11\x18\xcc"
17847                         "\xd6\xea\x5b\xe2\xcd\xf0\xf1\xb2"
17848                         "\xe5\x35\x90\x1f\x85\x4c\x76\x5b"
17849                         "\x66\xce\x44\xa4\x32\x9f\xe6\x7b"
17850                         "\x71\x6e\x9f\x58\x15\x67\x72\x87"
17851                         "\x64\x8e\x3a\x44\x45\xd4\x76\xfa"
17852                         "\xc2\xf6\xef\x85\x05\x18\x7a\x9b"
17853                         "\xba\x41\x54\xac\xf0\xfc\x59\x12"
17854                         "\x3f\xdf\xa0\xe5\x8a\x65\xfd\x3a"
17855                         "\x62\x8d\x83\x2c\x03\xbe\x05\x76"
17856                         "\x2e\x53\x49\x97\x94\x33\xae\x40"
17857                         "\x81\x15\xdb\x6e\xad\xaa\xf5\x4b"
17858                         "\xe3\x98\x70\xdf\xe0\x7c\xcd\xdb"
17859                         "\x02\xd4\x7d\x2f\xc1\xe6\xb4\xf3"
17860                         "\xd7\x0d\x7a\xd9\x23\x9e\x87\x2d"
17861                         "\xce\x87\xad\xcc\x72\x05\x00\x29"
17862                         "\xdc\x73\x7f\x64\xc1\x15\x0e\xc2"
17863                         "\xdf\xa7\x5f\xeb\x41\xa1\xcd\xef"
17864                         "\x5c\x50\x79\x2a\x56\x56\x71\x8c"
17865                         "\xac\xc0\x79\x50\x69\xca\x59\x32"
17866                         "\x65\xf2\x54\xe4\x52\x38\x76\xd1"
17867                         "\x5e\xde\x26\x9e\xfb\x75\x2e\x11"
17868                         "\xb5\x10\xf4\x17\x73\xf5\x89\xc7"
17869                         "\x4f\x43\x5c\x8e\x7c\xb9\x05\x52"
17870                         "\x24\x40\x99\xfe\x9b\x85\x0b\x6c"
17871                         "\x22\x3e\x8b\xae\x86\xa1\xd2\x79"
17872                         "\x05\x68\x6b\xab\xe3\x41\x49\xed"
17873                         "\x15\xa1\x8d\x40\x2d\x61\xdf\x1a"
17874                         "\x59\xc9\x26\x8b\xef\x30\x4c\x88"
17875                         "\x4b\x10\xf8\x8d\xa6\x92\x9f\x4b"
17876                         "\xf3\xc4\x53\x0b\x89\x5d\x28\x92"
17877                         "\xcf\x78\xb2\xc0\x5d\xed\x7e\xfc"
17878                         "\xc0\x12\x23\x5f\x5a\x78\x86\x43"
17879                         "\x6e\x27\xf7\x5a\xa7\x6a\xed\x19"
17880                         "\x04\xf0\xb3\x12\xd1\xbd\x0e\x89"
17881                         "\x6e\xbc\x96\xa8\xd8\x49\x39\x9f"
17882                         "\x7e\x67\xf0\x2e\x3e\x01\xa9\xba"
17883                         "\xec\x8b\x62\x8e\xcb\x4a\x70\x43"
17884                         "\xc7\xc2\xc4\xca\x82\x03\x73\xe9"
17885                         "\x11\xdf\xcf\x54\xea\xc9\xb0\x95"
17886                         "\x51\xc0\x13\x3d\x92\x05\xfa\xf4"
17887                         "\xa9\x34\xc8\xce\x6c\x3d\x54\xcc"
17888                         "\xc4\xaf\xf1\xdc\x11\x44\x26\xa2"
17889                         "\xaf\xf1\x85\x75\x7d\x03\x61\x68"
17890                         "\x4e\x78\xc6\x92\x7d\x86\x7d\x77"
17891                         "\xdc\x71\x72\xdb\xc6\xae\xa1\xcb"
17892                         "\x70\x9a\x0b\x19\xbe\x4a\x6c\x2a"
17893                         "\xe2\xba\x6c\x64\x9a\x13\x28\xdf"
17894                         "\x85\x75\xe6\x43\xf6\x87\x08\x68"
17895                         "\x6e\xba\x6e\x79\x9f\x04\xbc\x23"
17896                         "\x50\xf6\x33\x5c\x1f\x24\x25\xbe"
17897                         "\x33\x47\x80\x45\x56\xa3\xa7\xd7"
17898                         "\x7a\xb1\x34\x0b\x90\x3c\x9c\xad"
17899                         "\x44\x5f\x9e\x0e\x9d\xd4\xbd\x93"
17900                         "\x5e\xfa\x3c\xe0\xb0\xd9\xed\xf3"
17901                         "\xd6\x2e\xff\x24\xd8\x71\x6c\xed"
17902                         "\xaf\x55\xeb\x22\xac\x93\x68\x32"
17903                         "\x05\x5b\x47\xdd\xc6\x4a\xcb\xc7"
17904                         "\x10\xe1\x3c\x92\x1a\xf3\x23\x78"
17905                         "\x2b\xa1\xd2\x80\xf4\x12\xb1\x20"
17906                         "\x8f\xff\x26\x35\xdd\xfb\xc7\x4e"
17907                         "\x78\xf1\x2d\x50\x12\x77\xa8\x60"
17908                         "\x7c\x0f\xf5\x16\x2f\x63\x70\x2a"
17909                         "\xc0\x96\x80\x4e\x0a\xb4\x93\x35"
17910                         "\x5d\x1d\x3f\x56\xf7\x2f\xbb\x90"
17911                         "\x11\x16\x8f\xa2\xec\x47\xbe\xac"
17912                         "\x56\x01\x26\x56\xb1\x8c\xb2\x10"
17913                         "\xf9\x1a\xca\xf5\xd1\xb7\x39\x20"
17914                         "\x63\xf1\x69\x20\x4f\x13\x12\x1f"
17915                         "\x5b\x65\xfc\x98\xf7\xc4\x7a\xbe"
17916                         "\xf7\x26\x4d\x2b\x84\x7b\x42\xad"
17917                         "\xd8\x7a\x0a\xb4\xd8\x74\xbf\xc1"
17918                         "\xf0\x6e\xb4\x29\xa3\xbb\xca\x46"
17919                         "\x67\x70\x6a\x2d\xce\x0e\xa2\x8a"
17920                         "\xa9\x87\xbf\x05\xc4\xc1\x04\xa3"
17921                         "\xab\xd4\x45\x43\x8c\xb6\x02\xb0"
17922                         "\x41\xc8\xfc\x44\x3d\x59\xaa\x2e"
17923                         "\x44\x21\x2a\x8d\x88\x9d\x57\xf4"
17924                         "\xa0\x02\x77\xb8\xa6\xa0\xe6\x75"
17925                         "\x5c\x82\x65\x3e\x03\x5c\x29\x8f"
17926                         "\x38\x55\xab\x33\x26\xef\x9f\x43"
17927                         "\x52\xfd\x68\xaf\x36\xb4\xbb\x9a"
17928                         "\x58\x09\x09\x1b\xc3\x65\x46\x46"
17929                         "\x1d\xa7\x94\x18\x23\x50\x2c\xca"
17930                         "\x2c\x55\x19\x97\x01\x9d\x93\x3b"
17931                         "\x63\x86\xf2\x03\x67\x45\xd2\x72"
17932                         "\x28\x52\x6c\xf4\xe3\x1c\xb5\x11"
17933                         "\x13\xf1\xeb\x21\xc7\xd9\x56\x82"
17934                         "\x2b\x82\x39\xbd\x69\x54\xed\x62"
17935                         "\xc3\xe2\xde\x73\xd4\x6a\x12\xae"
17936                         "\x13\x21\x7f\x4b\x5b\xfc\xbf\xe8"
17937                         "\x2b\xbe\x56\xba\x68\x8b\x9a\xb1"
17938                         "\x6e\xfa\xbf\x7e\x5a\x4b\xf1\xac"
17939                         "\x98\x65\x85\xd1\x93\x53\xd3\x7b"
17940                         "\x09\xdd\x4b\x10\x6d\x84\xb0\x13"
17941                         "\x65\xbd\xcf\x52\x09\xc4\x85\xe2"
17942                         "\x84\x74\x15\x65\xb7\xf7\x51\xaf"
17943                         "\x55\xad\xa4\xd1\x22\x54\x70\x94"
17944                         "\xa0\x1c\x90\x41\xfd\x99\xd7\x5a"
17945                         "\x31\xef\xaa\x25\xd0\x7f\x4f\xea"
17946                         "\x1d\x55\x42\xe5\x49\xb0\xd0\x46"
17947                         "\x62\x36\x43\xb2\x82\x15\x75\x50"
17948                         "\xa4\x72\xeb\x54\x27\x1f\x8a\xe4"
17949                         "\x7d\xe9\x66\xc5\xf1\x53\xa4\xd1"
17950                         "\x0c\xeb\xb8\xf8\xbc\xd4\xe2\xe7"
17951                         "\xe1\xf8\x4b\xcb\xa9\xa1\xaf\x15"
17952                         "\x83\xcb\x72\xd0\x33\x79\x00\x2d"
17953                         "\x9f\xd7\xf1\x2e\x1e\x10\xe4\x45"
17954                         "\xc0\x75\x3a\x39\xea\x68\xf7\x5d"
17955                         "\x1b\x73\x8f\xe9\x8e\x0f\x72\x47"
17956                         "\xae\x35\x0a\x31\x7a\x14\x4d\x4a"
17957                         "\x6f\x47\xf7\x7e\x91\x6e\x74\x8b"
17958                         "\x26\x47\xf9\xc3\xf9\xde\x70\xf5"
17959                         "\x61\xab\xa9\x27\x9f\x82\xe4\x9c"
17960                         "\x89\x91\x3f\x2e\x6a\xfd\xb5\x49"
17961                         "\xe9\xfd\x59\x14\x36\x49\x40\x6d"
17962                         "\x32\xd8\x85\x42\xf3\xa5\xdf\x0c"
17963                         "\xa8\x27\xd7\x54\xe2\x63\x2f\xf2"
17964                         "\x7e\x8b\x8b\xe7\xf1\x9a\x95\x35"
17965                         "\x43\xdc\x3a\xe4\xb6\xf4\xd0\xdf"
17966                         "\x9c\xcb\x94\xf3\x21\xa0\x77\x50"
17967                         "\xe2\xc6\xc4\xc6\x5f\x09\x64\x5b"
17968                         "\x92\x90\xd8\xe1\xd1\xed\x4b\x42"
17969                         "\xd7\x37\xaf\x65\x3d\x11\x39\xb6"
17970                         "\x24\x8a\x60\xae\xd6\x1e\xbf\x0e"
17971                         "\x0d\xd7\xdc\x96\x0e\x65\x75\x4e"
17972                         "\x29\x06\x9d\xa4\x51\x3a\x10\x63"
17973                         "\x8f\x17\x07\xd5\x8e\x3c\xf4\x28"
17974                         "\x00\x5a\x5b\x05\x19\xd8\xc0\x6c"
17975                         "\xe5\x15\xe4\x9c\x9d\x71\x9d\x5e"
17976                         "\x94\x29\x1a\xa7\x80\xfa\x0e\x33"
17977                         "\x03\xdd\xb7\x3e\x9a\xa9\x26\x18"
17978                         "\x37\xa9\x64\x08\x4d\x94\x5a\x88"
17979                         "\xca\x35\xce\x81\x02\xe3\x1f\x1b"
17980                         "\x89\x1a\x77\x85\xe3\x41\x6d\x32"
17981                         "\x42\x19\x23\x7d\xc8\x73\xee\x25"
17982                         "\x85\x0d\xf8\x31\x25\x79\x1b\x6f"
17983                         "\x79\x25\xd2\xd8\xd4\x23\xfd\xf7"
17984                         "\x82\x36\x6a\x0c\x46\x22\x15\xe9"
17985                         "\xff\x72\x41\x91\x91\x7d\x3a\xb7"
17986                         "\xdd\x65\x99\x70\xf6\x8d\x84\xf8"
17987                         "\x67\x15\x20\x11\xd6\xb2\x55\x7b"
17988                         "\xdb\x87\xee\xef\x55\x89\x2a\x59"
17989                         "\x2b\x07\x8f\x43\x8a\x59\x3c\x01"
17990                         "\x8b\x65\x54\xa1\x66\xd5\x38\xbd"
17991                         "\xc6\x30\xa9\xcc\x49\xb6\xa8\x1b"
17992                         "\xb8\xc0\x0e\xe3\x45\x28\xe2\xff"
17993                         "\x41\x9f\x7e\x7c\xd1\xae\x9e\x25"
17994                         "\x3f\x4c\x7c\x7c\xf4\xa8\x26\x4d"
17995                         "\x5c\xfd\x4b\x27\x18\xf9\x61\x76"
17996                         "\x48\xba\x0c\x6b\xa9\x4d\xfc\xf5"
17997                         "\x3b\x35\x7e\x2f\x4a\xa9\xc2\x9a"
17998                         "\xae\xab\x86\x09\x89\xc9\xc2\x40"
17999                         "\x39\x2c\x81\xb3\xb8\x17\x67\xc2"
18000                         "\x0d\x32\x4a\x3a\x67\x81\xd7\x1a"
18001                         "\x34\x52\xc5\xdb\x0a\xf5\x63\x39"
18002                         "\xea\x1f\xe1\x7c\xa1\x9e\xc1\x35"
18003                         "\xe3\xb1\x18\x45\x67\xf9\x22\x38"
18004                         "\x95\xd9\x34\x34\x86\xc6\x41\x94"
18005                         "\x15\xf9\x5b\x41\xa6\x87\x8b\xf8"
18006                         "\xd5\xe1\x1b\xe2\x5b\xf3\x86\x10"
18007                         "\xff\xe6\xae\x69\x76\xbc\x0d\xb4"
18008                         "\x09\x90\x0c\xa2\x65\x0c\xad\x74"
18009                         "\xf5\xd7\xff\xda\xc1\xce\x85\xbe"
18010                         "\x00\xa7\xff\x4d\x2f\x65\xd3\x8c"
18011                         "\x86\x2d\x05\xe8\xed\x3e\x6b\x8b"
18012                         "\x0f\x3d\x83\x8c\xf1\x1d\x5b\x96"
18013                         "\x2e\xb1\x9c\xc2\x98\xe1\x70\xb9"
18014                         "\xba\x5c\x8a\x43\xd6\x34\xa7\x2d"
18015                         "\xc9\x92\xae\xf2\xa5\x7b\x05\x49"
18016                         "\xa7\x33\x34\x86\xca\xe4\x96\x23"
18017                         "\x76\x5b\xf2\xc6\xf1\x51\x28\x42"
18018                         "\x7b\xcc\x76\x8f\xfa\xa2\xad\x31"
18019                         "\xd4\xd6\x7a\x6d\x25\x25\x54\xe4"
18020                         "\x3f\x50\x59\xe1\x5c\x05\xb7\x27"
18021                         "\x48\xbf\x07\xec\x1b\x13\xbe\x2b"
18022                         "\xa1\x57\x2b\xd5\xab\xd7\xd0\x4c"
18023                         "\x1e\xcb\x71\x9b\xc5\x90\x85\xd3"
18024                         "\xde\x59\xec\x71\xeb\x89\xbb\xd0"
18025                         "\x09\x50\xe1\x16\x3f\xfd\x1c\x34"
18026                         "\xc3\x1c\xa1\x10\x77\x53\x98\xef"
18027                         "\xf2\xfd\xa5\x01\x59\xc2\x9b\x26"
18028                         "\xc7\x42\xd9\x49\xda\x58\x2b\x6e"
18029                         "\x9f\x53\x19\x76\x7e\xd9\xc9\x0e"
18030                         "\x68\xc8\x7f\x51\x22\x42\xef\x49"
18031                         "\xa4\x55\xb6\x36\xac\x09\xc7\x31"
18032                         "\x88\x15\x4b\x2e\x8f\x3a\x08\xf7"
18033                         "\xd8\xf7\xa8\xc5\xa9\x33\xa6\x45"
18034                         "\xe4\xc4\x94\x76\xf3\x0d\x8f\x7e"
18035                         "\xc8\xf6\xbc\x23\x0a\xb6\x4c\xd3"
18036                         "\x6a\xcd\x36\xc2\x90\x5c\x5c\x3c"
18037                         "\x65\x7b\xc2\xd6\xcc\xe6\x0d\x87"
18038                         "\x73\x2e\x71\x79\x16\x06\x63\x28"
18039                         "\x09\x15\xd8\x89\x38\x38\x3d\xb5"
18040                         "\x42\x1c\x08\x24\xf7\x2a\xd2\x9d"
18041                         "\xc8\xca\xef\xf9\x27\xd8\x07\x86"
18042                         "\xf7\x43\x0b\x55\x15\x3f\x9f\x83"
18043                         "\xef\xdc\x49\x9d\x2a\xc1\x54\x62"
18044                         "\xbd\x9b\x66\x55\x9f\xb7\x12\xf3"
18045                         "\x1b\x4d\x9d\x2a\x5c\xed\x87\x75"
18046                         "\x87\x26\xec\x61\x2c\xb4\x0f\x89"
18047                         "\xb0\xfb\x2e\x68\x5d\x15\xc7\x8d"
18048                         "\x2e\xc0\xd9\xec\xaf\x4f\xd2\x25"
18049                         "\x29\xe8\xd2\x26\x2b\x67\xe9\xfc"
18050                         "\x2b\xa8\x67\x96\x12\x1f\x5b\x96"
18051                         "\xc6\x14\x53\xaf\x44\xea\xd6\xe2"
18052                         "\x94\x98\xe4\x12\x93\x4c\x92\xe0"
18053                         "\x18\xa5\x8d\x2d\xe4\x71\x3c\x47"
18054                         "\x4c\xf7\xe6\x47\x9e\xc0\x68\xdf"
18055                         "\xd4\xf5\x5a\x74\xb1\x2b\x29\x03"
18056                         "\x19\x07\xaf\x90\x62\x5c\x68\x98"
18057                         "\x48\x16\x11\x02\x9d\xee\xb4\x9b"
18058                         "\xe5\x42\x7f\x08\xfd\x16\x32\x0b"
18059                         "\xd0\xb3\xfa\x2b\xb7\x99\xf9\x29"
18060                         "\xcd\x20\x45\x9f\xb3\x1a\x5d\xa2"
18061                         "\xaf\x4d\xe0\xbd\x42\x0d\xbc\x74"
18062                         "\x99\x9c\x8e\x53\x1a\xb4\x3e\xbd"
18063                         "\xa2\x9a\x2d\xf7\xf8\x39\x0f\x67"
18064                         "\x63\xfc\x6b\xc0\xaf\xb3\x4b\x4f"
18065                         "\x55\xc4\xcf\xa7\xc8\x04\x11\x3e"
18066                         "\x14\x32\xbb\x1b\x38\x77\xd6\x7f"
18067                         "\x54\x4c\xdf\x75\xf3\x07\x2d\x33"
18068                         "\x9b\xa8\x20\xe1\x7b\x12\xb5\xf3"
18069                         "\xef\x2f\xce\x72\xe5\x24\x60\xc1"
18070                         "\x30\xe2\xab\xa1\x8e\x11\x09\xa8"
18071                         "\x21\x33\x44\xfe\x7f\x35\x32\x93"
18072                         "\x39\xa7\xad\x8b\x79\x06\xb2\xcb"
18073                         "\x4e\xa9\x5f\xc7\xba\x74\x29\xec"
18074                         "\x93\xa0\x4e\x54\x93\xc0\xbc\x55"
18075                         "\x64\xf0\x48\xe5\x57\x99\xee\x75"
18076                         "\xd6\x79\x0f\x66\xb7\xc6\x57\x76"
18077                         "\xf7\xb7\xf3\x9c\xc5\x60\xe8\x7f"
18078                         "\x83\x76\xd6\x0e\xaa\xe6\x90\x39"
18079                         "\x1d\xa6\x32\x6a\x34\xe3\x55\xf8"
18080                         "\x58\xa0\x58\x7d\x33\xe0\x22\x39"
18081                         "\x44\x64\x87\x86\x5a\x2f\xa7\x7e"
18082                         "\x0f\x38\xea\xb0\x30\xcc\x61\xa5"
18083                         "\x6a\x32\xae\x1e\xf7\xe9\xd0\xa9"
18084                         "\x0c\x32\x4b\xb5\x49\x28\xab\x85"
18085                         "\x2f\x8e\x01\x36\x38\x52\xd0\xba"
18086                         "\xd6\x02\x78\xf8\x0e\x3e\x9c\x8b"
18087                         "\x6b\x45\x99\x3f\x5c\xfe\x58\xf1"
18088                         "\x5c\x94\x04\xe1\xf5\x18\x6d\x51"
18089                         "\xb2\x5d\x18\x20\xb6\xc2\x9a\x42"
18090                         "\x1d\xb3\xab\x3c\xb6\x3a\x13\x03"
18091                         "\xb2\x46\x82\x4f\xfc\x64\xbc\x4f"
18092                         "\xca\xfa\x9c\xc0\xd5\xa7\xbd\x11"
18093                         "\xb7\xe4\x5a\xf6\x6f\x4d\x4d\x54"
18094                         "\xea\xa4\x98\x66\xd4\x22\x3b\xd3"
18095                         "\x8f\x34\x47\xd9\x7c\xf4\x72\x3b"
18096                         "\x4d\x02\x77\xf6\xd6\xdd\x08\x0a"
18097                         "\x81\xe1\x86\x89\x3e\x56\x10\x3c"
18098                         "\xba\xd7\x81\x8c\x08\xbc\x8b\xe2"
18099                         "\x53\xec\xa7\x89\xee\xc8\x56\xb5"
18100                         "\x36\x2c\xb2\x03\xba\x99\xdd\x7c"
18101                         "\x48\xa0\xb0\xbc\x91\x33\xe9\xa8"
18102                         "\xcb\xcd\xcf\x59\x5f\x1f\x15\xe2"
18103                         "\x56\xf5\x4e\x01\x35\x27\x45\x77"
18104                         "\x47\xc8\xbc\xcb\x7e\x39\xc1\x97"
18105                         "\x28\xd3\x84\xfc\x2c\x3e\xc8\xad"
18106                         "\x9c\xf8\x8a\x61\x9c\x28\xaa\xc5"
18107                         "\x99\x20\x43\x85\x9d\xa5\xe2\x8b"
18108                         "\xb8\xae\xeb\xd0\x32\x0d\x52\x78"
18109                         "\x09\x56\x3f\xc7\xd8\x7e\x26\xfc"
18110                         "\x37\xfb\x6f\x04\xfc\xfa\x92\x10"
18111                         "\xac\xf8\x3e\x21\xdc\x8c\x21\x16"
18112                         "\x7d\x67\x6e\xf6\xcd\xda\xb6\x98"
18113                         "\x23\xab\x23\x3c\xb2\x10\xa0\x53"
18114                         "\x5a\x56\x9f\xc5\xd0\xff\xbb\xe4"
18115                         "\x98\x3c\x69\x1e\xdb\x38\x8f\x7e"
18116                         "\x0f\xd2\x98\x88\x81\x8b\x45\x67"
18117                         "\xea\x33\xf1\xeb\xe9\x97\x55\x2e"
18118                         "\xd9\xaa\xeb\x5a\xec\xda\xe1\x68"
18119                         "\xa8\x9d\x3c\x84\x7c\x05\x3d\x62"
18120                         "\x87\x8f\x03\x21\x28\x95\x0c\x89"
18121                         "\x25\x22\x4a\xb0\x93\xa9\x50\xa2"
18122                         "\x2f\x57\x6e\x18\x42\x19\x54\x0c"
18123                         "\x55\x67\xc6\x11\x49\xf4\x5c\xd2"
18124                         "\xe9\x3d\xdd\x8b\x48\x71\x21\x00"
18125                         "\xc3\x9a\x6c\x85\x74\x28\x83\x4a"
18126                         "\x1b\x31\x05\xe1\x06\x92\xe7\xda"
18127                         "\x85\x73\x78\x45\x20\x7f\xae\x13"
18128                         "\x7c\x33\x06\x22\xf4\x83\xf9\x35"
18129                         "\x3f\x6c\x71\xa8\x4e\x48\xbe\x9b"
18130                         "\xce\x8a\xba\xda\xbe\x28\x08\xf7"
18131                         "\xe2\x14\x8c\x71\xea\x72\xf9\x33"
18132                         "\xf2\x88\x3f\xd7\xbb\x69\x6c\x29"
18133                         "\x19\xdc\x84\xce\x1f\x12\x4f\xc8"
18134                         "\xaf\xa5\x04\xba\x5a\xab\xb0\xd9"
18135                         "\x14\x1f\x6c\x68\x98\x39\x89\x7a"
18136                         "\xd9\xd8\x2f\xdf\xa8\x47\x4a\x25"
18137                         "\xe2\xfb\x33\xf4\x59\x78\xe1\x68"
18138                         "\x85\xcf\xfe\x59\x20\xd4\x05\x1d"
18139                         "\x80\x99\xae\xbc\xca\xae\x0f\x2f"
18140                         "\x65\x43\x34\x8e\x7e\xac\xd3\x93"
18141                         "\x2f\xac\x6d\x14\x3d\x02\x07\x70"
18142                         "\x9d\xa4\xf3\x1b\x5c\x36\xfc\x01"
18143                         "\x73\x34\x85\x0c\x6c\xd6\xf1\xbd"
18144                         "\x3f\xdf\xee\xf5\xd9\xba\x56\xef"
18145                         "\xf4\x9b\x6b\xee\x9f\x5a\x78\x6d"
18146                         "\x32\x19\xf4\xf7\xf8\x4c\x69\x0b"
18147                         "\x4b\xbc\xbb\xb7\xf2\x85\xaf\x70"
18148                         "\x75\x24\x6c\x54\xa7\x0e\x4d\x1d"
18149                         "\x01\xbf\x08\xac\xcf\x7f\x2c\xe3"
18150                         "\x14\x89\x5e\x70\x5a\x99\x92\xcd"
18151                         "\x01\x84\xc8\xd2\xab\xe5\x4f\x58"
18152                         "\xe7\x0f\x2f\x0e\xff\x68\xea\xfd"
18153                         "\x15\xb3\x17\xe6\xb0\xe7\x85\xd8"
18154                         "\x23\x2e\x05\xc7\xc9\xc4\x46\x1f"
18155                         "\xe1\x9e\x49\x20\x23\x24\x4d\x7e"
18156                         "\x29\x65\xff\xf4\xb6\xfd\x1a\x85"
18157                         "\xc4\x16\xec\xfc\xea\x7b\xd6\x2c"
18158                         "\x43\xf8\xb7\xbf\x79\xc0\x85\xcd"
18159                         "\xef\xe1\x98\xd3\xa5\xf7\x90\x8c"
18160                         "\xe9\x7f\x80\x6b\xd2\xac\x4c\x30"
18161                         "\xa7\xc6\x61\x6c\xd2\xf9\x2c\xff"
18162                         "\x30\xbc\x22\x81\x7d\x93\x12\xe4"
18163                         "\x0a\xcd\xaf\xdd\xe8\xab\x0a\x1e"
18164                         "\x13\xa4\x27\xc3\x5f\xf7\x4b\xbb"
18165                         "\x37\x09\x4b\x91\x6f\x92\x4f\xaf"
18166                         "\x52\xee\xdf\xef\x09\x6f\xf7\x5c"
18167                         "\x6e\x12\x17\x72\x63\x57\xc7\xba"
18168                         "\x3b\x6b\x38\x32\x73\x1b\x9c\x80"
18169                         "\xc1\x7a\xc6\xcf\xcd\x35\xc0\x6b"
18170                         "\x31\x1a\x6b\xe9\xd8\x2c\x29\x3f"
18171                         "\x96\xfb\xb6\xcd\x13\x91\x3b\xc2"
18172                         "\xd2\xa3\x31\x8d\xa4\xcd\x57\xcd"
18173                         "\x13\x3d\x64\xfd\x06\xce\xe6\xdc"
18174                         "\x0c\x24\x43\x31\x40\x57\xf1\x72"
18175                         "\x17\xe3\x3a\x63\x6d\x35\xcf\x5d"
18176                         "\x97\x40\x59\xdd\xf7\x3c\x02\xf7"
18177                         "\x1c\x7e\x05\xbb\xa9\x0d\x01\xb1"
18178                         "\x8e\xc0\x30\xa9\x53\x24\xc9\x89"
18179                         "\x84\x6d\xaa\xd0\xcd\x91\xc2\x4d"
18180                         "\x91\xb0\x89\xe2\xbf\x83\x44\xaa"
18181                         "\x28\x72\x23\xa0\xc2\xad\xad\x1c"
18182                         "\xfc\x3f\x09\x7a\x0b\xdc\xc5\x1b"
18183                         "\x87\x13\xc6\x5b\x59\x8d\xf2\xc8"
18184                         "\xaf\xdf\x11\x95",
18185                 .rlen   = 4100,
18186                 .np     = 2,
18187                 .tap    = { 4064, 36 },
18188         },
18189 };
18190
18191 /*
18192  * CTS (Cipher Text Stealing) mode tests
18193  */
18194 #define CTS_MODE_ENC_TEST_VECTORS 6
18195 #define CTS_MODE_DEC_TEST_VECTORS 6
18196 static struct cipher_testvec cts_mode_enc_tv_template[] = {
18197         { /* from rfc3962 */
18198                 .klen   = 16,
18199                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18200                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18201                 .ilen   = 17,
18202                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18203                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18204                           "\x20",
18205                 .rlen   = 17,
18206                 .result = "\xc6\x35\x35\x68\xf2\xbf\x8c\xb4"
18207                           "\xd8\xa5\x80\x36\x2d\xa7\xff\x7f"
18208                           "\x97",
18209         }, {
18210                 .klen   = 16,
18211                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18212                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18213                 .ilen   = 31,
18214                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18215                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18216                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18217                           "\x20\x47\x61\x75\x27\x73\x20",
18218                 .rlen   = 31,
18219                 .result = "\xfc\x00\x78\x3e\x0e\xfd\xb2\xc1"
18220                           "\xd4\x45\xd4\xc8\xef\xf7\xed\x22"
18221                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18222                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5",
18223         }, {
18224                 .klen   = 16,
18225                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18226                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18227                 .ilen   = 32,
18228                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18229                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18230                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18231                           "\x20\x47\x61\x75\x27\x73\x20\x43",
18232                 .rlen   = 32,
18233                 .result = "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18234                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
18235                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18236                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84",
18237         }, {
18238                 .klen   = 16,
18239                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18240                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18241                 .ilen   = 47,
18242                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18243                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18244                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18245                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18246                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18247                           "\x70\x6c\x65\x61\x73\x65\x2c",
18248                 .rlen   = 47,
18249                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18250                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18251                           "\xb3\xff\xfd\x94\x0c\x16\xa1\x8c"
18252                           "\x1b\x55\x49\xd2\xf8\x38\x02\x9e"
18253                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18254                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5",
18255         }, {
18256                 .klen   = 16,
18257                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18258                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18259                 .ilen   = 48,
18260                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18261                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18262                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18263                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18264                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18265                           "\x70\x6c\x65\x61\x73\x65\x2c\x20",
18266                 .rlen   = 48,
18267                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18268                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18269                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
18270                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8"
18271                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18272                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8",
18273         }, {
18274                 .klen   = 16,
18275                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18276                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18277                 .ilen   = 64,
18278                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18279                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18280                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18281                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18282                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18283                           "\x70\x6c\x65\x61\x73\x65\x2c\x20"
18284                           "\x61\x6e\x64\x20\x77\x6f\x6e\x74"
18285                           "\x6f\x6e\x20\x73\x6f\x75\x70\x2e",
18286                 .rlen   = 64,
18287                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18288                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18289                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18290                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
18291                           "\x48\x07\xef\xe8\x36\xee\x89\xa5"
18292                           "\x26\x73\x0d\xbc\x2f\x7b\xc8\x40"
18293                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
18294                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8",
18295         }
18296 };
18297
18298 static struct cipher_testvec cts_mode_dec_tv_template[] = {
18299         { /* from rfc3962 */
18300                 .klen   = 16,
18301                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18302                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18303                 .rlen   = 17,
18304                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18305                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18306                           "\x20",
18307                 .ilen   = 17,
18308                 .input  = "\xc6\x35\x35\x68\xf2\xbf\x8c\xb4"
18309                           "\xd8\xa5\x80\x36\x2d\xa7\xff\x7f"
18310                           "\x97",
18311         }, {
18312                 .klen   = 16,
18313                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18314                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18315                 .rlen   = 31,
18316                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18317                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18318                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18319                           "\x20\x47\x61\x75\x27\x73\x20",
18320                 .ilen   = 31,
18321                 .input  = "\xfc\x00\x78\x3e\x0e\xfd\xb2\xc1"
18322                           "\xd4\x45\xd4\xc8\xef\xf7\xed\x22"
18323                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18324                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5",
18325         }, {
18326                 .klen   = 16,
18327                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18328                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18329                 .rlen   = 32,
18330                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18331                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18332                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18333                           "\x20\x47\x61\x75\x27\x73\x20\x43",
18334                 .ilen   = 32,
18335                 .input  = "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18336                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
18337                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18338                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84",
18339         }, {
18340                 .klen   = 16,
18341                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18342                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18343                 .rlen   = 47,
18344                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18345                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18346                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18347                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18348                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18349                           "\x70\x6c\x65\x61\x73\x65\x2c",
18350                 .ilen   = 47,
18351                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18352                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18353                           "\xb3\xff\xfd\x94\x0c\x16\xa1\x8c"
18354                           "\x1b\x55\x49\xd2\xf8\x38\x02\x9e"
18355                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18356                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5",
18357         }, {
18358                 .klen   = 16,
18359                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18360                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18361                 .rlen   = 48,
18362                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18363                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18364                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18365                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18366                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18367                           "\x70\x6c\x65\x61\x73\x65\x2c\x20",
18368                 .ilen   = 48,
18369                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18370                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18371                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
18372                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8"
18373                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18374                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8",
18375         }, {
18376                 .klen   = 16,
18377                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
18378                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
18379                 .rlen   = 64,
18380                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
18381                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
18382                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
18383                           "\x20\x47\x61\x75\x27\x73\x20\x43"
18384                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
18385                           "\x70\x6c\x65\x61\x73\x65\x2c\x20"
18386                           "\x61\x6e\x64\x20\x77\x6f\x6e\x74"
18387                           "\x6f\x6e\x20\x73\x6f\x75\x70\x2e",
18388                 .ilen   = 64,
18389                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
18390                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
18391                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
18392                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
18393                           "\x48\x07\xef\xe8\x36\xee\x89\xa5"
18394                           "\x26\x73\x0d\xbc\x2f\x7b\xc8\x40"
18395                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
18396                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8",
18397         }
18398 };
18399
18400 /*
18401  * Compression stuff.
18402  */
18403 #define COMP_BUF_SIZE           512
18404
18405 struct comp_testvec {
18406         int inlen, outlen;
18407         char input[COMP_BUF_SIZE];
18408         char output[COMP_BUF_SIZE];
18409 };
18410
18411 struct pcomp_testvec {
18412         void *params;
18413         unsigned int paramsize;
18414         int inlen, outlen;
18415         char input[COMP_BUF_SIZE];
18416         char output[COMP_BUF_SIZE];
18417 };
18418
18419 /*
18420  * Deflate test vectors (null-terminated strings).
18421  * Params: winbits=-11, Z_DEFAULT_COMPRESSION, MAX_MEM_LEVEL.
18422  */
18423
18424 #define DEFLATE_COMP_TEST_VECTORS 2
18425 #define DEFLATE_DECOMP_TEST_VECTORS 2
18426
18427 static struct comp_testvec deflate_comp_tv_template[] = {
18428         {
18429                 .inlen  = 70,
18430                 .outlen = 38,
18431                 .input  = "Join us now and share the software "
18432                         "Join us now and share the software ",
18433                 .output = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
18434                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
18435                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
18436                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
18437                           "\x71\xbc\x08\x2b\x01\x00",
18438         }, {
18439                 .inlen  = 191,
18440                 .outlen = 122,
18441                 .input  = "This document describes a compression method based on the DEFLATE"
18442                         "compression algorithm.  This document defines the application of "
18443                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
18444                 .output = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
18445                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
18446                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
18447                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
18448                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
18449                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
18450                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
18451                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
18452                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
18453                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
18454                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
18455                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
18456                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
18457                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
18458                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
18459                           "\xfa\x02",
18460         },
18461 };
18462
18463 static struct comp_testvec deflate_decomp_tv_template[] = {
18464         {
18465                 .inlen  = 122,
18466                 .outlen = 191,
18467                 .input  = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
18468                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
18469                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
18470                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
18471                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
18472                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
18473                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
18474                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
18475                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
18476                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
18477                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
18478                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
18479                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
18480                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
18481                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
18482                           "\xfa\x02",
18483                 .output = "This document describes a compression method based on the DEFLATE"
18484                         "compression algorithm.  This document defines the application of "
18485                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
18486         }, {
18487                 .inlen  = 38,
18488                 .outlen = 70,
18489                 .input  = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
18490                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
18491                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
18492                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
18493                           "\x71\xbc\x08\x2b\x01\x00",
18494                 .output = "Join us now and share the software "
18495                         "Join us now and share the software ",
18496         },
18497 };
18498
18499 #define ZLIB_COMP_TEST_VECTORS 2
18500 #define ZLIB_DECOMP_TEST_VECTORS 2
18501
18502 static const struct {
18503         struct nlattr nla;
18504         int val;
18505 } deflate_comp_params[] = {
18506         {
18507                 .nla = {
18508                         .nla_len        = NLA_HDRLEN + sizeof(int),
18509                         .nla_type       = ZLIB_COMP_LEVEL,
18510                 },
18511                 .val                    = Z_DEFAULT_COMPRESSION,
18512         }, {
18513                 .nla = {
18514                         .nla_len        = NLA_HDRLEN + sizeof(int),
18515                         .nla_type       = ZLIB_COMP_METHOD,
18516                 },
18517                 .val                    = Z_DEFLATED,
18518         }, {
18519                 .nla = {
18520                         .nla_len        = NLA_HDRLEN + sizeof(int),
18521                         .nla_type       = ZLIB_COMP_WINDOWBITS,
18522                 },
18523                 .val                    = -11,
18524         }, {
18525                 .nla = {
18526                         .nla_len        = NLA_HDRLEN + sizeof(int),
18527                         .nla_type       = ZLIB_COMP_MEMLEVEL,
18528                 },
18529                 .val                    = MAX_MEM_LEVEL,
18530         }, {
18531                 .nla = {
18532                         .nla_len        = NLA_HDRLEN + sizeof(int),
18533                         .nla_type       = ZLIB_COMP_STRATEGY,
18534                 },
18535                 .val                    = Z_DEFAULT_STRATEGY,
18536         }
18537 };
18538
18539 static const struct {
18540         struct nlattr nla;
18541         int val;
18542 } deflate_decomp_params[] = {
18543         {
18544                 .nla = {
18545                         .nla_len        = NLA_HDRLEN + sizeof(int),
18546                         .nla_type       = ZLIB_DECOMP_WINDOWBITS,
18547                 },
18548                 .val                    = -11,
18549         }
18550 };
18551
18552 static struct pcomp_testvec zlib_comp_tv_template[] = {
18553         {
18554                 .params = &deflate_comp_params,
18555                 .paramsize = sizeof(deflate_comp_params),
18556                 .inlen  = 70,
18557                 .outlen = 38,
18558                 .input  = "Join us now and share the software "
18559                         "Join us now and share the software ",
18560                 .output = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
18561                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
18562                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
18563                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
18564                           "\x71\xbc\x08\x2b\x01\x00",
18565         }, {
18566                 .params = &deflate_comp_params,
18567                 .paramsize = sizeof(deflate_comp_params),
18568                 .inlen  = 191,
18569                 .outlen = 122,
18570                 .input  = "This document describes a compression method based on the DEFLATE"
18571                         "compression algorithm.  This document defines the application of "
18572                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
18573                 .output = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
18574                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
18575                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
18576                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
18577                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
18578                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
18579                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
18580                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
18581                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
18582                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
18583                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
18584                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
18585                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
18586                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
18587                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
18588                           "\xfa\x02",
18589         },
18590 };
18591
18592 static struct pcomp_testvec zlib_decomp_tv_template[] = {
18593         {
18594                 .params = &deflate_decomp_params,
18595                 .paramsize = sizeof(deflate_decomp_params),
18596                 .inlen  = 122,
18597                 .outlen = 191,
18598                 .input  = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
18599                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
18600                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
18601                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
18602                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
18603                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
18604                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
18605                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
18606                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
18607                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
18608                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
18609                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
18610                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
18611                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
18612                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
18613                           "\xfa\x02",
18614                 .output = "This document describes a compression method based on the DEFLATE"
18615                         "compression algorithm.  This document defines the application of "
18616                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
18617         }, {
18618                 .params = &deflate_decomp_params,
18619                 .paramsize = sizeof(deflate_decomp_params),
18620                 .inlen  = 38,
18621                 .outlen = 70,
18622                 .input  = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
18623                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
18624                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
18625                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
18626                           "\x71\xbc\x08\x2b\x01\x00",
18627                 .output = "Join us now and share the software "
18628                         "Join us now and share the software ",
18629         },
18630 };
18631
18632 /*
18633  * LZO test vectors (null-terminated strings).
18634  */
18635 #define LZO_COMP_TEST_VECTORS 2
18636 #define LZO_DECOMP_TEST_VECTORS 2
18637
18638 static struct comp_testvec lzo_comp_tv_template[] = {
18639         {
18640                 .inlen  = 70,
18641                 .outlen = 46,
18642                 .input  = "Join us now and share the software "
18643                         "Join us now and share the software ",
18644                 .output = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
18645                         "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
18646                         "\x64\x20\x73\x68\x61\x72\x65\x20"
18647                         "\x74\x68\x65\x20\x73\x6f\x66\x74"
18648                         "\x77\x70\x01\x01\x4a\x6f\x69\x6e"
18649                         "\x3d\x88\x00\x11\x00\x00",
18650         }, {
18651                 .inlen  = 159,
18652                 .outlen = 133,
18653                 .input  = "This document describes a compression method based on the LZO "
18654                         "compression algorithm.  This document defines the application of "
18655                         "the LZO algorithm used in UBIFS.",
18656                 .output = "\x00\x2b\x54\x68\x69\x73\x20\x64"
18657                           "\x6f\x63\x75\x6d\x65\x6e\x74\x20"
18658                           "\x64\x65\x73\x63\x72\x69\x62\x65"
18659                           "\x73\x20\x61\x20\x63\x6f\x6d\x70"
18660                           "\x72\x65\x73\x73\x69\x6f\x6e\x20"
18661                           "\x6d\x65\x74\x68\x6f\x64\x20\x62"
18662                           "\x61\x73\x65\x64\x20\x6f\x6e\x20"
18663                           "\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
18664                           "\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
18665                           "\x69\x74\x68\x6d\x2e\x20\x20\x54"
18666                           "\x68\x69\x73\x2a\x54\x01\x02\x66"
18667                           "\x69\x6e\x65\x73\x94\x06\x05\x61"
18668                           "\x70\x70\x6c\x69\x63\x61\x74\x76"
18669                           "\x0a\x6f\x66\x88\x02\x60\x09\x27"
18670                           "\xf0\x00\x0c\x20\x75\x73\x65\x64"
18671                           "\x20\x69\x6e\x20\x55\x42\x49\x46"
18672                           "\x53\x2e\x11\x00\x00",
18673         },
18674 };
18675
18676 static struct comp_testvec lzo_decomp_tv_template[] = {
18677         {
18678                 .inlen  = 133,
18679                 .outlen = 159,
18680                 .input  = "\x00\x2b\x54\x68\x69\x73\x20\x64"
18681                           "\x6f\x63\x75\x6d\x65\x6e\x74\x20"
18682                           "\x64\x65\x73\x63\x72\x69\x62\x65"
18683                           "\x73\x20\x61\x20\x63\x6f\x6d\x70"
18684                           "\x72\x65\x73\x73\x69\x6f\x6e\x20"
18685                           "\x6d\x65\x74\x68\x6f\x64\x20\x62"
18686                           "\x61\x73\x65\x64\x20\x6f\x6e\x20"
18687                           "\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
18688                           "\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
18689                           "\x69\x74\x68\x6d\x2e\x20\x20\x54"
18690                           "\x68\x69\x73\x2a\x54\x01\x02\x66"
18691                           "\x69\x6e\x65\x73\x94\x06\x05\x61"
18692                           "\x70\x70\x6c\x69\x63\x61\x74\x76"
18693                           "\x0a\x6f\x66\x88\x02\x60\x09\x27"
18694                           "\xf0\x00\x0c\x20\x75\x73\x65\x64"
18695                           "\x20\x69\x6e\x20\x55\x42\x49\x46"
18696                           "\x53\x2e\x11\x00\x00",
18697                 .output = "This document describes a compression method based on the LZO "
18698                         "compression algorithm.  This document defines the application of "
18699                         "the LZO algorithm used in UBIFS.",
18700         }, {
18701                 .inlen  = 46,
18702                 .outlen = 70,
18703                 .input  = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
18704                           "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
18705                           "\x64\x20\x73\x68\x61\x72\x65\x20"
18706                           "\x74\x68\x65\x20\x73\x6f\x66\x74"
18707                           "\x77\x70\x01\x01\x4a\x6f\x69\x6e"
18708                           "\x3d\x88\x00\x11\x00\x00",
18709                 .output = "Join us now and share the software "
18710                         "Join us now and share the software ",
18711         },
18712 };
18713
18714 /*
18715  * Michael MIC test vectors from IEEE 802.11i
18716  */
18717 #define MICHAEL_MIC_TEST_VECTORS 6
18718
18719 static struct hash_testvec michael_mic_tv_template[] = {
18720         {
18721                 .key = "\x00\x00\x00\x00\x00\x00\x00\x00",
18722                 .ksize = 8,
18723                 .plaintext = zeroed_string,
18724                 .psize = 0,
18725                 .digest = "\x82\x92\x5c\x1c\xa1\xd1\x30\xb8",
18726         },
18727         {
18728                 .key = "\x82\x92\x5c\x1c\xa1\xd1\x30\xb8",
18729                 .ksize = 8,
18730                 .plaintext = "M",
18731                 .psize = 1,
18732                 .digest = "\x43\x47\x21\xca\x40\x63\x9b\x3f",
18733         },
18734         {
18735                 .key = "\x43\x47\x21\xca\x40\x63\x9b\x3f",
18736                 .ksize = 8,
18737                 .plaintext = "Mi",
18738                 .psize = 2,
18739                 .digest = "\xe8\xf9\xbe\xca\xe9\x7e\x5d\x29",
18740         },
18741         {
18742                 .key = "\xe8\xf9\xbe\xca\xe9\x7e\x5d\x29",
18743                 .ksize = 8,
18744                 .plaintext = "Mic",
18745                 .psize = 3,
18746                 .digest = "\x90\x03\x8f\xc6\xcf\x13\xc1\xdb",
18747         },
18748         {
18749                 .key = "\x90\x03\x8f\xc6\xcf\x13\xc1\xdb",
18750                 .ksize = 8,
18751                 .plaintext = "Mich",
18752                 .psize = 4,
18753                 .digest = "\xd5\x5e\x10\x05\x10\x12\x89\x86",
18754         },
18755         {
18756                 .key = "\xd5\x5e\x10\x05\x10\x12\x89\x86",
18757                 .ksize = 8,
18758                 .plaintext = "Michael",
18759                 .psize = 7,
18760                 .digest = "\x0a\x94\x2b\x12\x4e\xca\xa5\x46",
18761         }
18762 };
18763
18764 /*
18765  * CRC32C test vectors
18766  */
18767 #define CRC32C_TEST_VECTORS 14
18768
18769 static struct hash_testvec crc32c_tv_template[] = {
18770         {
18771                 .psize = 0,
18772                 .digest = "\x00\x00\x00\x00",
18773         },
18774         {
18775                 .key = "\x87\xa9\xcb\xed",
18776                 .ksize = 4,
18777                 .psize = 0,
18778                 .digest = "\x78\x56\x34\x12",
18779         },
18780         {
18781                 .key = "\xff\xff\xff\xff",
18782                 .ksize = 4,
18783                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18784                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18785                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18786                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18787                              "\x21\x22\x23\x24\x25\x26\x27\x28",
18788                 .psize = 40,
18789                 .digest = "\x7f\x15\x2c\x0e",
18790         },
18791         {
18792                 .key = "\xff\xff\xff\xff",
18793                 .ksize = 4,
18794                 .plaintext = "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
18795                              "\x31\x32\x33\x34\x35\x36\x37\x38"
18796                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
18797                              "\x41\x42\x43\x44\x45\x46\x47\x48"
18798                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50",
18799                 .psize = 40,
18800                 .digest = "\xf6\xeb\x80\xe9",
18801         },
18802         {
18803                 .key = "\xff\xff\xff\xff",
18804                 .ksize = 4,
18805                 .plaintext = "\x51\x52\x53\x54\x55\x56\x57\x58"
18806                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
18807                              "\x61\x62\x63\x64\x65\x66\x67\x68"
18808                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
18809                              "\x71\x72\x73\x74\x75\x76\x77\x78",
18810                 .psize = 40,
18811                 .digest = "\xed\xbd\x74\xde",
18812         },
18813         {
18814                 .key = "\xff\xff\xff\xff",
18815                 .ksize = 4,
18816                 .plaintext = "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
18817                              "\x81\x82\x83\x84\x85\x86\x87\x88"
18818                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
18819                              "\x91\x92\x93\x94\x95\x96\x97\x98"
18820                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0",
18821                 .psize = 40,
18822                 .digest = "\x62\xc8\x79\xd5",
18823         },
18824         {
18825                 .key = "\xff\xff\xff\xff",
18826                 .ksize = 4,
18827                 .plaintext = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
18828                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
18829                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
18830                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
18831                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8",
18832                 .psize = 40,
18833                 .digest = "\xd0\x9a\x97\xba",
18834         },
18835         {
18836                 .key = "\xff\xff\xff\xff",
18837                 .ksize = 4,
18838                 .plaintext = "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
18839                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
18840                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
18841                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
18842                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
18843                 .psize = 40,
18844                 .digest = "\x13\xd9\x29\x2b",
18845         },
18846         {
18847                 .key = "\x80\xea\xd3\xf1",
18848                 .ksize = 4,
18849                 .plaintext = "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
18850                              "\x31\x32\x33\x34\x35\x36\x37\x38"
18851                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
18852                              "\x41\x42\x43\x44\x45\x46\x47\x48"
18853                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50",
18854                 .psize = 40,
18855                 .digest = "\x0c\xb5\xe2\xa2",
18856         },
18857         {
18858                 .key = "\xf3\x4a\x1d\x5d",
18859                 .ksize = 4,
18860                 .plaintext = "\x51\x52\x53\x54\x55\x56\x57\x58"
18861                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
18862                              "\x61\x62\x63\x64\x65\x66\x67\x68"
18863                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
18864                              "\x71\x72\x73\x74\x75\x76\x77\x78",
18865                 .psize = 40,
18866                 .digest = "\xd1\x7f\xfb\xa6",
18867         },
18868         {
18869                 .key = "\x2e\x80\x04\x59",
18870                 .ksize = 4,
18871                 .plaintext = "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
18872                              "\x81\x82\x83\x84\x85\x86\x87\x88"
18873                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
18874                              "\x91\x92\x93\x94\x95\x96\x97\x98"
18875                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0",
18876                 .psize = 40,
18877                 .digest = "\x59\x33\xe6\x7a",
18878         },
18879         {
18880                 .key = "\xa6\xcc\x19\x85",
18881                 .ksize = 4,
18882                 .plaintext = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
18883                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
18884                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
18885                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
18886                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8",
18887                 .psize = 40,
18888                 .digest = "\xbe\x03\x01\xd2",
18889         },
18890         {
18891                 .key = "\x41\xfc\xfe\x2d",
18892                 .ksize = 4,
18893                 .plaintext = "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
18894                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
18895                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
18896                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
18897                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
18898                 .psize = 40,
18899                 .digest = "\x75\xd3\xc5\x24",
18900         },
18901         {
18902                 .key = "\xff\xff\xff\xff",
18903                 .ksize = 4,
18904                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18905                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18906                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18907                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18908                              "\x21\x22\x23\x24\x25\x26\x27\x28"
18909                              "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
18910                              "\x31\x32\x33\x34\x35\x36\x37\x38"
18911                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
18912                              "\x41\x42\x43\x44\x45\x46\x47\x48"
18913                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50"
18914                              "\x51\x52\x53\x54\x55\x56\x57\x58"
18915                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
18916                              "\x61\x62\x63\x64\x65\x66\x67\x68"
18917                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
18918                              "\x71\x72\x73\x74\x75\x76\x77\x78"
18919                              "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
18920                              "\x81\x82\x83\x84\x85\x86\x87\x88"
18921                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
18922                              "\x91\x92\x93\x94\x95\x96\x97\x98"
18923                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0"
18924                              "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
18925                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
18926                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
18927                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
18928                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8"
18929                              "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
18930                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
18931                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
18932                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
18933                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
18934                 .psize = 240,
18935                 .digest = "\x75\xd3\xc5\x24",
18936                 .np = 2,
18937                 .tap = { 31, 209 }
18938         },
18939 };
18940
18941 /*
18942  * Blakcifn CRC test vectors
18943  */
18944 #define BFIN_CRC_TEST_VECTORS 6
18945
18946 static struct hash_testvec bfin_crc_tv_template[] = {
18947         {
18948                 .psize = 0,
18949                 .digest = "\x00\x00\x00\x00",
18950         },
18951         {
18952                 .key = "\x87\xa9\xcb\xed",
18953                 .ksize = 4,
18954                 .psize = 0,
18955                 .digest = "\x87\xa9\xcb\xed",
18956         },
18957         {
18958                 .key = "\xff\xff\xff\xff",
18959                 .ksize = 4,
18960                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18961                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18962                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18963                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18964                              "\x21\x22\x23\x24\x25\x26\x27\x28",
18965                 .psize = 40,
18966                 .digest = "\x84\x0c\x8d\xa2",
18967         },
18968         {
18969                 .key = "\xff\xff\xff\xff",
18970                 .ksize = 4,
18971                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18972                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18973                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18974                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18975                              "\x21\x22\x23\x24\x25\x26",
18976                 .psize = 38,
18977                 .digest = "\x8c\x58\xec\xb7",
18978         },
18979         {
18980                 .key = "\xff\xff\xff\xff",
18981                 .ksize = 4,
18982                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18983                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18984                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18985                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18986                              "\x21\x22\x23\x24\x25\x26\x27",
18987                 .psize = 39,
18988                 .digest = "\xdc\x50\x28\x7b",
18989         },
18990         {
18991                 .key = "\xff\xff\xff\xff",
18992                 .ksize = 4,
18993                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
18994                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
18995                              "\x11\x12\x13\x14\x15\x16\x17\x18"
18996                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
18997                              "\x21\x22\x23\x24\x25\x26\x27\x28"
18998                              "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
18999                              "\x31\x32\x33\x34\x35\x36\x37\x38"
19000                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
19001                              "\x41\x42\x43\x44\x45\x46\x47\x48"
19002                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50"
19003                              "\x51\x52\x53\x54\x55\x56\x57\x58"
19004                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
19005                              "\x61\x62\x63\x64\x65\x66\x67\x68"
19006                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
19007                              "\x71\x72\x73\x74\x75\x76\x77\x78"
19008                              "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
19009                              "\x81\x82\x83\x84\x85\x86\x87\x88"
19010                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
19011                              "\x91\x92\x93\x94\x95\x96\x97\x98"
19012                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0"
19013                              "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
19014                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
19015                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
19016                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
19017                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8"
19018                              "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
19019                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
19020                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
19021                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
19022                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
19023                 .psize = 240,
19024                 .digest = "\x10\x19\x4a\x5c",
19025                 .np = 2,
19026                 .tap = { 31, 209 }
19027         },
19028
19029 };
19030
19031 #endif  /* _CRYPTO_TESTMGR_H */