crypto: xts: add interface for parallelized cipher implementations
[linux-flexiantxendom0-3.2.10.git] / 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 fail;
57         unsigned char wk; /* weak key flag */
58         unsigned char klen;
59         unsigned short ilen;
60         unsigned short rlen;
61 };
62
63 struct aead_testvec {
64         char *key;
65         char *iv;
66         char *input;
67         char *assoc;
68         char *result;
69         unsigned char tap[MAX_TAP];
70         unsigned char atap[MAX_TAP];
71         int np;
72         int anp;
73         unsigned char fail;
74         unsigned char novrfy;   /* ccm dec verification failure expected */
75         unsigned char wk; /* weak key flag */
76         unsigned char klen;
77         unsigned short ilen;
78         unsigned short alen;
79         unsigned short rlen;
80 };
81
82 struct cprng_testvec {
83         char *key;
84         char *dt;
85         char *v;
86         char *result;
87         unsigned char klen;
88         unsigned short dtlen;
89         unsigned short vlen;
90         unsigned short rlen;
91         unsigned short loops;
92 };
93
94 static char zeroed_string[48];
95
96 /*
97  * MD4 test vectors from RFC1320
98  */
99 #define MD4_TEST_VECTORS        7
100
101 static struct hash_testvec md4_tv_template [] = {
102         {
103                 .plaintext = "",
104                 .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
105                           "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
106         }, {
107                 .plaintext = "a",
108                 .psize  = 1,
109                 .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
110                           "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
111         }, {
112                 .plaintext = "abc",
113                 .psize  = 3,
114                 .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
115                           "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
116         }, {
117                 .plaintext = "message digest",
118                 .psize  = 14,
119                 .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
120                         "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
121         }, {
122                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
123                 .psize  = 26,
124                 .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
125                           "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
126                 .np     = 2,
127                 .tap    = { 13, 13 },
128         }, {
129                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
130                 .psize  = 62,
131                 .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
132                           "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
133         }, {
134                 .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
135                            "45678901234567890",
136                 .psize  = 80,
137                 .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
138                           "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
139         },
140 };
141
142 /*
143  * MD5 test vectors from RFC1321
144  */
145 #define MD5_TEST_VECTORS        7
146
147 static struct hash_testvec md5_tv_template[] = {
148         {
149                 .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
150                           "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
151         }, {
152                 .plaintext = "a",
153                 .psize  = 1,
154                 .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
155                           "\x31\xc3\x99\xe2\x69\x77\x26\x61",
156         }, {
157                 .plaintext = "abc",
158                 .psize  = 3,
159                 .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
160                           "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
161         }, {
162                 .plaintext = "message digest",
163                 .psize  = 14,
164                 .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
165                           "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
166         }, {
167                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
168                 .psize  = 26,
169                 .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
170                           "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
171                 .np     = 2,
172                 .tap    = {13, 13}
173         }, {
174                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
175                 .psize  = 62,
176                 .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
177                           "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
178         }, {
179                 .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
180                            "345678901234567890",
181                 .psize  = 80,
182                 .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
183                           "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
184         }
185
186 };
187
188 /*
189  * RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
190  */
191 #define RMD128_TEST_VECTORS     10
192
193 static struct hash_testvec rmd128_tv_template[] = {
194         {
195                 .digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
196                           "\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
197         }, {
198                 .plaintext = "a",
199                 .psize  = 1,
200                 .digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
201                           "\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
202         }, {
203                 .plaintext = "abc",
204                 .psize  = 3,
205                 .digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
206                           "\x84\x63\x6b\x0f\x69\x14\x4c\x77",
207         }, {
208                 .plaintext = "message digest",
209                 .psize  = 14,
210                 .digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
211                           "\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
212         }, {
213                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
214                 .psize  = 26,
215                 .digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
216                           "\x10\x71\x49\x22\xb3\x71\x83\x4e",
217         }, {
218                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
219                              "fghijklmnopqrstuvwxyz0123456789",
220                 .psize  = 62,
221                 .digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
222                           "\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
223         }, {
224                 .plaintext = "1234567890123456789012345678901234567890"
225                              "1234567890123456789012345678901234567890",
226                 .psize  = 80,
227                 .digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
228                           "\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
229         }, {
230                 .plaintext = "abcdbcdecdefdefgefghfghighij"
231                              "hijkijkljklmklmnlmnomnopnopq",
232                 .psize  = 56,
233                 .digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
234                           "\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
235                 .np     = 2,
236                 .tap    = { 28, 28 },
237         }, {
238                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
239                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
240                              "lmnopqrsmnopqrstnopqrstu",
241                 .psize  = 112,
242                 .digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
243                           "\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
244         }, {
245                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
246                 .psize  = 32,
247                 .digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
248                           "\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
249         }
250 };
251
252 /*
253  * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
254  */
255 #define RMD160_TEST_VECTORS     10
256
257 static struct hash_testvec rmd160_tv_template[] = {
258         {
259                 .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
260                           "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
261         }, {
262                 .plaintext = "a",
263                 .psize  = 1,
264                 .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
265                           "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
266         }, {
267                 .plaintext = "abc",
268                 .psize  = 3,
269                 .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
270                           "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
271         }, {
272                 .plaintext = "message digest",
273                 .psize  = 14,
274                 .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
275                           "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
276         }, {
277                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
278                 .psize  = 26,
279                 .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
280                           "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
281         }, {
282                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
283                              "fghijklmnopqrstuvwxyz0123456789",
284                 .psize  = 62,
285                 .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
286                           "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
287         }, {
288                 .plaintext = "1234567890123456789012345678901234567890"
289                              "1234567890123456789012345678901234567890",
290                 .psize  = 80,
291                 .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
292                           "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
293         }, {
294                 .plaintext = "abcdbcdecdefdefgefghfghighij"
295                              "hijkijkljklmklmnlmnomnopnopq",
296                 .psize  = 56,
297                 .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
298                           "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
299                 .np     = 2,
300                 .tap    = { 28, 28 },
301         }, {
302                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
303                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
304                              "lmnopqrsmnopqrstnopqrstu",
305                 .psize  = 112,
306                 .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
307                           "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
308         }, {
309                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
310                 .psize  = 32,
311                 .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
312                           "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
313         }
314 };
315
316 /*
317  * RIPEMD-256 test vectors
318  */
319 #define RMD256_TEST_VECTORS     8
320
321 static struct hash_testvec rmd256_tv_template[] = {
322         {
323                 .digest = "\x02\xba\x4c\x4e\x5f\x8e\xcd\x18"
324                           "\x77\xfc\x52\xd6\x4d\x30\xe3\x7a"
325                           "\x2d\x97\x74\xfb\x1e\x5d\x02\x63"
326                           "\x80\xae\x01\x68\xe3\xc5\x52\x2d",
327         }, {
328                 .plaintext = "a",
329                 .psize  = 1,
330                 .digest = "\xf9\x33\x3e\x45\xd8\x57\xf5\xd9"
331                           "\x0a\x91\xba\xb7\x0a\x1e\xba\x0c"
332                           "\xfb\x1b\xe4\xb0\x78\x3c\x9a\xcf"
333                           "\xcd\x88\x3a\x91\x34\x69\x29\x25",
334         }, {
335                 .plaintext = "abc",
336                 .psize  = 3,
337                 .digest = "\xaf\xbd\x6e\x22\x8b\x9d\x8c\xbb"
338                           "\xce\xf5\xca\x2d\x03\xe6\xdb\xa1"
339                           "\x0a\xc0\xbc\x7d\xcb\xe4\x68\x0e"
340                           "\x1e\x42\xd2\xe9\x75\x45\x9b\x65",
341         }, {
342                 .plaintext = "message digest",
343                 .psize  = 14,
344                 .digest = "\x87\xe9\x71\x75\x9a\x1c\xe4\x7a"
345                           "\x51\x4d\x5c\x91\x4c\x39\x2c\x90"
346                           "\x18\xc7\xc4\x6b\xc1\x44\x65\x55"
347                           "\x4a\xfc\xdf\x54\xa5\x07\x0c\x0e",
348         }, {
349                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
350                 .psize  = 26,
351                 .digest = "\x64\x9d\x30\x34\x75\x1e\xa2\x16"
352                           "\x77\x6b\xf9\xa1\x8a\xcc\x81\xbc"
353                           "\x78\x96\x11\x8a\x51\x97\x96\x87"
354                           "\x82\xdd\x1f\xd9\x7d\x8d\x51\x33",
355         }, {
356                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
357                              "fghijklmnopqrstuvwxyz0123456789",
358                 .psize  = 62,
359                 .digest = "\x57\x40\xa4\x08\xac\x16\xb7\x20"
360                           "\xb8\x44\x24\xae\x93\x1c\xbb\x1f"
361                           "\xe3\x63\xd1\xd0\xbf\x40\x17\xf1"
362                           "\xa8\x9f\x7e\xa6\xde\x77\xa0\xb8",
363         }, {
364                 .plaintext = "1234567890123456789012345678901234567890"
365                              "1234567890123456789012345678901234567890",
366                 .psize  = 80,
367                 .digest = "\x06\xfd\xcc\x7a\x40\x95\x48\xaa"
368                           "\xf9\x13\x68\xc0\x6a\x62\x75\xb5"
369                           "\x53\xe3\xf0\x99\xbf\x0e\xa4\xed"
370                           "\xfd\x67\x78\xdf\x89\xa8\x90\xdd",
371         }, {
372                 .plaintext = "abcdbcdecdefdefgefghfghighij"
373                              "hijkijkljklmklmnlmnomnopnopq",
374                 .psize  = 56,
375                 .digest = "\x38\x43\x04\x55\x83\xaa\xc6\xc8"
376                           "\xc8\xd9\x12\x85\x73\xe7\xa9\x80"
377                           "\x9a\xfb\x2a\x0f\x34\xcc\xc3\x6e"
378                           "\xa9\xe7\x2f\x16\xf6\x36\x8e\x3f",
379                 .np     = 2,
380                 .tap    = { 28, 28 },
381         }
382 };
383
384 /*
385  * RIPEMD-320 test vectors
386  */
387 #define RMD320_TEST_VECTORS     8
388
389 static struct hash_testvec rmd320_tv_template[] = {
390         {
391                 .digest = "\x22\xd6\x5d\x56\x61\x53\x6c\xdc\x75\xc1"
392                           "\xfd\xf5\xc6\xde\x7b\x41\xb9\xf2\x73\x25"
393                           "\xeb\xc6\x1e\x85\x57\x17\x7d\x70\x5a\x0e"
394                           "\xc8\x80\x15\x1c\x3a\x32\xa0\x08\x99\xb8",
395         }, {
396                 .plaintext = "a",
397                 .psize  = 1,
398                 .digest = "\xce\x78\x85\x06\x38\xf9\x26\x58\xa5\xa5"
399                           "\x85\x09\x75\x79\x92\x6d\xda\x66\x7a\x57"
400                           "\x16\x56\x2c\xfc\xf6\xfb\xe7\x7f\x63\x54"
401                           "\x2f\x99\xb0\x47\x05\xd6\x97\x0d\xff\x5d",
402         }, {
403                 .plaintext = "abc",
404                 .psize  = 3,
405                 .digest = "\xde\x4c\x01\xb3\x05\x4f\x89\x30\xa7\x9d"
406                           "\x09\xae\x73\x8e\x92\x30\x1e\x5a\x17\x08"
407                           "\x5b\xef\xfd\xc1\xb8\xd1\x16\x71\x3e\x74"
408                           "\xf8\x2f\xa9\x42\xd6\x4c\xdb\xc4\x68\x2d",
409         }, {
410                 .plaintext = "message digest",
411                 .psize  = 14,
412                 .digest = "\x3a\x8e\x28\x50\x2e\xd4\x5d\x42\x2f\x68"
413                           "\x84\x4f\x9d\xd3\x16\xe7\xb9\x85\x33\xfa"
414                           "\x3f\x2a\x91\xd2\x9f\x84\xd4\x25\xc8\x8d"
415                           "\x6b\x4e\xff\x72\x7d\xf6\x6a\x7c\x01\x97",
416         }, {
417                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
418                 .psize  = 26,
419                 .digest = "\xca\xbd\xb1\x81\x0b\x92\x47\x0a\x20\x93"
420                           "\xaa\x6b\xce\x05\x95\x2c\x28\x34\x8c\xf4"
421                           "\x3f\xf6\x08\x41\x97\x51\x66\xbb\x40\xed"
422                           "\x23\x40\x04\xb8\x82\x44\x63\xe6\xb0\x09",
423         }, {
424                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
425                              "fghijklmnopqrstuvwxyz0123456789",
426                 .psize  = 62,
427                 .digest = "\xed\x54\x49\x40\xc8\x6d\x67\xf2\x50\xd2"
428                           "\x32\xc3\x0b\x7b\x3e\x57\x70\xe0\xc6\x0c"
429                           "\x8c\xb9\xa4\xca\xfe\x3b\x11\x38\x8a\xf9"
430                           "\x92\x0e\x1b\x99\x23\x0b\x84\x3c\x86\xa4",
431         }, {
432                 .plaintext = "1234567890123456789012345678901234567890"
433                              "1234567890123456789012345678901234567890",
434                 .psize  = 80,
435                 .digest = "\x55\x78\x88\xaf\x5f\x6d\x8e\xd6\x2a\xb6"
436                           "\x69\x45\xc6\xd2\xa0\xa4\x7e\xcd\x53\x41"
437                           "\xe9\x15\xeb\x8f\xea\x1d\x05\x24\x95\x5f"
438                           "\x82\x5d\xc7\x17\xe4\xa0\x08\xab\x2d\x42",
439         }, {
440                 .plaintext = "abcdbcdecdefdefgefghfghighij"
441                              "hijkijkljklmklmnlmnomnopnopq",
442                 .psize  = 56,
443                 .digest = "\xd0\x34\xa7\x95\x0c\xf7\x22\x02\x1b\xa4"
444                           "\xb8\x4d\xf7\x69\xa5\xde\x20\x60\xe2\x59"
445                           "\xdf\x4c\x9b\xb4\xa4\x26\x8c\x0e\x93\x5b"
446                           "\xbc\x74\x70\xa9\x69\xc9\xd0\x72\xa1\xac",
447                 .np     = 2,
448                 .tap    = { 28, 28 },
449         }
450 };
451
452 /*
453  * SHA1 test vectors  from from FIPS PUB 180-1
454  * Long vector from CAVS 5.0
455  */
456 #define SHA1_TEST_VECTORS       3
457
458 static struct hash_testvec sha1_tv_template[] = {
459         {
460                 .plaintext = "abc",
461                 .psize  = 3,
462                 .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
463                           "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
464         }, {
465                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
466                 .psize  = 56,
467                 .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
468                           "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
469                 .np     = 2,
470                 .tap    = { 28, 28 }
471         }, {
472                 .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
473                              "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
474                              "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
475                              "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
476                              "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
477                              "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
478                              "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
479                              "\x72\x28\x26\xc0\x66\x86\x9e\xda"
480                              "\xcd\x73\xb2\x54\x80\x35\x18\x58"
481                              "\x13\xe2\x26\x34\xa9\xda\x44\x00"
482                              "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
483                              "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
484                              "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
485                              "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
486                              "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
487                              "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
488                              "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
489                              "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
490                              "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
491                              "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
492                              "\x5a\x90\x11",
493                 .psize  = 163,
494                 .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
495                           "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
496                 .np     = 4,
497                 .tap    = { 63, 64, 31, 5 }
498         }
499 };
500
501
502 /*
503  * SHA224 test vectors from from FIPS PUB 180-2
504  */
505 #define SHA224_TEST_VECTORS     2
506
507 static struct hash_testvec sha224_tv_template[] = {
508         {
509                 .plaintext = "abc",
510                 .psize  = 3,
511                 .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
512                           "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
513                           "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
514                           "\xE3\x6C\x9D\xA7",
515         }, {
516                 .plaintext =
517                 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
518                 .psize  = 56,
519                 .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
520                           "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
521                           "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
522                           "\x52\x52\x25\x25",
523                 .np     = 2,
524                 .tap    = { 28, 28 }
525         }
526 };
527
528 /*
529  * SHA256 test vectors from from NIST
530  */
531 #define SHA256_TEST_VECTORS     2
532
533 static struct hash_testvec sha256_tv_template[] = {
534         {
535                 .plaintext = "abc",
536                 .psize  = 3,
537                 .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
538                           "\x41\x41\x40\xde\x5d\xae\x22\x23"
539                           "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
540                           "\xb4\x10\xff\x61\xf2\x00\x15\xad",
541         }, {
542                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
543                 .psize  = 56,
544                 .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
545                           "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
546                           "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
547                           "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
548                 .np     = 2,
549                 .tap    = { 28, 28 }
550         },
551 };
552
553 /*
554  * SHA384 test vectors from from NIST and kerneli
555  */
556 #define SHA384_TEST_VECTORS     4
557
558 static struct hash_testvec sha384_tv_template[] = {
559         {
560                 .plaintext= "abc",
561                 .psize  = 3,
562                 .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
563                           "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
564                           "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
565                           "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
566                           "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
567                           "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
568         }, {
569                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
570                 .psize  = 56,
571                 .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
572                           "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
573                           "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
574                           "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
575                           "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
576                           "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
577         }, {
578                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
579                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
580                 .psize  = 112,
581                 .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
582                           "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
583                           "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
584                           "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
585                           "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
586                           "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
587         }, {
588                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
589                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
590                 .psize  = 104,
591                 .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
592                           "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
593                           "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
594                           "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
595                           "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
596                           "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
597                 .np     = 4,
598                 .tap    = { 26, 26, 26, 26 }
599         },
600 };
601
602 /*
603  * SHA512 test vectors from from NIST and kerneli
604  */
605 #define SHA512_TEST_VECTORS     4
606
607 static struct hash_testvec sha512_tv_template[] = {
608         {
609                 .plaintext = "abc",
610                 .psize  = 3,
611                 .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
612                           "\xcc\x41\x73\x49\xae\x20\x41\x31"
613                           "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
614                           "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
615                           "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
616                           "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
617                           "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
618                           "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
619         }, {
620                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
621                 .psize  = 56,
622                 .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
623                           "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
624                           "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
625                           "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
626                           "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
627                           "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
628                           "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
629                           "\x54\xec\x63\x12\x38\xca\x34\x45",
630         }, {
631                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
632                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
633                 .psize  = 112,
634                 .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
635                           "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
636                           "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
637                           "\x72\x99\xae\xad\xb6\x88\x90\x18"
638                           "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
639                           "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
640                           "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
641                           "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
642         }, {
643                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
644                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
645                 .psize  = 104,
646                 .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
647                           "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
648                           "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
649                           "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
650                           "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
651                           "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
652                           "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
653                           "\xed\xb4\x19\x87\x23\x28\x50\xc9",
654                 .np     = 4,
655                 .tap    = { 26, 26, 26, 26 }
656         },
657 };
658
659
660 /*
661  * WHIRLPOOL test vectors from Whirlpool package
662  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
663  * submission
664  */
665 #define WP512_TEST_VECTORS      8
666
667 static struct hash_testvec wp512_tv_template[] = {
668         {
669                 .plaintext = "",
670                 .psize  = 0,
671                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
672                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
673                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
674                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
675                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
676                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
677                           "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
678                           "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
679
680
681         }, {
682                 .plaintext = "a",
683                 .psize  = 1,
684                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
685                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
686                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
687                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
688                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
689                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
690                           "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
691                           "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
692         }, {
693                 .plaintext = "abc",
694                 .psize  = 3,
695                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
696                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
697                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
698                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
699                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
700                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
701                           "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
702                           "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
703         }, {
704                 .plaintext = "message digest",
705                 .psize  = 14,
706                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
707                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
708                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
709                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
710                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
711                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
712                           "\x92\xED\x92\x00\x52\x83\x8F\x33"
713                           "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
714         }, {
715                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
716                 .psize  = 26,
717                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
718                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
719                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
720                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
721                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
722                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
723                           "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
724                           "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
725         }, {
726                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
727                            "abcdefghijklmnopqrstuvwxyz0123456789",
728                 .psize  = 62,
729                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
730                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
731                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
732                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
733                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
734                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
735                           "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
736                           "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
737         }, {
738                 .plaintext = "1234567890123456789012345678901234567890"
739                            "1234567890123456789012345678901234567890",
740                 .psize  = 80,
741                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
742                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
743                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
744                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
745                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
746                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
747                           "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
748                           "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
749         }, {
750                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
751                 .psize  = 32,
752                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
753                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
754                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
755                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
756                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
757                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
758                           "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
759                           "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
760         },
761 };
762
763 #define WP384_TEST_VECTORS      8
764
765 static struct hash_testvec wp384_tv_template[] = {
766         {
767                 .plaintext = "",
768                 .psize  = 0,
769                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
770                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
771                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
772                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
773                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
774                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
775
776
777         }, {
778                 .plaintext = "a",
779                 .psize  = 1,
780                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
781                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
782                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
783                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
784                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
785                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
786         }, {
787                 .plaintext = "abc",
788                 .psize  = 3,
789                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
790                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
791                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
792                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
793                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
794                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
795         }, {
796                 .plaintext = "message digest",
797                 .psize  = 14,
798                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
799                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
800                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
801                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
802                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
803                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
804         }, {
805                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
806                 .psize  = 26,
807                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
808                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
809                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
810                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
811                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
812                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
813         }, {
814                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
815                            "abcdefghijklmnopqrstuvwxyz0123456789",
816                 .psize  = 62,
817                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
818                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
819                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
820                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
821                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
822                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
823         }, {
824                 .plaintext = "1234567890123456789012345678901234567890"
825                            "1234567890123456789012345678901234567890",
826                 .psize  = 80,
827                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
828                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
829                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
830                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
831                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
832                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
833         }, {
834                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
835                 .psize  = 32,
836                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
837                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
838                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
839                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
840                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
841                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
842         },
843 };
844
845 #define WP256_TEST_VECTORS      8
846
847 static struct hash_testvec wp256_tv_template[] = {
848         {
849                 .plaintext = "",
850                 .psize  = 0,
851                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
852                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
853                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
854                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
855
856
857         }, {
858                 .plaintext = "a",
859                 .psize  = 1,
860                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
861                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
862                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
863                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
864         }, {
865                 .plaintext = "abc",
866                 .psize  = 3,
867                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
868                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
869                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
870                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
871         }, {
872                 .plaintext = "message digest",
873                 .psize  = 14,
874                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
875                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
876                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
877                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
878         }, {
879                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
880                 .psize  = 26,
881                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
882                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
883                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
884                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
885         }, {
886                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
887                            "abcdefghijklmnopqrstuvwxyz0123456789",
888                 .psize  = 62,
889                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
890                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
891                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
892                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
893         }, {
894                 .plaintext = "1234567890123456789012345678901234567890"
895                            "1234567890123456789012345678901234567890",
896                 .psize  = 80,
897                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
898                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
899                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
900                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
901         }, {
902                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
903                 .psize  = 32,
904                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
905                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
906                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
907                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
908         },
909 };
910
911 /*
912  * TIGER test vectors from Tiger website
913  */
914 #define TGR192_TEST_VECTORS     6
915
916 static struct hash_testvec tgr192_tv_template[] = {
917         {
918                 .plaintext = "",
919                 .psize  = 0,
920                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
921                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
922                           "\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
923         }, {
924                 .plaintext = "abc",
925                 .psize  = 3,
926                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
927                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
928                           "\x93\x5f\x7b\x95\x1c\x13\x29\x51",
929         }, {
930                 .plaintext = "Tiger",
931                 .psize  = 5,
932                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
933                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
934                           "\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
935         }, {
936                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
937                 .psize  = 64,
938                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
939                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
940                           "\xb5\x86\x44\x50\x34\xa5\xa3\x86",
941         }, {
942                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
943                 .psize  = 64,
944                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
945                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
946                           "\x57\x89\x65\x65\x97\x5f\x91\x97",
947         }, {
948                 .plaintext = "Tiger - A Fast New Hash Function, "
949                            "by Ross Anderson and Eli Biham, "
950                            "proceedings of Fast Software Encryption 3, "
951                            "Cambridge, 1996.",
952                 .psize  = 125,
953                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
954                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
955                           "\xdd\x68\x15\x1d\x50\x39\x74\xfc",
956         },
957 };
958
959 #define TGR160_TEST_VECTORS     6
960
961 static struct hash_testvec tgr160_tv_template[] = {
962         {
963                 .plaintext = "",
964                 .psize  = 0,
965                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
966                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
967                           "\xf3\x73\xde\x2d",
968         }, {
969                 .plaintext = "abc",
970                 .psize  = 3,
971                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
972                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
973                           "\x93\x5f\x7b\x95",
974         }, {
975                 .plaintext = "Tiger",
976                 .psize  = 5,
977                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
978                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
979                           "\x37\x79\x0c\x11",
980         }, {
981                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
982                 .psize  = 64,
983                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
984                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
985                           "\xb5\x86\x44\x50",
986         }, {
987                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
988                 .psize  = 64,
989                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
990                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
991                           "\x57\x89\x65\x65",
992         }, {
993                 .plaintext = "Tiger - A Fast New Hash Function, "
994                            "by Ross Anderson and Eli Biham, "
995                            "proceedings of Fast Software Encryption 3, "
996                            "Cambridge, 1996.",
997                 .psize  = 125,
998                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
999                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
1000                           "\xdd\x68\x15\x1d",
1001         },
1002 };
1003
1004 #define TGR128_TEST_VECTORS     6
1005
1006 static struct hash_testvec tgr128_tv_template[] = {
1007         {
1008                 .plaintext = "",
1009                 .psize  = 0,
1010                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
1011                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
1012         }, {
1013                 .plaintext = "abc",
1014                 .psize  = 3,
1015                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
1016                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
1017         }, {
1018                 .plaintext = "Tiger",
1019                 .psize  = 5,
1020                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
1021                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
1022         }, {
1023                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1024                 .psize  = 64,
1025                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
1026                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
1027         }, {
1028                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
1029                 .psize  = 64,
1030                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
1031                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
1032         }, {
1033                 .plaintext = "Tiger - A Fast New Hash Function, "
1034                            "by Ross Anderson and Eli Biham, "
1035                            "proceedings of Fast Software Encryption 3, "
1036                            "Cambridge, 1996.",
1037                 .psize  = 125,
1038                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
1039                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
1040         },
1041 };
1042
1043 #define GHASH_TEST_VECTORS 1
1044
1045 static struct hash_testvec ghash_tv_template[] =
1046 {
1047         {
1048
1049                 .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61",
1050                 .ksize  = 16,
1051                 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
1052                 .psize  = 16,
1053                 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
1054                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
1055         },
1056 };
1057
1058 /*
1059  * HMAC-MD5 test vectors from RFC2202
1060  * (These need to be fixed to not use strlen).
1061  */
1062 #define HMAC_MD5_TEST_VECTORS   7
1063
1064 static struct hash_testvec hmac_md5_tv_template[] =
1065 {
1066         {
1067                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1068                 .ksize  = 16,
1069                 .plaintext = "Hi There",
1070                 .psize  = 8,
1071                 .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
1072                           "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
1073         }, {
1074                 .key    = "Jefe",
1075                 .ksize  = 4,
1076                 .plaintext = "what do ya want for nothing?",
1077                 .psize  = 28,
1078                 .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
1079                           "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
1080                 .np     = 2,
1081                 .tap    = {14, 14}
1082         }, {
1083                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1084                 .ksize  = 16,
1085                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1086                         "\xdd\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",
1089                 .psize  = 50,
1090                 .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
1091                           "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
1092         }, {
1093                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1094                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1095                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1096                 .ksize  = 25,
1097                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1098                         "\xcd\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",
1101                 .psize  = 50,
1102                 .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
1103                           "\x3a\x75\x16\x47\x46\xff\xaa\x79",
1104         }, {
1105                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1106                 .ksize  = 16,
1107                 .plaintext = "Test With Truncation",
1108                 .psize  = 20,
1109                 .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
1110                           "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
1111         }, {
1112                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1113                         "\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",
1119                 .ksize  = 80,
1120                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1121                 .psize  = 54,
1122                 .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
1123                           "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
1124         }, {
1125                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1126                         "\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",
1132                 .ksize  = 80,
1133                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1134                            "Block-Size Data",
1135                 .psize  = 73,
1136                 .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
1137                           "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
1138         },
1139 };
1140
1141 /*
1142  * HMAC-RIPEMD128 test vectors from RFC2286
1143  */
1144 #define HMAC_RMD128_TEST_VECTORS        7
1145
1146 static struct hash_testvec hmac_rmd128_tv_template[] = {
1147         {
1148                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1149                 .ksize  = 16,
1150                 .plaintext = "Hi There",
1151                 .psize  = 8,
1152                 .digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
1153                           "\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
1154         }, {
1155                 .key    = "Jefe",
1156                 .ksize  = 4,
1157                 .plaintext = "what do ya want for nothing?",
1158                 .psize  = 28,
1159                 .digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
1160                           "\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
1161                 .np     = 2,
1162                 .tap    = { 14, 14 },
1163         }, {
1164                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1165                 .ksize  = 16,
1166                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1167                         "\xdd\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",
1170                 .psize  = 50,
1171                 .digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
1172                           "\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
1173         }, {
1174                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1175                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1176                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1177                 .ksize  = 25,
1178                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1179                         "\xcd\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",
1182                 .psize  = 50,
1183                 .digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
1184                           "\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
1185         }, {
1186                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1187                 .ksize  = 16,
1188                 .plaintext = "Test With Truncation",
1189                 .psize  = 20,
1190                 .digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
1191                           "\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
1192         }, {
1193                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1194                         "\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",
1200                 .ksize  = 80,
1201                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1202                 .psize  = 54,
1203                 .digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
1204                           "\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
1205         }, {
1206                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1207                         "\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",
1213                 .ksize  = 80,
1214                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1215                            "Block-Size Data",
1216                 .psize  = 73,
1217                 .digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
1218                           "\x06\x90\xc2\x37\x63\x5f\x30\xc5",
1219         },
1220 };
1221
1222 /*
1223  * HMAC-RIPEMD160 test vectors from RFC2286
1224  */
1225 #define HMAC_RMD160_TEST_VECTORS        7
1226
1227 static struct hash_testvec hmac_rmd160_tv_template[] = {
1228         {
1229                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1230                 .ksize  = 20,
1231                 .plaintext = "Hi There",
1232                 .psize  = 8,
1233                 .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
1234                           "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
1235         }, {
1236                 .key    = "Jefe",
1237                 .ksize  = 4,
1238                 .plaintext = "what do ya want for nothing?",
1239                 .psize  = 28,
1240                 .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
1241                           "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
1242                 .np     = 2,
1243                 .tap    = { 14, 14 },
1244         }, {
1245                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1246                 .ksize  = 20,
1247                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1248                         "\xdd\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",
1251                 .psize  = 50,
1252                 .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
1253                           "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
1254         }, {
1255                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1256                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1257                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1258                 .ksize  = 25,
1259                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1260                         "\xcd\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",
1263                 .psize  = 50,
1264                 .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
1265                           "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
1266         }, {
1267                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1268                 .ksize  = 20,
1269                 .plaintext = "Test With Truncation",
1270                 .psize  = 20,
1271                 .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
1272                           "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
1273         }, {
1274                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1275                         "\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",
1281                 .ksize  = 80,
1282                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1283                 .psize  = 54,
1284                 .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
1285                           "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
1286         }, {
1287                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1288                         "\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",
1294                 .ksize  = 80,
1295                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1296                            "Block-Size Data",
1297                 .psize  = 73,
1298                 .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
1299                           "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
1300         },
1301 };
1302
1303 /*
1304  * HMAC-SHA1 test vectors from RFC2202
1305  */
1306 #define HMAC_SHA1_TEST_VECTORS  7
1307
1308 static struct hash_testvec hmac_sha1_tv_template[] = {
1309         {
1310                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1311                 .ksize  = 20,
1312                 .plaintext = "Hi There",
1313                 .psize  = 8,
1314                 .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
1315                           "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
1316                           "\x46\xbe",
1317         }, {
1318                 .key    = "Jefe",
1319                 .ksize  = 4,
1320                 .plaintext = "what do ya want for nothing?",
1321                 .psize  = 28,
1322                 .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
1323                           "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
1324                 .np     = 2,
1325                 .tap    = { 14, 14 }
1326         }, {
1327                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1328                 .ksize  = 20,
1329                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1330                         "\xdd\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",
1333                 .psize  = 50,
1334                 .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
1335                           "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
1336         }, {
1337                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1338                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1339                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
1340                 .ksize  = 25,
1341                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1342                         "\xcd\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",
1345                 .psize  = 50,
1346                 .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
1347                           "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
1348         }, {
1349                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
1350                 .ksize  = 20,
1351                 .plaintext = "Test With Truncation",
1352                 .psize  = 20,
1353                 .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
1354                           "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
1355         }, {
1356                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1357                         "\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",
1363                 .ksize  = 80,
1364                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1365                 .psize  = 54,
1366                 .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
1367                           "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
1368         }, {
1369                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1370                         "\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",
1376                 .ksize  = 80,
1377                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
1378                            "Block-Size Data",
1379                 .psize  = 73,
1380                 .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
1381                           "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
1382         },
1383 };
1384
1385
1386 /*
1387  * SHA224 HMAC test vectors from RFC4231
1388  */
1389 #define HMAC_SHA224_TEST_VECTORS    4
1390
1391 static struct hash_testvec hmac_sha224_tv_template[] = {
1392         {
1393                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1394                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1395                         "\x0b\x0b\x0b\x0b",
1396                 .ksize  = 20,
1397                 /*  ("Hi There") */
1398                 .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
1399                 .psize  = 8,
1400                 .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
1401                         "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
1402                         "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
1403                         "\x53\x68\x4b\x22",
1404         }, {
1405                 .key    = "Jefe",
1406                 .ksize  = 4,
1407                 /* ("what do ya want for nothing?") */
1408                 .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
1409                         "\x79\x61\x20\x77\x61\x6e\x74\x20"
1410                         "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
1411                         "\x69\x6e\x67\x3f",
1412                 .psize  = 28,
1413                 .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
1414                         "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
1415                         "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
1416                         "\x8f\xd0\x5e\x44",
1417                 .np = 4,
1418                 .tap    = { 7, 7, 7, 7 }
1419         }, {
1420                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1421                         "\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",
1437                 .ksize  = 131,
1438                 /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
1439                 .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
1440                         "\x6e\x67\x20\x4c\x61\x72\x67\x65"
1441                         "\x72\x20\x54\x68\x61\x6e\x20\x42"
1442                         "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
1443                         "\x65\x20\x4b\x65\x79\x20\x2d\x20"
1444                         "\x48\x61\x73\x68\x20\x4b\x65\x79"
1445                         "\x20\x46\x69\x72\x73\x74",
1446                 .psize  = 54,
1447                 .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
1448                         "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
1449                         "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
1450                         "\x3f\xa6\x87\x0e",
1451         }, {
1452                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1453                         "\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",
1469                 .ksize  = 131,
1470                 /* ("This is a test using a larger than block-size key and a")
1471                 (" larger than block-size data. The key needs to be")
1472                         (" hashed before being used by the HMAC algorithm.") */
1473                 .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
1474                         "\x61\x20\x74\x65\x73\x74\x20\x75"
1475                         "\x73\x69\x6e\x67\x20\x61\x20\x6c"
1476                         "\x61\x72\x67\x65\x72\x20\x74\x68"
1477                         "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
1478                         "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
1479                         "\x79\x20\x61\x6e\x64\x20\x61\x20"
1480                         "\x6c\x61\x72\x67\x65\x72\x20\x74"
1481                         "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
1482                         "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
1483                         "\x61\x74\x61\x2e\x20\x54\x68\x65"
1484                         "\x20\x6b\x65\x79\x20\x6e\x65\x65"
1485                         "\x64\x73\x20\x74\x6f\x20\x62\x65"
1486                         "\x20\x68\x61\x73\x68\x65\x64\x20"
1487                         "\x62\x65\x66\x6f\x72\x65\x20\x62"
1488                         "\x65\x69\x6e\x67\x20\x75\x73\x65"
1489                         "\x64\x20\x62\x79\x20\x74\x68\x65"
1490                         "\x20\x48\x4d\x41\x43\x20\x61\x6c"
1491                         "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
1492                 .psize  = 152,
1493                 .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
1494                         "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
1495                         "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
1496                         "\xf6\xf5\x65\xd1",
1497         },
1498 };
1499
1500 /*
1501  * HMAC-SHA256 test vectors from
1502  * draft-ietf-ipsec-ciph-sha-256-01.txt
1503  */
1504 #define HMAC_SHA256_TEST_VECTORS        10
1505
1506 static struct hash_testvec hmac_sha256_tv_template[] = {
1507         {
1508                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1509                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1510                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1511                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1512                 .ksize  = 32,
1513                 .plaintext = "abc",
1514                 .psize  = 3,
1515                 .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
1516                           "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
1517                           "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
1518                           "\x92\x75\x90\x21\xcf\xab\x81\x81",
1519         }, {
1520                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1521                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1522                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1523                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1524                 .ksize  = 32,
1525                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1526                 .psize  = 56,
1527                 .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
1528                           "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
1529                           "\xe6\x98\xe3\x61\x19\x42\x11\x49"
1530                           "\xea\x8c\x71\x24\x56\x69\x7d\x30",
1531         }, {
1532                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1533                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1534                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1535                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
1536                 .ksize  = 32,
1537                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
1538                            "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1539                 .psize  = 112,
1540                 .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
1541                           "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
1542                           "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
1543                           "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
1544         }, {
1545                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1546                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1547                         "\x0b\x0b\x0b\x0b\x0b\x0b",
1548                 .ksize  = 32,
1549                 .plaintext = "Hi There",
1550                 .psize  = 8,
1551                 .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
1552                           "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
1553                           "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
1554                           "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
1555         }, {
1556                 .key    = "Jefe",
1557                 .ksize  = 4,
1558                 .plaintext = "what do ya want for nothing?",
1559                 .psize  = 28,
1560                 .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
1561                           "\x6a\x04\x24\x26\x08\x95\x75\xc7"
1562                           "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
1563                           "\x9d\xec\x58\xb9\x64\xec\x38\x43",
1564                 .np     = 2,
1565                 .tap    = { 14, 14 }
1566         }, {
1567                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1568                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1569                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1570                 .ksize  = 32,
1571                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1572                         "\xdd\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",
1575                 .psize  = 50,
1576                 .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
1577                           "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
1578                           "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
1579                           "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
1580         }, {
1581                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
1582                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
1583                           "\x11\x12\x13\x14\x15\x16\x17\x18"
1584                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
1585                           "\x21\x22\x23\x24\x25",
1586                 .ksize  = 37,
1587                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1588                         "\xcd\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",
1591                 .psize  = 50,
1592                 .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
1593                           "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
1594                           "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
1595                           "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
1596         }, {
1597                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
1598                         "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
1599                         "\x0c\x0c\x0c\x0c\x0c\x0c",
1600                 .ksize  = 32,
1601                 .plaintext = "Test With Truncation",
1602                 .psize  = 20,
1603                 .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
1604                           "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
1605                           "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
1606                           "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
1607         }, {
1608                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1609                         "\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",
1615                 .ksize  = 80,
1616                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
1617                 .psize  = 54,
1618                 .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
1619                           "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
1620                           "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
1621                           "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
1622         }, {
1623                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1624                         "\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",
1630                 .ksize  = 80,
1631                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
1632                            "One Block-Size Data",
1633                 .psize  = 73,
1634                 .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
1635                           "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
1636                           "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
1637                           "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
1638         },
1639 };
1640
1641 #define XCBC_AES_TEST_VECTORS 6
1642
1643 static struct hash_testvec aes_xcbc128_tv_template[] = {
1644         {
1645                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1646                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1647                 .plaintext = zeroed_string,
1648                 .digest = "\x75\xf0\x25\x1d\x52\x8a\xc0\x1c"
1649                           "\x45\x73\xdf\xd5\x84\xd7\x9f\x29",
1650                 .psize  = 0,
1651                 .ksize  = 16,
1652         }, {
1653                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1654                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1655                 .plaintext = "\x00\x01\x02",
1656                 .digest = "\x5b\x37\x65\x80\xae\x2f\x19\xaf"
1657                           "\xe7\x21\x9c\xee\xf1\x72\x75\x6f",
1658                 .psize  = 3,
1659                 .ksize  = 16,
1660         } , {
1661                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1662                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1663                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1664                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1665                 .digest = "\xd2\xa2\x46\xfa\x34\x9b\x68\xa7"
1666                           "\x99\x98\xa4\x39\x4f\xf7\xa2\x63",
1667                 .psize  = 16,
1668                 .ksize  = 16,
1669         }, {
1670                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1671                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1672                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1673                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1674                              "\x10\x11\x12\x13",
1675                 .digest = "\x47\xf5\x1b\x45\x64\x96\x62\x15"
1676                           "\xb8\x98\x5c\x63\x05\x5e\xd3\x08",
1677                 .tap    = { 10, 10 },
1678                 .psize  = 20,
1679                 .np     = 2,
1680                 .ksize  = 16,
1681         }, {
1682                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1683                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1684                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1685                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1686                              "\x10\x11\x12\x13\x14\x15\x16\x17"
1687                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
1688                 .digest = "\xf5\x4f\x0e\xc8\xd2\xb9\xf3\xd3"
1689                           "\x68\x07\x73\x4b\xd5\x28\x3f\xd4",
1690                 .psize  = 32,
1691                 .ksize  = 16,
1692         }, {
1693                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1694                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1695                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
1696                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
1697                              "\x10\x11\x12\x13\x14\x15\x16\x17"
1698                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
1699                              "\x20\x21",
1700                 .digest = "\xbe\xcb\xb3\xbc\xcd\xb5\x18\xa3"
1701                           "\x06\x77\xd5\x48\x1f\xb6\xb4\xd8",
1702                 .tap    = { 17, 17 },
1703                 .psize  = 34,
1704                 .np     = 2,
1705                 .ksize  = 16,
1706         }
1707 };
1708
1709 #define VMAC_AES_TEST_VECTORS   8
1710 static char vmac_string1[128] = {'\x01', '\x01', '\x01', '\x01',
1711                                 '\x02', '\x03', '\x02', '\x02',
1712                                 '\x02', '\x04', '\x01', '\x07',
1713                                 '\x04', '\x01', '\x04', '\x03',};
1714 static char vmac_string2[128] = {'a', 'b', 'c',};
1715 static char vmac_string3[128] = {'a', 'b', 'c', 'a', 'b', 'c',
1716                                 '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                                 };
1724
1725 static struct hash_testvec aes_vmac128_tv_template[] = {
1726         {
1727                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1728                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1729                 .plaintext = NULL,
1730                 .digest = "\x07\x58\x80\x35\x77\xa4\x7b\x54",
1731                 .psize  = 0,
1732                 .ksize  = 16,
1733         }, {
1734                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1735                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1736                 .plaintext = vmac_string1,
1737                 .digest = "\xce\xf5\x3c\xd3\xae\x68\x8c\xa1",
1738                 .psize  = 128,
1739                 .ksize  = 16,
1740         }, {
1741                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1742                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1743                 .plaintext = vmac_string2,
1744                 .digest = "\xc9\x27\xb0\x73\x81\xbd\x14\x2d",
1745                 .psize  = 128,
1746                 .ksize  = 16,
1747         }, {
1748                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
1749                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
1750                 .plaintext = vmac_string3,
1751                 .digest = "\x8d\x1a\x95\x8c\x98\x47\x0b\x19",
1752                 .psize  = 128,
1753                 .ksize  = 16,
1754         }, {
1755                 .key    = "abcdefghijklmnop",
1756                 .plaintext = NULL,
1757                 .digest = "\x3b\x89\xa1\x26\x9e\x55\x8f\x84",
1758                 .psize  = 0,
1759                 .ksize  = 16,
1760         }, {
1761                 .key    = "abcdefghijklmnop",
1762                 .plaintext = vmac_string1,
1763                 .digest = "\xab\x5e\xab\xb0\xf6\x8d\x74\xc2",
1764                 .psize  = 128,
1765                 .ksize  = 16,
1766         }, {
1767                 .key    = "abcdefghijklmnop",
1768                 .plaintext = vmac_string2,
1769                 .digest = "\x11\x15\x68\x42\x3d\x7b\x09\xdf",
1770                 .psize  = 128,
1771                 .ksize  = 16,
1772         }, {
1773                 .key    = "abcdefghijklmnop",
1774                 .plaintext = vmac_string3,
1775                 .digest = "\x8b\x32\x8f\xe1\xed\x8f\xfa\xd4",
1776                 .psize  = 128,
1777                 .ksize  = 16,
1778         },
1779 };
1780
1781 /*
1782  * SHA384 HMAC test vectors from RFC4231
1783  */
1784
1785 #define HMAC_SHA384_TEST_VECTORS        4
1786
1787 static struct hash_testvec hmac_sha384_tv_template[] = {
1788         {
1789                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1790                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1791                           "\x0b\x0b\x0b\x0b",
1792                 .ksize  = 20,
1793                 .plaintext = "Hi There",
1794                 .psize  = 8,
1795                 .digest = "\xaf\xd0\x39\x44\xd8\x48\x95\x62"
1796                           "\x6b\x08\x25\xf4\xab\x46\x90\x7f"
1797                           "\x15\xf9\xda\xdb\xe4\x10\x1e\xc6"
1798                           "\x82\xaa\x03\x4c\x7c\xeb\xc5\x9c"
1799                           "\xfa\xea\x9e\xa9\x07\x6e\xde\x7f"
1800                           "\x4a\xf1\x52\xe8\xb2\xfa\x9c\xb6",
1801         }, {
1802                 .key    = "Jefe",
1803                 .ksize  = 4,
1804                 .plaintext = "what do ya want for nothing?",
1805                 .psize  = 28,
1806                 .digest = "\xaf\x45\xd2\xe3\x76\x48\x40\x31"
1807                           "\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
1808                           "\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47"
1809                           "\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
1810                           "\x8e\x22\x40\xca\x5e\x69\xe2\xc7"
1811                           "\x8b\x32\x39\xec\xfa\xb2\x16\x49",
1812                 .np     = 4,
1813                 .tap    = { 7, 7, 7, 7 }
1814         }, {
1815                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1816                           "\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",
1832                 .ksize  = 131,
1833                 .plaintext = "Test Using Larger Than Block-Siz"
1834                            "e Key - Hash Key First",
1835                 .psize  = 54,
1836                 .digest = "\x4e\xce\x08\x44\x85\x81\x3e\x90"
1837                           "\x88\xd2\xc6\x3a\x04\x1b\xc5\xb4"
1838                           "\x4f\x9e\xf1\x01\x2a\x2b\x58\x8f"
1839                           "\x3c\xd1\x1f\x05\x03\x3a\xc4\xc6"
1840                           "\x0c\x2e\xf6\xab\x40\x30\xfe\x82"
1841                           "\x96\x24\x8d\xf1\x63\xf4\x49\x52",
1842         }, {
1843                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1844                           "\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",
1860                 .ksize  = 131,
1861                 .plaintext = "This is a test u"
1862                            "sing a larger th"
1863                            "an block-size ke"
1864                            "y and a larger t"
1865                            "han block-size d"
1866                            "ata. The key nee"
1867                            "ds to be hashed "
1868                            "before being use"
1869                            "d by the HMAC al"
1870                            "gorithm.",
1871                 .psize  = 152,
1872                 .digest = "\x66\x17\x17\x8e\x94\x1f\x02\x0d"
1873                           "\x35\x1e\x2f\x25\x4e\x8f\xd3\x2c"
1874                           "\x60\x24\x20\xfe\xb0\xb8\xfb\x9a"
1875                           "\xdc\xce\xbb\x82\x46\x1e\x99\xc5"
1876                           "\xa6\x78\xcc\x31\xe7\x99\x17\x6d"
1877                           "\x38\x60\xe6\x11\x0c\x46\x52\x3e",
1878         },
1879 };
1880
1881 /*
1882  * SHA512 HMAC test vectors from RFC4231
1883  */
1884
1885 #define HMAC_SHA512_TEST_VECTORS        4
1886
1887 static struct hash_testvec hmac_sha512_tv_template[] = {
1888         {
1889                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1890                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1891                           "\x0b\x0b\x0b\x0b",
1892                 .ksize  = 20,
1893                 .plaintext = "Hi There",
1894                 .psize  = 8,
1895                 .digest = "\x87\xaa\x7c\xde\xa5\xef\x61\x9d"
1896                           "\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0"
1897                           "\x23\x79\xf4\xe2\xce\x4e\xc2\x78"
1898                           "\x7a\xd0\xb3\x05\x45\xe1\x7c\xde"
1899                           "\xda\xa8\x33\xb7\xd6\xb8\xa7\x02"
1900                           "\x03\x8b\x27\x4e\xae\xa3\xf4\xe4"
1901                           "\xbe\x9d\x91\x4e\xeb\x61\xf1\x70"
1902                           "\x2e\x69\x6c\x20\x3a\x12\x68\x54",
1903         }, {
1904                 .key    = "Jefe",
1905                 .ksize  = 4,
1906                 .plaintext = "what do ya want for nothing?",
1907                 .psize  = 28,
1908                 .digest = "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2"
1909                           "\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
1910                           "\x87\xbd\x64\x22\x2e\x83\x1f\xd6"
1911                           "\x10\x27\x0c\xd7\xea\x25\x05\x54"
1912                           "\x97\x58\xbf\x75\xc0\x5a\x99\x4a"
1913                           "\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd"
1914                           "\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b"
1915                           "\x63\x6e\x07\x0a\x38\xbc\xe7\x37",
1916                 .np     = 4,
1917                 .tap    = { 7, 7, 7, 7 }
1918         }, {
1919                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1920                           "\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",
1936                 .ksize  = 131,
1937                 .plaintext = "Test Using Large"
1938                            "r Than Block-Siz"
1939                            "e Key - Hash Key"
1940                            " First",
1941                 .psize  = 54,
1942                 .digest = "\x80\xb2\x42\x63\xc7\xc1\xa3\xeb"
1943                         "\xb7\x14\x93\xc1\xdd\x7b\xe8\xb4"
1944                         "\x9b\x46\xd1\xf4\x1b\x4a\xee\xc1"
1945                         "\x12\x1b\x01\x37\x83\xf8\xf3\x52"
1946                         "\x6b\x56\xd0\x37\xe0\x5f\x25\x98"
1947                         "\xbd\x0f\xd2\x21\x5d\x6a\x1e\x52"
1948                         "\x95\xe6\x4f\x73\xf6\x3f\x0a\xec"
1949                         "\x8b\x91\x5a\x98\x5d\x78\x65\x98",
1950         }, {
1951                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1952                         "\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",
1968                 .ksize  = 131,
1969                 .plaintext =
1970                           "This is a test u"
1971                           "sing a larger th"
1972                           "an block-size ke"
1973                           "y and a larger t"
1974                           "han block-size d"
1975                           "ata. The key nee"
1976                           "ds to be hashed "
1977                           "before being use"
1978                           "d by the HMAC al"
1979                           "gorithm.",
1980                 .psize  = 152,
1981                 .digest = "\xe3\x7b\x6a\x77\x5d\xc8\x7d\xba"
1982                         "\xa4\xdf\xa9\xf9\x6e\x5e\x3f\xfd"
1983                         "\xde\xbd\x71\xf8\x86\x72\x89\x86"
1984                         "\x5d\xf5\xa3\x2d\x20\xcd\xc9\x44"
1985                         "\xb6\x02\x2c\xac\x3c\x49\x82\xb1"
1986                         "\x0d\x5e\xeb\x55\xc3\xe4\xde\x15"
1987                         "\x13\x46\x76\xfb\x6d\xe0\x44\x60"
1988                         "\x65\xc9\x74\x40\xfa\x8c\x6a\x58",
1989         },
1990 };
1991
1992 /*
1993  * DES test vectors.
1994  */
1995 #define DES_ENC_TEST_VECTORS            10
1996 #define DES_DEC_TEST_VECTORS            4
1997 #define DES_CBC_ENC_TEST_VECTORS        5
1998 #define DES_CBC_DEC_TEST_VECTORS        4
1999 #define DES3_EDE_ENC_TEST_VECTORS       3
2000 #define DES3_EDE_DEC_TEST_VECTORS       3
2001 #define DES3_EDE_CBC_ENC_TEST_VECTORS   1
2002 #define DES3_EDE_CBC_DEC_TEST_VECTORS   1
2003
2004 static struct cipher_testvec des_enc_tv_template[] = {
2005         { /* From Applied Cryptography */
2006                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2007                 .klen   = 8,
2008                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2009                 .ilen   = 8,
2010                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2011                 .rlen   = 8,
2012         }, { /* Same key, different plaintext block */
2013                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2014                 .klen   = 8,
2015                 .input  = "\x22\x33\x44\x55\x66\x77\x88\x99",
2016                 .ilen   = 8,
2017                 .result = "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2018                 .rlen   = 8,
2019         }, { /* Sbox test from NBS */
2020                 .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
2021                 .klen   = 8,
2022                 .input  = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
2023                 .ilen   = 8,
2024                 .result = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2025                 .rlen   = 8,
2026         }, { /* Three blocks */
2027                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2028                 .klen   = 8,
2029                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2030                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2031                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
2032                 .ilen   = 24,
2033                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2034                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2035                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
2036                 .rlen   = 24,
2037         }, { /* Weak key */
2038                 .fail   = 1,
2039                 .wk     = 1,
2040                 .key    = "\x01\x01\x01\x01\x01\x01\x01\x01",
2041                 .klen   = 8,
2042                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2043                 .ilen   = 8,
2044                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2045                 .rlen   = 8,
2046         }, { /* Two blocks -- for testing encryption across pages */
2047                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2048                 .klen   = 8,
2049                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2050                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2051                 .ilen   = 16,
2052                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2053                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2054                 .rlen   = 16,
2055                 .np     = 2,
2056                 .tap    = { 8, 8 }
2057         }, { /* Four blocks -- for testing encryption with chunking */
2058                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2059                 .klen   = 8,
2060                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2061                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2062                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef"
2063                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2064                 .ilen   = 32,
2065                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2066                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2067                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90"
2068                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2069                 .rlen   = 32,
2070                 .np     = 3,
2071                 .tap    = { 14, 10, 8 }
2072         }, {
2073                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2074                 .klen   = 8,
2075                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2076                           "\x22\x33\x44\x55\x66\x77\x88\x99"
2077                           "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
2078                 .ilen   = 24,
2079                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2080                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
2081                           "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
2082                 .rlen   = 24,
2083                 .np     = 4,
2084                 .tap    = { 2, 1, 3, 18 }
2085         }, {
2086                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2087                 .klen   = 8,
2088                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2089                           "\x22\x33\x44\x55\x66\x77\x88\x99",
2090                 .ilen   = 16,
2091                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2092                           "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
2093                 .rlen   = 16,
2094                 .np     = 5,
2095                 .tap    = { 2, 2, 2, 2, 8 }
2096         }, {
2097                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2098                 .klen   = 8,
2099                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2100                 .ilen   = 8,
2101                 .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2102                 .rlen   = 8,
2103                 .np     = 8,
2104                 .tap    = { 1, 1, 1, 1, 1, 1, 1, 1 }
2105         },
2106 };
2107
2108 static struct cipher_testvec des_dec_tv_template[] = {
2109         { /* From Applied Cryptography */
2110                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2111                 .klen   = 8,
2112                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
2113                 .ilen   = 8,
2114                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
2115                 .rlen   = 8,
2116         }, { /* Sbox test from NBS */
2117                 .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
2118                 .klen   = 8,
2119                 .input  = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2120                 .ilen   = 8,
2121                 .result = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
2122                 .rlen   = 8,
2123         }, { /* Two blocks, for chunking test */
2124                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2125                 .klen   = 8,
2126                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2127                           "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2128                 .ilen   = 16,
2129                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2130                           "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
2131                 .rlen   = 16,
2132                 .np     = 2,
2133                 .tap    = { 8, 8 }
2134         }, {
2135                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2136                 .klen   = 8,
2137                 .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
2138                           "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
2139                 .ilen   = 16,
2140                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
2141                           "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
2142                 .rlen   = 16,
2143                 .np     = 3,
2144                 .tap    = { 3, 12, 1 }
2145         },
2146 };
2147
2148 static struct cipher_testvec des_cbc_enc_tv_template[] = {
2149         { /* From OpenSSL */
2150                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2151                 .klen   = 8,
2152                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2153                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2154                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2155                           "\x68\x65\x20\x74\x69\x6d\x65\x20",
2156                 .ilen   = 24,
2157                 .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
2158                           "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
2159                           "\x46\x8e\x91\x15\x78\x88\xba\x68",
2160                 .rlen   = 24,
2161         }, { /* FIPS Pub 81 */
2162                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2163                 .klen   = 8,
2164                 .iv     = "\x12\x34\x56\x78\x90\xab\xcd\xef",
2165                 .input  = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
2166                 .ilen   = 8,
2167                 .result = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2168                 .rlen   = 8,
2169         }, {
2170                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2171                 .klen   = 8,
2172                 .iv     = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2173                 .input  = "\x68\x65\x20\x74\x69\x6d\x65\x20",
2174                 .ilen   = 8,
2175                 .result = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2176                 .rlen   = 8,
2177         }, {
2178                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2179                 .klen   = 8,
2180                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2181                 .input  = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2182                 .ilen   = 8,
2183                 .result = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2184                 .rlen   = 8,
2185         }, { /* Copy of openssl vector for chunk testing */
2186              /* From OpenSSL */
2187                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2188                 .klen   = 8,
2189                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2190                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2191                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2192                           "\x68\x65\x20\x74\x69\x6d\x65\x20",
2193                 .ilen   = 24,
2194                 .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
2195                           "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
2196                           "\x46\x8e\x91\x15\x78\x88\xba\x68",
2197                 .rlen   = 24,
2198                 .np     = 2,
2199                 .tap    = { 13, 11 }
2200         },
2201 };
2202
2203 static struct cipher_testvec des_cbc_dec_tv_template[] = {
2204         { /* FIPS Pub 81 */
2205                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2206                 .klen   = 8,
2207                 .iv     = "\x12\x34\x56\x78\x90\xab\xcd\xef",
2208                 .input  = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2209                 .ilen   = 8,
2210                 .result = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
2211                 .rlen   = 8,
2212         }, {
2213                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2214                 .klen   = 8,
2215                 .iv     = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
2216                 .input  = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2217                 .ilen   = 8,
2218                 .result = "\x68\x65\x20\x74\x69\x6d\x65\x20",
2219                 .rlen   = 8,
2220         }, {
2221                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2222                 .klen   = 8,
2223                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2224                 .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2225                 .ilen   = 8,
2226                 .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2227                 .rlen   = 8,
2228         }, { /* Copy of above, for chunk testing */
2229                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2230                 .klen   = 8,
2231                 .iv     = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
2232                 .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
2233                 .ilen   = 8,
2234                 .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
2235                 .rlen   = 8,
2236                 .np     = 2,
2237                 .tap    = { 4, 4 }
2238         },
2239 };
2240
2241 static struct cipher_testvec des3_ede_enc_tv_template[] = {
2242         { /* These are from openssl */
2243                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2244                           "\x55\x55\x55\x55\x55\x55\x55\x55"
2245                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2246                 .klen   = 24,
2247                 .input  = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
2248                 .ilen   = 8,
2249                 .result = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
2250                 .rlen   = 8,
2251         }, {
2252                 .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
2253                           "\x86\x02\x87\x66\x59\x08\x21\x98"
2254                           "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
2255                 .klen   = 24,
2256                 .input  = "\x73\x71\x75\x69\x67\x67\x6c\x65",
2257                 .ilen   = 8,
2258                 .result = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
2259                 .rlen   = 8,
2260         }, {
2261                 .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
2262                           "\x91\x07\xd0\x15\x89\x19\x01\x01"
2263                           "\x19\x07\x92\x10\x98\x1a\x01\x01",
2264                 .klen   = 24,
2265                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
2266                 .ilen   = 8,
2267                 .result = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
2268                 .rlen   = 8,
2269         },
2270 };
2271
2272 static struct cipher_testvec des3_ede_dec_tv_template[] = {
2273         { /* These are from openssl */
2274                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2275                           "\x55\x55\x55\x55\x55\x55\x55\x55"
2276                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2277                 .klen   = 24,
2278                 .input  = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
2279                 .ilen   = 8,
2280                 .result = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
2281                 .rlen   = 8,
2282         }, {
2283                 .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
2284                           "\x86\x02\x87\x66\x59\x08\x21\x98"
2285                           "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
2286                 .klen   = 24,
2287                 .input  = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
2288                 .ilen   = 8,
2289                 .result = "\x73\x71\x75\x69\x67\x67\x6c\x65",
2290                 .rlen   = 8,
2291         }, {
2292                 .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
2293                           "\x91\x07\xd0\x15\x89\x19\x01\x01"
2294                           "\x19\x07\x92\x10\x98\x1a\x01\x01",
2295                 .klen   = 24,
2296                 .input  = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
2297                 .ilen   = 8,
2298                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
2299                 .rlen   = 8,
2300         },
2301 };
2302
2303 static struct cipher_testvec des3_ede_cbc_enc_tv_template[] = {
2304         { /* Generated from openssl */
2305                 .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
2306                           "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
2307                           "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
2308                 .klen   = 24,
2309                 .iv     = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
2310                 .input  = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
2311                           "\x53\x20\x63\x65\x65\x72\x73\x74"
2312                           "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
2313                           "\x20\x79\x65\x53\x72\x63\x74\x65"
2314                           "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
2315                           "\x79\x6e\x53\x20\x63\x65\x65\x72"
2316                           "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
2317                           "\x6e\x61\x20\x79\x65\x53\x72\x63"
2318                           "\x74\x65\x20\x73\x6f\x54\x20\x6f"
2319                           "\x61\x4d\x79\x6e\x53\x20\x63\x65"
2320                           "\x65\x72\x73\x74\x54\x20\x6f\x6f"
2321                           "\x4d\x20\x6e\x61\x20\x79\x65\x53"
2322                           "\x72\x63\x74\x65\x20\x73\x6f\x54"
2323                           "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
2324                           "\x63\x65\x65\x72\x73\x74\x54\x20"
2325                           "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
2326                 .ilen   = 128,
2327                 .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
2328                           "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
2329                           "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
2330                           "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
2331                           "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
2332                           "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
2333                           "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
2334                           "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
2335                           "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
2336                           "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
2337                           "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
2338                           "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
2339                           "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
2340                           "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
2341                           "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
2342                           "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
2343                 .rlen   = 128,
2344         },
2345 };
2346
2347 static struct cipher_testvec des3_ede_cbc_dec_tv_template[] = {
2348         { /* Generated from openssl */
2349                 .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
2350                           "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
2351                           "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
2352                 .klen   = 24,
2353                 .iv     = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
2354                 .input  = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
2355                           "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
2356                           "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
2357                           "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
2358                           "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
2359                           "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
2360                           "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
2361                           "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
2362                           "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
2363                           "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
2364                           "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
2365                           "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
2366                           "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
2367                           "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
2368                           "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
2369                           "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
2370                 .ilen   = 128,
2371                 .result = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
2372                           "\x53\x20\x63\x65\x65\x72\x73\x74"
2373                           "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
2374                           "\x20\x79\x65\x53\x72\x63\x74\x65"
2375                           "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
2376                           "\x79\x6e\x53\x20\x63\x65\x65\x72"
2377                           "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
2378                           "\x6e\x61\x20\x79\x65\x53\x72\x63"
2379                           "\x74\x65\x20\x73\x6f\x54\x20\x6f"
2380                           "\x61\x4d\x79\x6e\x53\x20\x63\x65"
2381                           "\x65\x72\x73\x74\x54\x20\x6f\x6f"
2382                           "\x4d\x20\x6e\x61\x20\x79\x65\x53"
2383                           "\x72\x63\x74\x65\x20\x73\x6f\x54"
2384                           "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
2385                           "\x63\x65\x65\x72\x73\x74\x54\x20"
2386                           "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
2387                 .rlen   = 128,
2388         },
2389 };
2390
2391 /*
2392  * Blowfish test vectors.
2393  */
2394 #define BF_ENC_TEST_VECTORS     7
2395 #define BF_DEC_TEST_VECTORS     7
2396 #define BF_CBC_ENC_TEST_VECTORS 2
2397 #define BF_CBC_DEC_TEST_VECTORS 2
2398 #define BF_CTR_ENC_TEST_VECTORS 2
2399 #define BF_CTR_DEC_TEST_VECTORS 2
2400
2401 static struct cipher_testvec bf_enc_tv_template[] = {
2402         { /* DES test vectors from OpenSSL */
2403                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
2404                 .klen   = 8,
2405                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
2406                 .ilen   = 8,
2407                 .result = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
2408                 .rlen   = 8,
2409         }, {
2410                 .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
2411                 .klen   = 8,
2412                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2413                 .ilen   = 8,
2414                 .result = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
2415                 .rlen   = 8,
2416         }, {
2417                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2418                 .klen   = 8,
2419                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2420                 .ilen   = 8,
2421                 .result = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
2422                 .rlen   = 8,
2423         }, { /* Vary the keylength... */
2424                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2425                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
2426                 .klen   = 16,
2427                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2428                 .ilen   = 8,
2429                 .result = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
2430                 .rlen   = 8,
2431         }, {
2432                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2433                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2434                           "\x00\x11\x22\x33\x44",
2435                 .klen   = 21,
2436                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2437                 .ilen   = 8,
2438                 .result = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
2439                 .rlen   = 8,
2440         }, { /* Generated with bf488 */
2441                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2442                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2443                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2444                           "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
2445                           "\x58\x40\x23\x64\x1a\xba\x61\x76"
2446                           "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
2447                           "\xff\xff\xff\xff\xff\xff\xff\xff",
2448                 .klen   = 56,
2449                 .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2450                 .ilen   = 8,
2451                 .result = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
2452                 .rlen   = 8,
2453         }, { /* Generated with Crypto++ */
2454                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2455                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2456                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2457                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2458                 .klen   = 32,
2459                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2460                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2461                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2462                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2463                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2464                 .ilen   = 40,
2465                 .result = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
2466                           "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
2467                           "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
2468                           "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
2469                           "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
2470                 .rlen   = 40,
2471         },
2472 };
2473
2474 static struct cipher_testvec bf_dec_tv_template[] = {
2475         { /* DES test vectors from OpenSSL */
2476                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
2477                 .klen   = 8,
2478                 .input  = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
2479                 .ilen   = 8,
2480                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
2481                 .rlen   = 8,
2482         }, {
2483                 .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
2484                 .klen   = 8,
2485                 .input  = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
2486                 .ilen   = 8,
2487                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
2488                 .rlen   = 8,
2489         }, {
2490                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2491                 .klen   = 8,
2492                 .input  = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
2493                 .ilen   = 8,
2494                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2495                 .rlen   = 8,
2496         }, { /* Vary the keylength... */
2497                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2498                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
2499                 .klen   = 16,
2500                 .input  = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
2501                 .ilen   = 8,
2502                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2503                 .rlen   = 8,
2504         }, {
2505                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2506                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2507                           "\x00\x11\x22\x33\x44",
2508                 .klen   = 21,
2509                 .input  = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
2510                 .ilen   = 8,
2511                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2512                 .rlen   = 8,
2513         }, { /* Generated with bf488, using OpenSSL, Libgcrypt and Nettle */
2514                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
2515                           "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
2516                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2517                           "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
2518                           "\x58\x40\x23\x64\x1a\xba\x61\x76"
2519                           "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
2520                           "\xff\xff\xff\xff\xff\xff\xff\xff",
2521                 .klen   = 56,
2522                 .input  = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
2523                 .ilen   = 8,
2524                 .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2525                 .rlen   = 8,
2526         }, { /* Generated with Crypto++ */
2527                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2528                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2529                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2530                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2531                 .klen   = 32,
2532                 .input  = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
2533                           "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
2534                           "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
2535                           "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
2536                           "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
2537                 .ilen   = 40,
2538                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2539                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2540                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2541                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2542                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2543                 .rlen   = 40,
2544         },
2545 };
2546
2547 static struct cipher_testvec bf_cbc_enc_tv_template[] = {
2548         { /* From OpenSSL */
2549                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2550                           "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2551                 .klen   = 16,
2552                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2553                 .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
2554                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2555                           "\x68\x65\x20\x74\x69\x6d\x65\x20"
2556                           "\x66\x6f\x72\x20\x00\x00\x00\x00",
2557                 .ilen   = 32,
2558                 .result = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
2559                           "\x05\xb1\x56\xe2\x74\x03\x97\x93"
2560                           "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
2561                           "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
2562                 .rlen   = 32,
2563         }, { /* Generated with Crypto++ */
2564                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2565                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2566                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2567                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2568                 .klen   = 32,
2569                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2570                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2571                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2572                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2573                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2574                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2575                 .ilen   = 40,
2576                 .result = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
2577                           "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
2578                           "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
2579                           "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
2580                           "\x01\x9C\x93\x63\x51\x60\x82\xD2",
2581                 .rlen   = 40,
2582         },
2583 };
2584
2585 static struct cipher_testvec bf_cbc_dec_tv_template[] = {
2586         { /* From OpenSSL */
2587                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2588                           "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
2589                 .klen   = 16,
2590                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
2591                 .input  = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
2592                           "\x05\xb1\x56\xe2\x74\x03\x97\x93"
2593                           "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
2594                           "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
2595                 .ilen   = 32,
2596                 .result = "\x37\x36\x35\x34\x33\x32\x31\x20"
2597                           "\x4e\x6f\x77\x20\x69\x73\x20\x74"
2598                           "\x68\x65\x20\x74\x69\x6d\x65\x20"
2599                           "\x66\x6f\x72\x20\x00\x00\x00\x00",
2600                 .rlen   = 32,
2601         }, { /* Generated with Crypto++ */
2602                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2603                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2604                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2605                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2606                 .klen   = 32,
2607                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2608                 .input  = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
2609                           "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
2610                           "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
2611                           "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
2612                           "\x01\x9C\x93\x63\x51\x60\x82\xD2",
2613                 .ilen   = 40,
2614                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2615                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2616                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2617                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2618                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2619                 .rlen   = 40,
2620         },
2621 };
2622
2623 static struct cipher_testvec bf_ctr_enc_tv_template[] = {
2624         { /* Generated with Crypto++ */
2625                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2626                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2627                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2628                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2629                 .klen   = 32,
2630                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2631                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2632                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2633                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2634                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2635                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2636                 .ilen   = 40,
2637                 .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2638                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2639                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2640                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2641                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
2642                 .rlen   = 40,
2643         }, { /* Generated with Crypto++ */
2644                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2645                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2646                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2647                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2648                 .klen   = 32,
2649                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2650                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2651                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2652                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2653                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2654                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2655                           "\x6D\x04\x9B",
2656                 .ilen   = 43,
2657                 .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2658                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2659                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2660                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2661                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
2662                           "\x3D\xA7\xE9",
2663                 .rlen   = 43,
2664         },
2665 };
2666
2667 static struct cipher_testvec bf_ctr_dec_tv_template[] = {
2668         { /* Generated with Crypto++ */
2669                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2670                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2671                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2672                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2673                 .klen   = 32,
2674                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2675                 .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2676                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2677                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2678                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2679                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
2680                 .ilen   = 40,
2681                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2682                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2683                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2684                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2685                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2686                 .rlen   = 40,
2687         }, { /* Generated with Crypto++ */
2688                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2689                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2690                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2691                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2692                 .klen   = 32,
2693                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
2694                 .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
2695                           "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
2696                           "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
2697                           "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
2698                           "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
2699                           "\x3D\xA7\xE9",
2700                 .ilen   = 43,
2701                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2702                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2703                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2704                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2705                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2706                           "\x6D\x04\x9B",
2707                 .rlen   = 43,
2708         },
2709 };
2710
2711 /*
2712  * Twofish test vectors.
2713  */
2714 #define TF_ENC_TEST_VECTORS             4
2715 #define TF_DEC_TEST_VECTORS             4
2716 #define TF_CBC_ENC_TEST_VECTORS         5
2717 #define TF_CBC_DEC_TEST_VECTORS         5
2718 #define TF_CTR_ENC_TEST_VECTORS         2
2719 #define TF_CTR_DEC_TEST_VECTORS         2
2720 #define TF_LRW_ENC_TEST_VECTORS         8
2721 #define TF_LRW_DEC_TEST_VECTORS         8
2722
2723 static struct cipher_testvec tf_enc_tv_template[] = {
2724         {
2725                 .key    = zeroed_string,
2726                 .klen   = 16,
2727                 .input  = zeroed_string,
2728                 .ilen   = 16,
2729                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2730                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2731                 .rlen   = 16,
2732         }, {
2733                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2734                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2735                           "\x00\x11\x22\x33\x44\x55\x66\x77",
2736                 .klen   = 24,
2737                 .input  = zeroed_string,
2738                 .ilen   = 16,
2739                 .result = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
2740                           "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
2741                 .rlen   = 16,
2742         }, {
2743                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2744                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2745                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2746                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
2747                 .klen   = 32,
2748                 .input  = zeroed_string,
2749                 .ilen   = 16,
2750                 .result = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
2751                           "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
2752                 .rlen   = 16,
2753         }, { /* Generated with Crypto++ */
2754                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
2755                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
2756                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
2757                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
2758                 .klen   = 32,
2759                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2760                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2761                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2762                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2763                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2764                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2765                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2766                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
2767                 .ilen   = 64,
2768                 .result = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
2769                           "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
2770                           "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
2771                           "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
2772                           "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
2773                           "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
2774                           "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
2775                           "\x89\xF6\x82\xF0\xD3\xDB\x06\x02",
2776                 .rlen   = 64,
2777         },
2778 };
2779
2780 static struct cipher_testvec tf_dec_tv_template[] = {
2781         {
2782                 .key    = zeroed_string,
2783                 .klen   = 16,
2784                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2785                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2786                 .ilen   = 16,
2787                 .result = zeroed_string,
2788                 .rlen   = 16,
2789         }, {
2790                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2791                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2792                           "\x00\x11\x22\x33\x44\x55\x66\x77",
2793                 .klen   = 24,
2794                 .input  = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
2795                           "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
2796                 .ilen   = 16,
2797                 .result = zeroed_string,
2798                 .rlen   = 16,
2799         }, {
2800                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
2801                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
2802                           "\x00\x11\x22\x33\x44\x55\x66\x77"
2803                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
2804                 .klen   = 32,
2805                 .input  = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
2806                           "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
2807                 .ilen   = 16,
2808                 .result = zeroed_string,
2809                 .rlen   = 16,
2810         }, { /* Generated with Crypto++ */
2811                 .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
2812                           "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
2813                           "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
2814                           "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
2815                 .klen   = 32,
2816                 .input  = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
2817                           "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
2818                           "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
2819                           "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
2820                           "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
2821                           "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
2822                           "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
2823                           "\x89\xF6\x82\xF0\xD3\xDB\x06\x02",
2824                 .ilen   = 64,
2825                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2826                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2827                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2828                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2829                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2830                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2831                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2832                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
2833                 .rlen   = 64,
2834         },
2835 };
2836
2837 static struct cipher_testvec tf_cbc_enc_tv_template[] = {
2838         { /* Generated with Nettle */
2839                 .key    = zeroed_string,
2840                 .klen   = 16,
2841                 .iv     = zeroed_string,
2842                 .input  = zeroed_string,
2843                 .ilen   = 16,
2844                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2845                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2846                 .rlen   = 16,
2847         }, {
2848                 .key    = zeroed_string,
2849                 .klen   = 16,
2850                 .iv     = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2851                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2852                 .input  = zeroed_string,
2853                 .ilen   = 16,
2854                 .result = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2855                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
2856                 .rlen   = 16,
2857         }, {
2858                 .key    = zeroed_string,
2859                 .klen   = 16,
2860                 .iv     = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2861                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
2862                 .input  = zeroed_string,
2863                 .ilen   = 16,
2864                 .result = "\x05\xef\x8c\x61\xa8\x11\x58\x26"
2865                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
2866                 .rlen   = 16,
2867         }, {
2868                 .key    = zeroed_string,
2869                 .klen   = 16,
2870                 .iv     = zeroed_string,
2871                 .input  = zeroed_string,
2872                 .ilen   = 48,
2873                 .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2874                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a"
2875                           "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2876                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19"
2877                           "\x05\xef\x8c\x61\xa8\x11\x58\x26"
2878                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
2879                 .rlen   = 48,
2880         }, { /* Generated with Crypto++ */
2881                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2882                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2883                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2884                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2885                 .klen   = 32,
2886                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
2887                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
2888                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2889                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2890                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2891                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2892                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2893                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2894                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2895                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
2896                 .ilen   = 64,
2897                 .result = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
2898                           "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
2899                           "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
2900                           "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
2901                           "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
2902                           "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
2903                           "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
2904                           "\xB1\xD3\x44\x65\xDF\xE7\x63\x38",
2905                 .rlen   = 64,
2906         },
2907 };
2908
2909 static struct cipher_testvec tf_cbc_dec_tv_template[] = {
2910         { /* Reverse of the first four above */
2911                 .key    = zeroed_string,
2912                 .klen   = 16,
2913                 .iv     = zeroed_string,
2914                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2915                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2916                 .ilen   = 16,
2917                 .result = zeroed_string,
2918                 .rlen   = 16,
2919         }, {
2920                 .key    = zeroed_string,
2921                 .klen   = 16,
2922                 .iv     = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2923                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
2924                 .input  = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2925                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
2926                 .ilen   = 16,
2927                 .result = zeroed_string,
2928                 .rlen   = 16,
2929         }, {
2930                 .key    = zeroed_string,
2931                 .klen   = 16,
2932                 .iv     = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2933                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
2934                 .input  = "\x05\xef\x8c\x61\xa8\x11\x58\x26"
2935                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
2936                 .ilen   = 16,
2937                 .result = zeroed_string,
2938                 .rlen   = 16,
2939         }, {
2940                 .key    = zeroed_string,
2941                 .klen   = 16,
2942                 .iv     = zeroed_string,
2943                 .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
2944                           "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a"
2945                           "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
2946                           "\x86\xcb\x08\x6b\x78\x9f\x54\x19"
2947                           "\x05\xef\x8c\x61\xa8\x11\x58\x26"
2948                           "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
2949                 .ilen   = 48,
2950                 .result = zeroed_string,
2951                 .rlen   = 48,
2952         }, { /* Generated with Crypto++ */
2953                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2954                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2955                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2956                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2957                 .klen   = 32,
2958                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
2959                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
2960                 .input  = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
2961                           "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
2962                           "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
2963                           "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
2964                           "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
2965                           "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
2966                           "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
2967                           "\xB1\xD3\x44\x65\xDF\xE7\x63\x38",
2968                 .ilen   = 64,
2969                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2970                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2971                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2972                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2973                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2974                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2975                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2976                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
2977                 .rlen   = 64,
2978         },
2979 };
2980
2981 static struct cipher_testvec tf_ctr_enc_tv_template[] = {
2982         { /* Generated with Crypto++ */
2983                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2984                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2985                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2986                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2987                 .klen   = 32,
2988                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
2989                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
2990                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2991                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2992                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2993                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2994                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2995                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2996                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2997                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
2998                 .ilen   = 64,
2999                 .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3000                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3001                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3002                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3003                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3004                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3005                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3006                           "\x01\x41\x21\x12\x38\xAB\x52\x4F",
3007                 .rlen   = 64,
3008         }, { /* Generated with Crypto++ */
3009                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3010                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3011                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3012                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3013                 .klen   = 32,
3014                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3015                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3016                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3017                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3018                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3019                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3020                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3021                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3022                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3023                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3024                           "\xC3\x37\xCE",
3025                 .ilen   = 67,
3026                 .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3027                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3028                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3029                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3030                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3031                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3032                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3033                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3034                           "\xA8\x57\x20",
3035                 .rlen   = 67,
3036         },
3037 };
3038
3039 static struct cipher_testvec tf_ctr_dec_tv_template[] = {
3040         { /* Generated with Crypto++ */
3041                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3042                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3043                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3044                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3045                 .klen   = 32,
3046                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3047                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3048                 .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3049                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3050                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3051                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3052                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3053                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3054                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3055                           "\x01\x41\x21\x12\x38\xAB\x52\x4F",
3056                 .ilen   = 64,
3057                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3058                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3059                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3060                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3061                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3062                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3063                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3064                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
3065                 .rlen   = 64,
3066         }, { /* Generated with Crypto++ */
3067                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3068                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3069                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3070                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3071                 .klen   = 32,
3072                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3073                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3074                 .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
3075                           "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
3076                           "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
3077                           "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
3078                           "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
3079                           "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
3080                           "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
3081                           "\x01\x41\x21\x12\x38\xAB\x52\x4F"
3082                           "\xA8\x57\x20",
3083                 .ilen   = 67,
3084                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3085                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3086                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3087                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3088                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3089                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3090                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3091                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3092                           "\xC3\x37\xCE",
3093                 .rlen   = 67,
3094         },
3095 };
3096
3097 static struct cipher_testvec tf_lrw_enc_tv_template[] = {
3098         /* Generated from AES-LRW test vectors */
3099         {
3100                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
3101                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
3102                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
3103                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
3104                 .klen   = 32,
3105                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3106                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3107                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3108                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3109                 .ilen   = 16,
3110                 .result = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
3111                           "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
3112                 .rlen   = 16,
3113         }, {
3114                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
3115                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
3116                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
3117                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
3118                 .klen   = 32,
3119                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3120                           "\x00\x00\x00\x00\x00\x00\x00\x02",
3121                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3122                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3123                 .ilen   = 16,
3124                 .result = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
3125                           "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
3126                 .rlen   = 16,
3127         }, {
3128                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
3129                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
3130                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
3131                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
3132                 .klen   = 32,
3133                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3134                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3135                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3136                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3137                 .ilen   = 16,
3138                 .result = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
3139                           "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
3140                 .rlen   = 16,
3141         }, {
3142                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
3143                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
3144                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
3145                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
3146                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
3147                 .klen   = 40,
3148                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3149                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3150                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3151                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3152                 .ilen   = 16,
3153                 .result = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
3154                           "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
3155                 .rlen   = 16,
3156         }, {
3157                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
3158                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
3159                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
3160                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
3161                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
3162                 .klen   = 40,
3163                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3164                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3165                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3166                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3167                 .ilen   = 16,
3168                 .result = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
3169                           "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
3170                 .rlen   = 16,
3171         }, {
3172                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
3173                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
3174                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
3175                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
3176                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
3177                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
3178                 .klen   = 48,
3179                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3180                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3181                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3182                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3183                 .ilen   = 16,
3184                 .result = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
3185                           "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
3186                 .rlen   = 16,
3187         }, {
3188                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
3189                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
3190                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
3191                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
3192                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
3193                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
3194                 .klen   = 48,
3195                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3196                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3197                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
3198                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3199                 .ilen   = 16,
3200                 .result = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
3201                           "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
3202                 .rlen   = 16,
3203         }, {
3204                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
3205                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
3206                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
3207                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
3208                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
3209                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
3210                 .klen   = 48,
3211                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3212                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3213                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
3214                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
3215                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
3216                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
3217                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
3218                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
3219                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
3220                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
3221                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
3222                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
3223                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
3224                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
3225                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
3226                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
3227                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
3228                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
3229                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
3230                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
3231                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
3232                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
3233                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
3234                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
3235                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
3236                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
3237                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
3238                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
3239                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
3240                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
3241                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
3242                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
3243                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
3244                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
3245                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
3246                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
3247                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
3248                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
3249                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
3250                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
3251                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
3252                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
3253                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
3254                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
3255                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
3256                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
3257                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
3258                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
3259                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
3260                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
3261                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
3262                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
3263                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
3264                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
3265                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
3266                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
3267                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
3268                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
3269                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
3270                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
3271                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
3272                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
3273                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
3274                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
3275                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
3276                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
3277                 .ilen   = 512,
3278                 .result = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
3279                           "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
3280                           "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
3281                           "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
3282                           "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
3283                           "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
3284                           "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
3285                           "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
3286                           "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
3287                           "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
3288                           "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
3289                           "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
3290                           "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
3291                           "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
3292                           "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
3293                           "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
3294                           "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
3295                           "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
3296                           "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
3297                           "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
3298                           "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
3299                           "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
3300                           "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
3301                           "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
3302                           "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
3303                           "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
3304                           "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
3305                           "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
3306                           "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
3307                           "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
3308                           "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
3309                           "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
3310                           "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
3311                           "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
3312                           "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
3313                           "\x3e\xae\x71\x90\x07\x70\x1c\x38"
3314                           "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
3315                           "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
3316                           "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
3317                           "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
3318                           "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
3319                           "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
3320                           "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
3321                           "\x93\x51\x1d\x3d\x62\x59\x83\x82"
3322                           "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
3323                           "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
3324                           "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
3325                           "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
3326                           "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
3327                           "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
3328                           "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
3329                           "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
3330                           "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
3331                           "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
3332                           "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
3333                           "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
3334                           "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
3335                           "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
3336                           "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
3337                           "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
3338                           "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
3339                           "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
3340                           "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
3341                           "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
3342                 .rlen   = 512,
3343         },
3344 };
3345
3346 static struct cipher_testvec tf_lrw_dec_tv_template[] = {
3347         /* Generated from AES-LRW test vectors */
3348         /* same as enc vectors with input and result reversed */
3349         {
3350                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
3351                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
3352                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
3353                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
3354                 .klen   = 32,
3355                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3356                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3357                 .input  = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
3358                           "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
3359                 .ilen   = 16,
3360                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3361                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3362                 .rlen   = 16,
3363         }, {
3364                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
3365                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
3366                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
3367                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
3368                 .klen   = 32,
3369                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3370                           "\x00\x00\x00\x00\x00\x00\x00\x02",
3371                 .input  = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
3372                           "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
3373                 .ilen   = 16,
3374                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3375                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3376                 .rlen   = 16,
3377         }, {
3378                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
3379                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
3380                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
3381                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
3382                 .klen   = 32,
3383                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3384                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3385                 .input  = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
3386                           "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
3387                 .ilen   = 16,
3388                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3389                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3390                 .rlen   = 16,
3391         }, {
3392                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
3393                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
3394                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
3395                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
3396                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
3397                 .klen   = 40,
3398                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3399                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3400                 .input  = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
3401                           "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
3402                 .ilen   = 16,
3403                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3404                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3405                 .rlen   = 16,
3406         }, {
3407                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
3408                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
3409                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
3410                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
3411                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
3412                 .klen   = 40,
3413                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3414                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3415                 .input  = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
3416                           "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
3417                 .ilen   = 16,
3418                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3419                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3420                 .rlen   = 16,
3421         }, {
3422                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
3423                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
3424                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
3425                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
3426                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
3427                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
3428                 .klen   = 48,
3429                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3430                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3431                 .input  = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
3432                           "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
3433                 .ilen   = 16,
3434                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3435                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3436                 .rlen   = 16,
3437         }, {
3438                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
3439                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
3440                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
3441                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
3442                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
3443                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
3444                 .klen   = 48,
3445                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3446                           "\x00\x00\x00\x02\x00\x00\x00\x00",
3447                 .input  = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
3448                           "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
3449                 .ilen   = 16,
3450                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
3451                           "\x38\x39\x41\x42\x43\x44\x45\x46",
3452                 .rlen   = 16,
3453         }, {
3454                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
3455                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
3456                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
3457                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
3458                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
3459                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
3460                 .klen   = 48,
3461                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
3462                           "\x00\x00\x00\x00\x00\x00\x00\x01",
3463                 .input  = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
3464                           "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
3465                           "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
3466                           "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
3467                           "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
3468                           "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
3469                           "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
3470                           "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
3471                           "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
3472                           "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
3473                           "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
3474                           "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
3475                           "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
3476                           "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
3477                           "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
3478                           "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
3479                           "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
3480                           "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
3481                           "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
3482                           "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
3483                           "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
3484                           "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
3485                           "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
3486                           "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
3487                           "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
3488                           "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
3489                           "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
3490                           "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
3491                           "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
3492                           "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
3493                           "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
3494                           "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
3495                           "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
3496                           "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
3497                           "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
3498                           "\x3e\xae\x71\x90\x07\x70\x1c\x38"
3499                           "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
3500                           "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
3501                           "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
3502                           "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
3503                           "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
3504                           "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
3505                           "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
3506                           "\x93\x51\x1d\x3d\x62\x59\x83\x82"
3507                           "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
3508                           "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
3509                           "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
3510                           "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
3511                           "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
3512                           "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
3513                           "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
3514                           "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
3515                           "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
3516                           "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
3517                           "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
3518                           "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
3519                           "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
3520                           "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
3521                           "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
3522                           "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
3523                           "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
3524                           "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
3525                           "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
3526                           "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
3527                 .ilen   = 512,
3528                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
3529                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
3530                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
3531                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
3532                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
3533                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
3534                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
3535                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
3536                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
3537                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
3538                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
3539                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
3540                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
3541                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
3542                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
3543                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
3544                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
3545                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
3546                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
3547                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
3548                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
3549                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
3550                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
3551                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
3552                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
3553                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
3554                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
3555                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
3556                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
3557                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
3558                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
3559                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
3560                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
3561                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
3562                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
3563                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
3564                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
3565                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
3566                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
3567                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
3568                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
3569                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
3570                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
3571                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
3572                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
3573                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
3574                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
3575                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
3576                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
3577                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
3578                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
3579                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
3580                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
3581                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
3582                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
3583                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
3584                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
3585                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
3586                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
3587                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
3588                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
3589                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
3590                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
3591                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
3592                 .rlen   = 512,
3593         },
3594 };
3595
3596 /*
3597  * Serpent test vectors.  These are backwards because Serpent writes
3598  * octet sequences in right-to-left mode.
3599  */
3600 #define SERPENT_ENC_TEST_VECTORS        5
3601 #define SERPENT_DEC_TEST_VECTORS        5
3602
3603 #define TNEPRES_ENC_TEST_VECTORS        4
3604 #define TNEPRES_DEC_TEST_VECTORS        4
3605
3606 #define SERPENT_CBC_ENC_TEST_VECTORS    1
3607 #define SERPENT_CBC_DEC_TEST_VECTORS    1
3608
3609 #define SERPENT_CTR_ENC_TEST_VECTORS    2
3610 #define SERPENT_CTR_DEC_TEST_VECTORS    2
3611
3612 #define SERPENT_LRW_ENC_TEST_VECTORS    8
3613 #define SERPENT_LRW_DEC_TEST_VECTORS    8
3614
3615 static struct cipher_testvec serpent_enc_tv_template[] = {
3616         {
3617                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
3618                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3619                 .ilen   = 16,
3620                 .result = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
3621                           "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
3622                 .rlen   = 16,
3623         }, {
3624                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3625                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3626                 .klen   = 16,
3627                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
3628                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3629                 .ilen   = 16,
3630                 .result = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
3631                           "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
3632                 .rlen   = 16,
3633         }, {
3634                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3635                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3636                           "\x10\x11\x12\x13\x14\x15\x16\x17"
3637                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3638                 .klen   = 32,
3639                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
3640                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3641                 .ilen   = 16,
3642                 .result = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
3643                           "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
3644                 .rlen   = 16,
3645         }, {
3646                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
3647                 .klen   = 16,
3648                 .input  = zeroed_string,
3649                 .ilen   = 16,
3650                 .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
3651                           "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
3652                 .rlen   = 16,
3653         }, { /* Generated with Crypto++ */
3654                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3655                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3656                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3657                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3658                 .klen   = 32,
3659                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3660                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3661                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3662                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3663                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3664                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3665                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3666                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3667                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3668                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3669                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3670                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3671                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3672                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3673                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3674                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3675                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3676                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3677                 .ilen   = 144,
3678                 .result = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
3679                           "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
3680                           "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
3681                           "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
3682                           "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
3683                           "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
3684                           "\x99\x34\x89\x5B\x54\xE9\x12\x13"
3685                           "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
3686                           "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
3687                           "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
3688                           "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
3689                           "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
3690                           "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
3691                           "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
3692                           "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
3693                           "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
3694                           "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
3695                           "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
3696                 .rlen   = 144,
3697         },
3698 };
3699
3700 static struct cipher_testvec tnepres_enc_tv_template[] = {
3701         { /* KeySize=128, PT=0, I=1 */
3702                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
3703                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3704                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
3705                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3706                 .klen   = 16,
3707                 .ilen   = 16,
3708                 .result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05"
3709                           "\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd",
3710                 .rlen   = 16,
3711         }, { /* KeySize=192, PT=0, I=1 */
3712                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
3713                           "\x00\x00\x00\x00\x00\x00\x00\x00"
3714                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3715                 .klen   = 24,
3716                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
3717                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3718                 .ilen   = 16,
3719                 .result = "\xe7\x8e\x54\x02\xc7\x19\x55\x68"
3720                           "\xac\x36\x78\xf7\xa3\xf6\x0c\x66",
3721                 .rlen   = 16,
3722         }, { /* KeySize=256, PT=0, I=1 */
3723                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
3724                           "\x00\x00\x00\x00\x00\x00\x00\x00"
3725                           "\x00\x00\x00\x00\x00\x00\x00\x00"
3726                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3727                 .klen   = 32,
3728                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
3729                           "\x00\x00\x00\x00\x00\x00\x00\x00",
3730                 .ilen   = 16,
3731                 .result = "\xab\xed\x96\xe7\x66\xbf\x28\xcb"
3732                           "\xc0\xeb\xd2\x1a\x82\xef\x08\x19",
3733                 .rlen   = 16,
3734         }, { /* KeySize=256, I=257 */
3735                 .key    = "\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18"
3736                           "\x17\x16\x15\x14\x13\x12\x11\x10"
3737                           "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
3738                           "\x07\x06\x05\x04\x03\x02\x01\x00",
3739                 .klen   = 32,
3740                 .input  = "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
3741                           "\x07\x06\x05\x04\x03\x02\x01\x00",
3742                 .ilen   = 16,
3743                 .result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b"
3744                           "\xb8\x32\xe4\x33\xf8\x9f\x26\xde",
3745                 .rlen   = 16,
3746         },
3747 };
3748
3749
3750 static struct cipher_testvec serpent_dec_tv_template[] = {
3751         {
3752                 .input  = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
3753                           "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
3754                 .ilen   = 16,
3755                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3756                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3757                 .rlen   = 16,
3758         }, {
3759                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3760                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3761                 .klen   = 16,
3762                 .input  = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
3763                           "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
3764                 .ilen   = 16,
3765                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3766                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3767                 .rlen   = 16,
3768         }, {
3769                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3770                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3771                           "\x10\x11\x12\x13\x14\x15\x16\x17"
3772                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3773                 .klen   = 32,
3774                 .input  = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
3775                           "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
3776                 .ilen   = 16,
3777                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3778                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3779                 .rlen   = 16,
3780         }, {
3781                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
3782                 .klen   = 16,
3783                 .input  = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
3784                           "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
3785                 .ilen   = 16,
3786                 .result = zeroed_string,
3787                 .rlen   = 16,
3788         }, { /* Generated with Crypto++ */
3789                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3790                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3791                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3792                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3793                 .klen   = 32,
3794                 .input  = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
3795                           "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
3796                           "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
3797                           "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
3798                           "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
3799                           "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
3800                           "\x99\x34\x89\x5B\x54\xE9\x12\x13"
3801                           "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
3802                           "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
3803                           "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
3804                           "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
3805                           "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
3806                           "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
3807                           "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
3808                           "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
3809                           "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
3810                           "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
3811                           "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
3812                 .ilen   = 144,
3813                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3814                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3815                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3816                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3817                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3818                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3819                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3820                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3821                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3822                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3823                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3824                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3825                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3826                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3827                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3828                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3829                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3830                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3831                 .rlen   = 144,
3832         },
3833 };
3834
3835 static struct cipher_testvec tnepres_dec_tv_template[] = {
3836         {
3837                 .input  = "\x41\xcc\x6b\x31\x59\x31\x45\x97"
3838                           "\x6d\x6f\xbb\x38\x4b\x37\x21\x28",
3839                 .ilen   = 16,
3840                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3841                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3842                 .rlen   = 16,
3843         }, {
3844                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3845                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3846                 .klen   = 16,
3847                 .input  = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47"
3848                           "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e",
3849                 .ilen   = 16,
3850                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3851                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3852                 .rlen   = 16,
3853         }, {
3854                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3855                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3856                           "\x10\x11\x12\x13\x14\x15\x16\x17"
3857                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3858                 .klen   = 32,
3859                 .input  = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49"
3860                           "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee",
3861                 .ilen   = 16,
3862                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
3863                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3864                 .rlen   = 16,
3865         }, { /* KeySize=128, I=121 */
3866                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
3867                 .klen   = 16,
3868                 .input  = "\x3d\xda\xbf\xc0\x06\xda\xab\x06"
3869                           "\x46\x2a\xf4\xef\x81\x54\x4e\x26",
3870                 .ilen   = 16,
3871                 .result = zeroed_string,
3872                 .rlen   = 16,
3873         },
3874 };
3875
3876 static struct cipher_testvec serpent_cbc_enc_tv_template[] = {
3877         { /* Generated with Crypto++ */
3878                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3879                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3880                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3881                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3882                 .klen   = 32,
3883                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3884                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3885                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3886                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3887                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3888                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3889                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3890                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3891                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3892                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3893                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3894                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3895                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3896                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3897                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3898                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3899                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3900                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3901                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3902                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3903                 .ilen   = 144,
3904                 .result = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
3905                           "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
3906                           "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
3907                           "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
3908                           "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
3909                           "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
3910                           "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
3911                           "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
3912                           "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
3913                           "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
3914                           "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
3915                           "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
3916                           "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
3917                           "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
3918                           "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
3919                           "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
3920                           "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
3921                           "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
3922                 .rlen   = 144,
3923         },
3924 };
3925
3926 static struct cipher_testvec serpent_cbc_dec_tv_template[] = {
3927         { /* Generated with Crypto++ */
3928                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3929                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3930                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3931                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3932                 .klen   = 32,
3933                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3934                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3935                 .input  = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
3936                           "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
3937                           "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
3938                           "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
3939                           "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
3940                           "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
3941                           "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
3942                           "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
3943                           "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
3944                           "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
3945                           "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
3946                           "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
3947                           "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
3948                           "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
3949                           "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
3950                           "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
3951                           "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
3952                           "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
3953                 .ilen   = 144,
3954                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3955                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3956                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3957                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3958                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3959                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3960                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3961                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3962                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3963                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3964                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3965                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3966                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3967                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3968                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3969                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3970                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3971                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3972                 .rlen   = 144,
3973         },
3974 };
3975
3976 static struct cipher_testvec serpent_ctr_enc_tv_template[] = {
3977         { /* Generated with Crypto++ */
3978                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3979                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3980                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3981                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3982                 .klen   = 32,
3983                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3984                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3985                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3986                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3987                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3988                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3989                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3990                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3991                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3992                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3993                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3994                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3995                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3996                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3997                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3998                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3999                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
4000                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
4001                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
4002                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
4003                 .ilen   = 144,
4004                 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
4005                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
4006                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
4007                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
4008                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
4009                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
4010                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
4011                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
4012                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
4013                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
4014                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
4015                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
4016                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
4017                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
4018                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
4019                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
4020                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
4021                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
4022                 .rlen   = 144,
4023         }, { /* Generated with Crypto++ */
4024                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
4025                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
4026                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
4027                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
4028                 .klen   = 32,
4029                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
4030                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
4031                 .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
4032                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
4033                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
4034                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
4035                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
4036                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
4037                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
4038                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
4039                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
4040                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
4041                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
4042                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
4043                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
4044                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
4045                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
4046                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
4047                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
4048                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
4049                           "\xF1\x65\xFC",
4050                 .ilen   = 147,
4051                 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
4052                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
4053                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
4054                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
4055                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
4056                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
4057                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
4058                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
4059                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
4060                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
4061                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
4062                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
4063                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
4064                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
4065                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
4066                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
4067                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
4068                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
4069                           "\xE6\xD0\x97",
4070                 .rlen   = 147,
4071         },
4072 };
4073
4074 static struct cipher_testvec serpent_ctr_dec_tv_template[] = {
4075         { /* Generated with Crypto++ */
4076                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
4077                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
4078                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
4079                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
4080                 .klen   = 32,
4081                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
4082                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
4083                 .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
4084                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
4085                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
4086                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
4087                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
4088                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
4089                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
4090                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
4091                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
4092                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
4093                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
4094                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
4095                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
4096                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
4097                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
4098                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
4099                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
4100                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
4101                 .ilen   = 144,
4102                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
4103                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
4104                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
4105                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
4106                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
4107                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
4108                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
4109                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
4110                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
4111                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
4112                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
4113                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
4114                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
4115                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
4116                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
4117                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
4118                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
4119                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
4120                 .rlen   = 144,
4121         }, { /* Generated with Crypto++ */
4122                 .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
4123                           "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
4124                           "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
4125                           "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
4126                 .klen   = 32,
4127                 .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
4128                           "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
4129                 .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
4130                           "\x37\x69\xE3\x3A\x22\x85\x48\x46"
4131                           "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
4132                           "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
4133                           "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
4134                           "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
4135                           "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
4136                           "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
4137                           "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
4138                           "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
4139                           "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
4140                           "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
4141                           "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
4142                           "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
4143                           "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
4144                           "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
4145                           "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
4146                           "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
4147                           "\xE6\xD0\x97",
4148                 .ilen   = 147,
4149                 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
4150                           "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
4151                           "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
4152                           "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
4153                           "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
4154                           "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
4155                           "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
4156                           "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
4157                           "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
4158                           "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
4159                           "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
4160                           "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
4161                           "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
4162                           "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
4163                           "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
4164                           "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
4165                           "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
4166                           "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
4167                           "\xF1\x65\xFC",
4168                 .rlen   = 147,
4169         },
4170 };
4171
4172 static struct cipher_testvec serpent_lrw_enc_tv_template[] = {
4173         /* Generated from AES-LRW test vectors */
4174         {
4175                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
4176                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
4177                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
4178                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
4179                 .klen   = 32,
4180                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4181                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4182                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4183                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4184                 .ilen   = 16,
4185                 .result = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
4186                           "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
4187                 .rlen   = 16,
4188         }, {
4189                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
4190                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
4191                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
4192                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
4193                 .klen   = 32,
4194                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4195                           "\x00\x00\x00\x00\x00\x00\x00\x02",
4196                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4197                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4198                 .ilen   = 16,
4199                 .result = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
4200                           "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
4201                 .rlen   = 16,
4202         }, {
4203                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
4204                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
4205                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
4206                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
4207                 .klen   = 32,
4208                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4209                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4210                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4211                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4212                 .ilen   = 16,
4213                 .result = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
4214                           "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
4215                 .rlen   = 16,
4216         }, {
4217                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
4218                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
4219                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
4220                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
4221                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
4222                 .klen   = 40,
4223                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4224                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4225                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4226                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4227                 .ilen   = 16,
4228                 .result = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
4229                           "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
4230                 .rlen   = 16,
4231         }, {
4232                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
4233                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
4234                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
4235                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
4236                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
4237                 .klen   = 40,
4238                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4239                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4240                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4241                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4242                 .ilen   = 16,
4243                 .result = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
4244                           "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
4245                 .rlen   = 16,
4246         }, {
4247                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4248                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4249                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4250                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4251                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4252                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4253                 .klen   = 48,
4254                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4255                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4256                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4257                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4258                 .ilen   = 16,
4259                 .result = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
4260                           "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
4261                 .rlen   = 16,
4262         }, {
4263                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
4264                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
4265                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
4266                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
4267                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
4268                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
4269                 .klen   = 48,
4270                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4271                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4272                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
4273                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4274                 .ilen   = 16,
4275                 .result = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
4276                           "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
4277                 .rlen   = 16,
4278         }, {
4279                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4280                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4281                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4282                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4283                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4284                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4285                 .klen   = 48,
4286                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4287                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4288                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
4289                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
4290                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
4291                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
4292                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
4293                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
4294                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
4295                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
4296                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
4297                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
4298                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
4299                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
4300                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
4301                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
4302                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
4303                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
4304                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
4305                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
4306                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
4307                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
4308                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
4309                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
4310                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
4311                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
4312                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
4313                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
4314                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
4315                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
4316                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
4317                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
4318                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
4319                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
4320                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
4321                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
4322                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
4323                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
4324                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
4325                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
4326                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
4327                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
4328                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
4329                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
4330                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
4331                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
4332                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
4333                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
4334                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
4335                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
4336                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
4337                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
4338                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
4339                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
4340                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
4341                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
4342                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
4343                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
4344                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
4345                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
4346                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
4347                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
4348                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
4349                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
4350                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
4351                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
4352                 .ilen   = 512,
4353                 .result = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
4354                           "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
4355                           "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
4356                           "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
4357                           "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
4358                           "\xce\xab\xda\x33\x30\x20\x12\xfa"
4359                           "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
4360                           "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
4361                           "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
4362                           "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
4363                           "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
4364                           "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
4365                           "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
4366                           "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
4367                           "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
4368                           "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
4369                           "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
4370                           "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
4371                           "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
4372                           "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
4373                           "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
4374                           "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
4375                           "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
4376                           "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
4377                           "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
4378                           "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
4379                           "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
4380                           "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
4381                           "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
4382                           "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
4383                           "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
4384                           "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
4385                           "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
4386                           "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
4387                           "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
4388                           "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
4389                           "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
4390                           "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
4391                           "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
4392                           "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
4393                           "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
4394                           "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
4395                           "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
4396                           "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
4397                           "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
4398                           "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
4399                           "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
4400                           "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
4401                           "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
4402                           "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
4403                           "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
4404                           "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
4405                           "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
4406                           "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
4407                           "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
4408                           "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
4409                           "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
4410                           "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
4411                           "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
4412                           "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
4413                           "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
4414                           "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
4415                           "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
4416                           "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
4417                 .rlen   = 512,
4418         },
4419 };
4420
4421 static struct cipher_testvec serpent_lrw_dec_tv_template[] = {
4422         /* Generated from AES-LRW test vectors */
4423         /* same as enc vectors with input and result reversed */
4424         {
4425                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
4426                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
4427                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
4428                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
4429                 .klen   = 32,
4430                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4431                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4432                 .input  = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
4433                           "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
4434                 .ilen   = 16,
4435                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4436                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4437                 .rlen   = 16,
4438         }, {
4439                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
4440                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
4441                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
4442                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
4443                 .klen   = 32,
4444                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4445                           "\x00\x00\x00\x00\x00\x00\x00\x02",
4446                 .input  = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
4447                           "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
4448                 .ilen   = 16,
4449                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4450                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4451                 .rlen   = 16,
4452         }, {
4453                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
4454                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
4455                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
4456                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
4457                 .klen   = 32,
4458                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4459                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4460                 .input  = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
4461                           "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
4462                 .ilen   = 16,
4463                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4464                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4465                 .rlen   = 16,
4466         }, {
4467                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
4468                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
4469                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
4470                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
4471                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
4472                 .klen   = 40,
4473                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4474                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4475                 .input  = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
4476                           "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
4477                 .ilen   = 16,
4478                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4479                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4480                 .rlen   = 16,
4481         }, {
4482                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
4483                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
4484                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
4485                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
4486                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
4487                 .klen   = 40,
4488                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4489                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4490                 .input  = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
4491                           "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
4492                 .ilen   = 16,
4493                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4494                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4495                 .rlen   = 16,
4496         }, {
4497                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4498                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4499                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4500                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4501                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4502                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4503                 .klen   = 48,
4504                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4505                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4506                 .input  = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
4507                           "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
4508                 .ilen   = 16,
4509                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4510                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4511                 .rlen   = 16,
4512         }, {
4513                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
4514                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
4515                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
4516                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
4517                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
4518                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
4519                 .klen   = 48,
4520                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4521                           "\x00\x00\x00\x02\x00\x00\x00\x00",
4522                 .input  = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
4523                           "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
4524                 .ilen   = 16,
4525                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
4526                           "\x38\x39\x41\x42\x43\x44\x45\x46",
4527                 .rlen   = 16,
4528         }, {
4529                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
4530                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
4531                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
4532                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
4533                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
4534                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
4535                 .klen   = 48,
4536                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4537                           "\x00\x00\x00\x00\x00\x00\x00\x01",
4538                 .input  = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
4539                           "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
4540                           "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
4541                           "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
4542                           "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
4543                           "\xce\xab\xda\x33\x30\x20\x12\xfa"
4544                           "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
4545                           "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
4546                           "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
4547                           "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
4548                           "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
4549                           "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
4550                           "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
4551                           "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
4552                           "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
4553                           "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
4554                           "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
4555                           "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
4556                           "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
4557                           "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
4558                           "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
4559                           "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
4560                           "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
4561                           "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
4562                           "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
4563                           "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
4564                           "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
4565                           "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
4566                           "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
4567                           "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
4568                           "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
4569                           "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
4570                           "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
4571                           "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
4572                           "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
4573                           "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
4574                           "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
4575                           "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
4576                           "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
4577                           "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
4578                           "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
4579                           "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
4580                           "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
4581                           "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
4582                           "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
4583                           "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
4584                           "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
4585                           "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
4586                           "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
4587                           "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
4588                           "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
4589                           "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
4590                           "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
4591                           "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
4592                           "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
4593                           "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
4594                           "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
4595                           "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
4596                           "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
4597                           "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
4598                           "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
4599                           "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
4600                           "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
4601                           "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
4602                 .ilen   = 512,
4603                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
4604                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
4605                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
4606                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
4607                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
4608                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
4609                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
4610                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
4611                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
4612                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
4613                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
4614                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
4615                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
4616                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
4617                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
4618                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
4619                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
4620                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
4621                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
4622                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
4623                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
4624                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
4625                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
4626                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
4627                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
4628                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
4629                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
4630                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
4631                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
4632                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
4633                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
4634                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
4635                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
4636                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
4637                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
4638                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
4639                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
4640                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
4641                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
4642                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
4643                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
4644                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
4645                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
4646                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
4647                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
4648                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
4649                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
4650                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
4651                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
4652                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
4653                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
4654                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
4655                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
4656                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
4657                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
4658                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
4659                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
4660                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
4661                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
4662                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
4663                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
4664                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
4665                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
4666                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
4667                 .rlen   = 512,
4668         },
4669 };
4670
4671 /* Cast6 test vectors from RFC 2612 */
4672 #define CAST6_ENC_TEST_VECTORS  3
4673 #define CAST6_DEC_TEST_VECTORS  3
4674
4675 static struct cipher_testvec cast6_enc_tv_template[] = {
4676         {
4677                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4678                           "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
4679                 .klen   = 16,
4680                 .input  = zeroed_string,
4681                 .ilen   = 16,
4682                 .result = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
4683                           "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
4684                 .rlen   = 16,
4685         }, {
4686                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4687                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
4688                           "\xba\xc7\x7a\x77\x17\x94\x28\x63",
4689                 .klen   = 24,
4690                 .input  = zeroed_string,
4691                 .ilen   = 16,
4692                 .result = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
4693                           "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
4694                 .rlen   = 16,
4695         }, {
4696                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4697                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
4698                           "\x8d\x7c\x47\xce\x26\x49\x08\x46"
4699                           "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
4700                 .klen   = 32,
4701                 .input  = zeroed_string,
4702                 .ilen   = 16,
4703                 .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
4704                           "\xc9\x87\x01\x36\x55\x33\x17\xfa",
4705                 .rlen   = 16,
4706         },
4707 };
4708
4709 static struct cipher_testvec cast6_dec_tv_template[] = {
4710         {
4711                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4712                           "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
4713                 .klen   = 16,
4714                 .input  = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
4715                           "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
4716                 .ilen   = 16,
4717                 .result = zeroed_string,
4718                 .rlen   = 16,
4719         }, {
4720                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4721                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
4722                           "\xba\xc7\x7a\x77\x17\x94\x28\x63",
4723                 .klen   = 24,
4724                 .input  = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
4725                           "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
4726                 .ilen   = 16,
4727                 .result = zeroed_string,
4728                 .rlen   = 16,
4729         }, {
4730                 .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
4731                           "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
4732                           "\x8d\x7c\x47\xce\x26\x49\x08\x46"
4733                           "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
4734                 .klen   = 32,
4735                 .input  = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
4736                           "\xc9\x87\x01\x36\x55\x33\x17\xfa",
4737                 .ilen   = 16,
4738                 .result = zeroed_string,
4739                 .rlen   = 16,
4740         },
4741 };
4742
4743
4744 /*
4745  * AES test vectors.
4746  */
4747 #define AES_ENC_TEST_VECTORS 3
4748 #define AES_DEC_TEST_VECTORS 3
4749 #define AES_CBC_ENC_TEST_VECTORS 4
4750 #define AES_CBC_DEC_TEST_VECTORS 4
4751 #define AES_LRW_ENC_TEST_VECTORS 8
4752 #define AES_LRW_DEC_TEST_VECTORS 8
4753 #define AES_XTS_ENC_TEST_VECTORS 5
4754 #define AES_XTS_DEC_TEST_VECTORS 5
4755 #define AES_CTR_ENC_TEST_VECTORS 3
4756 #define AES_CTR_DEC_TEST_VECTORS 3
4757 #define AES_OFB_ENC_TEST_VECTORS 1
4758 #define AES_OFB_DEC_TEST_VECTORS 1
4759 #define AES_CTR_3686_ENC_TEST_VECTORS 7
4760 #define AES_CTR_3686_DEC_TEST_VECTORS 6
4761 #define AES_GCM_ENC_TEST_VECTORS 9
4762 #define AES_GCM_DEC_TEST_VECTORS 8
4763 #define AES_GCM_4106_ENC_TEST_VECTORS 7
4764 #define AES_GCM_4106_DEC_TEST_VECTORS 7
4765 #define AES_CCM_ENC_TEST_VECTORS 7
4766 #define AES_CCM_DEC_TEST_VECTORS 7
4767 #define AES_CCM_4309_ENC_TEST_VECTORS 7
4768 #define AES_CCM_4309_DEC_TEST_VECTORS 10
4769
4770 static struct cipher_testvec aes_enc_tv_template[] = {
4771         { /* From FIPS-197 */
4772                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4773                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4774                 .klen   = 16,
4775                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
4776                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4777                 .ilen   = 16,
4778                 .result = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
4779                           "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
4780                 .rlen   = 16,
4781         }, {
4782                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4783                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4784                           "\x10\x11\x12\x13\x14\x15\x16\x17",
4785                 .klen   = 24,
4786                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
4787                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4788                 .ilen   = 16,
4789                 .result = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
4790                           "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
4791                 .rlen   = 16,
4792         }, {
4793                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4794                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4795                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4796                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4797                 .klen   = 32,
4798                 .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
4799                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4800                 .ilen   = 16,
4801                 .result = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
4802                           "\xea\xfc\x49\x90\x4b\x49\x60\x89",
4803                 .rlen   = 16,
4804         },
4805 };
4806
4807 static struct cipher_testvec aes_dec_tv_template[] = {
4808         { /* From FIPS-197 */
4809                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4810                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4811                 .klen   = 16,
4812                 .input  = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
4813                           "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
4814                 .ilen   = 16,
4815                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
4816                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4817                 .rlen   = 16,
4818         }, {
4819                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4820                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4821                           "\x10\x11\x12\x13\x14\x15\x16\x17",
4822                 .klen   = 24,
4823                 .input  = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
4824                           "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
4825                 .ilen   = 16,
4826                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
4827                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4828                 .rlen   = 16,
4829         }, {
4830                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
4831                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4832                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4833                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4834                 .klen   = 32,
4835                 .input  = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
4836                           "\xea\xfc\x49\x90\x4b\x49\x60\x89",
4837                 .ilen   = 16,
4838                 .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
4839                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
4840                 .rlen   = 16,
4841         },
4842 };
4843
4844 static struct cipher_testvec aes_cbc_enc_tv_template[] = {
4845         { /* From RFC 3602 */
4846                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
4847                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
4848                 .klen   = 16,
4849                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
4850                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
4851                 .input  = "Single block msg",
4852                 .ilen   = 16,
4853                 .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
4854                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
4855                 .rlen   = 16,
4856         }, {
4857                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
4858                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
4859                 .klen   = 16,
4860                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
4861                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
4862                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
4863                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4864                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4865                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4866                 .ilen   = 32,
4867                 .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
4868                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
4869                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
4870                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
4871                 .rlen   = 32,
4872         }, { /* From NIST SP800-38A */
4873                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
4874                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
4875                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
4876                 .klen   = 24,
4877                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
4878                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4879                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
4880                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
4881                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
4882                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
4883                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
4884                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
4885                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
4886                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
4887                 .ilen   = 64,
4888                 .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
4889                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
4890                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
4891                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
4892                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
4893                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
4894                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
4895                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
4896                 .rlen   = 64,
4897         }, {
4898                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
4899                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
4900                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
4901                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
4902                 .klen   = 32,
4903                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
4904                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4905                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
4906                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
4907                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
4908                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
4909                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
4910                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
4911                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
4912                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
4913                 .ilen   = 64,
4914                 .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
4915                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
4916                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
4917                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
4918                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
4919                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
4920                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
4921                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
4922                 .rlen   = 64,
4923         },
4924 };
4925
4926 static struct cipher_testvec aes_cbc_dec_tv_template[] = {
4927         { /* From RFC 3602 */
4928                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
4929                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
4930                 .klen   = 16,
4931                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
4932                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
4933                 .input  = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
4934                           "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
4935                 .ilen   = 16,
4936                 .result = "Single block msg",
4937                 .rlen   = 16,
4938         }, {
4939                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
4940                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
4941                 .klen   = 16,
4942                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
4943                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
4944                 .input  = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
4945                           "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
4946                           "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
4947                           "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
4948                 .ilen   = 32,
4949                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
4950                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4951                           "\x10\x11\x12\x13\x14\x15\x16\x17"
4952                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4953                 .rlen   = 32,
4954         }, { /* From NIST SP800-38A */
4955                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
4956                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
4957                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
4958                 .klen   = 24,
4959                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
4960                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4961                 .input  = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
4962                           "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
4963                           "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
4964                           "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
4965                           "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
4966                           "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
4967                           "\x08\xb0\xe2\x79\x88\x59\x88\x81"
4968                           "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
4969                 .ilen   = 64,
4970                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
4971                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
4972                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
4973                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
4974                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
4975                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
4976                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
4977                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
4978                 .rlen   = 64,
4979         }, {
4980                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
4981                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
4982                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
4983                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
4984                 .klen   = 32,
4985                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
4986                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
4987                 .input  = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
4988                           "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
4989                           "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
4990                           "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
4991                           "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
4992                           "\xa5\x30\xe2\x63\x04\x23\x14\x61"
4993                           "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
4994                           "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
4995                 .ilen   = 64,
4996                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
4997                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
4998                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
4999                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5000                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
5001                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
5002                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
5003                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
5004                 .rlen   = 64,
5005         },
5006 };
5007
5008 static struct cipher_testvec aes_lrw_enc_tv_template[] = {
5009         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
5010         { /* LRW-32-AES 1 */
5011                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
5012                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
5013                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
5014                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
5015                 .klen   = 32,
5016                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5017                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5018                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5019                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5020                 .ilen   = 16,
5021                 .result = "\xf1\xb2\x73\xcd\x65\xa3\xdf\x5f"
5022                           "\xe9\x5d\x48\x92\x54\x63\x4e\xb8",
5023                 .rlen   = 16,
5024         }, { /* LRW-32-AES 2 */
5025                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
5026                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
5027                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
5028                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
5029                 .klen   = 32,
5030                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5031                           "\x00\x00\x00\x00\x00\x00\x00\x02",
5032                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5033                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5034                 .ilen   = 16,
5035                 .result = "\x00\xc8\x2b\xae\x95\xbb\xcd\xe5"
5036                           "\x27\x4f\x07\x69\xb2\x60\xe1\x36",
5037                 .rlen   = 16,
5038         }, { /* LRW-32-AES 3 */
5039                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
5040                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
5041                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
5042                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
5043                 .klen   = 32,
5044                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5045                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5046                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5047                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5048                 .ilen   = 16,
5049                 .result = "\x76\x32\x21\x83\xed\x8f\xf1\x82"
5050                           "\xf9\x59\x62\x03\x69\x0e\x5e\x01",
5051                 .rlen   = 16,
5052         }, { /* LRW-32-AES 4 */
5053                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
5054                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
5055                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
5056                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
5057                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
5058                 .klen   = 40,
5059                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5060                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5061                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5062                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5063                 .ilen   = 16,
5064                 .result = "\x9c\x0f\x15\x2f\x55\xa2\xd8\xf0"
5065                           "\xd6\x7b\x8f\x9e\x28\x22\xbc\x41",
5066                 .rlen   = 16,
5067         }, { /* LRW-32-AES 5 */
5068                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
5069                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
5070                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
5071                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
5072                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
5073                 .klen   = 40,
5074                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5075                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5076                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5077                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5078                 .ilen   = 16,
5079                 .result = "\xd4\x27\x6a\x7f\x14\x91\x3d\x65"
5080                           "\xc8\x60\x48\x02\x87\xe3\x34\x06",
5081                 .rlen   = 16,
5082         }, { /* LRW-32-AES 6 */
5083                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5084                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5085                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5086                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5087                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5088                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5089                 .klen   = 48,
5090                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5091                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5092                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5093                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5094                 .ilen   = 16,
5095                 .result = "\xbd\x06\xb8\xe1\xdb\x98\x89\x9e"
5096                           "\xc4\x98\xe4\x91\xcf\x1c\x70\x2b",
5097                 .rlen   = 16,
5098         }, { /* LRW-32-AES 7 */
5099                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
5100                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
5101                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
5102                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
5103                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
5104                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
5105                 .klen   = 48,
5106                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5107                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5108                 .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5109                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5110                 .ilen   = 16,
5111                 .result = "\x5b\x90\x8e\xc1\xab\xdd\x67\x5f"
5112                           "\x3d\x69\x8a\x95\x53\xc8\x9c\xe5",
5113                 .rlen   = 16,
5114         }, {
5115 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
5116                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5117                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5118                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5119                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5120                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5121                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5122                 .klen   = 48,
5123                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5124                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5125                 .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
5126                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
5127                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
5128                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
5129                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
5130                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
5131                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
5132                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
5133                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
5134                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
5135                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
5136                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
5137                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
5138                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
5139                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
5140                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
5141                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
5142                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
5143                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
5144                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
5145                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
5146                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
5147                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
5148                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
5149                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
5150                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
5151                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
5152                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
5153                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
5154                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
5155                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
5156                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
5157                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
5158                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
5159                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
5160                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
5161                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
5162                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
5163                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
5164                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
5165                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
5166                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
5167                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
5168                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
5169                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
5170                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
5171                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
5172                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
5173                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
5174                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
5175                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
5176                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
5177                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
5178                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
5179                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
5180                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
5181                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
5182                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
5183                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
5184                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
5185                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
5186                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
5187                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
5188                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
5189                 .ilen   = 512,
5190                 .result = "\x1a\x1d\xa9\x30\xad\xf9\x2f\x9b"
5191                           "\xb6\x1d\xae\xef\xf0\x2f\xf8\x5a"
5192                           "\x39\x3c\xbf\x2a\xb2\x45\xb2\x23"
5193                           "\x1b\x63\x3c\xcf\xaa\xbe\xcf\x4e"
5194                           "\xfa\xe8\x29\xc2\x20\x68\x2b\x3c"
5195                           "\x2e\x8b\xf7\x6e\x25\xbd\xe3\x3d"
5196                           "\x66\x27\xd6\xaf\xd6\x64\x3e\xe3"
5197                           "\xe8\x58\x46\x97\x39\x51\x07\xde"
5198                           "\xcb\x37\xbc\xa9\xc0\x5f\x75\xc3"
5199                           "\x0e\x84\x23\x1d\x16\xd4\x1c\x59"
5200                           "\x9c\x1a\x02\x55\xab\x3a\x97\x1d"
5201                           "\xdf\xdd\xc7\x06\x51\xd7\x70\xae"
5202                           "\x23\xc6\x8c\xf5\x1e\xa0\xe5\x82"
5203                           "\xb8\xb2\xbf\x04\xa0\x32\x8e\x68"
5204                           "\xeb\xaf\x6e\x2d\x94\x22\x2f\xce"
5205                           "\x4c\xb5\x59\xe2\xa2\x2f\xa0\x98"
5206                           "\x1a\x97\xc6\xd4\xb5\x00\x59\xf2"
5207                           "\x84\x14\x72\xb1\x9a\x6e\xa3\x7f"
5208                           "\xea\x20\xe7\xcb\x65\x77\x3a\xdf"
5209                           "\xc8\x97\x67\x15\xc2\x2a\x27\xcc"
5210                           "\x18\x55\xa1\x24\x0b\x24\x24\xaf"
5211                           "\x5b\xec\x68\xb8\xc8\xf5\xba\x63"
5212                           "\xff\xed\x89\xce\xd5\x3d\x88\xf3"
5213                           "\x25\xef\x05\x7c\x3a\xef\xeb\xd8"
5214                           "\x7a\x32\x0d\xd1\x1e\x58\x59\x99"
5215                           "\x90\x25\xb5\x26\xb0\xe3\x2b\x6c"
5216                           "\x4c\xa9\x8b\x84\x4f\x5e\x01\x50"
5217                           "\x41\x30\x58\xc5\x62\x74\x52\x1d"
5218                           "\x45\x24\x6a\x42\x64\x4f\x97\x1c"
5219                           "\xa8\x66\xb5\x6d\x79\xd4\x0d\x48"
5220                           "\xc5\x5f\xf3\x90\x32\xdd\xdd\xe1"
5221                           "\xe4\xa9\x9f\xfc\xc3\x52\x5a\x46"
5222                           "\xe4\x81\x84\x95\x36\x59\x7a\x6b"
5223                           "\xaa\xb3\x60\xad\xce\x9f\x9f\x28"
5224                           "\xe0\x01\x75\x22\xc4\x4e\xa9\x62"
5225                           "\x5c\x62\x0d\x00\xcb\x13\xe8\x43"
5226                           "\x72\xd4\x2d\x53\x46\xb5\xd1\x16"
5227                           "\x22\x18\xdf\x34\x33\xf5\xd6\x1c"
5228                           "\xb8\x79\x78\x97\x94\xff\x72\x13"
5229                           "\x4c\x27\xfc\xcb\xbf\x01\x53\xa6"
5230                           "\xb4\x50\x6e\xde\xdf\xb5\x43\xa4"
5231                           "\x59\xdf\x52\xf9\x7c\xe0\x11\x6f"
5232                           "\x2d\x14\x8e\x24\x61\x2c\xe1\x17"
5233                           "\xcc\xce\x51\x0c\x19\x8a\x82\x30"
5234                           "\x94\xd5\x3d\x6a\x53\x06\x5e\xbd"
5235                           "\xb7\xeb\xfa\xfd\x27\x51\xde\x85"
5236                           "\x1e\x86\x53\x11\x53\x94\x00\xee"
5237                           "\x2b\x8c\x08\x2a\xbf\xdd\xae\x11"
5238                           "\xcb\x1e\xa2\x07\x9a\x80\xcf\x62"
5239                           "\x9b\x09\xdc\x95\x3c\x96\x8e\xb1"
5240                           "\x09\xbd\xe4\xeb\xdb\xca\x70\x7a"
5241                           "\x9e\xfa\x31\x18\x45\x3c\x21\x33"
5242                           "\xb0\xb3\x2b\xea\xf3\x71\x2d\xe1"
5243                           "\x03\xad\x1b\x48\xd4\x67\x27\xf0"
5244                           "\x62\xe4\x3d\xfb\x9b\x08\x76\xe7"
5245                           "\xdd\x2b\x01\x39\x04\x5a\x58\x7a"
5246                           "\xf7\x11\x90\xec\xbd\x51\x5c\x32"
5247                           "\x6b\xd7\x35\x39\x02\x6b\xf2\xa6"
5248                           "\xd0\x0d\x07\xe1\x06\xc4\x5b\x7d"
5249                           "\xe4\x6a\xd7\xee\x15\x1f\x83\xb4"
5250                           "\xa3\xa7\x5e\xc3\x90\xb7\xef\xd3"
5251                           "\xb7\x4f\xf8\x92\x4c\xb7\x3c\x29"
5252                           "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7"
5253                           "\x74\x3f\x7d\x58\x88\x75\xde\x3e",
5254                 .rlen   = 512,
5255         }
5256 };
5257
5258 static struct cipher_testvec aes_lrw_dec_tv_template[] = {
5259         /* from http://grouper.ieee.org/groups/1619/email/pdf00017.pdf */
5260         /* same as enc vectors with input and result reversed */
5261         { /* LRW-32-AES 1 */
5262                 .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
5263                           "\x4c\x26\x84\x14\xb5\x68\x01\x85"
5264                           "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
5265                           "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
5266                 .klen   = 32,
5267                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5268                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5269                 .input  = "\xf1\xb2\x73\xcd\x65\xa3\xdf\x5f"
5270                           "\xe9\x5d\x48\x92\x54\x63\x4e\xb8",
5271                 .ilen   = 16,
5272                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5273                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5274                 .rlen   = 16,
5275         }, { /* LRW-32-AES 2 */
5276                 .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
5277                           "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
5278                           "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
5279                           "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
5280                 .klen   = 32,
5281                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5282                           "\x00\x00\x00\x00\x00\x00\x00\x02",
5283                 .input  = "\x00\xc8\x2b\xae\x95\xbb\xcd\xe5"
5284                           "\x27\x4f\x07\x69\xb2\x60\xe1\x36",
5285                 .ilen   = 16,
5286                 .result  = "\x30\x31\x32\x33\x34\x35\x36\x37"
5287                            "\x38\x39\x41\x42\x43\x44\x45\x46",
5288                 .rlen   = 16,
5289         }, { /* LRW-32-AES 3 */
5290                 .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
5291                           "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
5292                           "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
5293                           "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
5294                 .klen   = 32,
5295                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5296                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5297                 .input  = "\x76\x32\x21\x83\xed\x8f\xf1\x82"
5298                           "\xf9\x59\x62\x03\x69\x0e\x5e\x01",
5299                 .ilen   = 16,
5300                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5301                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5302                 .rlen   = 16,
5303         }, { /* LRW-32-AES 4 */
5304                 .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
5305                           "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
5306                           "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
5307                           "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
5308                           "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
5309                 .klen   = 40,
5310                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5311                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5312                 .input  = "\x9c\x0f\x15\x2f\x55\xa2\xd8\xf0"
5313                           "\xd6\x7b\x8f\x9e\x28\x22\xbc\x41",
5314                 .ilen   = 16,
5315                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5316                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5317                 .rlen   = 16,
5318         }, { /* LRW-32-AES 5 */
5319                 .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
5320                           "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
5321                           "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
5322                           "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
5323                           "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
5324                 .klen   = 40,
5325                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5326                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5327                 .input  = "\xd4\x27\x6a\x7f\x14\x91\x3d\x65"
5328                           "\xc8\x60\x48\x02\x87\xe3\x34\x06",
5329                 .ilen   = 16,
5330                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5331                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5332                 .rlen   = 16,
5333         }, { /* LRW-32-AES 6 */
5334                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5335                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5336                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5337                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5338                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5339                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5340                 .klen   = 48,
5341                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5342                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5343                 .input  = "\xbd\x06\xb8\xe1\xdb\x98\x89\x9e"
5344                           "\xc4\x98\xe4\x91\xcf\x1c\x70\x2b",
5345                 .ilen   = 16,
5346                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5347                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5348                 .rlen   = 16,
5349         }, { /* LRW-32-AES 7 */
5350                 .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
5351                           "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
5352                           "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
5353                           "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
5354                           "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
5355                           "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
5356                 .klen   = 48,
5357                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5358                           "\x00\x00\x00\x02\x00\x00\x00\x00",
5359                 .input  = "\x5b\x90\x8e\xc1\xab\xdd\x67\x5f"
5360                           "\x3d\x69\x8a\x95\x53\xc8\x9c\xe5",
5361                 .ilen   = 16,
5362                 .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
5363                           "\x38\x39\x41\x42\x43\x44\x45\x46",
5364                 .rlen   = 16,
5365         }, {
5366 /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */
5367                 .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
5368                           "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
5369                           "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
5370                           "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
5371                           "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
5372                           "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
5373                 .klen   = 48,
5374                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5375                           "\x00\x00\x00\x00\x00\x00\x00\x01",
5376                 .input  = "\x1a\x1d\xa9\x30\xad\xf9\x2f\x9b"
5377                           "\xb6\x1d\xae\xef\xf0\x2f\xf8\x5a"
5378                           "\x39\x3c\xbf\x2a\xb2\x45\xb2\x23"
5379                           "\x1b\x63\x3c\xcf\xaa\xbe\xcf\x4e"
5380                           "\xfa\xe8\x29\xc2\x20\x68\x2b\x3c"
5381                           "\x2e\x8b\xf7\x6e\x25\xbd\xe3\x3d"
5382                           "\x66\x27\xd6\xaf\xd6\x64\x3e\xe3"
5383                           "\xe8\x58\x46\x97\x39\x51\x07\xde"
5384                           "\xcb\x37\xbc\xa9\xc0\x5f\x75\xc3"
5385                           "\x0e\x84\x23\x1d\x16\xd4\x1c\x59"
5386                           "\x9c\x1a\x02\x55\xab\x3a\x97\x1d"
5387                           "\xdf\xdd\xc7\x06\x51\xd7\x70\xae"
5388                           "\x23\xc6\x8c\xf5\x1e\xa0\xe5\x82"
5389                           "\xb8\xb2\xbf\x04\xa0\x32\x8e\x68"
5390                           "\xeb\xaf\x6e\x2d\x94\x22\x2f\xce"
5391                           "\x4c\xb5\x59\xe2\xa2\x2f\xa0\x98"
5392                           "\x1a\x97\xc6\xd4\xb5\x00\x59\xf2"
5393                           "\x84\x14\x72\xb1\x9a\x6e\xa3\x7f"
5394                           "\xea\x20\xe7\xcb\x65\x77\x3a\xdf"
5395                           "\xc8\x97\x67\x15\xc2\x2a\x27\xcc"
5396                           "\x18\x55\xa1\x24\x0b\x24\x24\xaf"
5397                           "\x5b\xec\x68\xb8\xc8\xf5\xba\x63"
5398                           "\xff\xed\x89\xce\xd5\x3d\x88\xf3"
5399                           "\x25\xef\x05\x7c\x3a\xef\xeb\xd8"
5400                           "\x7a\x32\x0d\xd1\x1e\x58\x59\x99"
5401                           "\x90\x25\xb5\x26\xb0\xe3\x2b\x6c"
5402                           "\x4c\xa9\x8b\x84\x4f\x5e\x01\x50"
5403                           "\x41\x30\x58\xc5\x62\x74\x52\x1d"
5404                           "\x45\x24\x6a\x42\x64\x4f\x97\x1c"
5405                           "\xa8\x66\xb5\x6d\x79\xd4\x0d\x48"
5406                           "\xc5\x5f\xf3\x90\x32\xdd\xdd\xe1"
5407                           "\xe4\xa9\x9f\xfc\xc3\x52\x5a\x46"
5408                           "\xe4\x81\x84\x95\x36\x59\x7a\x6b"
5409                           "\xaa\xb3\x60\xad\xce\x9f\x9f\x28"
5410                           "\xe0\x01\x75\x22\xc4\x4e\xa9\x62"
5411                           "\x5c\x62\x0d\x00\xcb\x13\xe8\x43"
5412                           "\x72\xd4\x2d\x53\x46\xb5\xd1\x16"
5413                           "\x22\x18\xdf\x34\x33\xf5\xd6\x1c"
5414                           "\xb8\x79\x78\x97\x94\xff\x72\x13"
5415                           "\x4c\x27\xfc\xcb\xbf\x01\x53\xa6"
5416                           "\xb4\x50\x6e\xde\xdf\xb5\x43\xa4"
5417                           "\x59\xdf\x52\xf9\x7c\xe0\x11\x6f"
5418                           "\x2d\x14\x8e\x24\x61\x2c\xe1\x17"
5419                           "\xcc\xce\x51\x0c\x19\x8a\x82\x30"
5420                           "\x94\xd5\x3d\x6a\x53\x06\x5e\xbd"
5421                           "\xb7\xeb\xfa\xfd\x27\x51\xde\x85"
5422                           "\x1e\x86\x53\x11\x53\x94\x00\xee"
5423                           "\x2b\x8c\x08\x2a\xbf\xdd\xae\x11"
5424                           "\xcb\x1e\xa2\x07\x9a\x80\xcf\x62"
5425                           "\x9b\x09\xdc\x95\x3c\x96\x8e\xb1"
5426                           "\x09\xbd\xe4\xeb\xdb\xca\x70\x7a"
5427                           "\x9e\xfa\x31\x18\x45\x3c\x21\x33"
5428                           "\xb0\xb3\x2b\xea\xf3\x71\x2d\xe1"
5429                           "\x03\xad\x1b\x48\xd4\x67\x27\xf0"
5430                           "\x62\xe4\x3d\xfb\x9b\x08\x76\xe7"
5431                           "\xdd\x2b\x01\x39\x04\x5a\x58\x7a"
5432                           "\xf7\x11\x90\xec\xbd\x51\x5c\x32"
5433                           "\x6b\xd7\x35\x39\x02\x6b\xf2\xa6"
5434                           "\xd0\x0d\x07\xe1\x06\xc4\x5b\x7d"
5435                           "\xe4\x6a\xd7\xee\x15\x1f\x83\xb4"
5436                           "\xa3\xa7\x5e\xc3\x90\xb7\xef\xd3"
5437                           "\xb7\x4f\xf8\x92\x4c\xb7\x3c\x29"
5438                           "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7"
5439                           "\x74\x3f\x7d\x58\x88\x75\xde\x3e",
5440                 .ilen   = 512,
5441                 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
5442                           "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
5443                           "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
5444                           "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
5445                           "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
5446                           "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
5447                           "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
5448                           "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
5449                           "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
5450                           "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
5451                           "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
5452                           "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
5453                           "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
5454                           "\x4c\x96\x12\xed\x7c\x92\x03\x01"
5455                           "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
5456                           "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
5457                           "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
5458                           "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
5459                           "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
5460                           "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
5461                           "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
5462                           "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
5463                           "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
5464                           "\x76\x12\x73\x44\x1a\x56\xd7\x72"
5465                           "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
5466                           "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
5467                           "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
5468                           "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
5469                           "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
5470                           "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
5471                           "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
5472                           "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
5473                           "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
5474                           "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
5475                           "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
5476                           "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
5477                           "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
5478                           "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
5479                           "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
5480                           "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
5481                           "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
5482                           "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
5483                           "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
5484                           "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
5485                           "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
5486                           "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
5487                           "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
5488                           "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
5489                           "\x62\x73\x65\xfd\x46\x63\x25\x3d"
5490                           "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
5491                           "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
5492                           "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
5493                           "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
5494                           "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
5495                           "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
5496                           "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
5497                           "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
5498                           "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
5499                           "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
5500                           "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
5501                           "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
5502                           "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
5503                           "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
5504                           "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
5505                 .rlen   = 512,
5506         }
5507 };
5508
5509 static struct cipher_testvec aes_xts_enc_tv_template[] = {
5510         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
5511         { /* XTS-AES 1 */
5512                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
5513                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5514                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5515                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5516                 .klen   = 32,
5517                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5518                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5519                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
5520                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5521                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5522                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5523                 .ilen   = 32,
5524                 .result = "\x91\x7c\xf6\x9e\xbd\x68\xb2\xec"
5525                           "\x9b\x9f\xe9\xa3\xea\xdd\xa6\x92"
5526                           "\xcd\x43\xd2\xf5\x95\x98\xed\x85"
5527                           "\x8c\x02\xc2\x65\x2f\xbf\x92\x2e",
5528                 .rlen   = 32,
5529         }, { /* XTS-AES 2 */
5530                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
5531                           "\x11\x11\x11\x11\x11\x11\x11\x11"
5532                           "\x22\x22\x22\x22\x22\x22\x22\x22"
5533                           "\x22\x22\x22\x22\x22\x22\x22\x22",
5534                 .klen   = 32,
5535                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
5536                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5537                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
5538                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5539                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5540                           "\x44\x44\x44\x44\x44\x44\x44\x44",
5541                 .ilen   = 32,
5542                 .result = "\xc4\x54\x18\x5e\x6a\x16\x93\x6e"
5543                           "\x39\x33\x40\x38\xac\xef\x83\x8b"
5544                           "\xfb\x18\x6f\xff\x74\x80\xad\xc4"
5545                           "\x28\x93\x82\xec\xd6\xd3\x94\xf0",
5546                 .rlen   = 32,
5547         }, { /* XTS-AES 3 */
5548                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
5549                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
5550                           "\x22\x22\x22\x22\x22\x22\x22\x22"
5551                           "\x22\x22\x22\x22\x22\x22\x22\x22",
5552                 .klen   = 32,
5553                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
5554                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5555                 .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
5556                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5557                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5558                           "\x44\x44\x44\x44\x44\x44\x44\x44",
5559                 .ilen   = 32,
5560                 .result = "\xaf\x85\x33\x6b\x59\x7a\xfc\x1a"
5561                           "\x90\x0b\x2e\xb2\x1e\xc9\x49\xd2"
5562                           "\x92\xdf\x4c\x04\x7e\x0b\x21\x53"
5563                           "\x21\x86\xa5\x97\x1a\x22\x7a\x89",
5564                 .rlen   = 32,
5565         }, { /* XTS-AES 4 */
5566                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
5567                           "\x23\x53\x60\x28\x74\x71\x35\x26"
5568                           "\x31\x41\x59\x26\x53\x58\x97\x93"
5569                           "\x23\x84\x62\x64\x33\x83\x27\x95",
5570                 .klen   = 32,
5571                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5572                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5573                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
5574                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5575                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5576                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5577                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5578                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5579                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5580                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5581                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5582                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5583                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5584                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5585                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5586                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5587                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5588                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5589                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5590                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5591                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5592                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5593                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5594                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5595                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5596                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5597                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5598                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5599                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5600                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5601                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5602                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5603                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5604                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
5605                           "\x00\x01\x02\x03\x04\x05\x06\x07"
5606                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5607                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5608                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5609                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5610                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5611                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5612                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5613                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5614                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5615                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5616                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5617                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5618                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5619                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5620                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5621                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5622                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5623                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5624                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5625                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5626                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5627                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5628                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5629                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5630                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5631                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5632                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5633                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5634                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5635                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5636                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
5637                 .ilen   = 512,
5638                 .result = "\x27\xa7\x47\x9b\xef\xa1\xd4\x76"
5639                           "\x48\x9f\x30\x8c\xd4\xcf\xa6\xe2"
5640                           "\xa9\x6e\x4b\xbe\x32\x08\xff\x25"
5641                           "\x28\x7d\xd3\x81\x96\x16\xe8\x9c"
5642                           "\xc7\x8c\xf7\xf5\xe5\x43\x44\x5f"
5643                           "\x83\x33\xd8\xfa\x7f\x56\x00\x00"
5644                           "\x05\x27\x9f\xa5\xd8\xb5\xe4\xad"
5645                           "\x40\xe7\x36\xdd\xb4\xd3\x54\x12"
5646                           "\x32\x80\x63\xfd\x2a\xab\x53\xe5"
5647                           "\xea\x1e\x0a\x9f\x33\x25\x00\xa5"
5648                           "\xdf\x94\x87\xd0\x7a\x5c\x92\xcc"
5649                           "\x51\x2c\x88\x66\xc7\xe8\x60\xce"
5650                           "\x93\xfd\xf1\x66\xa2\x49\x12\xb4"
5651                           "\x22\x97\x61\x46\xae\x20\xce\x84"
5652                           "\x6b\xb7\xdc\x9b\xa9\x4a\x76\x7a"
5653                           "\xae\xf2\x0c\x0d\x61\xad\x02\x65"
5654                           "\x5e\xa9\x2d\xc4\xc4\xe4\x1a\x89"
5655                           "\x52\xc6\x51\xd3\x31\x74\xbe\x51"
5656                           "\xa1\x0c\x42\x11\x10\xe6\xd8\x15"
5657                           "\x88\xed\xe8\x21\x03\xa2\x52\xd8"
5658                           "\xa7\x50\xe8\x76\x8d\xef\xff\xed"
5659                           "\x91\x22\x81\x0a\xae\xb9\x9f\x91"
5660                           "\x72\xaf\x82\xb6\x04\xdc\x4b\x8e"
5661                           "\x51\xbc\xb0\x82\x35\xa6\xf4\x34"
5662                           "\x13\x32\xe4\xca\x60\x48\x2a\x4b"
5663                           "\xa1\xa0\x3b\x3e\x65\x00\x8f\xc5"
5664                           "\xda\x76\xb7\x0b\xf1\x69\x0d\xb4"
5665                           "\xea\xe2\x9c\x5f\x1b\xad\xd0\x3c"
5666                           "\x5c\xcf\x2a\x55\xd7\x05\xdd\xcd"
5667                           "\x86\xd4\x49\x51\x1c\xeb\x7e\xc3"
5668                           "\x0b\xf1\x2b\x1f\xa3\x5b\x91\x3f"
5669                           "\x9f\x74\x7a\x8a\xfd\x1b\x13\x0e"
5670                           "\x94\xbf\xf9\x4e\xff\xd0\x1a\x91"
5671                           "\x73\x5c\xa1\x72\x6a\xcd\x0b\x19"
5672                           "\x7c\x4e\x5b\x03\x39\x36\x97\xe1"
5673                           "\x26\x82\x6f\xb6\xbb\xde\x8e\xcc"
5674                           "\x1e\x08\x29\x85\x16\xe2\xc9\xed"
5675                           "\x03\xff\x3c\x1b\x78\x60\xf6\xde"
5676                           "\x76\xd4\xce\xcd\x94\xc8\x11\x98"
5677                           "\x55\xef\x52\x97\xca\x67\xe9\xf3"
5678                           "\xe7\xff\x72\xb1\xe9\x97\x85\xca"
5679                           "\x0a\x7e\x77\x20\xc5\xb3\x6d\xc6"
5680                           "\xd7\x2c\xac\x95\x74\xc8\xcb\xbc"
5681                           "\x2f\x80\x1e\x23\xe5\x6f\xd3\x44"
5682                           "\xb0\x7f\x22\x15\x4b\xeb\xa0\xf0"
5683                           "\x8c\xe8\x89\x1e\x64\x3e\xd9\x95"
5684                           "\xc9\x4d\x9a\x69\xc9\xf1\xb5\xf4"
5685                           "\x99\x02\x7a\x78\x57\x2a\xee\xbd"
5686                           "\x74\xd2\x0c\xc3\x98\x81\xc2\x13"
5687                           "\xee\x77\x0b\x10\x10\xe4\xbe\xa7"
5688                           "\x18\x84\x69\x77\xae\x11\x9f\x7a"
5689                           "\x02\x3a\xb5\x8c\xca\x0a\xd7\x52"
5690                           "\xaf\xe6\x56\xbb\x3c\x17\x25\x6a"
5691                           "\x9f\x6e\x9b\xf1\x9f\xdd\x5a\x38"
5692                           "\xfc\x82\xbb\xe8\x72\xc5\x53\x9e"
5693                           "\xdb\x60\x9e\xf4\xf7\x9c\x20\x3e"
5694                           "\xbb\x14\x0f\x2e\x58\x3c\xb2\xad"
5695                           "\x15\xb4\xaa\x5b\x65\x50\x16\xa8"
5696                           "\x44\x92\x77\xdb\xd4\x77\xef\x2c"
5697                           "\x8d\x6c\x01\x7d\xb7\x38\xb1\x8d"
5698                           "\xeb\x4a\x42\x7d\x19\x23\xce\x3f"
5699                           "\xf2\x62\x73\x57\x79\xa4\x18\xf2"
5700                           "\x0a\x28\x2d\xf9\x20\x14\x7b\xea"
5701                           "\xbe\x42\x1e\xe5\x31\x9d\x05\x68",
5702                 .rlen   = 512,
5703         }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
5704                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
5705                           "\x23\x53\x60\x28\x74\x71\x35\x26"
5706                           "\x62\x49\x77\x57\x24\x70\x93\x69"
5707                           "\x99\x59\x57\x49\x66\x96\x76\x27"
5708                           "\x31\x41\x59\x26\x53\x58\x97\x93"
5709                           "\x23\x84\x62\x64\x33\x83\x27\x95"
5710                           "\x02\x88\x41\x97\x16\x93\x99\x37"
5711                           "\x51\x05\x82\x09\x74\x94\x45\x92",
5712                 .klen   = 64,
5713                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
5714                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5715                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5716                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5717                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
5718                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5719                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5720                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5721                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5722                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5723                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5724                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5725                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5726                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5727                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5728                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5729                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5730                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5731                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5732                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5733                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5734                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5735                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5736                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5737                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5738                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5739                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5740                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5741                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5742                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5743                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5744                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5745                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5746                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5747                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5748                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
5749                           "\x00\x01\x02\x03\x04\x05\x06\x07"
5750                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5751                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5752                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5753                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5754                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5755                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5756                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5757                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5758                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5759                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5760                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5761                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5762                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5763                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5764                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5765                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5766                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5767                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5768                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5769                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
5770                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
5771                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
5772                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
5773                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
5774                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
5775                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
5776                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
5777                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
5778                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
5779                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5780                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
5781                 .ilen   = 512,
5782                 .result = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
5783                           "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
5784                           "\xea\x00\x80\x3f\x5e\x48\x23\x57"
5785                           "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
5786                           "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
5787                           "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
5788                           "\x68\x0a\x86\xac\x35\xad\xfc\x33"
5789                           "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
5790                           "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
5791                           "\xb1\x08\xfd\x10\x98\xba\xec\x70"
5792                           "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
5793                           "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
5794                           "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
5795                           "\xae\xba\x12\x29\x61\xd0\x3a\x75"
5796                           "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
5797                           "\x00\x02\x08\x87\x89\x14\x29\xca"
5798                           "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
5799                           "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
5800                           "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
5801                           "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
5802                           "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
5803                           "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
5804                           "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
5805                           "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
5806                           "\x93\xec\x05\xc5\x2e\x04\x93\xef"
5807                           "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
5808                           "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
5809                           "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
5810                           "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
5811                           "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
5812                           "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
5813                           "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
5814                           "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
5815                           "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
5816                           "\xbc\x48\x14\x57\x77\x8f\x61\x60"
5817                           "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
5818                           "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
5819                           "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
5820                           "\xf4\xc3\x33\xec\x44\x23\x88\x51"
5821                           "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
5822                           "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
5823                           "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
5824                           "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
5825                           "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
5826                           "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
5827                           "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
5828                           "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
5829                           "\x92\x5f\xed\xc4\xae\x74\xff\xac"
5830                           "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
5831                           "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
5832                           "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
5833                           "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
5834                           "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
5835                           "\x94\x30\x54\xff\x84\x01\x14\x93"
5836                           "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
5837                           "\x53\x76\x44\x1a\x77\xed\x43\x85"
5838                           "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
5839                           "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
5840                           "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
5841                           "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
5842                           "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
5843                           "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
5844                           "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
5845                           "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
5846                 .rlen   = 512,
5847         }
5848 };
5849
5850 static struct cipher_testvec aes_xts_dec_tv_template[] = {
5851         /* http://grouper.ieee.org/groups/1619/email/pdf00086.pdf */
5852         { /* XTS-AES 1 */
5853                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
5854                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5855                           "\x00\x00\x00\x00\x00\x00\x00\x00"
5856                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5857                 .klen   = 32,
5858                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5859                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5860                 .input = "\x91\x7c\xf6\x9e\xbd\x68\xb2\xec"
5861                          "\x9b\x9f\xe9\xa3\xea\xdd\xa6\x92"
5862                          "\xcd\x43\xd2\xf5\x95\x98\xed\x85"
5863                          "\x8c\x02\xc2\x65\x2f\xbf\x92\x2e",
5864                 .ilen   = 32,
5865                 .result  = "\x00\x00\x00\x00\x00\x00\x00\x00"
5866                            "\x00\x00\x00\x00\x00\x00\x00\x00"
5867                            "\x00\x00\x00\x00\x00\x00\x00\x00"
5868                            "\x00\x00\x00\x00\x00\x00\x00\x00",
5869                 .rlen   = 32,
5870         }, { /* XTS-AES 2 */
5871                 .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
5872                           "\x11\x11\x11\x11\x11\x11\x11\x11"
5873                           "\x22\x22\x22\x22\x22\x22\x22\x22"
5874                           "\x22\x22\x22\x22\x22\x22\x22\x22",
5875                 .klen   = 32,
5876                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
5877                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5878                 .input  = "\xc4\x54\x18\x5e\x6a\x16\x93\x6e"
5879                           "\x39\x33\x40\x38\xac\xef\x83\x8b"
5880                           "\xfb\x18\x6f\xff\x74\x80\xad\xc4"
5881                           "\x28\x93\x82\xec\xd6\xd3\x94\xf0",
5882                 .ilen   = 32,
5883                 .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
5884                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5885                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5886                           "\x44\x44\x44\x44\x44\x44\x44\x44",
5887                 .rlen   = 32,
5888         }, { /* XTS-AES 3 */
5889                 .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
5890                           "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
5891                           "\x22\x22\x22\x22\x22\x22\x22\x22"
5892                           "\x22\x22\x22\x22\x22\x22\x22\x22",
5893                 .klen   = 32,
5894                 .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
5895                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5896                 .input = "\xaf\x85\x33\x6b\x59\x7a\xfc\x1a"
5897                           "\x90\x0b\x2e\xb2\x1e\xc9\x49\xd2"
5898                           "\x92\xdf\x4c\x04\x7e\x0b\x21\x53"
5899                           "\x21\x86\xa5\x97\x1a\x22\x7a\x89",
5900                 .ilen   = 32,
5901                 .result  = "\x44\x44\x44\x44\x44\x44\x44\x44"
5902                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5903                           "\x44\x44\x44\x44\x44\x44\x44\x44"
5904                           "\x44\x44\x44\x44\x44\x44\x44\x44",
5905                 .rlen   = 32,
5906         }, { /* XTS-AES 4 */
5907                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
5908                           "\x23\x53\x60\x28\x74\x71\x35\x26"
5909                           "\x31\x41\x59\x26\x53\x58\x97\x93"
5910                           "\x23\x84\x62\x64\x33\x83\x27\x95",
5911                 .klen   = 32,
5912                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
5913                           "\x00\x00\x00\x00\x00\x00\x00\x00",
5914                 .input  = "\x27\xa7\x47\x9b\xef\xa1\xd4\x76"
5915                           "\x48\x9f\x30\x8c\xd4\xcf\xa6\xe2"
5916                           "\xa9\x6e\x4b\xbe\x32\x08\xff\x25"
5917                           "\x28\x7d\xd3\x81\x96\x16\xe8\x9c"
5918                           "\xc7\x8c\xf7\xf5\xe5\x43\x44\x5f"
5919                           "\x83\x33\xd8\xfa\x7f\x56\x00\x00"
5920                           "\x05\x27\x9f\xa5\xd8\xb5\xe4\xad"
5921                           "\x40\xe7\x36\xdd\xb4\xd3\x54\x12"
5922                           "\x32\x80\x63\xfd\x2a\xab\x53\xe5"
5923                           "\xea\x1e\x0a\x9f\x33\x25\x00\xa5"
5924                           "\xdf\x94\x87\xd0\x7a\x5c\x92\xcc"
5925                           "\x51\x2c\x88\x66\xc7\xe8\x60\xce"
5926                           "\x93\xfd\xf1\x66\xa2\x49\x12\xb4"
5927                           "\x22\x97\x61\x46\xae\x20\xce\x84"
5928                           "\x6b\xb7\xdc\x9b\xa9\x4a\x76\x7a"
5929                           "\xae\xf2\x0c\x0d\x61\xad\x02\x65"
5930                           "\x5e\xa9\x2d\xc4\xc4\xe4\x1a\x89"
5931                           "\x52\xc6\x51\xd3\x31\x74\xbe\x51"
5932                           "\xa1\x0c\x42\x11\x10\xe6\xd8\x15"
5933                           "\x88\xed\xe8\x21\x03\xa2\x52\xd8"
5934                           "\xa7\x50\xe8\x76\x8d\xef\xff\xed"
5935                           "\x91\x22\x81\x0a\xae\xb9\x9f\x91"
5936                           "\x72\xaf\x82\xb6\x04\xdc\x4b\x8e"
5937                           "\x51\xbc\xb0\x82\x35\xa6\xf4\x34"
5938                           "\x13\x32\xe4\xca\x60\x48\x2a\x4b"
5939                           "\xa1\xa0\x3b\x3e\x65\x00\x8f\xc5"
5940                           "\xda\x76\xb7\x0b\xf1\x69\x0d\xb4"
5941                           "\xea\xe2\x9c\x5f\x1b\xad\xd0\x3c"
5942                           "\x5c\xcf\x2a\x55\xd7\x05\xdd\xcd"
5943                           "\x86\xd4\x49\x51\x1c\xeb\x7e\xc3"
5944                           "\x0b\xf1\x2b\x1f\xa3\x5b\x91\x3f"
5945                           "\x9f\x74\x7a\x8a\xfd\x1b\x13\x0e"
5946                           "\x94\xbf\xf9\x4e\xff\xd0\x1a\x91"
5947                           "\x73\x5c\xa1\x72\x6a\xcd\x0b\x19"
5948                           "\x7c\x4e\x5b\x03\x39\x36\x97\xe1"
5949                           "\x26\x82\x6f\xb6\xbb\xde\x8e\xcc"
5950                           "\x1e\x08\x29\x85\x16\xe2\xc9\xed"
5951                           "\x03\xff\x3c\x1b\x78\x60\xf6\xde"
5952                           "\x76\xd4\xce\xcd\x94\xc8\x11\x98"
5953                           "\x55\xef\x52\x97\xca\x67\xe9\xf3"
5954                           "\xe7\xff\x72\xb1\xe9\x97\x85\xca"
5955                           "\x0a\x7e\x77\x20\xc5\xb3\x6d\xc6"
5956                           "\xd7\x2c\xac\x95\x74\xc8\xcb\xbc"
5957                           "\x2f\x80\x1e\x23\xe5\x6f\xd3\x44"
5958                           "\xb0\x7f\x22\x15\x4b\xeb\xa0\xf0"
5959                           "\x8c\xe8\x89\x1e\x64\x3e\xd9\x95"
5960                           "\xc9\x4d\x9a\x69\xc9\xf1\xb5\xf4"
5961                           "\x99\x02\x7a\x78\x57\x2a\xee\xbd"
5962                           "\x74\xd2\x0c\xc3\x98\x81\xc2\x13"
5963                           "\xee\x77\x0b\x10\x10\xe4\xbe\xa7"
5964                           "\x18\x84\x69\x77\xae\x11\x9f\x7a"
5965                           "\x02\x3a\xb5\x8c\xca\x0a\xd7\x52"
5966                           "\xaf\xe6\x56\xbb\x3c\x17\x25\x6a"
5967                           "\x9f\x6e\x9b\xf1\x9f\xdd\x5a\x38"
5968                           "\xfc\x82\xbb\xe8\x72\xc5\x53\x9e"
5969                           "\xdb\x60\x9e\xf4\xf7\x9c\x20\x3e"
5970                           "\xbb\x14\x0f\x2e\x58\x3c\xb2\xad"
5971                           "\x15\xb4\xaa\x5b\x65\x50\x16\xa8"
5972                           "\x44\x92\x77\xdb\xd4\x77\xef\x2c"
5973                           "\x8d\x6c\x01\x7d\xb7\x38\xb1\x8d"
5974                           "\xeb\x4a\x42\x7d\x19\x23\xce\x3f"
5975                           "\xf2\x62\x73\x57\x79\xa4\x18\xf2"
5976                           "\x0a\x28\x2d\xf9\x20\x14\x7b\xea"
5977                           "\xbe\x42\x1e\xe5\x31\x9d\x05\x68",
5978                 .ilen   = 512,
5979                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
5980                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
5981                           "\x10\x11\x12\x13\x14\x15\x16\x17"
5982                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
5983                           "\x20\x21\x22\x23\x24\x25\x26\x27"
5984                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
5985                           "\x30\x31\x32\x33\x34\x35\x36\x37"
5986                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
5987                           "\x40\x41\x42\x43\x44\x45\x46\x47"
5988                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
5989                           "\x50\x51\x52\x53\x54\x55\x56\x57"
5990                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
5991                           "\x60\x61\x62\x63\x64\x65\x66\x67"
5992                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
5993                           "\x70\x71\x72\x73\x74\x75\x76\x77"
5994                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
5995                           "\x80\x81\x82\x83\x84\x85\x86\x87"
5996                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
5997                           "\x90\x91\x92\x93\x94\x95\x96\x97"
5998                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
5999                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6000                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6001                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6002                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6003                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6004                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6005                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6006                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6007                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6008                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6009                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6010                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6011                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6012                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6013                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6014                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6015                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6016                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6017                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6018                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6019                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6020                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6021                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6022                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6023                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6024                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6025                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6026                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6027                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6028                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6029                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6030                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6031                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6032                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6033                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6034                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6035                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6036                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6037                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6038                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6039                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6040                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6041                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6042                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6043                 .rlen   = 512,
6044         }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
6045                 .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
6046                           "\x23\x53\x60\x28\x74\x71\x35\x26"
6047                           "\x62\x49\x77\x57\x24\x70\x93\x69"
6048                           "\x99\x59\x57\x49\x66\x96\x76\x27"
6049                           "\x31\x41\x59\x26\x53\x58\x97\x93"
6050                           "\x23\x84\x62\x64\x33\x83\x27\x95"
6051                           "\x02\x88\x41\x97\x16\x93\x99\x37"
6052                           "\x51\x05\x82\x09\x74\x94\x45\x92",
6053                 .klen   = 64,
6054                 .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
6055                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6056                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6057                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6058                 .input  = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
6059                           "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
6060                           "\xea\x00\x80\x3f\x5e\x48\x23\x57"
6061                           "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
6062                           "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
6063                           "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
6064                           "\x68\x0a\x86\xac\x35\xad\xfc\x33"
6065                           "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
6066                           "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
6067                           "\xb1\x08\xfd\x10\x98\xba\xec\x70"
6068                           "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
6069                           "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
6070                           "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
6071                           "\xae\xba\x12\x29\x61\xd0\x3a\x75"
6072                           "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
6073                           "\x00\x02\x08\x87\x89\x14\x29\xca"
6074                           "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
6075                           "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
6076                           "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
6077                           "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
6078                           "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
6079                           "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
6080                           "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
6081                           "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
6082                           "\x93\xec\x05\xc5\x2e\x04\x93\xef"
6083                           "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
6084                           "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
6085                           "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
6086                           "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
6087                           "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
6088                           "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
6089                           "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
6090                           "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
6091                           "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
6092                           "\xbc\x48\x14\x57\x77\x8f\x61\x60"
6093                           "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
6094                           "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
6095                           "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
6096                           "\xf4\xc3\x33\xec\x44\x23\x88\x51"
6097                           "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
6098                           "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
6099                           "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
6100                           "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
6101                           "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
6102                           "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
6103                           "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
6104                           "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
6105                           "\x92\x5f\xed\xc4\xae\x74\xff\xac"
6106                           "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
6107                           "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
6108                           "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
6109                           "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
6110                           "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
6111                           "\x94\x30\x54\xff\x84\x01\x14\x93"
6112                           "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
6113                           "\x53\x76\x44\x1a\x77\xed\x43\x85"
6114                           "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
6115                           "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
6116                           "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
6117                           "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
6118                           "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
6119                           "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
6120                           "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
6121                           "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
6122                 .ilen   = 512,
6123                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
6124                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6125                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6126                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6127                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6128                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6129                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6130                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6131                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6132                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6133                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6134                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6135                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6136                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6137                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6138                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6139                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6140                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6141                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6142                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6143                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6144                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6145                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6146                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6147                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6148                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6149                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6150                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6151                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6152                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6153                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6154                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6155                           "\x00\x01\x02\x03\x04\x05\x06\x07"
6156                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6157                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6158                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6159                           "\x20\x21\x22\x23\x24\x25\x26\x27"
6160                           "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6161                           "\x30\x31\x32\x33\x34\x35\x36\x37"
6162                           "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6163                           "\x40\x41\x42\x43\x44\x45\x46\x47"
6164                           "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6165                           "\x50\x51\x52\x53\x54\x55\x56\x57"
6166                           "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6167                           "\x60\x61\x62\x63\x64\x65\x66\x67"
6168                           "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6169                           "\x70\x71\x72\x73\x74\x75\x76\x77"
6170                           "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6171                           "\x80\x81\x82\x83\x84\x85\x86\x87"
6172                           "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6173                           "\x90\x91\x92\x93\x94\x95\x96\x97"
6174                           "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6175                           "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6176                           "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6177                           "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6178                           "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6179                           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6180                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6181                           "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6182                           "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6183                           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6184                           "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6185                           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6186                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6187                 .rlen   = 512,
6188
6189         }
6190 };
6191
6192
6193 static struct cipher_testvec aes_ctr_enc_tv_template[] = {
6194         { /* From NIST Special Publication 800-38A, Appendix F.5 */
6195                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6196                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6197                 .klen   = 16,
6198                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6199                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6200                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6201                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6202                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6203                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6204                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6205                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6206                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6207                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6208                 .ilen   = 64,
6209                 .result = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
6210                           "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
6211                           "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
6212                           "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
6213                           "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
6214                           "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
6215                           "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
6216                           "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
6217                 .rlen   = 64,
6218         }, {
6219                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
6220                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
6221                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
6222                 .klen   = 24,
6223                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6224                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6225                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6226                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6227                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6228                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6229                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6230                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6231                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6232                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6233                 .ilen   = 64,
6234                 .result = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
6235                           "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
6236                           "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
6237                           "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
6238                           "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
6239                           "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
6240                           "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
6241                           "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
6242                 .rlen   = 64,
6243         }, {
6244                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
6245                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
6246                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
6247                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
6248                 .klen   = 32,
6249                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6250                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6251                 .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6252                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6253                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6254                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6255                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6256                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6257                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6258                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6259                 .ilen   = 64,
6260                 .result = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
6261                           "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
6262                           "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
6263                           "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
6264                           "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
6265                           "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
6266                           "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
6267                           "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
6268                 .rlen   = 64,
6269         }
6270 };
6271
6272 static struct cipher_testvec aes_ctr_dec_tv_template[] = {
6273         { /* From NIST Special Publication 800-38A, Appendix F.5 */
6274                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6275                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6276                 .klen   = 16,
6277                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6278                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6279                 .input  = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
6280                           "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
6281                           "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
6282                           "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
6283                           "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
6284                           "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
6285                           "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
6286                           "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
6287                 .ilen   = 64,
6288                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6289                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6290                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6291                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6292                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6293                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6294                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6295                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6296                 .rlen   = 64,
6297         }, {
6298                 .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
6299                           "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
6300                           "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
6301                 .klen   = 24,
6302                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6303                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6304                 .input  = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
6305                           "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
6306                           "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
6307                           "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
6308                           "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
6309                           "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
6310                           "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
6311                           "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
6312                 .ilen   = 64,
6313                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6314                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6315                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6316                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6317                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6318                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6319                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6320                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6321                 .rlen   = 64,
6322         }, {
6323                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
6324                           "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
6325                           "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
6326                           "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
6327                 .klen   = 32,
6328                 .iv     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6329                           "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6330                 .input  = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
6331                           "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
6332                           "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
6333                           "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
6334                           "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
6335                           "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
6336                           "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
6337                           "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
6338                 .ilen   = 64,
6339                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6340                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6341                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6342                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6343                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6344                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6345                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6346                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6347                 .rlen   = 64,
6348         }
6349 };
6350
6351 static struct cipher_testvec aes_ctr_rfc3686_enc_tv_template[] = {
6352         { /* From RFC 3686 */
6353                 .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
6354                           "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
6355                           "\x00\x00\x00\x30",
6356                 .klen   = 20,
6357                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
6358                 .input  = "Single block msg",
6359                 .ilen   = 16,
6360                 .result = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
6361                           "\x2d\x61\x75\xa3\x26\x13\x11\xb8",
6362                 .rlen   = 16,
6363         }, {
6364                 .key    = "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
6365                           "\x43\xd6\xce\x1f\x32\x53\x91\x63"
6366                           "\x00\x6c\xb6\xdb",
6367                 .klen   = 20,
6368                 .iv     = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
6369                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
6370                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6371                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6372                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
6373                 .ilen   = 32,
6374                 .result = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
6375                           "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
6376                           "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
6377                           "\xfc\xe6\x30\xdf\x91\x41\xbe\x28",
6378                 .rlen   = 32,
6379         }, {
6380                 .key    = "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
6381                           "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
6382                           "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
6383                           "\x00\x00\x00\x48",
6384                 .klen   = 28,
6385                 .iv     = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
6386                 .input  = "Single block msg",
6387                 .ilen   = 16,
6388                 .result = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
6389                           "\x4e\x79\x35\xa0\x03\xcb\xe9\x28",
6390                 .rlen   = 16,
6391         }, {
6392                 .key    = "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
6393                           "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
6394                           "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
6395                           "\x00\x96\xb0\x3b",
6396                 .klen   = 28,
6397                 .iv     = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
6398                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
6399                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6400                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6401                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
6402                 .ilen   = 32,
6403                 .result = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
6404                           "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
6405                           "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
6406                           "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00",
6407                 .rlen   = 32,
6408         }, {
6409                 .key    = "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
6410                           "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
6411                           "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
6412                           "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
6413                           "\x00\x00\x00\x60",
6414                 .klen   = 36,
6415                 .iv     = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
6416                 .input  = "Single block msg",
6417                 .ilen   = 16,
6418                 .result = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
6419                           "\x56\x08\x63\xdc\x71\xe3\xe0\xc0",
6420                 .rlen   = 16,
6421         }, {
6422                 .key    = "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
6423                           "\x07\x96\x36\x58\x79\xef\xf8\x86"
6424                           "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
6425                           "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
6426                           "\x00\xfa\xac\x24",
6427                 .klen   = 36,
6428                 .iv     = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
6429                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
6430                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6431                           "\x10\x11\x12\x13\x14\x15\x16\x17"
6432                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
6433                 .ilen   = 32,
6434                 .result = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
6435                           "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
6436                           "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
6437                           "\x55\x30\x83\x1d\x93\x44\xaf\x1c",
6438                 .rlen   = 32,
6439         }, {
6440         // generated using Crypto++
6441                 .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
6442                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6443                         "\x10\x11\x12\x13\x14\x15\x16\x17"
6444                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6445                         "\x00\x00\x00\x00",
6446                 .klen = 32 + 4,
6447                 .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
6448                 .input =
6449                         "\x00\x01\x02\x03\x04\x05\x06\x07"
6450                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6451                         "\x10\x11\x12\x13\x14\x15\x16\x17"
6452                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6453                         "\x20\x21\x22\x23\x24\x25\x26\x27"
6454                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
6455                         "\x30\x31\x32\x33\x34\x35\x36\x37"
6456                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
6457                         "\x40\x41\x42\x43\x44\x45\x46\x47"
6458                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
6459                         "\x50\x51\x52\x53\x54\x55\x56\x57"
6460                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
6461                         "\x60\x61\x62\x63\x64\x65\x66\x67"
6462                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
6463                         "\x70\x71\x72\x73\x74\x75\x76\x77"
6464                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
6465                         "\x80\x81\x82\x83\x84\x85\x86\x87"
6466                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
6467                         "\x90\x91\x92\x93\x94\x95\x96\x97"
6468                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
6469                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
6470                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
6471                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
6472                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
6473                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
6474                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
6475                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
6476                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
6477                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
6478                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
6479                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6480                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
6481                         "\x00\x03\x06\x09\x0c\x0f\x12\x15"
6482                         "\x18\x1b\x1e\x21\x24\x27\x2a\x2d"
6483                         "\x30\x33\x36\x39\x3c\x3f\x42\x45"
6484                         "\x48\x4b\x4e\x51\x54\x57\x5a\x5d"
6485                         "\x60\x63\x66\x69\x6c\x6f\x72\x75"
6486                         "\x78\x7b\x7e\x81\x84\x87\x8a\x8d"
6487                         "\x90\x93\x96\x99\x9c\x9f\xa2\xa5"
6488                         "\xa8\xab\xae\xb1\xb4\xb7\xba\xbd"
6489                         "\xc0\xc3\xc6\xc9\xcc\xcf\xd2\xd5"
6490                         "\xd8\xdb\xde\xe1\xe4\xe7\xea\xed"
6491                         "\xf0\xf3\xf6\xf9\xfc\xff\x02\x05"
6492                         "\x08\x0b\x0e\x11\x14\x17\x1a\x1d"
6493                         "\x20\x23\x26\x29\x2c\x2f\x32\x35"
6494                         "\x38\x3b\x3e\x41\x44\x47\x4a\x4d"
6495                         "\x50\x53\x56\x59\x5c\x5f\x62\x65"
6496                         "\x68\x6b\x6e\x71\x74\x77\x7a\x7d"
6497                         "\x80\x83\x86\x89\x8c\x8f\x92\x95"
6498                         "\x98\x9b\x9e\xa1\xa4\xa7\xaa\xad"
6499                         "\xb0\xb3\xb6\xb9\xbc\xbf\xc2\xc5"
6500                         "\xc8\xcb\xce\xd1\xd4\xd7\xda\xdd"
6501                         "\xe0\xe3\xe6\xe9\xec\xef\xf2\xf5"
6502                         "\xf8\xfb\xfe\x01\x04\x07\x0a\x0d"
6503                         "\x10\x13\x16\x19\x1c\x1f\x22\x25"
6504                         "\x28\x2b\x2e\x31\x34\x37\x3a\x3d"
6505                         "\x40\x43\x46\x49\x4c\x4f\x52\x55"
6506                         "\x58\x5b\x5e\x61\x64\x67\x6a\x6d"
6507                         "\x70\x73\x76\x79\x7c\x7f\x82\x85"
6508                         "\x88\x8b\x8e\x91\x94\x97\x9a\x9d"
6509                         "\xa0\xa3\xa6\xa9\xac\xaf\xb2\xb5"
6510                         "\xb8\xbb\xbe\xc1\xc4\xc7\xca\xcd"
6511                         "\xd0\xd3\xd6\xd9\xdc\xdf\xe2\xe5"
6512                         "\xe8\xeb\xee\xf1\xf4\xf7\xfa\xfd"
6513                         "\x00\x05\x0a\x0f\x14\x19\x1e\x23"
6514                         "\x28\x2d\x32\x37\x3c\x41\x46\x4b"
6515                         "\x50\x55\x5a\x5f\x64\x69\x6e\x73"
6516                         "\x78\x7d\x82\x87\x8c\x91\x96\x9b"
6517                         "\xa0\xa5\xaa\xaf\xb4\xb9\xbe\xc3"
6518                         "\xc8\xcd\xd2\xd7\xdc\xe1\xe6\xeb"
6519                         "\xf0\xf5\xfa\xff\x04\x09\x0e\x13"
6520                         "\x18\x1d\x22\x27\x2c\x31\x36\x3b"
6521                         "\x40\x45\x4a\x4f\x54\x59\x5e\x63"
6522                         "\x68\x6d\x72\x77\x7c\x81\x86\x8b"
6523                         "\x90\x95\x9a\x9f\xa4\xa9\xae\xb3"
6524                         "\xb8\xbd\xc2\xc7\xcc\xd1\xd6\xdb"
6525                         "\xe0\xe5\xea\xef\xf4\xf9\xfe\x03"
6526                         "\x08\x0d\x12\x17\x1c\x21\x26\x2b"
6527                         "\x30\x35\x3a\x3f\x44\x49\x4e\x53"
6528                         "\x58\x5d\x62\x67\x6c\x71\x76\x7b"
6529                         "\x80\x85\x8a\x8f\x94\x99\x9e\xa3"
6530                         "\xa8\xad\xb2\xb7\xbc\xc1\xc6\xcb"
6531                         "\xd0\xd5\xda\xdf\xe4\xe9\xee\xf3"
6532                         "\xf8\xfd\x02\x07\x0c\x11\x16\x1b"
6533                         "\x20\x25\x2a\x2f\x34\x39\x3e\x43"
6534                         "\x48\x4d\x52\x57\x5c\x61\x66\x6b"
6535                         "\x70\x75\x7a\x7f\x84\x89\x8e\x93"
6536                         "\x98\x9d\xa2\xa7\xac\xb1\xb6\xbb"
6537                         "\xc0\xc5\xca\xcf\xd4\xd9\xde\xe3"
6538                         "\xe8\xed\xf2\xf7\xfc\x01\x06\x0b"
6539                         "\x10\x15\x1a\x1f\x24\x29\x2e\x33"
6540                         "\x38\x3d\x42\x47\x4c\x51\x56\x5b"
6541                         "\x60\x65\x6a\x6f\x74\x79\x7e\x83"
6542                         "\x88\x8d\x92\x97\x9c\xa1\xa6\xab"
6543                         "\xb0\xb5\xba\xbf\xc4\xc9\xce\xd3"
6544                         "\xd8\xdd\xe2\xe7\xec\xf1\xf6\xfb"
6545                         "\x00\x07\x0e\x15\x1c\x23\x2a\x31"
6546                         "\x38\x3f\x46\x4d\x54\x5b\x62\x69"
6547                         "\x70\x77\x7e\x85\x8c\x93\x9a\xa1"
6548                         "\xa8\xaf\xb6\xbd\xc4\xcb\xd2\xd9"
6549                         "\xe0\xe7\xee\xf5\xfc\x03\x0a\x11"
6550                         "\x18\x1f\x26\x2d\x34\x3b\x42\x49"
6551                         "\x50\x57\x5e\x65\x6c\x73\x7a\x81"
6552                         "\x88\x8f\x96\x9d\xa4\xab\xb2\xb9"
6553                         "\xc0\xc7\xce\xd5\xdc\xe3\xea\xf1"
6554                         "\xf8\xff\x06\x0d\x14\x1b\x22\x29"
6555                         "\x30\x37\x3e\x45\x4c\x53\x5a\x61"
6556                         "\x68\x6f\x76\x7d\x84\x8b\x92\x99"
6557                         "\xa0\xa7\xae\xb5\xbc\xc3\xca\xd1"
6558                         "\xd8\xdf\xe6\xed\xf4\xfb\x02\x09"
6559                         "\x10\x17\x1e\x25\x2c\x33\x3a\x41"
6560                         "\x48\x4f\x56\x5d\x64\x6b\x72\x79"
6561                         "\x80\x87\x8e\x95\x9c\xa3\xaa\xb1"
6562                         "\xb8\xbf\xc6\xcd\xd4\xdb\xe2\xe9"
6563                         "\xf0\xf7\xfe\x05\x0c\x13\x1a\x21"
6564                         "\x28\x2f\x36\x3d\x44\x4b\x52\x59"
6565                         "\x60\x67\x6e\x75\x7c\x83\x8a\x91"
6566                         "\x98\x9f\xa6\xad\xb4\xbb\xc2\xc9"
6567                         "\xd0\xd7\xde\xe5\xec\xf3\xfa\x01"
6568                         "\x08\x0f\x16\x1d\x24\x2b\x32\x39"
6569                         "\x40\x47\x4e\x55\x5c\x63\x6a\x71"
6570                         "\x78\x7f\x86\x8d\x94\x9b\xa2\xa9"
6571                         "\xb0\xb7\xbe\xc5\xcc\xd3\xda\xe1"
6572                         "\xe8\xef\xf6\xfd\x04\x0b\x12\x19"
6573                         "\x20\x27\x2e\x35\x3c\x43\x4a\x51"
6574                         "\x58\x5f\x66\x6d\x74\x7b\x82\x89"
6575                         "\x90\x97\x9e\xa5\xac\xb3\xba\xc1"
6576                         "\xc8\xcf\xd6\xdd\xe4\xeb\xf2\xf9"
6577                         "\x00\x09\x12\x1b\x24\x2d\x36\x3f"
6578                         "\x48\x51\x5a\x63\x6c\x75\x7e\x87"
6579                         "\x90\x99\xa2\xab\xb4\xbd\xc6\xcf"
6580                         "\xd8\xe1\xea\xf3\xfc\x05\x0e\x17"
6581                         "\x20\x29\x32\x3b\x44\x4d\x56\x5f"
6582                         "\x68\x71\x7a\x83\x8c\x95\x9e\xa7"
6583                         "\xb0\xb9\xc2\xcb\xd4\xdd\xe6\xef"
6584                         "\xf8\x01\x0a\x13\x1c\x25\x2e\x37"
6585                         "\x40\x49\x52\x5b\x64\x6d\x76\x7f"
6586                         "\x88\x91\x9a\xa3\xac\xb5\xbe\xc7"
6587                         "\xd0\xd9\xe2\xeb\xf4\xfd\x06\x0f"
6588                         "\x18\x21\x2a\x33\x3c\x45\x4e\x57"
6589                         "\x60\x69\x72\x7b\x84\x8d\x96\x9f"
6590                         "\xa8\xb1\xba\xc3\xcc\xd5\xde\xe7"
6591                         "\xf0\xf9\x02\x0b\x14\x1d\x26\x2f"
6592                         "\x38\x41\x4a\x53\x5c\x65\x6e\x77"
6593                         "\x80\x89\x92\x9b\xa4\xad\xb6\xbf"
6594                         "\xc8\xd1\xda\xe3\xec\xf5\xfe\x07"
6595                         "\x10\x19\x22\x2b\x34\x3d\x46\x4f"
6596                         "\x58\x61\x6a\x73\x7c\x85\x8e\x97"
6597                         "\xa0\xa9\xb2\xbb\xc4\xcd\xd6\xdf"
6598                         "\xe8\xf1\xfa\x03\x0c\x15\x1e\x27"
6599                         "\x30\x39\x42\x4b\x54\x5d\x66\x6f"
6600                         "\x78\x81\x8a\x93\x9c\xa5\xae\xb7"
6601                         "\xc0\xc9\xd2\xdb\xe4\xed\xf6\xff"
6602                         "\x08\x11\x1a\x23\x2c\x35\x3e\x47"
6603                         "\x50\x59\x62\x6b\x74\x7d\x86\x8f"
6604                         "\x98\xa1\xaa\xb3\xbc\xc5\xce\xd7"
6605                         "\xe0\xe9\xf2\xfb\x04\x0d\x16\x1f"
6606                         "\x28\x31\x3a\x43\x4c\x55\x5e\x67"
6607                         "\x70\x79\x82\x8b\x94\x9d\xa6\xaf"
6608                         "\xb8\xc1\xca\xd3\xdc\xe5\xee\xf7"
6609                         "\x00\x0b\x16\x21\x2c\x37\x42\x4d"
6610                         "\x58\x63\x6e\x79\x84\x8f\x9a\xa5"
6611                         "\xb0\xbb\xc6\xd1\xdc\xe7\xf2\xfd"
6612                         "\x08\x13\x1e\x29\x34\x3f\x4a\x55"
6613                         "\x60\x6b\x76\x81\x8c\x97\xa2\xad"
6614                         "\xb8\xc3\xce\xd9\xe4\xef\xfa\x05"
6615                         "\x10\x1b\x26\x31\x3c\x47\x52\x5d"
6616                         "\x68\x73\x7e\x89\x94\x9f\xaa\xb5"
6617                         "\xc0\xcb\xd6\xe1\xec\xf7\x02\x0d"
6618                         "\x18\x23\x2e\x39\x44\x4f\x5a\x65"
6619                         "\x70\x7b\x86\x91\x9c\xa7\xb2\xbd"
6620                         "\xc8\xd3\xde\xe9\xf4\xff\x0a\x15"
6621                         "\x20\x2b\x36\x41\x4c\x57\x62\x6d"
6622                         "\x78\x83\x8e\x99\xa4\xaf\xba\xc5"
6623                         "\xd0\xdb\xe6\xf1\xfc\x07\x12\x1d"
6624                         "\x28\x33\x3e\x49\x54\x5f\x6a\x75"
6625                         "\x80\x8b\x96\xa1\xac\xb7\xc2\xcd"
6626                         "\xd8\xe3\xee\xf9\x04\x0f\x1a\x25"
6627                         "\x30\x3b\x46\x51\x5c\x67\x72\x7d"
6628                         "\x88\x93\x9e\xa9\xb4\xbf\xca\xd5"
6629                         "\xe0\xeb\xf6\x01\x0c\x17\x22\x2d"
6630                         "\x38\x43\x4e\x59\x64\x6f\x7a\x85"
6631                         "\x90\x9b\xa6\xb1\xbc\xc7\xd2\xdd"
6632                         "\xe8\xf3\xfe\x09\x14\x1f\x2a\x35"
6633                         "\x40\x4b\x56\x61\x6c\x77\x82\x8d"
6634                         "\x98\xa3\xae\xb9\xc4\xcf\xda\xe5"
6635                         "\xf0\xfb\x06\x11\x1c\x27\x32\x3d"
6636                         "\x48\x53\x5e\x69\x74\x7f\x8a\x95"
6637                         "\xa0\xab\xb6\xc1\xcc\xd7\xe2\xed"
6638                         "\xf8\x03\x0e\x19\x24\x2f\x3a\x45"
6639                         "\x50\x5b\x66\x71\x7c\x87\x92\x9d"
6640                         "\xa8\xb3\xbe\xc9\xd4\xdf\xea\xf5"
6641                         "\x00\x0d\x1a\x27\x34\x41\x4e\x5b"
6642                         "\x68\x75\x82\x8f\x9c\xa9\xb6\xc3"
6643                         "\xd0\xdd\xea\xf7\x04\x11\x1e\x2b"
6644                         "\x38\x45\x52\x5f\x6c\x79\x86\x93"
6645                         "\xa0\xad\xba\xc7\xd4\xe1\xee\xfb"
6646                         "\x08\x15\x22\x2f\x3c\x49\x56\x63"
6647                         "\x70\x7d\x8a\x97\xa4\xb1\xbe\xcb"
6648                         "\xd8\xe5\xf2\xff\x0c\x19\x26\x33"
6649                         "\x40\x4d\x5a\x67\x74\x81\x8e\x9b"
6650                         "\xa8\xb5\xc2\xcf\xdc\xe9\xf6\x03"
6651                         "\x10\x1d\x2a\x37\x44\x51\x5e\x6b"
6652                         "\x78\x85\x92\x9f\xac\xb9\xc6\xd3"
6653                         "\xe0\xed\xfa\x07\x14\x21\x2e\x3b"
6654                         "\x48\x55\x62\x6f\x7c\x89\x96\xa3"
6655                         "\xb0\xbd\xca\xd7\xe4\xf1\xfe\x0b"
6656                         "\x18\x25\x32\x3f\x4c\x59\x66\x73"
6657                         "\x80\x8d\x9a\xa7\xb4\xc1\xce\xdb"
6658                         "\xe8\xf5\x02\x0f\x1c\x29\x36\x43"
6659                         "\x50\x5d\x6a\x77\x84\x91\x9e\xab"
6660                         "\xb8\xc5\xd2\xdf\xec\xf9\x06\x13"
6661                         "\x20\x2d\x3a\x47\x54\x61\x6e\x7b"
6662                         "\x88\x95\xa2\xaf\xbc\xc9\xd6\xe3"
6663                         "\xf0\xfd\x0a\x17\x24\x31\x3e\x4b"
6664                         "\x58\x65\x72\x7f\x8c\x99\xa6\xb3"
6665                         "\xc0\xcd\xda\xe7\xf4\x01\x0e\x1b"
6666                         "\x28\x35\x42\x4f\x5c\x69\x76\x83"
6667                         "\x90\x9d\xaa\xb7\xc4\xd1\xde\xeb"
6668                         "\xf8\x05\x12\x1f\x2c\x39\x46\x53"
6669                         "\x60\x6d\x7a\x87\x94\xa1\xae\xbb"
6670                         "\xc8\xd5\xe2\xef\xfc\x09\x16\x23"
6671                         "\x30\x3d\x4a\x57\x64\x71\x7e\x8b"
6672                         "\x98\xa5\xb2\xbf\xcc\xd9\xe6\xf3"
6673                         "\x00\x0f\x1e\x2d\x3c\x4b\x5a\x69"
6674                         "\x78\x87\x96\xa5\xb4\xc3\xd2\xe1"
6675                         "\xf0\xff\x0e\x1d\x2c\x3b\x4a\x59"
6676                         "\x68\x77\x86\x95\xa4\xb3\xc2\xd1"
6677                         "\xe0\xef\xfe\x0d\x1c\x2b\x3a\x49"
6678                         "\x58\x67\x76\x85\x94\xa3\xb2\xc1"
6679                         "\xd0\xdf\xee\xfd\x0c\x1b\x2a\x39"
6680                         "\x48\x57\x66\x75\x84\x93\xa2\xb1"
6681                         "\xc0\xcf\xde\xed\xfc\x0b\x1a\x29"
6682                         "\x38\x47\x56\x65\x74\x83\x92\xa1"
6683                         "\xb0\xbf\xce\xdd\xec\xfb\x0a\x19"
6684                         "\x28\x37\x46\x55\x64\x73\x82\x91"
6685                         "\xa0\xaf\xbe\xcd\xdc\xeb\xfa\x09"
6686                         "\x18\x27\x36\x45\x54\x63\x72\x81"
6687                         "\x90\x9f\xae\xbd\xcc\xdb\xea\xf9"
6688                         "\x08\x17\x26\x35\x44\x53\x62\x71"
6689                         "\x80\x8f\x9e\xad\xbc\xcb\xda\xe9"
6690                         "\xf8\x07\x16\x25\x34\x43\x52\x61"
6691                         "\x70\x7f\x8e\x9d\xac\xbb\xca\xd9"
6692                         "\xe8\xf7\x06\x15\x24\x33\x42\x51"
6693                         "\x60\x6f\x7e\x8d\x9c\xab\xba\xc9"
6694                         "\xd8\xe7\xf6\x05\x14\x23\x32\x41"
6695                         "\x50\x5f\x6e\x7d\x8c\x9b\xaa\xb9"
6696                         "\xc8\xd7\xe6\xf5\x04\x13\x22\x31"
6697                         "\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9"
6698                         "\xb8\xc7\xd6\xe5\xf4\x03\x12\x21"
6699                         "\x30\x3f\x4e\x5d\x6c\x7b\x8a\x99"
6700                         "\xa8\xb7\xc6\xd5\xe4\xf3\x02\x11"
6701                         "\x20\x2f\x3e\x4d\x5c\x6b\x7a\x89"
6702                         "\x98\xa7\xb6\xc5\xd4\xe3\xf2\x01"
6703                         "\x10\x1f\x2e\x3d\x4c\x5b\x6a\x79"
6704                         "\x88\x97\xa6\xb5\xc4\xd3\xe2\xf1"
6705                         "\x00\x11\x22\x33\x44\x55\x66\x77"
6706                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff"
6707                         "\x10\x21\x32\x43\x54\x65\x76\x87"
6708                         "\x98\xa9\xba\xcb\xdc\xed\xfe\x0f"
6709                         "\x20\x31\x42\x53\x64\x75\x86\x97"
6710                         "\xa8\xb9\xca\xdb\xec\xfd\x0e\x1f"
6711                         "\x30\x41\x52\x63\x74\x85\x96\xa7"
6712                         "\xb8\xc9\xda\xeb\xfc\x0d\x1e\x2f"
6713                         "\x40\x51\x62\x73\x84\x95\xa6\xb7"
6714                         "\xc8\xd9\xea\xfb\x0c\x1d\x2e\x3f"
6715                         "\x50\x61\x72\x83\x94\xa5\xb6\xc7"
6716                         "\xd8\xe9\xfa\x0b\x1c\x2d\x3e\x4f"
6717                         "\x60\x71\x82\x93\xa4\xb5\xc6\xd7"
6718                         "\xe8\xf9\x0a\x1b\x2c\x3d\x4e\x5f"
6719                         "\x70\x81\x92\xa3\xb4\xc5\xd6\xe7"
6720                         "\xf8\x09\x1a\x2b\x3c\x4d\x5e\x6f"
6721                         "\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7"
6722                         "\x08\x19\x2a\x3b\x4c\x5d\x6e\x7f"
6723                         "\x90\xa1\xb2\xc3\xd4\xe5\xf6\x07"
6724                         "\x18\x29\x3a\x4b\x5c\x6d\x7e\x8f"
6725                         "\xa0\xb1\xc2\xd3\xe4\xf5\x06\x17"
6726                         "\x28\x39\x4a\x5b\x6c\x7d\x8e\x9f"
6727                         "\xb0\xc1\xd2\xe3\xf4\x05\x16\x27"
6728                         "\x38\x49\x5a\x6b\x7c\x8d\x9e\xaf"
6729                         "\xc0\xd1\xe2\xf3\x04\x15\x26\x37"
6730                         "\x48\x59\x6a\x7b\x8c\x9d\xae\xbf"
6731                         "\xd0\xe1\xf2\x03\x14\x25\x36\x47"
6732                         "\x58\x69\x7a\x8b\x9c\xad\xbe\xcf"
6733                         "\xe0\xf1\x02\x13\x24\x35\x46\x57"
6734                         "\x68\x79\x8a\x9b\xac\xbd\xce\xdf"
6735                         "\xf0\x01\x12\x23\x34\x45\x56\x67"
6736                         "\x78\x89\x9a\xab\xbc\xcd\xde\xef"
6737                         "\x00\x13\x26\x39\x4c\x5f\x72\x85"
6738                         "\x98\xab\xbe\xd1\xe4\xf7\x0a\x1d"
6739                         "\x30\x43\x56\x69\x7c\x8f\xa2\xb5"
6740                         "\xc8\xdb\xee\x01\x14\x27\x3a\x4d"
6741                         "\x60\x73\x86\x99\xac\xbf\xd2\xe5"
6742                         "\xf8\x0b\x1e\x31\x44\x57\x6a\x7d"
6743                         "\x90\xa3\xb6\xc9\xdc\xef\x02\x15"
6744                         "\x28\x3b\x4e\x61\x74\x87\x9a\xad"
6745                         "\xc0\xd3\xe6\xf9\x0c\x1f\x32\x45"
6746                         "\x58\x6b\x7e\x91\xa4\xb7\xca\xdd"
6747                         "\xf0\x03\x16\x29\x3c\x4f\x62\x75"
6748                         "\x88\x9b\xae\xc1\xd4\xe7\xfa\x0d"
6749                         "\x20\x33\x46\x59\x6c\x7f\x92\xa5"
6750                         "\xb8\xcb\xde\xf1\x04\x17\x2a\x3d"
6751                         "\x50\x63\x76\x89\x9c\xaf\xc2\xd5"
6752                         "\xe8\xfb\x0e\x21\x34\x47\x5a\x6d"
6753                         "\x80\x93\xa6\xb9\xcc\xdf\xf2\x05"
6754                         "\x18\x2b\x3e\x51\x64\x77\x8a\x9d"
6755                         "\xb0\xc3\xd6\xe9\xfc\x0f\x22\x35"
6756                         "\x48\x5b\x6e\x81\x94\xa7\xba\xcd"
6757                         "\xe0\xf3\x06\x19\x2c\x3f\x52\x65"
6758                         "\x78\x8b\x9e\xb1\xc4\xd7\xea\xfd"
6759                         "\x10\x23\x36\x49\x5c\x6f\x82\x95"
6760                         "\xa8\xbb\xce\xe1\xf4\x07\x1a\x2d"
6761                         "\x40\x53\x66\x79\x8c\x9f\xb2\xc5"
6762                         "\xd8\xeb\xfe\x11\x24\x37\x4a\x5d"
6763                         "\x70\x83\x96\xa9\xbc\xcf\xe2\xf5"
6764                         "\x08\x1b\x2e\x41\x54\x67\x7a\x8d"
6765                         "\xa0\xb3\xc6\xd9\xec\xff\x12\x25"
6766                         "\x38\x4b\x5e\x71\x84\x97\xaa\xbd"
6767                         "\xd0\xe3\xf6\x09\x1c\x2f\x42\x55"
6768                         "\x68\x7b\x8e\xa1\xb4\xc7\xda\xed"
6769                         "\x00\x15\x2a\x3f\x54\x69\x7e\x93"
6770                         "\xa8\xbd\xd2\xe7\xfc\x11\x26\x3b"
6771                         "\x50\x65\x7a\x8f\xa4\xb9\xce\xe3"
6772                         "\xf8\x0d\x22\x37\x4c\x61\x76\x8b"
6773                         "\xa0\xb5\xca\xdf\xf4\x09\x1e\x33"
6774                         "\x48\x5d\x72\x87\x9c\xb1\xc6\xdb"
6775                         "\xf0\x05\x1a\x2f\x44\x59\x6e\x83"
6776                         "\x98\xad\xc2\xd7\xec\x01\x16\x2b"
6777                         "\x40\x55\x6a\x7f\x94\xa9\xbe\xd3"
6778                         "\xe8\xfd\x12\x27\x3c\x51\x66\x7b"
6779                         "\x90\xa5\xba\xcf\xe4\xf9\x0e\x23"
6780                         "\x38\x4d\x62\x77\x8c\xa1\xb6\xcb"
6781                         "\xe0\xf5\x0a\x1f\x34\x49\x5e\x73"
6782                         "\x88\x9d\xb2\xc7\xdc\xf1\x06\x1b"
6783                         "\x30\x45\x5a\x6f\x84\x99\xae\xc3"
6784                         "\xd8\xed\x02\x17\x2c\x41\x56\x6b"
6785                         "\x80\x95\xaa\xbf\xd4\xe9\xfe\x13"
6786                         "\x28\x3d\x52\x67\x7c\x91\xa6\xbb"
6787                         "\xd0\xe5\xfa\x0f\x24\x39\x4e\x63"
6788                         "\x78\x8d\xa2\xb7\xcc\xe1\xf6\x0b"
6789                         "\x20\x35\x4a\x5f\x74\x89\x9e\xb3"
6790                         "\xc8\xdd\xf2\x07\x1c\x31\x46\x5b"
6791                         "\x70\x85\x9a\xaf\xc4\xd9\xee\x03"
6792                         "\x18\x2d\x42\x57\x6c\x81\x96\xab"
6793                         "\xc0\xd5\xea\xff\x14\x29\x3e\x53"
6794                         "\x68\x7d\x92\xa7\xbc\xd1\xe6\xfb"
6795                         "\x10\x25\x3a\x4f\x64\x79\x8e\xa3"
6796                         "\xb8\xcd\xe2\xf7\x0c\x21\x36\x4b"
6797                         "\x60\x75\x8a\x9f\xb4\xc9\xde\xf3"
6798                         "\x08\x1d\x32\x47\x5c\x71\x86\x9b"
6799                         "\xb0\xc5\xda\xef\x04\x19\x2e\x43"
6800                         "\x58\x6d\x82\x97\xac\xc1\xd6\xeb"
6801                         "\x00\x17\x2e\x45\x5c\x73\x8a\xa1"
6802                         "\xb8\xcf\xe6\xfd\x14\x2b\x42\x59"
6803                         "\x70\x87\x9e\xb5\xcc\xe3\xfa\x11"
6804                         "\x28\x3f\x56\x6d\x84\x9b\xb2\xc9"
6805                         "\xe0\xf7\x0e\x25\x3c\x53\x6a\x81"
6806                         "\x98\xaf\xc6\xdd\xf4\x0b\x22\x39"
6807                         "\x50\x67\x7e\x95\xac\xc3\xda\xf1"
6808                         "\x08\x1f\x36\x4d\x64\x7b\x92\xa9"
6809                         "\xc0\xd7\xee\x05\x1c\x33\x4a\x61"
6810                         "\x78\x8f\xa6\xbd\xd4\xeb\x02\x19"
6811                         "\x30\x47\x5e\x75\x8c\xa3\xba\xd1"
6812                         "\xe8\xff\x16\x2d\x44\x5b\x72\x89"
6813                         "\xa0\xb7\xce\xe5\xfc\x13\x2a\x41"
6814                         "\x58\x6f\x86\x9d\xb4\xcb\xe2\xf9"
6815                         "\x10\x27\x3e\x55\x6c\x83\x9a\xb1"
6816                         "\xc8\xdf\xf6\x0d\x24\x3b\x52\x69"
6817                         "\x80\x97\xae\xc5\xdc\xf3\x0a\x21"
6818                         "\x38\x4f\x66\x7d\x94\xab\xc2\xd9"
6819                         "\xf0\x07\x1e\x35\x4c\x63\x7a\x91"
6820                         "\xa8\xbf\xd6\xed\x04\x1b\x32\x49"
6821                         "\x60\x77\x8e\xa5\xbc\xd3\xea\x01"
6822                         "\x18\x2f\x46\x5d\x74\x8b\xa2\xb9"
6823                         "\xd0\xe7\xfe\x15\x2c\x43\x5a\x71"
6824                         "\x88\x9f\xb6\xcd\xe4\xfb\x12\x29"
6825                         "\x40\x57\x6e\x85\x9c\xb3\xca\xe1"
6826                         "\xf8\x0f\x26\x3d\x54\x6b\x82\x99"
6827                         "\xb0\xc7\xde\xf5\x0c\x23\x3a\x51"
6828                         "\x68\x7f\x96\xad\xc4\xdb\xf2\x09"
6829                         "\x20\x37\x4e\x65\x7c\x93\xaa\xc1"
6830                         "\xd8\xef\x06\x1d\x34\x4b\x62\x79"
6831                         "\x90\xa7\xbe\xd5\xec\x03\x1a\x31"
6832                         "\x48\x5f\x76\x8d\xa4\xbb\xd2\xe9"
6833                         "\x00\x19\x32\x4b\x64\x7d\x96\xaf"
6834                         "\xc8\xe1\xfa\x13\x2c\x45\x5e\x77"
6835                         "\x90\xa9\xc2\xdb\xf4\x0d\x26\x3f"
6836                         "\x58\x71\x8a\xa3\xbc\xd5\xee\x07"
6837                         "\x20\x39\x52\x6b\x84\x9d\xb6\xcf"
6838                         "\xe8\x01\x1a\x33\x4c\x65\x7e\x97"
6839                         "\xb0\xc9\xe2\xfb\x14\x2d\x46\x5f"
6840                         "\x78\x91\xaa\xc3\xdc\xf5\x0e\x27"
6841                         "\x40\x59\x72\x8b\xa4\xbd\xd6\xef"
6842                         "\x08\x21\x3a\x53\x6c\x85\x9e\xb7"
6843                         "\xd0\xe9\x02\x1b\x34\x4d\x66\x7f"
6844                         "\x98\xb1\xca\xe3\xfc\x15\x2e\x47"
6845                         "\x60\x79\x92\xab\xc4\xdd\xf6\x0f"
6846                         "\x28\x41\x5a\x73\x8c\xa5\xbe\xd7"
6847                         "\xf0\x09\x22\x3b\x54\x6d\x86\x9f"
6848                         "\xb8\xd1\xea\x03\x1c\x35\x4e\x67"
6849                         "\x80\x99\xb2\xcb\xe4\xfd\x16\x2f"
6850                         "\x48\x61\x7a\x93\xac\xc5\xde\xf7"
6851                         "\x10\x29\x42\x5b\x74\x8d\xa6\xbf"
6852                         "\xd8\xf1\x0a\x23\x3c\x55\x6e\x87"
6853                         "\xa0\xb9\xd2\xeb\x04\x1d\x36\x4f"
6854                         "\x68\x81\x9a\xb3\xcc\xe5\xfe\x17"
6855                         "\x30\x49\x62\x7b\x94\xad\xc6\xdf"
6856                         "\xf8\x11\x2a\x43\x5c\x75\x8e\xa7"
6857                         "\xc0\xd9\xf2\x0b\x24\x3d\x56\x6f"
6858                         "\x88\xa1\xba\xd3\xec\x05\x1e\x37"
6859                         "\x50\x69\x82\x9b\xb4\xcd\xe6\xff"
6860                         "\x18\x31\x4a\x63\x7c\x95\xae\xc7"
6861                         "\xe0\xf9\x12\x2b\x44\x5d\x76\x8f"
6862                         "\xa8\xc1\xda\xf3\x0c\x25\x3e\x57"
6863                         "\x70\x89\xa2\xbb\xd4\xed\x06\x1f"
6864                         "\x38\x51\x6a\x83\x9c\xb5\xce\xe7"
6865                         "\x00\x1b\x36\x51\x6c\x87\xa2\xbd"
6866                         "\xd8\xf3\x0e\x29\x44\x5f\x7a\x95"
6867                         "\xb0\xcb\xe6\x01\x1c\x37\x52\x6d"
6868                         "\x88\xa3\xbe\xd9\xf4\x0f\x2a\x45"
6869                         "\x60\x7b\x96\xb1\xcc\xe7\x02\x1d"
6870                         "\x38\x53\x6e\x89\xa4\xbf\xda\xf5"
6871                         "\x10\x2b\x46\x61\x7c\x97\xb2\xcd"
6872                         "\xe8\x03\x1e\x39\x54\x6f\x8a\xa5"
6873                         "\xc0\xdb\xf6\x11\x2c\x47\x62\x7d"
6874                         "\x98\xb3\xce\xe9\x04\x1f\x3a\x55"
6875                         "\x70\x8b\xa6\xc1\xdc\xf7\x12\x2d"
6876                         "\x48\x63\x7e\x99\xb4\xcf\xea\x05"
6877                         "\x20\x3b\x56\x71\x8c\xa7\xc2\xdd"
6878                         "\xf8\x13\x2e\x49\x64\x7f\x9a\xb5"
6879                         "\xd0\xeb\x06\x21\x3c\x57\x72\x8d"
6880                         "\xa8\xc3\xde\xf9\x14\x2f\x4a\x65"
6881                         "\x80\x9b\xb6\xd1\xec\x07\x22\x3d"
6882                         "\x58\x73\x8e\xa9\xc4\xdf\xfa\x15"
6883                         "\x30\x4b\x66\x81\x9c\xb7\xd2\xed"
6884                         "\x08\x23\x3e\x59\x74\x8f\xaa\xc5"
6885                         "\xe0\xfb\x16\x31\x4c\x67\x82\x9d"
6886                         "\xb8\xd3\xee\x09\x24\x3f\x5a\x75"
6887                         "\x90\xab\xc6\xe1\xfc\x17\x32\x4d"
6888                         "\x68\x83\x9e\xb9\xd4\xef\x0a\x25"
6889                         "\x40\x5b\x76\x91\xac\xc7\xe2\xfd"
6890                         "\x18\x33\x4e\x69\x84\x9f\xba\xd5"
6891                         "\xf0\x0b\x26\x41\x5c\x77\x92\xad"
6892                         "\xc8\xe3\xfe\x19\x34\x4f\x6a\x85"
6893                         "\xa0\xbb\xd6\xf1\x0c\x27\x42\x5d"
6894                         "\x78\x93\xae\xc9\xe4\xff\x1a\x35"
6895                         "\x50\x6b\x86\xa1\xbc\xd7\xf2\x0d"
6896                         "\x28\x43\x5e\x79\x94\xaf\xca\xe5"
6897                         "\x00\x1d\x3a\x57\x74\x91\xae\xcb"
6898                         "\xe8\x05\x22\x3f\x5c\x79\x96\xb3"
6899                         "\xd0\xed\x0a\x27\x44\x61\x7e\x9b"
6900                         "\xb8\xd5\xf2\x0f\x2c\x49\x66\x83"
6901                         "\xa0\xbd\xda\xf7\x14\x31\x4e\x6b"
6902                         "\x88\xa5\xc2\xdf\xfc\x19\x36\x53"
6903                         "\x70\x8d\xaa\xc7\xe4\x01\x1e\x3b"
6904                         "\x58\x75\x92\xaf\xcc\xe9\x06\x23"
6905                         "\x40\x5d\x7a\x97\xb4\xd1\xee\x0b"
6906                         "\x28\x45\x62\x7f\x9c\xb9\xd6\xf3"
6907                         "\x10\x2d\x4a\x67\x84\xa1\xbe\xdb"
6908                         "\xf8\x15\x32\x4f\x6c\x89\xa6\xc3"
6909                         "\xe0\xfd\x1a\x37\x54\x71\x8e\xab"
6910                         "\xc8\xe5\x02\x1f\x3c\x59\x76\x93"
6911                         "\xb0\xcd\xea\x07\x24\x41\x5e\x7b"
6912                         "\x98\xb5\xd2\xef\x0c\x29\x46\x63"
6913                         "\x80\x9d\xba\xd7\xf4\x11\x2e\x4b"
6914                         "\x68\x85\xa2\xbf\xdc\xf9\x16\x33"
6915                         "\x50\x6d\x8a\xa7\xc4\xe1\xfe\x1b"
6916                         "\x38\x55\x72\x8f\xac\xc9\xe6\x03"
6917                         "\x20\x3d\x5a\x77\x94\xb1\xce\xeb"
6918                         "\x08\x25\x42\x5f\x7c\x99\xb6\xd3"
6919                         "\xf0\x0d\x2a\x47\x64\x81\x9e\xbb"
6920                         "\xd8\xf5\x12\x2f\x4c\x69\x86\xa3"
6921                         "\xc0\xdd\xfa\x17\x34\x51\x6e\x8b"
6922                         "\xa8\xc5\xe2\xff\x1c\x39\x56\x73"
6923                         "\x90\xad\xca\xe7\x04\x21\x3e\x5b"
6924                         "\x78\x95\xb2\xcf\xec\x09\x26\x43"
6925                         "\x60\x7d\x9a\xb7\xd4\xf1\x0e\x2b"
6926                         "\x48\x65\x82\x9f\xbc\xd9\xf6\x13"
6927                         "\x30\x4d\x6a\x87\xa4\xc1\xde\xfb"
6928                         "\x18\x35\x52\x6f\x8c\xa9\xc6\xe3"
6929                         "\x00\x1f\x3e\x5d\x7c\x9b\xba\xd9"
6930                         "\xf8\x17\x36\x55\x74\x93\xb2\xd1"
6931                         "\xf0\x0f\x2e\x4d\x6c\x8b\xaa\xc9"
6932                         "\xe8\x07\x26\x45\x64\x83\xa2\xc1"
6933                         "\xe0\xff\x1e\x3d\x5c\x7b\x9a\xb9"
6934                         "\xd8\xf7\x16\x35\x54\x73\x92\xb1"
6935                         "\xd0\xef\x0e\x2d\x4c\x6b\x8a\xa9"
6936                         "\xc8\xe7\x06\x25\x44\x63\x82\xa1"
6937                         "\xc0\xdf\xfe\x1d\x3c\x5b\x7a\x99"
6938                         "\xb8\xd7\xf6\x15\x34\x53\x72\x91"
6939                         "\xb0\xcf\xee\x0d\x2c\x4b\x6a\x89"
6940                         "\xa8\xc7\xe6\x05\x24\x43\x62\x81"
6941                         "\xa0\xbf\xde\xfd\x1c\x3b\x5a\x79"
6942                         "\x98\xb7\xd6\xf5\x14\x33\x52\x71"
6943                         "\x90\xaf\xce\xed\x0c\x2b\x4a\x69"
6944                         "\x88\xa7\xc6\xe5\x04\x23\x42\x61"
6945                         "\x80\x9f\xbe\xdd\xfc\x1b\x3a\x59"
6946                         "\x78\x97\xb6\xd5\xf4\x13\x32\x51"
6947                         "\x70\x8f\xae\xcd\xec\x0b\x2a\x49"
6948                         "\x68\x87\xa6\xc5\xe4\x03\x22\x41"
6949                         "\x60\x7f\x9e\xbd\xdc\xfb\x1a\x39"
6950                         "\x58\x77\x96\xb5\xd4\xf3\x12\x31"
6951                         "\x50\x6f\x8e\xad\xcc\xeb\x0a\x29"
6952                         "\x48\x67\x86\xa5\xc4\xe3\x02\x21"
6953                         "\x40\x5f\x7e\x9d\xbc\xdb\xfa\x19"
6954                         "\x38\x57\x76\x95\xb4\xd3\xf2\x11"
6955                         "\x30\x4f\x6e\x8d\xac\xcb\xea\x09"
6956                         "\x28\x47\x66\x85\xa4\xc3\xe2\x01"
6957                         "\x20\x3f\x5e\x7d\x9c\xbb\xda\xf9"
6958                         "\x18\x37\x56\x75\x94\xb3\xd2\xf1"
6959                         "\x10\x2f\x4e\x6d\x8c\xab\xca\xe9"
6960                         "\x08\x27\x46\x65\x84\xa3\xc2\xe1"
6961                         "\x00\x21\x42\x63",
6962                 .ilen = 4100,
6963                 .result =
6964                         "\xf0\x5c\x74\xad\x4e\xbc\x99\xe2"
6965                         "\xae\xff\x91\x3a\x44\xcf\x38\x32"
6966                         "\x1e\xad\xa7\xcd\xa1\x39\x95\xaa"
6967                         "\x10\xb1\xb3\x2e\x04\x31\x8f\x86"
6968                         "\xf2\x62\x74\x70\x0c\xa4\x46\x08"
6969                         "\xa8\xb7\x99\xa8\xe9\xd2\x73\x79"
6970                         "\x7e\x6e\xd4\x8f\x1e\xc7\x8e\x31"
6971                         "\x0b\xfa\x4b\xce\xfd\xf3\x57\x71"
6972                         "\xe9\x46\x03\xa5\x3d\x34\x00\xe2"
6973                         "\x18\xff\x75\x6d\x06\x2d\x00\xab"
6974                         "\xb9\x3e\x6c\x59\xc5\x84\x06\xb5"
6975                         "\x8b\xd0\x89\x9c\x4a\x79\x16\xc6"
6976                         "\x3d\x74\x54\xfa\x44\xcd\x23\x26"
6977                         "\x5c\xcf\x7e\x28\x92\x32\xbf\xdf"
6978                         "\xa7\x20\x3c\x74\x58\x2a\x9a\xde"
6979                         "\x61\x00\x1c\x4f\xff\x59\xc4\x22"
6980                         "\xac\x3c\xd0\xe8\x6c\xf9\x97\x1b"
6981                         "\x58\x9b\xad\x71\xe8\xa9\xb5\x0d"
6982                         "\xee\x2f\x04\x1f\x7f\xbc\x99\xee"
6983                         "\x84\xff\x42\x60\xdc\x3a\x18\xa5"
6984                         "\x81\xf9\xef\xdc\x7a\x0f\x65\x41"
6985                         "\x2f\xa3\xd3\xf9\xc2\xcb\xc0\x4d"
6986                         "\x8f\xd3\x76\x96\xad\x49\x6d\x38"
6987                         "\x3d\x39\x0b\x6c\x80\xb7\x54\x69"
6988                         "\xf0\x2c\x90\x02\x29\x0d\x1c\x12"
6989                         "\xad\x55\xc3\x8b\x68\xd9\xcc\xb3"
6990                         "\xb2\x64\x33\x90\x5e\xca\x4b\xe2"
6991                         "\xfb\x75\xdc\x63\xf7\x9f\x82\x74"
6992                         "\xf0\xc9\xaa\x7f\xe9\x2a\x9b\x33"
6993                         "\xbc\x88\x00\x7f\xca\xb2\x1f\x14"
6994                         "\xdb\xc5\x8e\x7b\x11\x3c\x3e\x08"
6995                         "\xf3\x83\xe8\xe0\x94\x86\x2e\x92"
6996                         "\x78\x6b\x01\xc9\xc7\x83\xba\x21"
6997                         "\x6a\x25\x15\x33\x4e\x45\x08\xec"
6998                         "\x35\xdb\xe0\x6e\x31\x51\x79\xa9"
6999                         "\x42\x44\x65\xc1\xa0\xf1\xf9\x2a"
7000                         "\x70\xd5\xb6\xc6\xc1\x8c\x39\xfc"
7001                         "\x25\xa6\x55\xd9\xdd\x2d\x4c\xec"
7002                         "\x49\xc6\xeb\x0e\xa8\x25\x2a\x16"
7003                         "\x1b\x66\x84\xda\xe2\x92\xe5\xc0"
7004                         "\xc8\x53\x07\xaf\x80\x84\xec\xfd"
7005                         "\xcd\xd1\x6e\xcd\x6f\x6a\xf5\x36"
7006                         "\xc5\x15\xe5\x25\x7d\x77\xd1\x1a"
7007                         "\x93\x36\xa9\xcf\x7c\xa4\x54\x4a"
7008                         "\x06\x51\x48\x4e\xf6\x59\x87\xd2"
7009                         "\x04\x02\xef\xd3\x44\xde\x76\x31"
7010                         "\xb3\x34\x17\x1b\x9d\x66\x11\x9f"
7011                         "\x1e\xcc\x17\xe9\xc7\x3c\x1b\xe7"
7012                         "\xcb\x50\x08\xfc\xdc\x2b\x24\xdb"
7013                         "\x65\x83\xd0\x3b\xe3\x30\xea\x94"
7014                         "\x6c\xe7\xe8\x35\x32\xc7\xdb\x64"
7015                         "\xb4\x01\xab\x36\x2c\x77\x13\xaf"
7016                         "\xf8\x2b\x88\x3f\x54\x39\xc4\x44"
7017                         "\xfe\xef\x6f\x68\x34\xbe\x0f\x05"
7018                         "\x16\x6d\xf6\x0a\x30\xe7\xe3\xed"
7019                         "\xc4\xde\x3c\x1b\x13\xd8\xdb\xfe"
7020                         "\x41\x62\xe5\x28\xd4\x8d\xa3\xc7"
7021                         "\x93\x97\xc6\x48\x45\x1d\x9f\x83"
7022                         "\xdf\x4b\x40\x3e\x42\x25\x87\x80"
7023                         "\x4c\x7d\xa8\xd4\x98\x23\x95\x75"
7024                         "\x41\x8c\xda\x41\x9b\xd4\xa7\x06"
7025                         "\xb5\xf1\x71\x09\x53\xbe\xca\xbf"
7026                         "\x32\x03\xed\xf0\x50\x1c\x56\x39"
7027                         "\x5b\xa4\x75\x18\xf7\x9b\x58\xef"
7028                         "\x53\xfc\x2a\x38\x23\x15\x75\xcd"
7029                         "\x45\xe5\x5a\x82\x55\xba\x21\xfa"
7030                         "\xd4\xbd\xc6\x94\x7c\xc5\x80\x12"
7031                         "\xf7\x4b\x32\xc4\x9a\x82\xd8\x28"
7032                         "\x8f\xd9\xc2\x0f\x60\x03\xbe\x5e"
7033                         "\x21\xd6\x5f\x58\xbf\x5c\xb1\x32"
7034                         "\x82\x8d\xa9\xe5\xf2\x66\x1a\xc0"
7035                         "\xa0\xbc\x58\x2f\x71\xf5\x2f\xed"
7036                         "\xd1\x26\xb9\xd8\x49\x5a\x07\x19"
7037                         "\x01\x7c\x59\xb0\xf8\xa4\xb7\xd3"
7038                         "\x7b\x1a\x8c\x38\xf4\x50\xa4\x59"
7039                         "\xb0\xcc\x41\x0b\x88\x7f\xe5\x31"
7040                         "\xb3\x42\xba\xa2\x7e\xd4\x32\x71"
7041                         "\x45\x87\x48\xa9\xc2\xf2\x89\xb3"
7042                         "\xe4\xa7\x7e\x52\x15\x61\xfa\xfe"
7043                         "\xc9\xdd\x81\xeb\x13\xab\xab\xc3"
7044                         "\x98\x59\xd8\x16\x3d\x14\x7a\x1c"
7045                         "\x3c\x41\x9a\x16\x16\x9b\xd2\xd2"
7046                         "\x69\x3a\x29\x23\xac\x86\x32\xa5"
7047                         "\x48\x9c\x9e\xf3\x47\x77\x81\x70"
7048                         "\x24\xe8\x85\xd2\xf5\xb5\xfa\xff"
7049                         "\x59\x6a\xd3\x50\x59\x43\x59\xde"
7050                         "\xd9\xf1\x55\xa5\x0c\xc3\x1a\x1a"
7051                         "\x18\x34\x0d\x1a\x63\x33\xed\x10"
7052                         "\xe0\x1d\x2a\x18\xd2\xc0\x54\xa8"
7053                         "\xca\xb5\x9a\xd3\xdd\xca\x45\x84"
7054                         "\x50\xe7\x0f\xfe\xa4\x99\x5a\xbe"
7055                         "\x43\x2d\x9a\xcb\x92\x3f\x5a\x1d"
7056                         "\x85\xd8\xc9\xdf\x68\xc9\x12\x80"
7057                         "\x56\x0c\xdc\x00\xdc\x3a\x7d\x9d"
7058                         "\xa3\xa2\xe8\x4d\xbf\xf9\x70\xa0"
7059                         "\xa4\x13\x4f\x6b\xaf\x0a\x89\x7f"
7060                         "\xda\xf0\xbf\x9b\xc8\x1d\xe5\xf8"
7061                         "\x2e\x8b\x07\xb5\x73\x1b\xcc\xa2"
7062                         "\xa6\xad\x30\xbc\x78\x3c\x5b\x10"
7063                         "\xfa\x5e\x62\x2d\x9e\x64\xb3\x33"
7064                         "\xce\xf9\x1f\x86\xe7\x8b\xa2\xb8"
7065                         "\xe8\x99\x57\x8c\x11\xed\x66\xd9"
7066                         "\x3c\x72\xb9\xc3\xe6\x4e\x17\x3a"
7067                         "\x6a\xcb\x42\x24\x06\xed\x3e\x4e"
7068                         "\xa3\xe8\x6a\x94\xda\x0d\x4e\xd5"
7069                         "\x14\x19\xcf\xb6\x26\xd8\x2e\xcc"
7070                         "\x64\x76\x38\x49\x4d\xfe\x30\x6d"
7071                         "\xe4\xc8\x8c\x7b\xc4\xe0\x35\xba"
7072                         "\x22\x6e\x76\xe1\x1a\xf2\x53\xc3"
7073                         "\x28\xa2\x82\x1f\x61\x69\xad\xc1"
7074                         "\x7b\x28\x4b\x1e\x6c\x85\x95\x9b"
7075                         "\x51\xb5\x17\x7f\x12\x69\x8c\x24"
7076                         "\xd5\xc7\x5a\x5a\x11\x54\xff\x5a"
7077                         "\xf7\x16\xc3\x91\xa6\xf0\xdc\x0a"
7078                         "\xb6\xa7\x4a\x0d\x7a\x58\xfe\xa5"
7079                         "\xf5\xcb\x8f\x7b\x0e\xea\x57\xe7"
7080                         "\xbd\x79\xd6\x1c\x88\x23\x6c\xf2"
7081                         "\x4d\x29\x77\x53\x35\x6a\x00\x8d"
7082                         "\xcd\xa3\x58\xbe\x77\x99\x18\xf8"
7083                         "\xe6\xe1\x8f\xe9\x37\x8f\xe3\xe2"
7084                         "\x5a\x8a\x93\x25\xaf\xf3\x78\x80"
7085                         "\xbe\xa6\x1b\xc6\xac\x8b\x1c\x91"
7086                         "\x58\xe1\x9f\x89\x35\x9d\x1d\x21"
7087                         "\x29\x9f\xf4\x99\x02\x27\x0f\xa8"
7088                         "\x4f\x79\x94\x2b\x33\x2c\xda\xa2"
7089                         "\x26\x39\x83\x94\xef\x27\xd8\x53"
7090                         "\x8f\x66\x0d\xe4\x41\x7d\x34\xcd"
7091                         "\x43\x7c\x95\x0a\x53\xef\x66\xda"
7092                         "\x7e\x9b\xf3\x93\xaf\xd0\x73\x71"
7093                         "\xba\x40\x9b\x74\xf8\xd7\xd7\x41"
7094                         "\x6d\xaf\x72\x9c\x8d\x21\x87\x3c"
7095                         "\xfd\x0a\x90\xa9\x47\x96\x9e\xd3"
7096                         "\x88\xee\x73\xcf\x66\x2f\x52\x56"
7097                         "\x6d\xa9\x80\x4c\xe2\x6f\x62\x88"
7098                         "\x3f\x0e\x54\x17\x48\x80\x5d\xd3"
7099                         "\xc3\xda\x25\x3d\xa1\xc8\xcb\x9f"
7100                         "\x9b\x70\xb3\xa1\xeb\x04\x52\xa1"
7101                         "\xf2\x22\x0f\xfc\xc8\x18\xfa\xf9"
7102                         "\x85\x9c\xf1\xac\xeb\x0c\x02\x46"
7103                         "\x75\xd2\xf5\x2c\xe3\xd2\x59\x94"
7104                         "\x12\xf3\x3c\xfc\xd7\x92\xfa\x36"
7105                         "\xba\x61\x34\x38\x7c\xda\x48\x3e"
7106                         "\x08\xc9\x39\x23\x5e\x02\x2c\x1a"
7107                         "\x18\x7e\xb4\xd9\xfd\x9e\x40\x02"
7108                         "\xb1\x33\x37\x32\xe7\xde\xd6\xd0"
7109                         "\x7c\x58\x65\x4b\xf8\x34\x27\x9c"
7110                         "\x44\xb4\xbd\xe9\xe9\x4c\x78\x7d"
7111                         "\x4b\x9f\xce\xb1\xcd\x47\xa5\x37"
7112                         "\xe5\x6d\xbd\xb9\x43\x94\x0a\xd4"
7113                         "\xd6\xf9\x04\x5f\xb5\x66\x6c\x1a"
7114                         "\x35\x12\xe3\x36\x28\x27\x36\x58"
7115                         "\x01\x2b\x79\xe4\xba\x6d\x10\x7d"
7116                         "\x65\xdf\x84\x95\xf4\xd5\xb6\x8f"
7117                         "\x2b\x9f\x96\x00\x86\x60\xf0\x21"
7118                         "\x76\xa8\x6a\x8c\x28\x1c\xb3\x6b"
7119                         "\x97\xd7\xb6\x53\x2a\xcc\xab\x40"
7120                         "\x9d\x62\x79\x58\x52\xe6\x65\xb7"
7121                         "\xab\x55\x67\x9c\x89\x7c\x03\xb0"
7122                         "\x73\x59\xc5\x81\xf5\x18\x17\x5c"
7123                         "\x89\xf3\x78\x35\x44\x62\x78\x72"
7124                         "\xd0\x96\xeb\x31\xe7\x87\x77\x14"
7125                         "\x99\x51\xf2\x59\x26\x9e\xb5\xa6"
7126                         "\x45\xfe\x6e\xbd\x07\x4c\x94\x5a"
7127                         "\xa5\x7d\xfc\xf1\x2b\x77\xe2\xfe"
7128                         "\x17\xd4\x84\xa0\xac\xb5\xc7\xda"
7129                         "\xa9\x1a\xb6\xf3\x74\x11\xb4\x9d"
7130                         "\xfb\x79\x2e\x04\x2d\x50\x28\x83"
7131                         "\xbf\xc6\x52\xd3\x34\xd6\xe8\x7a"
7132                         "\xb6\xea\xe7\xa8\x6c\x15\x1e\x2c"
7133                         "\x57\xbc\x48\x4e\x5f\x5c\xb6\x92"
7134                         "\xd2\x49\x77\x81\x6d\x90\x70\xae"
7135                         "\x98\xa1\x03\x0d\x6b\xb9\x77\x14"
7136                         "\xf1\x4e\x23\xd3\xf8\x68\xbd\xc2"
7137                         "\xfe\x04\xb7\x5c\xc5\x17\x60\x8f"
7138                         "\x65\x54\xa4\x7a\x42\xdc\x18\x0d"
7139                         "\xb5\xcf\x0f\xd3\xc7\x91\x66\x1b"
7140                         "\x45\x42\x27\x75\x50\xe5\xee\xb8"
7141                         "\x7f\x33\x2c\xba\x4a\x92\x4d\x2c"
7142                         "\x3c\xe3\x0d\x80\x01\xba\x0d\x29"
7143                         "\xd8\x3c\xe9\x13\x16\x57\xe6\xea"
7144                         "\x94\x52\xe7\x00\x4d\x30\xb0\x0f"
7145                         "\x35\xb8\xb8\xa7\xb1\xb5\x3b\x44"
7146                         "\xe1\x2f\xfd\x88\xed\x43\xe7\x52"
7147                         "\x10\x93\xb3\x8a\x30\x6b\x0a\xf7"
7148                         "\x23\xc6\x50\x9d\x4a\xb0\xde\xc3"
7149                         "\xdc\x9b\x2f\x01\x56\x36\x09\xc5"
7150                         "\x2f\x6b\xfe\xf1\xd8\x27\x45\x03"
7151                         "\x30\x5e\x5c\x5b\xb4\x62\x0e\x1a"
7152                         "\xa9\x21\x2b\x92\x94\x87\x62\x57"
7153                         "\x4c\x10\x74\x1a\xf1\x0a\xc5\x84"
7154                         "\x3b\x9e\x72\x02\xd7\xcc\x09\x56"
7155                         "\xbd\x54\xc1\xf0\xc3\xe3\xb3\xf8"
7156                         "\xd2\x0d\x61\xcb\xef\xce\x0d\x05"
7157                         "\xb0\x98\xd9\x8e\x4f\xf9\xbc\x93"
7158                         "\xa6\xea\xc8\xcf\x10\x53\x4b\xf1"
7159                         "\xec\xfc\x89\xf9\x64\xb0\x22\xbf"
7160                         "\x9e\x55\x46\x9f\x7c\x50\x8e\x84"
7161                         "\x54\x20\x98\xd7\x6c\x40\x1e\xdb"
7162                         "\x69\x34\x78\x61\x24\x21\x9c\x8a"
7163                         "\xb3\x62\x31\x8b\x6e\xf5\x2a\x35"
7164                         "\x86\x13\xb1\x6c\x64\x2e\x41\xa5"
7165                         "\x05\xf2\x42\xba\xd2\x3a\x0d\x8e"
7166                         "\x8a\x59\x94\x3c\xcf\x36\x27\x82"
7167                         "\xc2\x45\xee\x58\xcd\x88\xb4\xec"
7168                         "\xde\xb2\x96\x0a\xaf\x38\x6f\x88"
7169                         "\xd7\xd8\xe1\xdf\xb9\x96\xa9\x0a"
7170                         "\xb1\x95\x28\x86\x20\xe9\x17\x49"
7171                         "\xa2\x29\x38\xaa\xa5\xe9\x6e\xf1"
7172                         "\x19\x27\xc0\xd5\x2a\x22\xc3\x0b"
7173                         "\xdb\x7c\x73\x10\xb9\xba\x89\x76"
7174                         "\x54\xae\x7d\x71\xb3\x93\xf6\x32"
7175                         "\xe6\x47\x43\x55\xac\xa0\x0d\xc2"
7176                         "\x93\x27\x4a\x8e\x0e\x74\x15\xc7"
7177                         "\x0b\x85\xd9\x0c\xa9\x30\x7a\x3e"
7178                         "\xea\x8f\x85\x6d\x3a\x12\x4f\x72"
7179                         "\x69\x58\x7a\x80\xbb\xb5\x97\xf3"
7180                         "\xcf\x70\xd2\x5d\xdd\x4d\x21\x79"
7181                         "\x54\x4d\xe4\x05\xe8\xbd\xc2\x62"
7182                         "\xb1\x3b\x77\x1c\xd6\x5c\xf3\xa0"
7183                         "\x79\x00\xa8\x6c\x29\xd9\x18\x24"
7184                         "\x36\xa2\x46\xc0\x96\x65\x7f\xbd"
7185                         "\x2a\xed\x36\x16\x0c\xaa\x9f\xf4"
7186                         "\xc5\xb4\xe2\x12\xed\x69\xed\x4f"
7187                         "\x26\x2c\x39\x52\x89\x98\xe7\x2c"
7188                         "\x99\xa4\x9e\xa3\x9b\x99\x46\x7a"
7189                         "\x3a\xdc\xa8\x59\xa3\xdb\xc3\x3b"
7190                         "\x95\x0d\x3b\x09\x6e\xee\x83\x5d"
7191                         "\x32\x4d\xed\xab\xfa\x98\x14\x4e"
7192                         "\xc3\x15\x45\x53\x61\xc4\x93\xbd"
7193                         "\x90\xf4\x99\x95\x4c\xe6\x76\x92"
7194                         "\x29\x90\x46\x30\x92\x69\x7d\x13"
7195                         "\xf2\xa5\xcd\x69\x49\x44\xb2\x0f"
7196                         "\x63\x40\x36\x5f\x09\xe2\x78\xf8"
7197                         "\x91\xe3\xe2\xfa\x10\xf7\xc8\x24"
7198                         "\xa8\x89\x32\x5c\x37\x25\x1d\xb2"
7199                         "\xea\x17\x8a\x0a\xa9\x64\xc3\x7c"
7200                         "\x3c\x7c\xbd\xc6\x79\x34\xe7\xe2"
7201                         "\x85\x8e\xbf\xf8\xde\x92\xa0\xae"
7202                         "\x20\xc4\xf6\xbb\x1f\x38\x19\x0e"
7203                         "\xe8\x79\x9c\xa1\x23\xe9\x54\x7e"
7204                         "\x37\x2f\xe2\x94\x32\xaf\xa0\x23"
7205                         "\x49\xe4\xc0\xb3\xac\x00\x8f\x36"
7206                         "\x05\xc4\xa6\x96\xec\x05\x98\x4f"
7207                         "\x96\x67\x57\x1f\x20\x86\x1b\x2d"
7208                         "\x69\xe4\x29\x93\x66\x5f\xaf\x6b"
7209                         "\x88\x26\x2c\x67\x02\x4b\x52\xd0"
7210                         "\x83\x7a\x43\x1f\xc0\x71\x15\x25"
7211                         "\x77\x65\x08\x60\x11\x76\x4c\x8d"
7212                         "\xed\xa9\x27\xc6\xb1\x2a\x2c\x6a"
7213                         "\x4a\x97\xf5\xc6\xb7\x70\x42\xd3"
7214                         "\x03\xd1\x24\x95\xec\x6d\xab\x38"
7215                         "\x72\xce\xe2\x8b\x33\xd7\x51\x09"
7216                         "\xdc\x45\xe0\x09\x96\x32\xf3\xc4"
7217                         "\x84\xdc\x73\x73\x2d\x1b\x11\x98"
7218                         "\xc5\x0e\x69\x28\x94\xc7\xb5\x4d"
7219                         "\xc8\x8a\xd0\xaa\x13\x2e\x18\x74"
7220                         "\xdd\xd1\x1e\xf3\x90\xe8\xfc\x9a"
7221                         "\x72\x4a\x0e\xd1\xe4\xfb\x0d\x96"
7222                         "\xd1\x0c\x79\x85\x1b\x1c\xfe\xe1"
7223                         "\x62\x8f\x7a\x73\x32\xab\xc8\x18"
7224                         "\x69\xe3\x34\x30\xdf\x13\xa6\xe5"
7225                         "\xe8\x0e\x67\x7f\x81\x11\xb4\x60"
7226                         "\xc7\xbd\x79\x65\x50\xdc\xc4\x5b"
7227                         "\xde\x39\xa4\x01\x72\x63\xf3\xd1"
7228                         "\x64\x4e\xdf\xfc\x27\x92\x37\x0d"
7229                         "\x57\xcd\x11\x4f\x11\x04\x8e\x1d"
7230                         "\x16\xf7\xcd\x92\x9a\x99\x30\x14"
7231                         "\xf1\x7c\x67\x1b\x1f\x41\x0b\xe8"
7232                         "\x32\xe8\xb8\xc1\x4f\x54\x86\x4f"
7233                         "\xe5\x79\x81\x73\xcd\x43\x59\x68"
7234                         "\x73\x02\x3b\x78\x21\x72\x43\x00"
7235                         "\x49\x17\xf7\x00\xaf\x68\x24\x53"
7236                         "\x05\x0a\xc3\x33\xe0\x33\x3f\x69"
7237                         "\xd2\x84\x2f\x0b\xed\xde\x04\xf4"
7238                         "\x11\x94\x13\x69\x51\x09\x28\xde"
7239                         "\x57\x5c\xef\xdc\x9a\x49\x1c\x17"
7240                         "\x97\xf3\x96\xc1\x7f\x5d\x2e\x7d"
7241                         "\x55\xb8\xb3\x02\x09\xb3\x1f\xe7"
7242                         "\xc9\x8d\xa3\x36\x34\x8a\x77\x13"
7243                         "\x30\x63\x4c\xa5\xcd\xc3\xe0\x7e"
7244                         "\x05\xa1\x7b\x0c\xcb\x74\x47\x31"
7245                         "\x62\x03\x43\xf1\x87\xb4\xb0\x85"
7246                         "\x87\x8e\x4b\x25\xc7\xcf\xae\x4b"
7247                         "\x36\x46\x3e\x62\xbc\x6f\xeb\x5f"
7248                         "\x73\xac\xe6\x07\xee\xc1\xa1\xd6"
7249                         "\xc4\xab\xc9\xd6\x89\x45\xe1\xf1"
7250                         "\x04\x4e\x1a\x6f\xbb\x4f\x3a\xa3"
7251                         "\xa0\xcb\xa3\x0a\xd8\x71\x35\x55"
7252                         "\xe4\xbc\x2e\x04\x06\xe6\xff\x5b"
7253                         "\x1c\xc0\x11\x7c\xc5\x17\xf3\x38"
7254                         "\xcf\xe9\xba\x0f\x0e\xef\x02\xc2"
7255                         "\x8d\xc6\xbc\x4b\x67\x20\x95\xd7"
7256                         "\x2c\x45\x5b\x86\x44\x8c\x6f\x2e"
7257                         "\x7e\x9f\x1c\x77\xba\x6b\x0e\xa3"
7258                         "\x69\xdc\xab\x24\x57\x60\x47\xc1"
7259                         "\xd1\xa5\x9d\x23\xe6\xb1\x37\xfe"
7260                         "\x93\xd2\x4c\x46\xf9\x0c\xc6\xfb"
7261                         "\xd6\x9d\x99\x69\xab\x7a\x07\x0c"
7262                         "\x65\xe7\xc4\x08\x96\xe2\xa5\x01"
7263                         "\x3f\x46\x07\x05\x7e\xe8\x9a\x90"
7264                         "\x50\xdc\xe9\x7a\xea\xa1\x39\x6e"
7265                         "\x66\xe4\x6f\xa5\x5f\xb2\xd9\x5b"
7266                         "\xf5\xdb\x2a\x32\xf0\x11\x6f\x7c"
7267                         "\x26\x10\x8f\x3d\x80\xe9\x58\xf7"
7268                         "\xe0\xa8\x57\xf8\xdb\x0e\xce\x99"
7269                         "\x63\x19\x3d\xd5\xec\x1b\x77\x69"
7270                         "\x98\xf6\xe4\x5f\x67\x17\x4b\x09"
7271                         "\x85\x62\x82\x70\x18\xe2\x9a\x78"
7272                         "\xe2\x62\xbd\xb4\xf1\x42\xc6\xfb"
7273                         "\x08\xd0\xbd\xeb\x4e\x09\xf2\xc8"
7274                         "\x1e\xdc\x3d\x32\x21\x56\x9c\x4f"
7275                         "\x35\xf3\x61\x06\x72\x84\xc4\x32"
7276                         "\xf2\xf1\xfa\x0b\x2f\xc3\xdb\x02"
7277                         "\x04\xc2\xde\x57\x64\x60\x8d\xcf"
7278                         "\xcb\x86\x5d\x97\x3e\xb1\x9c\x01"
7279                         "\xd6\x28\x8f\x99\xbc\x46\xeb\x05"
7280                         "\xaf\x7e\xb8\x21\x2a\x56\x85\x1c"
7281                         "\xb3\x71\xa0\xde\xca\x96\xf1\x78"
7282                         "\x49\xa2\x99\x81\x80\x5c\x01\xf5"
7283                         "\xa0\xa2\x56\x63\xe2\x70\x07\xa5"
7284                         "\x95\xd6\x85\xeb\x36\x9e\xa9\x51"
7285                         "\x66\x56\x5f\x1d\x02\x19\xe2\xf6"
7286                         "\x4f\x73\x38\x09\x75\x64\x48\xe0"
7287                         "\xf1\x7e\x0e\xe8\x9d\xf9\xed\x94"
7288                         "\xfe\x16\x26\x62\x49\x74\xf4\xb0"
7289                         "\xd4\xa9\x6c\xb0\xfd\x53\xe9\x81"
7290                         "\xe0\x7a\xbf\xcf\xb5\xc4\x01\x81"
7291                         "\x79\x99\x77\x01\x3b\xe9\xa2\xb6"
7292                         "\xe6\x6a\x8a\x9e\x56\x1c\x8d\x1e"
7293                         "\x8f\x06\x55\x2c\x6c\xdc\x92\x87"
7294                         "\x64\x3b\x4b\x19\xa1\x13\x64\x1d"
7295                         "\x4a\xe9\xc0\x00\xb8\x95\xef\x6b"
7296                         "\x1a\x86\x6d\x37\x52\x02\xc2\xe0"
7297                         "\xc8\xbb\x42\x0c\x02\x21\x4a\xc9"
7298                         "\xef\xa0\x54\xe4\x5e\x16\x53\x81"
7299                         "\x70\x62\x10\xaf\xde\xb8\xb5\xd3"
7300                         "\xe8\x5e\x6c\xc3\x8a\x3e\x18\x07"
7301                         "\xf2\x2f\x7d\xa7\xe1\x3d\x4e\xb4"
7302                         "\x26\xa7\xa3\x93\x86\xb2\x04\x1e"
7303                         "\x53\x5d\x86\xd6\xde\x65\xca\xe3"
7304                         "\x4e\xc1\xcf\xef\xc8\x70\x1b\x83"
7305                         "\x13\xdd\x18\x8b\x0d\x76\xd2\xf6"
7306                         "\x37\x7a\x93\x7a\x50\x11\x9f\x96"
7307                         "\x86\x25\xfd\xac\xdc\xbe\x18\x93"
7308                         "\x19\x6b\xec\x58\x4f\xb9\x75\xa7"
7309                         "\xdd\x3f\x2f\xec\xc8\x5a\x84\xab"
7310                         "\xd5\xe4\x8a\x07\xf6\x4d\x23\xd6"
7311                         "\x03\xfb\x03\x6a\xea\x66\xbf\xd4"
7312                         "\xb1\x34\xfb\x78\xe9\x55\xdc\x7c"
7313                         "\x3d\x9c\xe5\x9a\xac\xc3\x7a\x80"
7314                         "\x24\x6d\xa0\xef\x25\x7c\xb7\xea"
7315                         "\xce\x4d\x5f\x18\x60\xce\x87\x22"
7316                         "\x66\x2f\xd5\xdd\xdd\x02\x21\x75"
7317                         "\x82\xa0\x1f\x58\xc6\xd3\x62\xf7"
7318                         "\x32\xd8\xaf\x1e\x07\x77\x51\x96"
7319                         "\xd5\x6b\x1e\x7e\x80\x02\xe8\x67"
7320                         "\xea\x17\x0b\x10\xd2\x3f\x28\x25"
7321                         "\x4f\x05\x77\x02\x14\x69\xf0\x2c"
7322                         "\xbe\x0c\xf1\x74\x30\xd1\xb9\x9b"
7323                         "\xfc\x8c\xbb\x04\x16\xd9\xba\xc3"
7324                         "\xbc\x91\x8a\xc4\x30\xa4\xb0\x12"
7325                         "\x4c\x21\x87\xcb\xc9\x1d\x16\x96"
7326                         "\x07\x6f\x23\x54\xb9\x6f\x79\xe5"
7327                         "\x64\xc0\x64\xda\xb1\xae\xdd\x60"
7328                         "\x6c\x1a\x9d\xd3\x04\x8e\x45\xb0"
7329                         "\x92\x61\xd0\x48\x81\xed\x5e\x1d"
7330                         "\xa0\xc9\xa4\x33\xc7\x13\x51\x5d"
7331                         "\x7f\x83\x73\xb6\x70\x18\x65\x3e"
7332                         "\x2f\x0e\x7a\x12\x39\x98\xab\xd8"
7333                         "\x7e\x6f\xa3\xd1\xba\x56\xad\xbd"
7334                         "\xf0\x03\x01\x1c\x85\x35\x9f\xeb"
7335                         "\x19\x63\xa1\xaf\xfe\x2d\x35\x50"
7336                         "\x39\xa0\x65\x7c\x95\x7e\x6b\xfe"
7337                         "\xc1\xac\x07\x7c\x98\x4f\xbe\x57"
7338                         "\xa7\x22\xec\xe2\x7e\x29\x09\x53"
7339                         "\xe8\xbf\xb4\x7e\x3f\x8f\xfc\x14"
7340                         "\xce\x54\xf9\x18\x58\xb5\xff\x44"
7341                         "\x05\x9d\xce\x1b\xb6\x82\x23\xc8"
7342                         "\x2e\xbc\x69\xbb\x4a\x29\x0f\x65"
7343                         "\x94\xf0\x63\x06\x0e\xef\x8c\xbd"
7344                         "\xff\xfd\xb0\x21\x6e\x57\x05\x75"
7345                         "\xda\xd5\xc4\xeb\x8d\x32\xf7\x50"
7346                         "\xd3\x6f\x22\xed\x5f\x8e\xa2\x5b"
7347                         "\x80\x8c\xc8\x78\x40\x24\x4b\x89"
7348                         "\x30\xce\x7a\x97\x0e\xc4\xaf\xef"
7349                         "\x9b\xb4\xcd\x66\x74\x14\x04\x2b"
7350                         "\xf7\xce\x0b\x1c\x6e\xc2\x78\x8c"
7351                         "\xca\xc5\xd0\x1c\x95\x4a\x91\x2d"
7352                         "\xa7\x20\xeb\x86\x52\xb7\x67\xd8"
7353                         "\x0c\xd6\x04\x14\xde\x51\x74\x75"
7354                         "\xe7\x11\xb4\x87\xa3\x3d\x2d\xad"
7355                         "\x4f\xef\xa0\x0f\x70\x00\x6d\x13"
7356                         "\x19\x1d\x41\x50\xe9\xd8\xf0\x32"
7357                         "\x71\xbc\xd3\x11\xf2\xac\xbe\xaf"
7358                         "\x75\x46\x65\x4e\x07\x34\x37\xa3"
7359                         "\x89\xfe\x75\xd4\x70\x4c\xc6\x3f"
7360                         "\x69\x24\x0e\x38\x67\x43\x8c\xde"
7361                         "\x06\xb5\xb8\xe7\xc4\xf0\x41\x8f"
7362                         "\xf0\xbd\x2f\x0b\xb9\x18\xf8\xde"
7363                         "\x64\xb1\xdb\xee\x00\x50\x77\xe1"
7364                         "\xc7\xff\xa6\xfa\xdd\x70\xf4\xe3"
7365                         "\x93\xe9\x77\x35\x3d\x4b\x2f\x2b"
7366                         "\x6d\x55\xf0\xfc\x88\x54\x4e\x89"
7367                         "\xc1\x8a\x23\x31\x2d\x14\x2a\xb8"
7368                         "\x1b\x15\xdd\x9e\x6e\x7b\xda\x05"
7369                         "\x91\x7d\x62\x64\x96\x72\xde\xfc"
7370                         "\xc1\xec\xf0\x23\x51\x6f\xdb\x5b"
7371                         "\x1d\x08\x57\xce\x09\xb8\xf6\xcd"
7372                         "\x8d\x95\xf2\x20\xbf\x0f\x20\x57"
7373                         "\x98\x81\x84\x4f\x15\x5c\x76\xe7"
7374                         "\x3e\x0a\x3a\x6c\xc4\x8a\xbe\x78"
7375                         "\x74\x77\xc3\x09\x4b\x5d\x48\xe4"
7376                         "\xc8\xcb\x0b\xea\x17\x28\xcf\xcf"
7377                         "\x31\x32\x44\xa4\xe5\x0e\x1a\x98"
7378                         "\x94\xc4\xf0\xff\xae\x3e\x44\xe8"
7379                         "\xa5\xb3\xb5\x37\x2f\xe8\xaf\x6f"
7380                         "\x28\xc1\x37\x5f\x31\xd2\xb9\x33"
7381                         "\xb1\xb2\x52\x94\x75\x2c\x29\x59"
7382                         "\x06\xc2\x25\xe8\x71\x65\x4e\xed"
7383                         "\xc0\x9c\xb1\xbb\x25\xdc\x6c\xe7"
7384                         "\x4b\xa5\x7a\x54\x7a\x60\xff\x7a"
7385                         "\xe0\x50\x40\x96\x35\x63\xe4\x0b"
7386                         "\x76\xbd\xa4\x65\x00\x1b\x57\x88"
7387                         "\xae\xed\x39\x88\x42\x11\x3c\xed"
7388                         "\x85\x67\x7d\xb9\x68\x82\xe9\x43"
7389                         "\x3c\x47\x53\xfa\xe8\xf8\x9f\x1f"
7390                         "\x9f\xef\x0f\xf7\x30\xd9\x30\x0e"
7391                         "\xb9\x9f\x69\x18\x2f\x7e\xf8\xf8"
7392                         "\xf8\x8c\x0f\xd4\x02\x4d\xea\xcd"
7393                         "\x0a\x9c\x6f\x71\x6d\x5a\x4c\x60"
7394                         "\xce\x20\x56\x32\xc6\xc5\x99\x1f"
7395                         "\x09\xe6\x4e\x18\x1a\x15\x13\xa8"
7396                         "\x7d\xb1\x6b\xc0\xb2\x6d\xf8\x26"
7397                         "\x66\xf8\x3d\x18\x74\x70\x66\x7a"
7398                         "\x34\x17\xde\xba\x47\xf1\x06\x18"
7399                         "\xcb\xaf\xeb\x4a\x1e\x8f\xa7\x77"
7400                         "\xe0\x3b\x78\x62\x66\xc9\x10\xea"
7401                         "\x1f\xb7\x29\x0a\x45\xa1\x1d\x1e"
7402                         "\x1d\xe2\x65\x61\x50\x9c\xd7\x05"
7403                         "\xf2\x0b\x5b\x12\x61\x02\xc8\xe5"
7404                         "\x63\x4f\x20\x0c\x07\x17\x33\x5e"
7405                         "\x03\x9a\x53\x0f\x2e\x55\xfe\x50"
7406                         "\x43\x7d\xd0\xb6\x7e\x5a\xda\xae"
7407                         "\x58\xef\x15\xa9\x83\xd9\x46\xb1"
7408                         "\x42\xaa\xf5\x02\x6c\xce\x92\x06"
7409                         "\x1b\xdb\x66\x45\x91\x79\xc2\x2d"
7410                         "\xe6\x53\xd3\x14\xfd\xbb\x44\x63"
7411                         "\xc6\xd7\x3d\x7a\x0c\x75\x78\x9d"
7412                         "\x5c\xa6\x39\xb3\xe5\x63\xca\x8b"
7413                         "\xfe\xd3\xef\x60\x83\xf6\x8e\x70"
7414                         "\xb6\x67\xc7\x77\xed\x23\xef\x4c"
7415                         "\xf0\xed\x2d\x07\x59\x6f\xc1\x01"
7416                         "\x34\x37\x08\xab\xd9\x1f\x09\xb1"
7417                         "\xce\x5b\x17\xff\x74\xf8\x9c\xd5"
7418                         "\x2c\x56\x39\x79\x0f\x69\x44\x75"
7419                         "\x58\x27\x01\xc4\xbf\xa7\xa1\x1d"
7420                         "\x90\x17\x77\x86\x5a\x3f\xd9\xd1"
7421                         "\x0e\xa0\x10\xf8\xec\x1e\xa5\x7f"
7422                         "\x5e\x36\xd1\xe3\x04\x2c\x70\xf7"
7423                         "\x8e\xc0\x98\x2f\x6c\x94\x2b\x41"
7424                         "\xb7\x60\x00\xb7\x2e\xb8\x02\x8d"
7425                         "\xb8\xb0\xd3\x86\xba\x1d\xd7\x90"
7426                         "\xd6\xb6\xe1\xfc\xd7\xd8\x28\x06"
7427                         "\x63\x9b\xce\x61\x24\x79\xc0\x70"
7428                         "\x52\xd0\xb6\xd4\x28\x95\x24\x87"
7429                         "\x03\x1f\xb7\x9a\xda\xa3\xfb\x52"
7430                         "\x5b\x68\xe7\x4c\x8c\x24\xe1\x42"
7431                         "\xf7\xd5\xfd\xad\x06\x32\x9f\xba"
7432                         "\xc1\xfc\xdd\xc6\xfc\xfc\xb3\x38"
7433                         "\x74\x56\x58\x40\x02\x37\x52\x2c"
7434                         "\x55\xcc\xb3\x9e\x7a\xe9\xd4\x38"
7435                         "\x41\x5e\x0c\x35\xe2\x11\xd1\x13"
7436                         "\xf8\xb7\x8d\x72\x6b\x22\x2a\xb0"
7437                         "\xdb\x08\xba\x35\xb9\x3f\xc8\xd3"
7438                         "\x24\x90\xec\x58\xd2\x09\xc7\x2d"
7439                         "\xed\x38\x80\x36\x72\x43\x27\x49"
7440                         "\x4a\x80\x8a\xa2\xe8\xd3\xda\x30"
7441                         "\x7d\xb6\x82\x37\x86\x92\x86\x3e"
7442                         "\x08\xb2\x28\x5a\x55\x44\x24\x7d"
7443                         "\x40\x48\x8a\xb6\x89\x58\x08\xa0"
7444                         "\xd6\x6d\x3a\x17\xbf\xf6\x54\xa2"
7445                         "\xf5\xd3\x8c\x0f\x78\x12\x57\x8b"
7446                         "\xd5\xc2\xfd\x58\x5b\x7f\x38\xe3"
7447                         "\xcc\xb7\x7c\x48\xb3\x20\xe8\x81"
7448                         "\x14\x32\x45\x05\xe0\xdb\x9f\x75"
7449                         "\x85\xb4\x6a\xfc\x95\xe3\x54\x22"
7450                         "\x12\xee\x30\xfe\xd8\x30\xef\x34"
7451                         "\x50\xab\x46\x30\x98\x2f\xb7\xc0"
7452                         "\x15\xa2\x83\xb6\xf2\x06\x21\xa2"
7453                         "\xc3\x26\x37\x14\xd1\x4d\xb5\x10"
7454                         "\x52\x76\x4d\x6a\xee\xb5\x2b\x15"
7455                         "\xb7\xf9\x51\xe8\x2a\xaf\xc7\xfa"
7456                         "\x77\xaf\xb0\x05\x4d\xd1\x68\x8e"
7457                         "\x74\x05\x9f\x9d\x93\xa5\x3e\x7f"
7458                         "\x4e\x5f\x9d\xcb\x09\xc7\x83\xe3"
7459                         "\x02\x9d\x27\x1f\xef\x85\x05\x8d"
7460                         "\xec\x55\x88\x0f\x0d\x7c\x4c\xe8"
7461                         "\xa1\x75\xa0\xd8\x06\x47\x14\xef"
7462                         "\xaa\x61\xcf\x26\x15\xad\xd8\xa3"
7463                         "\xaa\x75\xf2\x78\x4a\x5a\x61\xdf"
7464                         "\x8b\xc7\x04\xbc\xb2\x32\xd2\x7e"
7465                         "\x42\xee\xb4\x2f\x51\xff\x7b\x2e"
7466                         "\xd3\x02\xe8\xdc\x5d\x0d\x50\xdc"
7467                         "\xae\xb7\x46\xf9\xa8\xe6\xd0\x16"
7468                         "\xcc\xe6\x2c\x81\xc7\xad\xe9\xf0"
7469                         "\x05\x72\x6d\x3d\x0a\x7a\xa9\x02"
7470                         "\xac\x82\x93\x6e\xb6\x1c\x28\xfc"
7471                         "\x44\x12\xfb\x73\x77\xd4\x13\x39"
7472                         "\x29\x88\x8a\xf3\x5c\xa6\x36\xa0"
7473                         "\x2a\xed\x7e\xb1\x1d\xd6\x4c\x6b"
7474                         "\x41\x01\x18\x5d\x5d\x07\x97\xa6"
7475                         "\x4b\xef\x31\x18\xea\xac\xb1\x84"
7476                         "\x21\xed\xda\x86",
7477                 .rlen = 4100,
7478                 .np     = 2,
7479                 .tap    = { 4064, 36 },
7480         },
7481 };
7482
7483 static struct cipher_testvec aes_ctr_rfc3686_dec_tv_template[] = {
7484         { /* From RFC 3686 */
7485                 .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
7486                           "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
7487                           "\x00\x00\x00\x30",
7488                 .klen   = 20,
7489                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
7490                 .input  = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
7491                           "\x2d\x61\x75\xa3\x26\x13\x11\xb8",
7492                 .ilen   = 16,
7493                 .result = "Single block msg",
7494                 .rlen   = 16,
7495         }, {
7496                 .key    = "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
7497                           "\x43\xd6\xce\x1f\x32\x53\x91\x63"
7498                           "\x00\x6c\xb6\xdb",
7499                 .klen   = 20,
7500                 .iv     = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
7501                 .input  = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
7502                           "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
7503                           "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
7504                           "\xfc\xe6\x30\xdf\x91\x41\xbe\x28",
7505                 .ilen   = 32,
7506                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
7507                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
7508                           "\x10\x11\x12\x13\x14\x15\x16\x17"
7509                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
7510                 .rlen   = 32,
7511         }, {
7512                 .key    = "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
7513                           "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
7514                           "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
7515                           "\x00\x00\x00\x48",
7516                 .klen   = 28,
7517                 .iv     = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
7518                 .input  = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
7519                           "\x4e\x79\x35\xa0\x03\xcb\xe9\x28",
7520                 .ilen   = 16,
7521                 .result = "Single block msg",
7522                 .rlen   = 16,
7523         }, {
7524                 .key    = "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
7525                           "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
7526                           "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
7527                           "\x00\x96\xb0\x3b",
7528                 .klen   = 28,
7529                 .iv     = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
7530                 .input  = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
7531                           "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
7532                           "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
7533                           "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00",
7534                 .ilen   = 32,
7535                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
7536                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
7537                           "\x10\x11\x12\x13\x14\x15\x16\x17"
7538                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
7539                 .rlen   = 32,
7540         }, {
7541                 .key    = "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
7542                           "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
7543                           "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
7544                           "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
7545                           "\x00\x00\x00\x60",
7546                 .klen   = 36,
7547                 .iv     = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
7548                 .input  = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
7549                           "\x56\x08\x63\xdc\x71\xe3\xe0\xc0",
7550                 .ilen   = 16,
7551                 .result = "Single block msg",
7552                 .rlen   = 16,
7553         }, {
7554                 .key    = "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
7555                           "\x07\x96\x36\x58\x79\xef\xf8\x86"
7556                           "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
7557                           "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
7558                           "\x00\xfa\xac\x24",
7559                 .klen   = 36,
7560                 .iv     = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
7561                 .input  = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
7562                           "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
7563                           "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
7564                           "\x55\x30\x83\x1d\x93\x44\xaf\x1c",
7565                 .ilen   = 32,
7566                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
7567                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
7568                           "\x10\x11\x12\x13\x14\x15\x16\x17"
7569                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
7570                 .rlen   = 32,
7571         },
7572 };
7573
7574 static struct cipher_testvec aes_ofb_enc_tv_template[] = {
7575          /* From NIST Special Publication 800-38A, Appendix F.5 */
7576         {
7577                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
7578                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
7579                 .klen   = 16,
7580                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
7581                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
7582                 .input = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
7583                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
7584                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
7585                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
7586                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
7587                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
7588                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
7589                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
7590                 .ilen   = 64,
7591                 .result = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
7592                           "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
7593                           "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
7594                           "\x3c\x52\xda\xc5\x4e\xd8\x25"
7595                           "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
7596                           "\x44\xf7\xa8\x22\x60\xed\xcc"
7597                           "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
7598                           "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
7599                 .rlen   = 64,
7600         }
7601 };
7602
7603 static struct cipher_testvec aes_ofb_dec_tv_template[] = {
7604          /* From NIST Special Publication 800-38A, Appendix F.5 */
7605         {
7606                 .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
7607                           "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
7608                 .klen   = 16,
7609                 .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
7610                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
7611                 .input = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
7612                           "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
7613                           "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
7614                           "\x3c\x52\xda\xc5\x4e\xd8\x25"
7615                           "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
7616                           "\x44\xf7\xa8\x22\x60\xed\xcc"
7617                           "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
7618                           "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
7619                 .ilen   = 64,
7620                 .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
7621                           "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
7622                           "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
7623                           "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
7624                           "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
7625                           "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
7626                           "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
7627                           "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
7628                 .rlen   = 64,
7629         }
7630 };
7631
7632 static struct aead_testvec aes_gcm_enc_tv_template[] = {
7633         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
7634                 .key    = zeroed_string,
7635                 .klen   = 16,
7636                 .result = "\x58\xe2\xfc\xce\xfa\x7e\x30\x61"
7637                           "\x36\x7f\x1d\x57\xa4\xe7\x45\x5a",
7638                 .rlen   = 16,
7639         }, {
7640                 .key    = zeroed_string,
7641                 .klen   = 16,
7642                 .input  = zeroed_string,
7643                 .ilen   = 16,
7644                 .result = "\x03\x88\xda\xce\x60\xb6\xa3\x92"
7645                           "\xf3\x28\xc2\xb9\x71\xb2\xfe\x78"
7646                           "\xab\x6e\x47\xd4\x2c\xec\x13\xbd"
7647                           "\xf5\x3a\x67\xb2\x12\x57\xbd\xdf",
7648                 .rlen   = 32,
7649         }, {
7650                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7651                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7652                 .klen   = 16,
7653                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7654                           "\xde\xca\xf8\x88",
7655                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7656                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7657                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7658                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7659                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7660                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7661                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7662                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
7663                 .ilen   = 64,
7664                 .result = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
7665                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
7666                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
7667                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
7668                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
7669                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
7670                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
7671                           "\x3d\x58\xe0\x91\x47\x3f\x59\x85"
7672                           "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6"
7673                           "\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4",
7674                 .rlen   = 80,
7675         }, {
7676                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7677                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7678                 .klen   = 16,
7679                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7680                           "\xde\xca\xf8\x88",
7681                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7682                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7683                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7684                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7685                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7686                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7687                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7688                           "\xba\x63\x7b\x39",
7689                 .ilen   = 60,
7690                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7691                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7692                           "\xab\xad\xda\xd2",
7693                 .alen   = 20,
7694                 .result = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
7695                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
7696                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
7697                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
7698                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
7699                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
7700                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
7701                           "\x3d\x58\xe0\x91"
7702                           "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb"
7703                           "\x94\xfa\xe9\x5a\xe7\x12\x1a\x47",
7704                 .rlen   = 76,
7705         }, {
7706                 .key    = zeroed_string,
7707                 .klen   = 24,
7708                 .result = "\xcd\x33\xb2\x8a\xc7\x73\xf7\x4b"
7709                           "\xa0\x0e\xd1\xf3\x12\x57\x24\x35",
7710                 .rlen   = 16,
7711         }, {
7712                 .key    = zeroed_string,
7713                 .klen   = 24,
7714                 .input  = zeroed_string,
7715                 .ilen   = 16,
7716                 .result = "\x98\xe7\x24\x7c\x07\xf0\xfe\x41"
7717                           "\x1c\x26\x7e\x43\x84\xb0\xf6\x00"
7718                           "\x2f\xf5\x8d\x80\x03\x39\x27\xab"
7719                           "\x8e\xf4\xd4\x58\x75\x14\xf0\xfb",
7720                 .rlen   = 32,
7721         }, {
7722                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7723                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7724                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
7725                 .klen   = 24,
7726                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7727                           "\xde\xca\xf8\x88",
7728                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7729                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7730                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7731                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7732                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7733                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7734                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7735                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
7736                 .ilen   = 64,
7737                 .result = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
7738                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
7739                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
7740                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
7741                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
7742                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
7743                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
7744                           "\xcc\xda\x27\x10\xac\xad\xe2\x56"
7745                           "\x99\x24\xa7\xc8\x58\x73\x36\xbf"
7746                           "\xb1\x18\x02\x4d\xb8\x67\x4a\x14",
7747                 .rlen   = 80,
7748         }, {
7749                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7750                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7751                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
7752                 .klen   = 24,
7753                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7754                           "\xde\xca\xf8\x88",
7755                 .input  = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7756                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7757                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7758                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7759                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7760                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7761                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7762                           "\xba\x63\x7b\x39",
7763                 .ilen   = 60,
7764                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7765                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7766                           "\xab\xad\xda\xd2",
7767                 .alen   = 20,
7768                 .result = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
7769                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
7770                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
7771                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
7772                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
7773                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
7774                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
7775                           "\xcc\xda\x27\x10"
7776                           "\x25\x19\x49\x8e\x80\xf1\x47\x8f"
7777                           "\x37\xba\x55\xbd\x6d\x27\x61\x8c",
7778                 .rlen   = 76,
7779                 .np     = 2,
7780                 .tap    = { 32, 28 },
7781                 .anp    = 2,
7782                 .atap   = { 8, 12 }
7783         }, {
7784                 .key    = zeroed_string,
7785                 .klen   = 32,
7786                 .result = "\x53\x0f\x8a\xfb\xc7\x45\x36\xb9"
7787                           "\xa9\x63\xb4\xf1\xc4\xcb\x73\x8b",
7788                 .rlen   = 16,
7789         }
7790 };
7791
7792 static struct aead_testvec aes_gcm_dec_tv_template[] = {
7793         { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
7794                 .key    = zeroed_string,
7795                 .klen   = 32,
7796                 .input  = "\xce\xa7\x40\x3d\x4d\x60\x6b\x6e"
7797                           "\x07\x4e\xc5\xd3\xba\xf3\x9d\x18"
7798                           "\xd0\xd1\xc8\xa7\x99\x99\x6b\xf0"
7799                           "\x26\x5b\x98\xb5\xd4\x8a\xb9\x19",
7800                 .ilen   = 32,
7801                 .result  = zeroed_string,
7802                 .rlen   = 16,
7803         }, {
7804                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7805                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7806                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7807                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7808                 .klen   = 32,
7809                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7810                           "\xde\xca\xf8\x88",
7811                 .input  = "\x52\x2d\xc1\xf0\x99\x56\x7d\x07"
7812                           "\xf4\x7f\x37\xa3\x2a\x84\x42\x7d"
7813                           "\x64\x3a\x8c\xdc\xbf\xe5\xc0\xc9"
7814                           "\x75\x98\xa2\xbd\x25\x55\xd1\xaa"
7815                           "\x8c\xb0\x8e\x48\x59\x0d\xbb\x3d"
7816                           "\xa7\xb0\x8b\x10\x56\x82\x88\x38"
7817                           "\xc5\xf6\x1e\x63\x93\xba\x7a\x0a"
7818                           "\xbc\xc9\xf6\x62\x89\x80\x15\xad"
7819                           "\xb0\x94\xda\xc5\xd9\x34\x71\xbd"
7820                           "\xec\x1a\x50\x22\x70\xe3\xcc\x6c",
7821                 .ilen   = 80,
7822                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7823                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7824                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7825                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7826                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7827                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7828                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7829                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
7830                 .rlen   = 64,
7831         }, {
7832                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7833                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7834                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7835                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7836                 .klen   = 32,
7837                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7838                           "\xde\xca\xf8\x88",
7839                 .input  = "\x52\x2d\xc1\xf0\x99\x56\x7d\x07"
7840                           "\xf4\x7f\x37\xa3\x2a\x84\x42\x7d"
7841                           "\x64\x3a\x8c\xdc\xbf\xe5\xc0\xc9"
7842                           "\x75\x98\xa2\xbd\x25\x55\xd1\xaa"
7843                           "\x8c\xb0\x8e\x48\x59\x0d\xbb\x3d"
7844                           "\xa7\xb0\x8b\x10\x56\x82\x88\x38"
7845                           "\xc5\xf6\x1e\x63\x93\xba\x7a\x0a"
7846                           "\xbc\xc9\xf6\x62"
7847                           "\x76\xfc\x6e\xce\x0f\x4e\x17\x68"
7848                           "\xcd\xdf\x88\x53\xbb\x2d\x55\x1b",
7849                 .ilen   = 76,
7850                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7851                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7852                           "\xab\xad\xda\xd2",
7853                 .alen   = 20,
7854                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7855                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7856                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7857                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7858                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7859                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7860                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7861                           "\xba\x63\x7b\x39",
7862                 .rlen   = 60,
7863                 .np     = 2,
7864                 .tap    = { 48, 28 },
7865                 .anp    = 3,
7866                 .atap   = { 8, 8, 4 }
7867         }, {
7868                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7869                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7870                 .klen   = 16,
7871                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7872                           "\xde\xca\xf8\x88",
7873                 .input  = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
7874                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
7875                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
7876                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
7877                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
7878                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
7879                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
7880                           "\x3d\x58\xe0\x91\x47\x3f\x59\x85"
7881                           "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6"
7882                           "\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4",
7883                 .ilen   = 80,
7884                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7885                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7886                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7887                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7888                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7889                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7890                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7891                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
7892                 .rlen   = 64,
7893         }, {
7894                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7895                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
7896                 .klen   = 16,
7897                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7898                           "\xde\xca\xf8\x88",
7899                 .input  = "\x42\x83\x1e\xc2\x21\x77\x74\x24"
7900                           "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
7901                           "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
7902                           "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
7903                           "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
7904                           "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
7905                           "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
7906                           "\x3d\x58\xe0\x91"
7907                           "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb"
7908                           "\x94\xfa\xe9\x5a\xe7\x12\x1a\x47",
7909                 .ilen   = 76,
7910                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7911                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7912                           "\xab\xad\xda\xd2",
7913                 .alen   = 20,
7914                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7915                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7916                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7917                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7918                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7919                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7920                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7921                           "\xba\x63\x7b\x39",
7922                 .rlen   = 60,
7923         }, {
7924                 .key    = zeroed_string,
7925                 .klen   = 24,
7926                 .input  = "\x98\xe7\x24\x7c\x07\xf0\xfe\x41"
7927                           "\x1c\x26\x7e\x43\x84\xb0\xf6\x00"
7928                           "\x2f\xf5\x8d\x80\x03\x39\x27\xab"
7929                           "\x8e\xf4\xd4\x58\x75\x14\xf0\xfb",
7930                 .ilen   = 32,
7931                 .result  = zeroed_string,
7932                 .rlen   = 16,
7933         }, {
7934                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7935                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7936                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
7937                 .klen   = 24,
7938                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7939                           "\xde\xca\xf8\x88",
7940                 .input  = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
7941                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
7942                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
7943                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
7944                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
7945                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
7946                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
7947                           "\xcc\xda\x27\x10\xac\xad\xe2\x56"
7948                           "\x99\x24\xa7\xc8\x58\x73\x36\xbf"
7949                           "\xb1\x18\x02\x4d\xb8\x67\x4a\x14",
7950                 .ilen   = 80,
7951                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7952                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7953                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7954                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7955                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7956                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7957                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7958                           "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
7959                 .rlen   = 64,
7960         }, {
7961                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
7962                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
7963                           "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
7964                 .klen   = 24,
7965                 .iv     = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
7966                           "\xde\xca\xf8\x88",
7967                 .input  = "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
7968                           "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
7969                           "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
7970                           "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
7971                           "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
7972                           "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
7973                           "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
7974                           "\xcc\xda\x27\x10"
7975                           "\x25\x19\x49\x8e\x80\xf1\x47\x8f"
7976                           "\x37\xba\x55\xbd\x6d\x27\x61\x8c",
7977                 .ilen   = 76,
7978                 .assoc  = "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7979                           "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
7980                           "\xab\xad\xda\xd2",
7981                 .alen   = 20,
7982                 .result = "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
7983                           "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
7984                           "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
7985                           "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
7986                           "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
7987                           "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
7988                           "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
7989                           "\xba\x63\x7b\x39",
7990                 .rlen   = 60,
7991         }
7992 };
7993
7994 static struct aead_testvec aes_gcm_rfc4106_enc_tv_template[] = {
7995         { /* Generated using Crypto++ */
7996                 .key    = zeroed_string,
7997                 .klen   = 20,
7998                 .iv     = zeroed_string,
7999                 .input  = zeroed_string,
8000                 .ilen   = 16,
8001                 .assoc  = zeroed_string,
8002                 .alen   = 8,
8003                 .result = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
8004                           "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
8005                           "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
8006                           "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
8007                 .rlen   = 32,
8008         },{
8009                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8010                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8011                           "\x00\x00\x00\x00",
8012                 .klen   = 20,
8013                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8014                           "\x00\x00\x00\x00",
8015                 .input  = zeroed_string,
8016                 .ilen   = 16,
8017                 .assoc  = zeroed_string,
8018                 .alen   = 8,
8019                 .result = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
8020                           "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
8021                           "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
8022                           "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
8023                 .rlen   = 32,
8024
8025         }, {
8026                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8027                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8028                           "\x00\x00\x00\x00",
8029                 .klen   = 20,
8030                 .iv     = zeroed_string,
8031                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
8032                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8033                 .ilen   = 16,
8034                 .assoc  = zeroed_string,
8035                 .alen   = 8,
8036                 .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
8037                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
8038                           "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
8039                           "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
8040                 .rlen   = 32,
8041         }, {
8042                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8043                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8044                           "\x00\x00\x00\x00",
8045                 .klen   = 20,
8046                 .iv     = zeroed_string,
8047                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
8048                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8049                 .ilen   = 16,
8050                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8051                 .alen   = 8,
8052                 .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
8053                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
8054                           "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
8055                           "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
8056                 .rlen   = 32,
8057         }, {
8058                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8059                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8060                           "\x00\x00\x00\x00",
8061                 .klen   = 20,
8062                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8063                           "\x00\x00\x00\x00",
8064                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
8065                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8066                 .ilen   = 16,
8067                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8068                 .alen   = 8,
8069                 .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
8070                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
8071                           "\x64\x50\xF9\x32\x13\xFB\x74\x61"
8072                           "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
8073                 .rlen   = 32,
8074         }, {
8075                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8076                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8077                           "\x00\x00\x00\x00",
8078                 .klen   = 20,
8079                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8080                           "\x00\x00\x00\x00",
8081                 .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
8082                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8083                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8084                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8085                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8086                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8087                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8088                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8089                 .ilen   = 64,
8090                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8091                 .alen   = 8,
8092                 .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
8093                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
8094                           "\x98\x14\xA1\x42\x37\x80\xFD\x90"
8095                           "\x68\x12\x01\xA8\x91\x89\xB9\x83"
8096                           "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
8097                           "\x94\x5F\x18\x12\xBA\x27\x09\x39"
8098                           "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
8099                           "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
8100                           "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
8101                           "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
8102                 .rlen   = 80,
8103         }, {
8104                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8105                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8106                           "\x00\x00\x00\x00",
8107                 .klen   = 20,
8108                 .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
8109                           "\x00\x00\x00\x00",
8110                 .input  = "\xff\xff\xff\xff\xff\xff\xff\xff"
8111                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8112                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8113                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8114                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8115                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8116                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8117                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8118                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8119                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8120                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8121                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8122                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8123                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8124                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8125                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8126                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8127                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8128                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8129                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8130                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8131                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8132                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8133                           "\xff\xff\xff\xff\xff\xff\xff\xff",
8134                 .ilen   = 192,
8135                 .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
8136                           "\xaa\xaa\xaa\xaa",
8137                 .alen   = 12,
8138                 .result = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
8139                           "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
8140                           "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
8141                           "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
8142                           "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
8143                           "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
8144                           "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
8145                           "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
8146                           "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
8147                           "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
8148                           "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
8149                           "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
8150                           "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
8151                           "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
8152                           "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
8153                           "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
8154                           "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
8155                           "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
8156                           "\x7E\x13\x06\x82\x08\x17\xA4\x35"
8157                           "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
8158                           "\xA3\x05\x38\x95\x20\x1A\x47\x04"
8159                           "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
8160                           "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
8161                           "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
8162                           "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
8163                           "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
8164                 .rlen   = 208,
8165         }
8166 };
8167
8168 static struct aead_testvec aes_gcm_rfc4106_dec_tv_template[] = {
8169         { /* Generated using Crypto++ */
8170                 .key    = zeroed_string,
8171                 .klen   = 20,
8172                 .iv     = zeroed_string,
8173                 .input  = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
8174                           "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
8175                           "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
8176                           "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
8177                 .ilen   = 32,
8178                 .assoc  = zeroed_string,
8179                 .alen   = 8,
8180                 .result = zeroed_string,
8181                 .rlen   = 16,
8182
8183         },{
8184                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8185                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8186                           "\x00\x00\x00\x00",
8187                 .klen   = 20,
8188                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8189                           "\x00\x00\x00\x00",
8190                 .input  = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
8191                           "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
8192                           "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
8193                           "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
8194                 .ilen   = 32,
8195                 .assoc  = zeroed_string,
8196                 .alen   = 8,
8197                 .result = zeroed_string,
8198                 .rlen   = 16,
8199         }, {
8200                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8201                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8202                           "\x00\x00\x00\x00",
8203                 .klen   = 20,
8204                 .iv     = zeroed_string,
8205                 .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
8206                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
8207                           "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
8208                           "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
8209                 .ilen   = 32,
8210                 .assoc  = zeroed_string,
8211                 .alen   = 8,
8212                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
8213                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8214                 .rlen   = 16,
8215         }, {
8216                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8217                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8218                           "\x00\x00\x00\x00",
8219                 .klen   = 20,
8220                 .iv     = zeroed_string,
8221                 .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
8222                           "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
8223                           "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
8224                           "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
8225                 .ilen   = 32,
8226                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8227                 .alen   = 8,
8228                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
8229                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8230                 .rlen   = 16,
8231
8232         }, {
8233                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8234                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8235                           "\x00\x00\x00\x00",
8236                 .klen   = 20,
8237                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8238                           "\x00\x00\x00\x00",
8239                 .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
8240                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
8241                           "\x64\x50\xF9\x32\x13\xFB\x74\x61"
8242                           "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
8243                 .ilen   = 32,
8244                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8245                 .alen   = 8,
8246                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
8247                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8248                 .rlen   = 16,
8249         }, {
8250                 .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
8251                           "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
8252                           "\x00\x00\x00\x00",
8253                 .klen   = 20,
8254                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
8255                           "\x00\x00\x00\x00",
8256                 .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
8257                           "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
8258                           "\x98\x14\xA1\x42\x37\x80\xFD\x90"
8259                           "\x68\x12\x01\xA8\x91\x89\xB9\x83"
8260                           "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
8261                           "\x94\x5F\x18\x12\xBA\x27\x09\x39"
8262                           "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
8263                           "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
8264                           "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
8265                           "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
8266                 .ilen   = 80,
8267                 .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
8268                 .alen   = 8,
8269                 .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
8270                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8271                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8272                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8273                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8274                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8275                           "\x01\x01\x01\x01\x01\x01\x01\x01"
8276                           "\x01\x01\x01\x01\x01\x01\x01\x01",
8277                 .rlen   = 64,
8278         }, {
8279                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
8280                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8281                           "\x00\x00\x00\x00",
8282                 .klen   = 20,
8283                 .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
8284                           "\x00\x00\x00\x00",
8285                 .input  = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
8286                           "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
8287                           "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
8288                           "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
8289                           "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
8290                           "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
8291                           "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
8292                           "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
8293                           "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
8294                           "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
8295                           "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
8296                           "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
8297                           "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
8298                           "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
8299                           "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
8300                           "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
8301                           "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
8302                           "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
8303                           "\x7E\x13\x06\x82\x08\x17\xA4\x35"
8304                           "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
8305                           "\xA3\x05\x38\x95\x20\x1A\x47\x04"
8306                           "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
8307                           "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
8308                           "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
8309                           "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
8310                           "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
8311                 .ilen   = 208,
8312                 .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
8313                           "\xaa\xaa\xaa\xaa",
8314                 .alen   = 12,
8315                 .result = "\xff\xff\xff\xff\xff\xff\xff\xff"
8316                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8317                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8318                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8319                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8320                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8321                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8322                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8323                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8324                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8325                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8326                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8327                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8328                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8329                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8330                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8331                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8332                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8333                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8334                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8335                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8336                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8337                           "\xff\xff\xff\xff\xff\xff\xff\xff"
8338                           "\xff\xff\xff\xff\xff\xff\xff\xff",
8339                 .rlen   = 192,
8340
8341         }
8342 };
8343
8344 static struct aead_testvec aes_ccm_enc_tv_template[] = {
8345         { /* From RFC 3610 */
8346                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8347                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8348                 .klen   = 16,
8349                 .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
8350                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8351                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
8352                 .alen   = 8,
8353                 .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8354                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8355                           "\x18\x19\x1a\x1b\x1c\x1d\x1e",
8356                 .ilen   = 23,
8357                 .result = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
8358                           "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
8359                           "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
8360                           "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
8361                 .rlen   = 31,
8362         }, {
8363                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8364                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8365                 .klen   = 16,
8366                 .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
8367                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8368                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8369                           "\x08\x09\x0a\x0b",
8370                 .alen   = 12,
8371                 .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
8372                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
8373                           "\x1c\x1d\x1e\x1f",
8374                 .ilen   = 20,
8375                 .result = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
8376                           "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
8377                           "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
8378                           "\x7d\x9c\x2d\x93",
8379                 .rlen   = 28,
8380         }, {
8381                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8382                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8383                 .klen   = 16,
8384                 .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
8385                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8386                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
8387                 .alen   = 8,
8388                 .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8389                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8390                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8391                           "\x20",
8392                 .ilen   = 25,
8393                 .result = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
8394                           "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
8395                           "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
8396                           "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
8397                           "\x7e\x5f\x4e",
8398                 .rlen   = 35,
8399         }, {
8400                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8401                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8402                 .klen   = 16,
8403                 .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
8404                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8405                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8406                           "\x08\x09\x0a\x0b",
8407                 .alen   = 12,
8408                 .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
8409                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
8410                           "\x1c\x1d\x1e",
8411                 .ilen   = 19,
8412                 .result = "\x07\x34\x25\x94\x15\x77\x85\x15"
8413                           "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
8414                           "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
8415                           "\x4d\x99\x99\x88\xdd",
8416                 .rlen   = 29,
8417         }, {
8418                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8419                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8420                 .klen   = 16,
8421                 .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
8422                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8423                 .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
8424                 .alen   = 8,
8425                 .input  = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
8426                           "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
8427                           "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
8428                 .ilen   = 24,
8429                 .result = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
8430                           "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
8431                           "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
8432                           "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
8433                 .rlen   = 32,
8434         }, {
8435                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8436                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8437                 .klen   = 16,
8438                 .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
8439                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8440                 .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
8441                           "\x20\xea\x60\xc0",
8442                 .alen   = 12,
8443                 .input  = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
8444                           "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
8445                           "\x3a\x80\x3b\xa8\x7f",
8446                 .ilen   = 21,
8447                 .result = "\x00\x97\x69\xec\xab\xdf\x48\x62"
8448                           "\x55\x94\xc5\x92\x51\xe6\x03\x57"
8449                           "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
8450                           "\x5a\xe0\x70\x45\x51",
8451                 .rlen   = 29,
8452         }, {
8453                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8454                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8455                 .klen   = 16,
8456                 .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
8457                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8458                 .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
8459                 .alen   = 8,
8460                 .input  = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
8461                           "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
8462                           "\x98\x09\xd6\x7d\xbe\xdd\x18",
8463                 .ilen   = 23,
8464                 .result = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
8465                           "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
8466                           "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
8467                           "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
8468                           "\xba",
8469                 .rlen   = 33,
8470         },
8471 };
8472
8473 static struct aead_testvec aes_ccm_dec_tv_template[] = {
8474         { /* From RFC 3610 */
8475                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8476                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8477                 .klen   = 16,
8478                 .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
8479                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8480                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
8481                 .alen   = 8,
8482                 .input  = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
8483                           "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
8484                           "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
8485                           "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
8486                 .ilen   = 31,
8487                 .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8488                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8489                           "\x18\x19\x1a\x1b\x1c\x1d\x1e",
8490                 .rlen   = 23,
8491         }, {
8492                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8493                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8494                 .klen   = 16,
8495                 .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
8496                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8497                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8498                           "\x08\x09\x0a\x0b",
8499                 .alen   = 12,
8500                 .input  = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
8501                           "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
8502                           "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
8503                           "\x7d\x9c\x2d\x93",
8504                 .ilen   = 28,
8505                 .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
8506                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
8507                           "\x1c\x1d\x1e\x1f",
8508                 .rlen   = 20,
8509         }, {
8510                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8511                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8512                 .klen   = 16,
8513                 .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
8514                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8515                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
8516                 .alen   = 8,
8517                 .input  = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
8518                           "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
8519                           "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
8520                           "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
8521                           "\x7e\x5f\x4e",
8522                 .ilen   = 35,
8523                 .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
8524                           "\x10\x11\x12\x13\x14\x15\x16\x17"
8525                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
8526                           "\x20",
8527                 .rlen   = 25,
8528         }, {
8529                 .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
8530                           "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
8531                 .klen   = 16,
8532                 .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
8533                           "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
8534                 .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
8535                           "\x08\x09\x0a\x0b",
8536                 .alen   = 12,
8537                 .input  = "\x07\x34\x25\x94\x15\x77\x85\x15"
8538                           "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
8539                           "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
8540                           "\x4d\x99\x99\x88\xdd",
8541                 .ilen   = 29,
8542                 .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
8543                           "\x14\x15\x16\x17\x18\x19\x1a\x1b"
8544                           "\x1c\x1d\x1e",
8545                 .rlen   = 19,
8546         }, {
8547                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8548                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8549                 .klen   = 16,
8550                 .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
8551                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8552                 .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
8553                 .alen   = 8,
8554                 .input  = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
8555                           "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
8556                           "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
8557                           "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
8558                 .ilen   = 32,
8559                 .result = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
8560                           "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
8561                           "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
8562                 .rlen   = 24,
8563         }, {
8564                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8565                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8566                 .klen   = 16,
8567                 .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
8568                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8569                 .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
8570                           "\x20\xea\x60\xc0",
8571                 .alen   = 12,
8572                 .input  = "\x00\x97\x69\xec\xab\xdf\x48\x62"
8573                           "\x55\x94\xc5\x92\x51\xe6\x03\x57"
8574                           "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
8575                           "\x5a\xe0\x70\x45\x51",
8576                 .ilen   = 29,
8577                 .result = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
8578                           "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
8579                           "\x3a\x80\x3b\xa8\x7f",
8580                 .rlen   = 21,
8581         }, {
8582                 .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
8583                           "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
8584                 .klen   = 16,
8585                 .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
8586                           "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
8587                 .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
8588                 .alen   = 8,
8589                 .input  = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
8590                           "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
8591                           "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
8592                           "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
8593                           "\xba",
8594                 .ilen   = 33,
8595                 .result = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
8596                           "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
8597                           "\x98\x09\xd6\x7d\xbe\xdd\x18",
8598                 .rlen   = 23,
8599         },
8600 };
8601
8602 /*
8603  * rfc4309 refers to section 8 of rfc3610 for test vectors, but they all
8604  * use a 13-byte nonce, we only support an 11-byte nonce. Similarly, all of
8605  * Special Publication 800-38C's test vectors also use nonce lengths our
8606  * implementation doesn't support. The following are taken from fips cavs
8607  * fax files on hand at Red Hat.
8608  *
8609  * nb: actual key lengths are (klen - 3), the last 3 bytes are actually
8610  * part of the nonce which combine w/the iv, but need to be input this way.
8611  */
8612 static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[] = {
8613         {
8614                 .key    = "\x83\xac\x54\x66\xc2\xeb\xe5\x05"
8615                           "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e"
8616                           "\x96\xac\x59",
8617                 .klen   = 19,
8618                 .iv     = "\x30\x07\xa1\xe2\xa2\xc7\x55\x24",
8619                 .alen   = 0,
8620                 .input  = "\x19\xc8\x81\xf6\xe9\x86\xff\x93"
8621                           "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e"
8622                           "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c"
8623                           "\x35\x2e\xad\xe0\x62\xf9\x91\xa1",
8624                 .ilen   = 32,
8625                 .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8"
8626                           "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1"
8627                           "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a"
8628                           "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32"
8629                           "\xda\x24\xea\xd9\xa1\x39\x98\xfd"
8630                           "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8",
8631                 .rlen   = 48,
8632         }, {
8633                 .key    = "\x1e\x2c\x7e\x01\x41\x9a\xef\xc0"
8634                           "\x0d\x58\x96\x6e\x5c\xa2\x4b\xd3"
8635                           "\x4f\xa3\x19",
8636                 .klen   = 19,
8637                 .iv     = "\xd3\x01\x5a\xd8\x30\x60\x15\x56",
8638                 .assoc  = "\xda\xe6\x28\x9c\x45\x2d\xfd\x63"
8639                           "\x5e\xda\x4c\xb6\xe6\xfc\xf9\xb7"
8640                           "\x0c\x56\xcb\xe4\xe0\x05\x7a\xe1"
8641                           "\x0a\x63\x09\x78\xbc\x2c\x55\xde",
8642                 .alen   = 32,
8643                 .input  = "\x87\xa3\x36\xfd\x96\xb3\x93\x78"
8644                           "\xa9\x28\x63\xba\x12\xa3\x14\x85"
8645                           "\x57\x1e\x06\xc9\x7b\x21\xef\x76"
8646                           "\x7f\x38\x7e\x8e\x29\xa4\x3e\x7e",
8647                 .ilen   = 32,
8648                 .result = "\x8a\x1e\x11\xf0\x02\x6b\xe2\x19"
8649                           "\xfc\x70\xc4\x6d\x8e\xb7\x99\xab"
8650                           "\xc5\x4b\xa2\xac\xd3\xf3\x48\xff"
8651                           "\x3b\xb5\xce\x53\xef\xde\xbb\x02"
8652                           "\xa9\x86\x15\x6c\x13\xfe\xda\x0a"
8653                           "\x22\xb8\x29\x3d\xd8\x39\x9a\x23",
8654                 .rlen   = 48,
8655         }, {
8656                 .key    = "\xf4\x6b\xc2\x75\x62\xfe\xb4\xe1"
8657                           "\xa3\xf0\xff\xdd\x4e\x4b\x12\x75"
8658                           "\x53\x14\x73\x66\x8d\x88\xf6\x80"
8659                           "\xa0\x20\x35",
8660                 .klen   = 27,
8661                 .iv     = "\x26\xf2\x21\x8d\x50\x20\xda\xe2",
8662                 .assoc  = "\x5b\x9e\x13\x67\x02\x5e\xef\xc1"
8663                           "\x6c\xf9\xd7\x1e\x52\x8f\x7a\x47"
8664                           "\xe9\xd4\xcf\x20\x14\x6e\xf0\x2d"
8665                           "\xd8\x9e\x2b\x56\x10\x23\x56\xe7",
8666                 .alen   = 32,
8667                 .ilen   = 0,
8668                 .result = "\x36\xea\x7a\x70\x08\xdc\x6a\xbc"
8669                           "\xad\x0c\x7a\x63\xf6\x61\xfd\x9b",
8670                 .rlen   = 16,
8671         }, {
8672                 .key    = "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42"
8673                           "\xef\x7a\xd3\xce\xfc\x84\x60\x62"
8674                           "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01"
8675                           "\xd6\x3c\x8c",
8676                 .klen   = 27,
8677                 .iv     = "\x86\x84\xb6\xcd\xef\x09\x2e\x94",
8678                 .assoc  = "\x02\x65\x78\x3c\xe9\x21\x30\x91"
8679                           "\xb1\xb9\xda\x76\x9a\x78\x6d\x95"
8680                           "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c"
8681                           "\xe3\x00\x73\x69\x84\x69\x87\x79",
8682                 .alen   = 32,
8683                 .input  = "\x9f\xd2\x02\x4b\x52\x49\x31\x3c"
8684                           "\x43\x69\x3a\x2d\x8e\x70\xad\x7e"
8685                           "\xe0\xe5\x46\x09\x80\x89\x13\xb2"
8686                           "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b",
8687                 .ilen   = 32,
8688                 .result = "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62"
8689                           "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f"
8690                           "\x9b\x6a\x09\x70\xc1\x51\x83\xc2"
8691                           "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e"
8692                           "\xc7\x79\x11\x58\xe5\x6b\x20\x40"
8693                           "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1",
8694                 .rlen   = 48,
8695         }, {
8696                 .key    = "\xe0\x8d\x99\x71\x60\xd7\x97\x1a"
8697                           "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a"
8698                           "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e"
8699                           "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b"
8700                           "\x1e\x29\x91",
8701                 .klen   = 35,
8702                 .iv     = "\xad\x8e\xc1\x53\x0a\xcf\x2d\xbe",
8703                 .assoc  = "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b"
8704                           "\x78\x2b\x94\x02\x29\x0f\x42\x27"
8705                           "\x6b\x75\xcb\x98\x34\x08\x7e\x79"
8706                           "\xe4\x3e\x49\x0d\x84\x8b\x22\x87",
8707                 .alen   = 32,
8708                 .input  = "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f"
8709                           "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66"
8710                           "\xbf\x17\x99\x62\x4a\x39\x27\x1f"
8711                           "\x1d\xdc\x24\xae\x19\x2f\x98\x4c",
8712                 .ilen   = 32,
8713                 .result = "\x19\xb8\x61\x33\x45\x2b\x43\x96"
8714                           "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6"
8715                           "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f"
8716                           "\xf0\x62\x17\x34\xf2\x1e\x8d\x75"
8717                           "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d",
8718                 .rlen   = 40,
8719         }, {
8720                 .key    = "\x7c\xc8\x18\x3b\x8d\x99\xe0\x7c"
8721                           "\x45\x41\xb8\xbd\x5c\xa7\xc2\x32"
8722                           "\x8a\xb8\x02\x59\xa4\xfe\xa9\x2c"
8723                           "\x09\x75\x9a\x9b\x3c\x9b\x27\x39"
8724                           "\xf9\xd9\x4e",
8725                 .klen   = 35,
8726                 .iv     = "\x63\xb5\x3d\x9d\x43\xf6\x1e\x50",
8727                 .assoc  = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b"
8728                           "\x13\x02\x01\x0c\x83\x4c\x96\x35"
8729                           "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94"
8730                           "\xb0\x39\x36\xe6\x8f\x57\xe0\x13",
8731                 .alen   = 32,
8732                 .input  = "\x3b\x6c\x29\x36\xb6\xef\x07\xa6"
8733                           "\x83\x72\x07\x4f\xcf\xfa\x66\x89"
8734                           "\x5f\xca\xb1\xba\xd5\x8f\x2c\x27"
8735                           "\x30\xdb\x75\x09\x93\xd4\x65\xe4",
8736                 .ilen   = 32,
8737                 .result = "\xb0\x88\x5a\x33\xaa\xe5\xc7\x1d"
8738                           "\x85\x23\xc7\xc6\x2f\xf4\x1e\x3d"
8739                           "\xcc\x63\x44\x25\x07\x78\x4f\x9e"
8740                           "\x96\xb8\x88\xeb\xbc\x48\x1f\x06"
8741                           "\x39\xaf\x39\xac\xd8\x4a\x80\x39"
8742                           "\x7b\x72\x8a\xf7",
8743                 .rlen   = 44,
8744         }, {
8745                 .key    = "\xab\xd0\xe9\x33\x07\x26\xe5\x83"
8746                           "\x8c\x76\x95\xd4\xb6\xdc\xf3\x46"
8747                           "\xf9\x8f\xad\xe3\x02\x13\x83\x77"
8748                           "\x3f\xb0\xf1\xa1\xa1\x22\x0f\x2b"
8749                           "\x24\xa7\x8b",
8750                 .klen   = 35,
8751                 .iv     = "\x07\xcb\xcc\x0e\xe6\x33\xbf\xf5",
8752                 .assoc  = "\xd4\xdb\x30\x1d\x03\xfe\xfd\x5f"
8753                           "\x87\xd4\x8c\xb6\xb6\xf1\x7a\x5d"
8754                           "\xab\x90\x65\x8d\x8e\xca\x4d\x4f"
8755                           "\x16\x0c\x40\x90\x4b\xc7\x36\x73",
8756                 .alen   = 32,
8757                 .input  = "\xf5\xc6\x7d\x48\xc1\xb7\xe6\x92"
8758                           "\x97\x5a\xca\xc4\xa9\x6d\xf9\x3d"
8759                           "\x6c\xde\xbc\xf1\x90\xea\x6a\xb2"
8760                           "\x35\x86\x36\xaf\x5c\xfe\x4b\x3a",
8761                 .ilen   = 32,
8762                 .result = "\x83\x6f\x40\x87\x72\xcf\xc1\x13"
8763                           "\xef\xbb\x80\x21\x04\x6c\x58\x09"
8764                           "\x07\x1b\xfc\xdf\xc0\x3f\x5b\xc7"
8765                           "\xe0\x79\xa8\x6e\x71\x7c\x3f\xcf"
8766                           "\x5c\xda\xb2\x33\xe5\x13\xe2\x0d"
8767                           "\x74\xd1\xef\xb5\x0f\x3a\xb5\xf8",
8768                 .rlen   = 48,
8769         },
8770 };
8771
8772 static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = {
8773         {
8774                 .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
8775                           "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
8776                           "\xc6\xfb\x7d",
8777                 .klen   = 19,
8778                 .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
8779                 .alen   = 0,
8780                 .input  = "\xd5\xe8\x93\x9f\xc7\x89\x2e\x2b",
8781                 .ilen   = 8,
8782                 .result = "\x00",
8783                 .rlen   = 0,
8784                 .novrfy = 1,
8785         }, {
8786                 .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
8787                           "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
8788                           "\xaf\x94\x87",
8789                 .klen   = 19,
8790                 .iv     = "\x78\x35\x82\x81\x7f\x88\x94\x68",
8791                 .alen   = 0,
8792                 .input  = "\x41\x3c\xb8\x87\x73\xcb\xf3\xf3",
8793                 .ilen   = 8,
8794                 .result = "\x00",
8795                 .rlen   = 0,
8796         }, {
8797                 .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
8798                           "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
8799                           "\xc6\xfb\x7d",
8800                 .klen   = 19,
8801                 .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
8802                 .assoc  = "\xf3\x94\x87\x78\x35\x82\x81\x7f"
8803                           "\x88\x94\x68\xb1\x78\x6b\x2b\xd6"
8804                           "\x04\x1f\x4e\xed\x78\xd5\x33\x66"
8805                           "\xd8\x94\x99\x91\x81\x54\x62\x57",
8806                 .alen   = 32,
8807                 .input  = "\xf0\x7c\x29\x02\xae\x1c\x2f\x55"
8808                           "\xd0\xd1\x3d\x1a\xa3\x6d\xe4\x0a"
8809                           "\x86\xb0\x87\x6b\x62\x33\x8c\x34"
8810                           "\xce\xab\x57\xcc\x79\x0b\xe0\x6f"
8811                           "\x5c\x3e\x48\x1f\x6c\x46\xf7\x51"
8812                           "\x8b\x84\x83\x2a\xc1\x05\xb8\xc5",
8813                 .ilen   = 48,
8814                 .result = "\x50\x82\x3e\x07\xe2\x1e\xb6\xfb"
8815                           "\x33\xe4\x73\xce\xd2\xfb\x95\x79"
8816                           "\xe8\xb4\xb5\x77\x11\x10\x62\x6f"
8817                           "\x6a\x82\xd1\x13\xec\xf5\xd0\x48",
8818                 .rlen   = 32,
8819                 .novrfy = 1,
8820         }, {
8821                 .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
8822                           "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
8823                           "\x05\xe0\xc9",
8824                 .klen   = 19,
8825                 .iv     = "\x0f\xed\x34\xea\x97\xd4\x3b\xdf",
8826                 .assoc  = "\x49\x5c\x50\x1f\x1d\x94\xcc\x81"
8827                           "\xba\xb7\xb6\x03\xaf\xa5\xc1\xa1"
8828                           "\xd8\x5c\x42\x68\xe0\x6c\xda\x89"
8829                           "\x05\xac\x56\xac\x1b\x2a\xd3\x86",
8830                 .alen   = 32,
8831                 .input  = "\x39\xbe\x7d\x15\x62\x77\xf3\x3c"
8832                           "\xad\x83\x52\x6d\x71\x03\x25\x1c"
8833                           "\xed\x81\x3a\x9a\x16\x7d\x19\x80"
8834                           "\x72\x04\x72\xd0\xf6\xff\x05\x0f"
8835                           "\xb7\x14\x30\x00\x32\x9e\xa0\xa6"
8836                           "\x9e\x5a\x18\xa1\xb8\xfe\xdb\xd3",
8837                 .ilen   = 48,
8838                 .result = "\x75\x05\xbe\xc2\xd9\x1e\xde\x60"
8839                           "\x47\x3d\x8c\x7d\xbd\xb5\xd9\xb7"
8840                           "\xf2\xae\x61\x05\x8f\x82\x24\x3f"
8841                           "\x9c\x67\x91\xe1\x38\x4f\xe4\x0c",
8842                 .rlen   = 32,
8843         }, {
8844                 .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
8845                           "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
8846                           "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
8847                           "\xee\x49\x83",
8848                 .klen   = 27,
8849                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
8850                 .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
8851                           "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
8852                           "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
8853                           "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
8854                 .alen   = 32,
8855                 .input  = "\x71\x99\xfa\xf4\x44\x12\x68\x9b",
8856                 .ilen   = 8,
8857                 .result = "\x00",
8858                 .rlen   = 0,
8859         }, {
8860                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
8861                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
8862                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
8863                           "\xee\x49\x83",
8864                 .klen   = 27,
8865                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
8866                 .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
8867                           "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
8868                           "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
8869                           "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
8870                 .alen   = 32,
8871                 .input  = "\xfb\xe5\x5d\x34\xbe\xe5\xe8\xe7"
8872                           "\x5a\xef\x2f\xbf\x1f\x7f\xd4\xb2"
8873                           "\x66\xca\x61\x1e\x96\x7a\x61\xb3"
8874                           "\x1c\x16\x45\x52\xba\x04\x9c\x9f"
8875                           "\xb1\xd2\x40\xbc\x52\x7c\x6f\xb1",
8876                 .ilen   = 40,
8877                 .result = "\x85\x34\x66\x42\xc8\x92\x0f\x36"
8878                           "\x58\xe0\x6b\x91\x3c\x98\x5c\xbb"
8879                           "\x0a\x85\xcc\x02\xad\x7a\x96\xe9"
8880                           "\x65\x43\xa4\xc3\x0f\xdc\x55\x81",
8881                 .rlen   = 32,
8882         }, {
8883                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
8884                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
8885                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
8886                           "\xd1\xfc\x57",
8887                 .klen   = 27,
8888                 .iv     = "\x9c\xfe\xb8\x9c\xad\x71\xaa\x1f",
8889                 .assoc  = "\x86\x67\xa5\xa9\x14\x5f\x0d\xc6"
8890                           "\xff\x14\xc7\x44\xbf\x6c\x3a\xc3"
8891                           "\xff\xb6\x81\xbd\xe2\xd5\x06\xc7"
8892                           "\x3c\xa1\x52\x13\x03\x8a\x23\x3a",
8893                 .alen   = 32,
8894                 .input  = "\x3f\x66\xb0\x9d\xe5\x4b\x38\x00"
8895                           "\xc6\x0e\x6e\xe5\xd6\x98\xa6\x37"
8896                           "\x8c\x26\x33\xc6\xb2\xa2\x17\xfa"
8897                           "\x64\x19\xc0\x30\xd7\xfc\x14\x6b"
8898                           "\xe3\x33\xc2\x04\xb0\x37\xbe\x3f"
8899                           "\xa9\xb4\x2d\x68\x03\xa3\x44\xef",
8900                 .ilen   = 48,
8901                 .result = "\x02\x87\x4d\x28\x80\x6e\xb2\xed"
8902                           "\x99\x2a\xa8\xca\x04\x25\x45\x90"
8903                           "\x1d\xdd\x5a\xd9\xe4\xdb\x9c\x9c"
8904                           "\x49\xe9\x01\xfe\xa7\x80\x6d\x6b",
8905                 .rlen   = 32,
8906                 .novrfy = 1,
8907         }, {
8908                 .key    = "\xa4\x4b\x54\x29\x0a\xb8\x6d\x01"
8909                           "\x5b\x80\x2a\xcf\x25\xc4\xb7\x5c"
8910                           "\x20\x2c\xad\x30\xc2\x2b\x41\xfb"
8911                           "\x0e\x85\xbc\x33\xad\x0f\x2b\xff"
8912                           "\xee\x49\x83",
8913                 .klen   = 35,
8914                 .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
8915                 .alen   = 0,
8916                 .input  = "\x1f\xb8\x8f\xa3\xdd\x54\x00\xf2",
8917                 .ilen   = 8,
8918                 .result = "\x00",
8919                 .rlen   = 0,
8920         }, {
8921                 .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
8922                           "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
8923                           "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
8924                           "\xae\x8f\x11\x4c\xc2\x9c\x4a\xbb"
8925                           "\x85\x34\x66",
8926                 .klen   = 35,
8927                 .iv     = "\x42\xc8\x92\x0f\x36\x58\xe0\x6b",
8928                 .alen   = 0,
8929                 .input  = "\x48\x01\x5e\x02\x24\x04\x66\x47"
8930                           "\xa1\xea\x6f\xaf\xe8\xfc\xfb\xdd"
8931                           "\xa5\xa9\x87\x8d\x84\xee\x2e\x77"
8932                           "\xbb\x86\xb9\xf5\x5c\x6c\xff\xf6"
8933                           "\x72\xc3\x8e\xf7\x70\xb1\xb2\x07"
8934                           "\xbc\xa8\xa3\xbd\x83\x7c\x1d\x2a",
8935                 .ilen   = 48,
8936                 .result = "\xdc\x56\xf2\x71\xb0\xb1\xa0\x6c"
8937                           "\xf0\x97\x3a\xfb\x6d\xe7\x32\x99"
8938                           "\x3e\xaf\x70\x5e\xb2\x4d\xea\x39"
8939                           "\x89\xd4\x75\x7a\x63\xb1\xda\x93",
8940                 .rlen   = 32,
8941                 .novrfy = 1,
8942         }, {
8943                 .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
8944                           "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
8945                           "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
8946                           "\x0d\x1a\x53\x3b\xb5\xe3\xf8\x8b"
8947                           "\xcf\x76\x3f",
8948                 .klen   = 35,
8949                 .iv     = "\xd9\x95\x75\x8f\x44\x89\x40\x7b",
8950                 .assoc  = "\x8f\x86\x6c\x4d\x1d\xc5\x39\x88"
8951                           "\xc8\xf3\x5c\x52\x10\x63\x6f\x2b"
8952                           "\x8a\x2a\xc5\x6f\x30\x23\x58\x7b"
8953                           "\xfb\x36\x03\x11\xb4\xd9\xf2\xfe",
8954                 .alen   = 32,
8955                 .input  = "\x48\x58\xd6\xf3\xad\x63\x58\xbf"
8956                           "\xae\xc7\x5e\xae\x83\x8f\x7b\xe4"
8957                           "\x78\x5c\x4c\x67\x71\x89\x94\xbf"
8958                           "\x47\xf1\x63\x7e\x1c\x59\xbd\xc5"
8959                           "\x7f\x44\x0a\x0c\x01\x18\x07\x92"
8960                           "\xe1\xd3\x51\xce\x32\x6d\x0c\x5b",
8961                 .ilen   = 48,
8962                 .result = "\xc2\x54\xc8\xde\x78\x87\x77\x40"
8963                           "\x49\x71\xe4\xb7\xe7\xcb\x76\x61"
8964                           "\x0a\x41\xb9\xe9\xc0\x76\x54\xab"
8965                           "\x04\x49\x3b\x19\x93\x57\x25\x5d",
8966                 .rlen   = 32,
8967         },
8968 };
8969
8970 /*
8971  * ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode)
8972  * test vectors, taken from Appendix B.2.9 and B.2.10:
8973  *     http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf
8974  * Only AES-128 is supported at this time.
8975  */
8976 #define ANSI_CPRNG_AES_TEST_VECTORS     6
8977
8978 static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
8979         {
8980                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
8981                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
8982                 .klen   = 16,
8983                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
8984                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xf9",
8985                 .dtlen  = 16,
8986                 .v      = "\x80\x00\x00\x00\x00\x00\x00\x00"
8987                           "\x00\x00\x00\x00\x00\x00\x00\x00",
8988                 .vlen   = 16,
8989                 .result = "\x59\x53\x1e\xd1\x3b\xb0\xc0\x55"
8990                           "\x84\x79\x66\x85\xc1\x2f\x76\x41",
8991                 .rlen   = 16,
8992                 .loops  = 1,
8993         }, {
8994                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
8995                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
8996                 .klen   = 16,
8997                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
8998                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfa",
8999                 .dtlen  = 16,
9000                 .v      = "\xc0\x00\x00\x00\x00\x00\x00\x00"
9001                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9002                 .vlen   = 16,
9003                 .result = "\x7c\x22\x2c\xf4\xca\x8f\xa2\x4c"
9004                           "\x1c\x9c\xb6\x41\xa9\xf3\x22\x0d",
9005                 .rlen   = 16,
9006                 .loops  = 1,
9007         }, {
9008                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
9009                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
9010                 .klen   = 16,
9011                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
9012                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfb",
9013                 .dtlen  = 16,
9014                 .v      = "\xe0\x00\x00\x00\x00\x00\x00\x00"
9015                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9016                 .vlen   = 16,
9017                 .result = "\x8a\xaa\x00\x39\x66\x67\x5b\xe5"
9018                           "\x29\x14\x28\x81\xa9\x4d\x4e\xc7",
9019                 .rlen   = 16,
9020                 .loops  = 1,
9021         }, {
9022                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
9023                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
9024                 .klen   = 16,
9025                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
9026                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfc",
9027                 .dtlen  = 16,
9028                 .v      = "\xf0\x00\x00\x00\x00\x00\x00\x00"
9029                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9030                 .vlen   = 16,
9031                 .result = "\x88\xdd\xa4\x56\x30\x24\x23\xe5"
9032                           "\xf6\x9d\xa5\x7e\x7b\x95\xc7\x3a",
9033                 .rlen   = 16,
9034                 .loops  = 1,
9035         }, {
9036                 .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
9037                           "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
9038                 .klen   = 16,
9039                 .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
9040                           "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfd",
9041                 .dtlen  = 16,
9042                 .v      = "\xf8\x00\x00\x00\x00\x00\x00\x00"
9043                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9044                 .vlen   = 16,
9045                 .result = "\x05\x25\x92\x46\x61\x79\xd2\xcb"
9046                           "\x78\xc4\x0b\x14\x0a\x5a\x9a\xc8",
9047                 .rlen   = 16,
9048                 .loops  = 1,
9049         }, {    /* Monte Carlo Test */
9050                 .key    = "\x9f\x5b\x51\x20\x0b\xf3\x34\xb5"
9051                           "\xd8\x2b\xe8\xc3\x72\x55\xc8\x48",
9052                 .klen   = 16,
9053                 .dt     = "\x63\x76\xbb\xe5\x29\x02\xba\x3b"
9054                           "\x67\xc9\x25\xfa\x70\x1f\x11\xac",
9055                 .dtlen  = 16,
9056                 .v      = "\x57\x2c\x8e\x76\x87\x26\x47\x97"
9057                           "\x7e\x74\xfb\xdd\xc4\x95\x01\xd1",
9058                 .vlen   = 16,
9059                 .result = "\x48\xe9\xbd\x0d\x06\xee\x18\xfb"
9060                           "\xe4\x57\x90\xd5\xc3\xfc\x9b\x73",
9061                 .rlen   = 16,
9062                 .loops  = 10000,
9063         },
9064 };
9065
9066 /* Cast5 test vectors from RFC 2144 */
9067 #define CAST5_ENC_TEST_VECTORS  3
9068 #define CAST5_DEC_TEST_VECTORS  3
9069
9070 static struct cipher_testvec cast5_enc_tv_template[] = {
9071         {
9072                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
9073                           "\x23\x45\x67\x89\x34\x56\x78\x9a",
9074                 .klen   = 16,
9075                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9076                 .ilen   = 8,
9077                 .result = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
9078                 .rlen   = 8,
9079         }, {
9080                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
9081                           "\x23\x45",
9082                 .klen   = 10,
9083                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9084                 .ilen   = 8,
9085                 .result = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
9086                 .rlen   = 8,
9087         }, {
9088                 .key    = "\x01\x23\x45\x67\x12",
9089                 .klen   = 5,
9090                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9091                 .ilen   = 8,
9092                 .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
9093                 .rlen   = 8,
9094         },
9095 };
9096
9097 static struct cipher_testvec cast5_dec_tv_template[] = {
9098         {
9099                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
9100                           "\x23\x45\x67\x89\x34\x56\x78\x9a",
9101                 .klen   = 16,
9102                 .input  = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
9103                 .ilen   = 8,
9104                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9105                 .rlen   = 8,
9106         }, {
9107                 .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
9108                           "\x23\x45",
9109                 .klen   = 10,
9110                 .input  = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
9111                 .ilen   = 8,
9112                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9113                 .rlen   = 8,
9114         }, {
9115                 .key    = "\x01\x23\x45\x67\x12",
9116                 .klen   = 5,
9117                 .input  = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
9118                 .ilen   = 8,
9119                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9120                 .rlen   = 8,
9121         },
9122 };
9123
9124 /*
9125  * ARC4 test vectors from OpenSSL
9126  */
9127 #define ARC4_ENC_TEST_VECTORS   7
9128 #define ARC4_DEC_TEST_VECTORS   7
9129
9130 static struct cipher_testvec arc4_enc_tv_template[] = {
9131         {
9132                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9133                 .klen   = 8,
9134                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9135                 .ilen   = 8,
9136                 .result = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
9137                 .rlen   = 8,
9138         }, {
9139                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9140                 .klen   = 8,
9141                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
9142                 .ilen   = 8,
9143                 .result = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
9144                 .rlen   = 8,
9145         }, {
9146                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
9147                 .klen   = 8,
9148                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
9149                 .ilen   = 8,
9150                 .result = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
9151                 .rlen   = 8,
9152         }, {
9153                 .key    = "\xef\x01\x23\x45",
9154                 .klen   = 4,
9155                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
9156                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9157                           "\x00\x00\x00\x00",
9158                 .ilen   = 20,
9159                 .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
9160                           "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
9161                           "\x36\xb6\x78\x58",
9162                 .rlen   = 20,
9163         }, {
9164                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9165                 .klen   = 8,
9166                 .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9167                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9168                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9169                           "\x12\x34\x56\x78",
9170                 .ilen   = 28,
9171                 .result = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
9172                           "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
9173                           "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
9174                           "\x40\x01\x1e\xcf",
9175                 .rlen   = 28,
9176         }, {
9177                 .key    = "\xef\x01\x23\x45",
9178                 .klen   = 4,
9179                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
9180                           "\x00\x00",
9181                 .ilen   = 10,
9182                 .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
9183                           "\xbd\x61",
9184                 .rlen   = 10,
9185         }, {
9186                 .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
9187                         "\x00\x00\x00\x00\x00\x00\x00\x00",
9188                 .klen   = 16,
9189                 .input  = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
9190                 .ilen   = 8,
9191                 .result = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
9192                 .rlen   = 8,
9193         },
9194 };
9195
9196 static struct cipher_testvec arc4_dec_tv_template[] = {
9197         {
9198                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9199                 .klen   = 8,
9200                 .input  = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
9201                 .ilen   = 8,
9202                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9203                 .rlen   = 8,
9204         }, {
9205                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9206                 .klen   = 8,
9207                 .input  = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
9208                 .ilen   = 8,
9209                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
9210                 .rlen   = 8,
9211         }, {
9212                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
9213                 .klen   = 8,
9214                 .input  = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
9215                 .ilen   = 8,
9216                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
9217                 .rlen   = 8,
9218         }, {
9219                 .key    = "\xef\x01\x23\x45",
9220                 .klen   = 4,
9221                 .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
9222                           "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
9223                           "\x36\xb6\x78\x58",
9224                 .ilen   = 20,
9225                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
9226                           "\x00\x00\x00\x00\x00\x00\x00\x00"
9227                           "\x00\x00\x00\x00",
9228                 .rlen   = 20,
9229         }, {
9230                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
9231                 .klen   = 8,
9232                 .input  = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
9233                           "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
9234                           "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
9235                           "\x40\x01\x1e\xcf",
9236                 .ilen   = 28,
9237                 .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9238                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9239                           "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
9240                           "\x12\x34\x56\x78",
9241                 .rlen   = 28,
9242         }, {
9243                 .key    = "\xef\x01\x23\x45",
9244                 .klen   = 4,
9245                 .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
9246                           "\xbd\x61",
9247                 .ilen   = 10,
9248                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
9249                           "\x00\x00",
9250                 .rlen   = 10,
9251         }, {
9252                 .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
9253                         "\x00\x00\x00\x00\x00\x00\x00\x00",
9254                 .klen   = 16,
9255                 .input  = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
9256                 .ilen   = 8,
9257                 .result = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
9258                 .rlen   = 8,
9259         },
9260 };
9261
9262 /*
9263  * TEA test vectors
9264  */
9265 #define TEA_ENC_TEST_VECTORS    4
9266 #define TEA_DEC_TEST_VECTORS    4
9267
9268 static struct cipher_testvec tea_enc_tv_template[] = {
9269         {
9270                 .key    = zeroed_string,
9271                 .klen   = 16,
9272                 .input  = zeroed_string,
9273                 .ilen   = 8,
9274                 .result = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
9275                 .rlen   = 8,
9276         }, {
9277                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9278                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9279                 .klen   = 16,
9280                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9281                 .ilen   = 8,
9282                 .result = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
9283                 .rlen   = 8,
9284         }, {
9285                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9286                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9287                 .klen   = 16,
9288                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9289                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9290                 .ilen   = 16,
9291                 .result = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
9292                           "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
9293                 .rlen   = 16,
9294         }, {
9295                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9296                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9297                 .klen   = 16,
9298                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
9299                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9300                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9301                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9302                 .ilen   = 32,
9303                 .result = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
9304                           "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
9305                           "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
9306                           "\x07\x89\x73\xc2\x45\x92\xc6\x90",
9307                 .rlen   = 32,
9308         }
9309 };
9310
9311 static struct cipher_testvec tea_dec_tv_template[] = {
9312         {
9313                 .key    = zeroed_string,
9314                 .klen   = 16,
9315                 .input  = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
9316                 .ilen   = 8,
9317                 .result = zeroed_string,
9318                 .rlen   = 8,
9319         }, {
9320                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9321                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9322                 .klen   = 16,
9323                 .input  = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
9324                 .ilen   = 8,
9325                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9326                 .rlen   = 8,
9327         }, {
9328                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9329                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9330                 .klen   = 16,
9331                 .input  = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
9332                           "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
9333                 .ilen   = 16,
9334                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9335                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9336                 .rlen   = 16,
9337         }, {
9338                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9339                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9340                 .klen   = 16,
9341                 .input  = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
9342                           "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
9343                           "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
9344                           "\x07\x89\x73\xc2\x45\x92\xc6\x90",
9345                 .ilen   = 32,
9346                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
9347                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9348                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9349                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9350                 .rlen   = 32,
9351         }
9352 };
9353
9354 /*
9355  * XTEA test vectors
9356  */
9357 #define XTEA_ENC_TEST_VECTORS   4
9358 #define XTEA_DEC_TEST_VECTORS   4
9359
9360 static struct cipher_testvec xtea_enc_tv_template[] = {
9361         {
9362                 .key    = zeroed_string,
9363                 .klen   = 16,
9364                 .input  = zeroed_string,
9365                 .ilen   = 8,
9366                 .result = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
9367                 .rlen   = 8,
9368         }, {
9369                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9370                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9371                 .klen   = 16,
9372                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9373                 .ilen   = 8,
9374                 .result = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
9375                 .rlen   = 8,
9376         }, {
9377                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9378                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9379                 .klen   = 16,
9380                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9381                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9382                 .ilen   = 16,
9383                 .result = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
9384                           "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
9385                 .rlen   = 16,
9386         }, {
9387                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9388                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9389                 .klen   = 16,
9390                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
9391                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9392                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9393                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9394                 .ilen   = 32,
9395                 .result = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
9396                           "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
9397                           "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
9398                           "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
9399                 .rlen   = 32,
9400         }
9401 };
9402
9403 static struct cipher_testvec xtea_dec_tv_template[] = {
9404         {
9405                 .key    = zeroed_string,
9406                 .klen   = 16,
9407                 .input  = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
9408                 .ilen   = 8,
9409                 .result = zeroed_string,
9410                 .rlen   = 8,
9411         }, {
9412                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9413                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9414                 .klen   = 16,
9415                 .input  = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
9416                 .ilen   = 8,
9417                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9418                 .rlen   = 8,
9419         }, {
9420                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9421                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9422                 .klen   = 16,
9423                 .input  = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
9424                           "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
9425                 .ilen   = 16,
9426                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9427                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9428                 .rlen   = 16,
9429         }, {
9430                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9431                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9432                 .klen   = 16,
9433                 .input  = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
9434                           "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
9435                           "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
9436                           "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
9437                 .ilen   = 32,
9438                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
9439                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9440                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9441                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9442                 .rlen   = 32,
9443         }
9444 };
9445
9446 /*
9447  * KHAZAD test vectors.
9448  */
9449 #define KHAZAD_ENC_TEST_VECTORS 5
9450 #define KHAZAD_DEC_TEST_VECTORS 5
9451
9452 static struct cipher_testvec khazad_enc_tv_template[] = {
9453         {
9454                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
9455                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9456                 .klen   = 16,
9457                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
9458                 .ilen   = 8,
9459                 .result = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
9460                 .rlen   = 8,
9461         }, {
9462                 .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
9463                           "\x38\x38\x38\x38\x38\x38\x38\x38",
9464                 .klen   = 16,
9465                 .input  = "\x38\x38\x38\x38\x38\x38\x38\x38",
9466                 .ilen   = 8,
9467                 .result = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
9468                 .rlen   = 8,
9469         }, {
9470                 .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
9471                         "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
9472                 .klen   = 16,
9473                 .input  = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
9474                 .ilen   = 8,
9475                 .result = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
9476                 .rlen   = 8,
9477         }, {
9478                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9479                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9480                 .klen   = 16,
9481                 .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9482                 .ilen   = 8,
9483                 .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
9484                 .rlen   = 8,
9485         }, {
9486                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9487                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9488                 .klen   = 16,
9489                 .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9490                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9491                 .ilen   = 16,
9492                 .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
9493                         "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
9494                 .rlen   = 16,
9495         },
9496 };
9497
9498 static struct cipher_testvec khazad_dec_tv_template[] = {
9499         {
9500                 .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
9501                           "\x00\x00\x00\x00\x00\x00\x00\x00",
9502                 .klen   = 16,
9503                 .input  = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
9504                 .ilen   = 8,
9505                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
9506                 .rlen   = 8,
9507         }, {
9508                 .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
9509                           "\x38\x38\x38\x38\x38\x38\x38\x38",
9510                 .klen   = 16,
9511                 .input  = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
9512                 .ilen   = 8,
9513                 .result = "\x38\x38\x38\x38\x38\x38\x38\x38",
9514                 .rlen   = 8,
9515         }, {
9516                 .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
9517                         "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
9518                 .klen   = 16,
9519                 .input  = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
9520                 .ilen   = 8,
9521                 .result = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
9522                 .rlen   = 8,
9523         }, {
9524                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9525                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9526                 .klen   = 16,
9527                 .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
9528                 .ilen   = 8,
9529                 .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9530                 .rlen   = 8,
9531         }, {
9532                 .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9533                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9534                 .klen   = 16,
9535                 .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
9536                         "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
9537                 .ilen   = 16,
9538                 .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
9539                         "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
9540                 .rlen   = 16,
9541         },
9542 };
9543
9544 /*
9545  * Anubis test vectors.
9546  */
9547
9548 #define ANUBIS_ENC_TEST_VECTORS                 5
9549 #define ANUBIS_DEC_TEST_VECTORS                 5
9550 #define ANUBIS_CBC_ENC_TEST_VECTORS             2
9551 #define ANUBIS_CBC_DEC_TEST_VECTORS             2
9552
9553 static struct cipher_testvec anubis_enc_tv_template[] = {
9554         {
9555                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9556                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9557                 .klen   = 16,
9558                 .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9559                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9560                 .ilen   = 16,
9561                 .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
9562                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
9563                 .rlen   = 16,
9564         }, {
9565
9566                 .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
9567                           "\x03\x03\x03\x03\x03\x03\x03\x03"
9568                           "\x03\x03\x03\x03",
9569                 .klen   = 20,
9570                 .input  = "\x03\x03\x03\x03\x03\x03\x03\x03"
9571                           "\x03\x03\x03\x03\x03\x03\x03\x03",
9572                 .ilen   = 16,
9573                 .result = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
9574                           "\x87\x41\x6f\x82\x0a\x98\x64\xae",
9575                 .rlen   = 16,
9576         }, {
9577                 .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
9578                           "\x24\x24\x24\x24\x24\x24\x24\x24"
9579                           "\x24\x24\x24\x24\x24\x24\x24\x24"
9580                           "\x24\x24\x24\x24",
9581                 .klen   = 28,
9582                 .input  = "\x24\x24\x24\x24\x24\x24\x24\x24"
9583                           "\x24\x24\x24\x24\x24\x24\x24\x24",
9584                 .ilen   = 16,
9585                 .result = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
9586                           "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
9587                 .rlen   = 16,
9588         }, {
9589                 .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
9590                           "\x25\x25\x25\x25\x25\x25\x25\x25"
9591                           "\x25\x25\x25\x25\x25\x25\x25\x25"
9592                           "\x25\x25\x25\x25\x25\x25\x25\x25",
9593                 .klen   = 32,
9594                 .input  = "\x25\x25\x25\x25\x25\x25\x25\x25"
9595                           "\x25\x25\x25\x25\x25\x25\x25\x25",
9596                 .ilen   = 16,
9597                 .result = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
9598                         "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
9599                 .rlen   = 16,
9600         }, {
9601                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
9602                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9603                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9604                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9605                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9606                 .klen   = 40,
9607                 .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
9608                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9609                 .ilen   = 16,
9610                 .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
9611                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
9612                 .rlen   = 16,
9613         },
9614 };
9615
9616 static struct cipher_testvec anubis_dec_tv_template[] = {
9617         {
9618                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9619                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9620                 .klen   = 16,
9621                 .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
9622                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
9623                 .ilen   = 16,
9624                 .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9625                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9626                 .rlen   = 16,
9627         }, {
9628
9629                 .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
9630                           "\x03\x03\x03\x03\x03\x03\x03\x03"
9631                           "\x03\x03\x03\x03",
9632                 .klen   = 20,
9633                 .input  = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
9634                           "\x87\x41\x6f\x82\x0a\x98\x64\xae",
9635                 .ilen   = 16,
9636                 .result = "\x03\x03\x03\x03\x03\x03\x03\x03"
9637                           "\x03\x03\x03\x03\x03\x03\x03\x03",
9638                 .rlen   = 16,
9639         }, {
9640                 .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
9641                           "\x24\x24\x24\x24\x24\x24\x24\x24"
9642                           "\x24\x24\x24\x24\x24\x24\x24\x24"
9643                           "\x24\x24\x24\x24",
9644                 .klen   = 28,
9645                 .input  = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
9646                           "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
9647                 .ilen   = 16,
9648                 .result = "\x24\x24\x24\x24\x24\x24\x24\x24"
9649                           "\x24\x24\x24\x24\x24\x24\x24\x24",
9650                 .rlen   = 16,
9651         }, {
9652                 .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
9653                           "\x25\x25\x25\x25\x25\x25\x25\x25"
9654                           "\x25\x25\x25\x25\x25\x25\x25\x25"
9655                           "\x25\x25\x25\x25\x25\x25\x25\x25",
9656                 .klen   = 32,
9657                 .input  = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
9658                         "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
9659                 .ilen   = 16,
9660                 .result = "\x25\x25\x25\x25\x25\x25\x25\x25"
9661                           "\x25\x25\x25\x25\x25\x25\x25\x25",
9662                 .rlen   = 16,
9663         }, {
9664                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
9665                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9666                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9667                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9668                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9669                 .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
9670                          "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
9671                 .klen   = 40,
9672                 .ilen   = 16,
9673                 .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
9674                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9675                 .rlen   = 16,
9676         },
9677 };
9678
9679 static struct cipher_testvec anubis_cbc_enc_tv_template[] = {
9680         {
9681                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9682                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9683                 .klen   = 16,
9684                 .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9685                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9686                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9687                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9688                 .ilen   = 32,
9689                 .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
9690                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
9691                           "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
9692                           "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
9693                 .rlen   = 32,
9694         }, {
9695                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
9696                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9697                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9698                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9699                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9700                 .klen   = 40,
9701                 .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
9702                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9703                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9704                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9705                 .ilen   = 32,
9706                 .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
9707                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
9708                           "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
9709                           "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
9710                 .rlen   = 32,
9711         },
9712 };
9713
9714 static struct cipher_testvec anubis_cbc_dec_tv_template[] = {
9715         {
9716                 .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9717                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9718                 .klen   = 16,
9719                 .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
9720                           "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
9721                           "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
9722                           "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
9723                 .ilen   = 32,
9724                 .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9725                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9726                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
9727                           "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
9728                 .rlen   = 32,
9729         }, {
9730                 .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
9731                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9732                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9733                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9734                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9735                 .klen   = 40,
9736                 .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
9737                           "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
9738                           "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
9739                           "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
9740                 .ilen   = 32,
9741                 .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
9742                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9743                           "\x35\x35\x35\x35\x35\x35\x35\x35"
9744                           "\x35\x35\x35\x35\x35\x35\x35\x35",
9745                 .rlen   = 32,
9746         },
9747 };
9748
9749 /*
9750  * XETA test vectors
9751  */
9752 #define XETA_ENC_TEST_VECTORS   4
9753 #define XETA_DEC_TEST_VECTORS   4
9754
9755 static struct cipher_testvec xeta_enc_tv_template[] = {
9756         {
9757                 .key    = zeroed_string,
9758                 .klen   = 16,
9759                 .input  = zeroed_string,
9760                 .ilen   = 8,
9761                 .result = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
9762                 .rlen   = 8,
9763         }, {
9764                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9765                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9766                 .klen   = 16,
9767                 .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9768                 .ilen   = 8,
9769                 .result = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
9770                 .rlen   = 8,
9771         }, {
9772                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9773                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9774                 .klen   = 16,
9775                 .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9776                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9777                 .ilen   = 16,
9778                 .result = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
9779                           "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
9780                 .rlen   = 16,
9781         }, {
9782                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9783                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9784                 .klen   = 16,
9785                 .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
9786                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9787                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9788                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9789                 .ilen   = 32,
9790                 .result = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
9791                           "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
9792                           "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
9793                           "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
9794                 .rlen   = 32,
9795         }
9796 };
9797
9798 static struct cipher_testvec xeta_dec_tv_template[] = {
9799         {
9800                 .key    = zeroed_string,
9801                 .klen   = 16,
9802                 .input  = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
9803                 .ilen   = 8,
9804                 .result = zeroed_string,
9805                 .rlen   = 8,
9806         }, {
9807                 .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
9808                           "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
9809                 .klen   = 16,
9810                 .input  = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
9811                 .ilen   = 8,
9812                 .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
9813                 .rlen   = 8,
9814         }, {
9815                 .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
9816                           "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
9817                 .klen   = 16,
9818                 .input  = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
9819                           "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
9820                 .ilen   = 16,
9821                 .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
9822                           "\x65\x73\x74\x5f\x76\x65\x63\x74",
9823                 .rlen   = 16,
9824         }, {
9825                 .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
9826                           "\x5d\x04\x16\x36\x15\x72\x63\x2f",
9827                 .klen   = 16,
9828                 .input  = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
9829                           "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
9830                           "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
9831                           "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
9832                 .ilen   = 32,
9833                 .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
9834                           "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
9835                           "\x79\x6f\x75\x21\x21\x21\x20\x72"
9836                           "\x65\x61\x6c\x6c\x79\x21\x21\x21",
9837                 .rlen   = 32,
9838         }
9839 };
9840
9841 /*
9842  * FCrypt test vectors
9843  */
9844 #define FCRYPT_ENC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_enc_tv_template)
9845 #define FCRYPT_DEC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_dec_tv_template)
9846
9847 static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = {
9848         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
9849                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
9850                 .klen   = 8,
9851                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
9852                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
9853                 .ilen   = 8,
9854                 .result = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
9855                 .rlen   = 8,
9856         }, {
9857                 .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
9858                 .klen   = 8,
9859                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
9860                 .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
9861                 .ilen   = 8,
9862                 .result = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
9863                 .rlen   = 8,
9864         }, { /* From Arla */
9865                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9866                 .klen   = 8,
9867                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9868                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
9869                 .ilen   = 48,
9870                 .result = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
9871                           "\xee\xac\x98\x62\x44\x51\xe4\x84"
9872                           "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
9873                           "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
9874                           "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
9875                           "\xf8\x91\x3c\xac\x44\x22\x92\xef",
9876                 .rlen   = 48,
9877         }, {
9878                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9879                 .klen   = 8,
9880                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9881                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
9882                 .ilen   = 48,
9883                 .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
9884                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
9885                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
9886                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
9887                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
9888                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
9889                 .rlen   = 48,
9890         }, { /* split-page version */
9891                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9892                 .klen   = 8,
9893                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9894                 .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
9895                 .ilen   = 48,
9896                 .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
9897                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
9898                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
9899                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
9900                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
9901                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
9902                 .rlen   = 48,
9903                 .np     = 2,
9904                 .tap    = { 20, 28 },
9905         }
9906 };
9907
9908 static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = {
9909         { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
9910                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
9911                 .klen   = 8,
9912                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
9913                 .input  = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
9914                 .ilen   = 8,
9915                 .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
9916                 .rlen   = 8,
9917         }, {
9918                 .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
9919                 .klen   = 8,
9920                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
9921                 .input  = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
9922                 .ilen   = 8,
9923                 .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
9924                 .rlen   = 8,
9925         }, { /* From Arla */
9926                 .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9927                 .klen   = 8,
9928                 .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9929                 .input  = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
9930                           "\xee\xac\x98\x62\x44\x51\xe4\x84"
9931                           "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
9932                           "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
9933                           "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
9934                           "\xf8\x91\x3c\xac\x44\x22\x92\xef",
9935                 .ilen   = 48,
9936                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
9937                 .rlen   = 48,
9938         }, {
9939                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9940                 .klen   = 8,
9941                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9942                 .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
9943                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
9944                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
9945                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
9946                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
9947                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
9948                 .ilen   = 48,
9949                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
9950                 .rlen   = 48,
9951         }, { /* split-page version */
9952                 .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9953                 .klen   = 8,
9954                 .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
9955                 .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
9956                           "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
9957                           "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
9958                           "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
9959                           "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
9960                           "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
9961                 .ilen   = 48,
9962                 .result = "The quick brown fox jumps over the lazy dogs.\0\0",
9963                 .rlen   = 48,
9964                 .np     = 2,
9965                 .tap    = { 20, 28 },
9966         }
9967 };
9968
9969 /*
9970  * CAMELLIA test vectors.
9971  */
9972 #define CAMELLIA_ENC_TEST_VECTORS 3
9973 #define CAMELLIA_DEC_TEST_VECTORS 3
9974 #define CAMELLIA_CBC_ENC_TEST_VECTORS 2
9975 #define CAMELLIA_CBC_DEC_TEST_VECTORS 2
9976
9977 static struct cipher_testvec camellia_enc_tv_template[] = {
9978         {
9979                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
9980                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9981                 .klen   = 16,
9982                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
9983                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9984                 .ilen   = 16,
9985                 .result = "\x67\x67\x31\x38\x54\x96\x69\x73"
9986                           "\x08\x57\x06\x56\x48\xea\xbe\x43",
9987                 .rlen   = 16,
9988         }, {
9989                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
9990                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
9991                           "\x00\x11\x22\x33\x44\x55\x66\x77",
9992                 .klen   = 24,
9993                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
9994                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
9995                 .ilen   = 16,
9996                 .result = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
9997                           "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
9998                 .rlen   = 16,
9999         }, {
10000                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10001                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
10002                           "\x00\x11\x22\x33\x44\x55\x66\x77"
10003                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
10004                 .klen   = 32,
10005                 .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10006                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
10007                 .ilen   = 16,
10008                 .result = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
10009                           "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
10010                 .rlen   = 16,
10011         },
10012 };
10013
10014 static struct cipher_testvec camellia_dec_tv_template[] = {
10015         {
10016                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10017                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
10018                 .klen   = 16,
10019                 .input  = "\x67\x67\x31\x38\x54\x96\x69\x73"
10020                           "\x08\x57\x06\x56\x48\xea\xbe\x43",
10021                 .ilen   = 16,
10022                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10023                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
10024                 .rlen   = 16,
10025         }, {
10026                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10027                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
10028                           "\x00\x11\x22\x33\x44\x55\x66\x77",
10029                 .klen   = 24,
10030                 .input  = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
10031                           "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
10032                 .ilen   = 16,
10033                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10034                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
10035                 .rlen   = 16,
10036         }, {
10037                 .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10038                           "\xfe\xdc\xba\x98\x76\x54\x32\x10"
10039                           "\x00\x11\x22\x33\x44\x55\x66\x77"
10040                           "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
10041                 .klen   = 32,
10042                 .input  = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
10043                           "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
10044                 .ilen   = 16,
10045                 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
10046                           "\xfe\xdc\xba\x98\x76\x54\x32\x10",
10047                 .rlen   = 16,
10048         },
10049 };
10050
10051 static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
10052         {
10053                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
10054                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
10055                 .klen   = 16,
10056                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
10057                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
10058                 .input  = "Single block msg",
10059                 .ilen   = 16,
10060                 .result = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
10061                           "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
10062                 .rlen   = 16,
10063         }, {
10064                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
10065                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
10066                 .klen   = 16,
10067                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
10068                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
10069                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10070                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10071                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10072                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
10073                 .ilen   = 32,
10074                 .result = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
10075                           "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
10076                           "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
10077                           "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
10078                 .rlen   = 32,
10079         },
10080 };
10081
10082 static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
10083         {
10084                 .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
10085                           "\x51\x2e\x03\xd5\x34\x12\x00\x06",
10086                 .klen   = 16,
10087                 .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
10088                           "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
10089                 .input  = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
10090                           "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
10091                 .ilen   = 16,
10092                 .result = "Single block msg",
10093                 .rlen   = 16,
10094         }, {
10095                 .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
10096                           "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
10097                 .klen   = 16,
10098                 .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
10099                           "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
10100                 .input = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
10101                           "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
10102                           "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
10103                           "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
10104                 .ilen   = 32,
10105                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
10106                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10107                           "\x10\x11\x12\x13\x14\x15\x16\x17"
10108                           "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
10109                 .rlen   = 32,
10110         },
10111 };
10112
10113 /*
10114  * SEED test vectors
10115  */
10116 #define SEED_ENC_TEST_VECTORS   4
10117 #define SEED_DEC_TEST_VECTORS   4
10118
10119 static struct cipher_testvec seed_enc_tv_template[] = {
10120         {
10121                 .key    = zeroed_string,
10122                 .klen   = 16,
10123                 .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
10124                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
10125                 .ilen   = 16,
10126                 .result = "\x5e\xba\xc6\xe0\x05\x4e\x16\x68"
10127                           "\x19\xaf\xf1\xcc\x6d\x34\x6c\xdb",
10128                 .rlen   = 16,
10129         }, {
10130                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
10131                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
10132                 .klen   = 16,
10133                 .input  = zeroed_string,
10134                 .ilen   = 16,
10135                 .result = "\xc1\x1f\x22\xf2\x01\x40\x50\x50"
10136                           "\x84\x48\x35\x97\xe4\x37\x0f\x43",
10137                 .rlen   = 16,
10138         }, {
10139                 .key    = "\x47\x06\x48\x08\x51\xe6\x1b\xe8"
10140                           "\x5d\x74\xbf\xb3\xfd\x95\x61\x85",
10141                 .klen   = 16,
10142                 .input  = "\x83\xa2\xf8\xa2\x88\x64\x1f\xb9"
10143                           "\xa4\xe9\xa5\xcc\x2f\x13\x1c\x7d",
10144                 .ilen   = 16,
10145                 .result = "\xee\x54\xd1\x3e\xbc\xae\x70\x6d"
10146                           "\x22\x6b\xc3\x14\x2c\xd4\x0d\x4a",
10147                 .rlen   = 16,
10148         }, {
10149                 .key    = "\x28\xdb\xc3\xbc\x49\xff\xd8\x7d"
10150                           "\xcf\xa5\x09\xb1\x1d\x42\x2b\xe7",
10151                 .klen   = 16,
10152                 .input  = "\xb4\x1e\x6b\xe2\xeb\xa8\x4a\x14"
10153                           "\x8e\x2e\xed\x84\x59\x3c\x5e\xc7",
10154                 .ilen   = 16,
10155                 .result = "\x9b\x9b\x7b\xfc\xd1\x81\x3c\xb9"
10156                           "\x5d\x0b\x36\x18\xf4\x0f\x51\x22",
10157                 .rlen   = 16,
10158         }
10159 };
10160
10161 static struct cipher_testvec seed_dec_tv_template[] = {
10162         {
10163                 .key    = zeroed_string,
10164                 .klen   = 16,
10165                 .input  = "\x5e\xba\xc6\xe0\x05\x4e\x16\x68"
10166                           "\x19\xaf\xf1\xcc\x6d\x34\x6c\xdb",
10167                 .ilen   = 16,
10168                 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
10169                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
10170                 .rlen   = 16,
10171         }, {
10172                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
10173                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
10174                 .klen   = 16,
10175                 .input  = "\xc1\x1f\x22\xf2\x01\x40\x50\x50"
10176                           "\x84\x48\x35\x97\xe4\x37\x0f\x43",
10177                 .ilen   = 16,
10178                 .result = zeroed_string,
10179                 .rlen   = 16,
10180         }, {
10181                 .key    = "\x47\x06\x48\x08\x51\xe6\x1b\xe8"
10182                           "\x5d\x74\xbf\xb3\xfd\x95\x61\x85",
10183                 .klen   = 16,
10184                 .input  = "\xee\x54\xd1\x3e\xbc\xae\x70\x6d"
10185                           "\x22\x6b\xc3\x14\x2c\xd4\x0d\x4a",
10186                 .ilen   = 16,
10187                 .result = "\x83\xa2\xf8\xa2\x88\x64\x1f\xb9"
10188                           "\xa4\xe9\xa5\xcc\x2f\x13\x1c\x7d",
10189                 .rlen   = 16,
10190         }, {
10191                 .key    = "\x28\xdb\xc3\xbc\x49\xff\xd8\x7d"
10192                           "\xcf\xa5\x09\xb1\x1d\x42\x2b\xe7",
10193                 .klen   = 16,
10194                 .input  = "\x9b\x9b\x7b\xfc\xd1\x81\x3c\xb9"
10195                           "\x5d\x0b\x36\x18\xf4\x0f\x51\x22",
10196                 .ilen   = 16,
10197                 .result = "\xb4\x1e\x6b\xe2\xeb\xa8\x4a\x14"
10198                           "\x8e\x2e\xed\x84\x59\x3c\x5e\xc7",
10199                 .rlen   = 16,
10200         }
10201 };
10202
10203 #define SALSA20_STREAM_ENC_TEST_VECTORS 5
10204 static struct cipher_testvec salsa20_stream_enc_tv_template[] = {
10205         /*
10206         * Testvectors from verified.test-vectors submitted to ECRYPT.
10207         * They are truncated to size 39, 64, 111, 129 to test a variety
10208         * of input length.
10209         */
10210         { /* Set 3, vector 0 */
10211                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
10212                         "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
10213                 .klen   = 16,
10214                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
10215                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10216                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10217                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10218                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10219                         "\x00\x00\x00\x00\x00\x00\x00",
10220                 .ilen   = 39,
10221                 .result = "\x2D\xD5\xC3\xF7\xBA\x2B\x20\xF7"
10222                          "\x68\x02\x41\x0C\x68\x86\x88\x89"
10223                          "\x5A\xD8\xC1\xBD\x4E\xA6\xC9\xB1"
10224                          "\x40\xFB\x9B\x90\xE2\x10\x49\xBF"
10225                          "\x58\x3F\x52\x79\x70\xEB\xC1",
10226                 .rlen   = 39,
10227         }, { /* Set 5, vector 0 */
10228                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
10229                         "\x00\x00\x00\x00\x00\x00\x00\x00",
10230                 .klen   = 16,
10231                 .iv     = "\x80\x00\x00\x00\x00\x00\x00\x00",
10232                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10233                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10234                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10235                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10236                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10237                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10238                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10239                         "\x00\x00\x00\x00\x00\x00\x00\x00",
10240                 .ilen   = 64,
10241                 .result = "\xB6\x6C\x1E\x44\x46\xDD\x95\x57"
10242                          "\xE5\x78\xE2\x23\xB0\xB7\x68\x01"
10243                          "\x7B\x23\xB2\x67\xBB\x02\x34\xAE"
10244                          "\x46\x26\xBF\x44\x3F\x21\x97\x76"
10245                          "\x43\x6F\xB1\x9F\xD0\xE8\x86\x6F"
10246                          "\xCD\x0D\xE9\xA9\x53\x8F\x4A\x09"
10247                          "\xCA\x9A\xC0\x73\x2E\x30\xBC\xF9"
10248                          "\x8E\x4F\x13\xE4\xB9\xE2\x01\xD9",
10249                 .rlen   = 64,
10250         }, { /* Set 3, vector 27 */
10251                 .key    = "\x1B\x1C\x1D\x1E\x1F\x20\x21\x22"
10252                         "\x23\x24\x25\x26\x27\x28\x29\x2A"
10253                         "\x2B\x2C\x2D\x2E\x2F\x30\x31\x32"
10254                         "\x33\x34\x35\x36\x37\x38\x39\x3A",
10255                 .klen   = 32,
10256                 .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
10257                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10258                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10259                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10260                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10261                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10262                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10263                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10264                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10265                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10266                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10267                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10268                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10269                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10270                         "\x00\x00\x00\x00\x00\x00\x00",
10271                 .ilen   = 111,
10272                 .result = "\xAE\x39\x50\x8E\xAC\x9A\xEC\xE7"
10273                          "\xBF\x97\xBB\x20\xB9\xDE\xE4\x1F"
10274                          "\x87\xD9\x47\xF8\x28\x91\x35\x98"
10275                          "\xDB\x72\xCC\x23\x29\x48\x56\x5E"
10276                          "\x83\x7E\x0B\xF3\x7D\x5D\x38\x7B"
10277                          "\x2D\x71\x02\xB4\x3B\xB5\xD8\x23"
10278                          "\xB0\x4A\xDF\x3C\xEC\xB6\xD9\x3B"
10279                          "\x9B\xA7\x52\xBE\xC5\xD4\x50\x59"
10280                          "\x15\x14\xB4\x0E\x40\xE6\x53\xD1"
10281                          "\x83\x9C\x5B\xA0\x92\x29\x6B\x5E"
10282                          "\x96\x5B\x1E\x2F\xD3\xAC\xC1\x92"
10283                          "\xB1\x41\x3F\x19\x2F\xC4\x3B\xC6"
10284                          "\x95\x46\x45\x54\xE9\x75\x03\x08"
10285                          "\x44\xAF\xE5\x8A\x81\x12\x09",
10286                 .rlen   = 111,
10287         }, { /* Set 5, vector 27 */
10288                 .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
10289                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10290                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10291                         "\x00\x00\x00\x00\x00\x00\x00\x00",
10292                 .klen   = 32,
10293                 .iv     = "\x00\x00\x00\x10\x00\x00\x00\x00",
10294                 .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
10295                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10296                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10297                         "\x00\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                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10302                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10303                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10304                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10305                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10306                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10307                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10308                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10309                         "\x00\x00\x00\x00\x00\x00\x00\x00"
10310                         "\x00",
10311                 .ilen   = 129,
10312                 .result = "\xD2\xDB\x1A\x5C\xF1\xC1\xAC\xDB"
10313                          "\xE8\x1A\x7A\x43\x40\xEF\x53\x43"
10314                          "\x5E\x7F\x4B\x1A\x50\x52\x3F\x8D"
10315                          "\x28\x3D\xCF\x85\x1D\x69\x6E\x60"
10316                          "\xF2\xDE\x74\x56\x18\x1B\x84\x10"
10317                          "\xD4\x62\xBA\x60\x50\xF0\x61\xF2"
10318                          "\x1C\x78\x7F\xC1\x24\x34\xAF\x58"
10319                          "\xBF\x2C\x59\xCA\x90\x77\xF3\xB0"
10320                          "\x5B\x4A\xDF\x89\xCE\x2C\x2F\xFC"
10321                          "\x67\xF0\xE3\x45\xE8\xB3\xB3\x75"
10322                          "\xA0\x95\x71\xA1\x29\x39\x94\xCA"
10323                          "\x45\x2F\xBD\xCB\x10\xB6\xBE\x9F"
10324                          "\x8E\xF9\xB2\x01\x0A\x5A\x0A\xB7"
10325                          "\x6B\x9D\x70\x8E\x4B\xD6\x2F\xCD"
10326                          "\x2E\x40\x48\x75\xE9\xE2\x21\x45"
10327                          "\x0B\xC9\xB6\xB5\x66\xBC\x9A\x59"
10328                          "\x5A",
10329                 .rlen   = 129,
10330         }, { /* large test vector generated using Crypto++ */
10331                 .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
10332                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10333                         "\x10\x11\x12\x13\x14\x15\x16\x17"
10334                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
10335                 .klen = 32,
10336                 .iv =   "\x00\x00\x00\x00\x00\x00\x00\x00"
10337                         "\x00\x00\x00\x00\x00\x00\x00\x00",
10338                 .input =
10339                         "\x00\x01\x02\x03\x04\x05\x06\x07"
10340                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
10341                         "\x10\x11\x12\x13\x14\x15\x16\x17"
10342                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
10343                         "\x20\x21\x22\x23\x24\x25\x26\x27"
10344                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
10345                         "\x30\x31\x32\x33\x34\x35\x36\x37"
10346                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
10347                         "\x40\x41\x42\x43\x44\x45\x46\x47"
10348                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
10349                         "\x50\x51\x52\x53\x54\x55\x56\x57"
10350                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
10351                         "\x60\x61\x62\x63\x64\x65\x66\x67"
10352                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
10353                         "\x70\x71\x72\x73\x74\x75\x76\x77"
10354                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
10355                         "\x80\x81\x82\x83\x84\x85\x86\x87"
10356                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
10357                         "\x90\x91\x92\x93\x94\x95\x96\x97"
10358                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
10359                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
10360                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
10361                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
10362                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
10363                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
10364                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
10365                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
10366                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
10367                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
10368                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
10369                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
10370                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
10371                         "\x00\x03\x06\x09\x0c\x0f\x12\x15"
10372                         "\x18\x1b\x1e\x21\x24\x27\x2a\x2d"
10373                         "\x30\x33\x36\x39\x3c\x3f\x42\x45"
10374                         "\x48\x4b\x4e\x51\x54\x57\x5a\x5d"
10375                         "\x60\x63\x66\x69\x6c\x6f\x72\x75"
10376                         "\x78\x7b\x7e\x81\x84\x87\x8a\x8d"
10377                         "\x90\x93\x96\x99\x9c\x9f\xa2\xa5"
10378                         "\xa8\xab\xae\xb1\xb4\xb7\xba\xbd"
10379                         "\xc0\xc3\xc6\xc9\xcc\xcf\xd2\xd5"
10380                         "\xd8\xdb\xde\xe1\xe4\xe7\xea\xed"
10381                         "\xf0\xf3\xf6\xf9\xfc\xff\x02\x05"
10382                         "\x08\x0b\x0e\x11\x14\x17\x1a\x1d"
10383                         "\x20\x23\x26\x29\x2c\x2f\x32\x35"
10384                         "\x38\x3b\x3e\x41\x44\x47\x4a\x4d"
10385                         "\x50\x53\x56\x59\x5c\x5f\x62\x65"
10386                         "\x68\x6b\x6e\x71\x74\x77\x7a\x7d"
10387                         "\x80\x83\x86\x89\x8c\x8f\x92\x95"
10388                         "\x98\x9b\x9e\xa1\xa4\xa7\xaa\xad"
10389                         "\xb0\xb3\xb6\xb9\xbc\xbf\xc2\xc5"
10390                         "\xc8\xcb\xce\xd1\xd4\xd7\xda\xdd"
10391                         "\xe0\xe3\xe6\xe9\xec\xef\xf2\xf5"
10392                         "\xf8\xfb\xfe\x01\x04\x07\x0a\x0d"
10393                         "\x10\x13\x16\x19\x1c\x1f\x22\x25"
10394                         "\x28\x2b\x2e\x31\x34\x37\x3a\x3d"
10395                         "\x40\x43\x46\x49\x4c\x4f\x52\x55"
10396                         "\x58\x5b\x5e\x61\x64\x67\x6a\x6d"
10397                         "\x70\x73\x76\x79\x7c\x7f\x82\x85"
10398                         "\x88\x8b\x8e\x91\x94\x97\x9a\x9d"
10399                         "\xa0\xa3\xa6\xa9\xac\xaf\xb2\xb5"
10400                         "\xb8\xbb\xbe\xc1\xc4\xc7\xca\xcd"
10401                         "\xd0\xd3\xd6\xd9\xdc\xdf\xe2\xe5"
10402                         "\xe8\xeb\xee\xf1\xf4\xf7\xfa\xfd"
10403                         "\x00\x05\x0a\x0f\x14\x19\x1e\x23"
10404                         "\x28\x2d\x32\x37\x3c\x41\x46\x4b"
10405                         "\x50\x55\x5a\x5f\x64\x69\x6e\x73"
10406                         "\x78\x7d\x82\x87\x8c\x91\x96\x9b"
10407                         "\xa0\xa5\xaa\xaf\xb4\xb9\xbe\xc3"
10408                         "\xc8\xcd\xd2\xd7\xdc\xe1\xe6\xeb"
10409                         "\xf0\xf5\xfa\xff\x04\x09\x0e\x13"
10410                         "\x18\x1d\x22\x27\x2c\x31\x36\x3b"
10411                         "\x40\x45\x4a\x4f\x54\x59\x5e\x63"
10412                         "\x68\x6d\x72\x77\x7c\x81\x86\x8b"
10413                         "\x90\x95\x9a\x9f\xa4\xa9\xae\xb3"
10414                         "\xb8\xbd\xc2\xc7\xcc\xd1\xd6\xdb"
10415                         "\xe0\xe5\xea\xef\xf4\xf9\xfe\x03"
10416                         "\x08\x0d\x12\x17\x1c\x21\x26\x2b"
10417                         "\x30\x35\x3a\x3f\x44\x49\x4e\x53"
10418                         "\x58\x5d\x62\x67\x6c\x71\x76\x7b"
10419                         "\x80\x85\x8a\x8f\x94\x99\x9e\xa3"
10420                         "\xa8\xad\xb2\xb7\xbc\xc1\xc6\xcb"
10421                         "\xd0\xd5\xda\xdf\xe4\xe9\xee\xf3"
10422                         "\xf8\xfd\x02\x07\x0c\x11\x16\x1b"
10423                         "\x20\x25\x2a\x2f\x34\x39\x3e\x43"
10424                         "\x48\x4d\x52\x57\x5c\x61\x66\x6b"
10425                         "\x70\x75\x7a\x7f\x84\x89\x8e\x93"
10426                         "\x98\x9d\xa2\xa7\xac\xb1\xb6\xbb"
10427                         "\xc0\xc5\xca\xcf\xd4\xd9\xde\xe3"
10428                         "\xe8\xed\xf2\xf7\xfc\x01\x06\x0b"
10429                         "\x10\x15\x1a\x1f\x24\x29\x2e\x33"
10430                         "\x38\x3d\x42\x47\x4c\x51\x56\x5b"
10431                         "\x60\x65\x6a\x6f\x74\x79\x7e\x83"
10432                         "\x88\x8d\x92\x97\x9c\xa1\xa6\xab"
10433                         "\xb0\xb5\xba\xbf\xc4\xc9\xce\xd3"
10434                         "\xd8\xdd\xe2\xe7\xec\xf1\xf6\xfb"
10435                         "\x00\x07\x0e\x15\x1c\x23\x2a\x31"
10436                         "\x38\x3f\x46\x4d\x54\x5b\x62\x69"
10437                         "\x70\x77\x7e\x85\x8c\x93\x9a\xa1"
10438                         "\xa8\xaf\xb6\xbd\xc4\xcb\xd2\xd9"
10439                         "\xe0\xe7\xee\xf5\xfc\x03\x0a\x11"
10440                         "\x18\x1f\x26\x2d\x34\x3b\x42\x49"
10441                         "\x50\x57\x5e\x65\x6c\x73\x7a\x81"
10442                         "\x88\x8f\x96\x9d\xa4\xab\xb2\xb9"
10443                         "\xc0\xc7\xce\xd5\xdc\xe3\xea\xf1"
10444                         "\xf8\xff\x06\x0d\x14\x1b\x22\x29"
10445                         "\x30\x37\x3e\x45\x4c\x53\x5a\x61"
10446                         "\x68\x6f\x76\x7d\x84\x8b\x92\x99"
10447                         "\xa0\xa7\xae\xb5\xbc\xc3\xca\xd1"
10448                         "\xd8\xdf\xe6\xed\xf4\xfb\x02\x09"
10449                         "\x10\x17\x1e\x25\x2c\x33\x3a\x41"
10450                         "\x48\x4f\x56\x5d\x64\x6b\x72\x79"
10451                         "\x80\x87\x8e\x95\x9c\xa3\xaa\xb1"
10452                         "\xb8\xbf\xc6\xcd\xd4\xdb\xe2\xe9"
10453                         "\xf0\xf7\xfe\x05\x0c\x13\x1a\x21"
10454                         "\x28\x2f\x36\x3d\x44\x4b\x52\x59"
10455                         "\x60\x67\x6e\x75\x7c\x83\x8a\x91"
10456                         "\x98\x9f\xa6\xad\xb4\xbb\xc2\xc9"
10457                         "\xd0\xd7\xde\xe5\xec\xf3\xfa\x01"
10458                         "\x08\x0f\x16\x1d\x24\x2b\x32\x39"
10459                         "\x40\x47\x4e\x55\x5c\x63\x6a\x71"
10460                         "\x78\x7f\x86\x8d\x94\x9b\xa2\xa9"
10461                         "\xb0\xb7\xbe\xc5\xcc\xd3\xda\xe1"
10462                         "\xe8\xef\xf6\xfd\x04\x0b\x12\x19"
10463                         "\x20\x27\x2e\x35\x3c\x43\x4a\x51"
10464                         "\x58\x5f\x66\x6d\x74\x7b\x82\x89"
10465                         "\x90\x97\x9e\xa5\xac\xb3\xba\xc1"
10466                         "\xc8\xcf\xd6\xdd\xe4\xeb\xf2\xf9"
10467                         "\x00\x09\x12\x1b\x24\x2d\x36\x3f"
10468                         "\x48\x51\x5a\x63\x6c\x75\x7e\x87"
10469                         "\x90\x99\xa2\xab\xb4\xbd\xc6\xcf"
10470                         "\xd8\xe1\xea\xf3\xfc\x05\x0e\x17"
10471                         "\x20\x29\x32\x3b\x44\x4d\x56\x5f"
10472                         "\x68\x71\x7a\x83\x8c\x95\x9e\xa7"
10473                         "\xb0\xb9\xc2\xcb\xd4\xdd\xe6\xef"
10474                         "\xf8\x01\x0a\x13\x1c\x25\x2e\x37"
10475                         "\x40\x49\x52\x5b\x64\x6d\x76\x7f"
10476                         "\x88\x91\x9a\xa3\xac\xb5\xbe\xc7"
10477                         "\xd0\xd9\xe2\xeb\xf4\xfd\x06\x0f"
10478                         "\x18\x21\x2a\x33\x3c\x45\x4e\x57"
10479                         "\x60\x69\x72\x7b\x84\x8d\x96\x9f"
10480                         "\xa8\xb1\xba\xc3\xcc\xd5\xde\xe7"
10481                         "\xf0\xf9\x02\x0b\x14\x1d\x26\x2f"
10482                         "\x38\x41\x4a\x53\x5c\x65\x6e\x77"
10483                         "\x80\x89\x92\x9b\xa4\xad\xb6\xbf"
10484                         "\xc8\xd1\xda\xe3\xec\xf5\xfe\x07"
10485                         "\x10\x19\x22\x2b\x34\x3d\x46\x4f"
10486                         "\x58\x61\x6a\x73\x7c\x85\x8e\x97"
10487                         "\xa0\xa9\xb2\xbb\xc4\xcd\xd6\xdf"
10488                         "\xe8\xf1\xfa\x03\x0c\x15\x1e\x27"
10489                         "\x30\x39\x42\x4b\x54\x5d\x66\x6f"
10490                         "\x78\x81\x8a\x93\x9c\xa5\xae\xb7"
10491                         "\xc0\xc9\xd2\xdb\xe4\xed\xf6\xff"
10492                         "\x08\x11\x1a\x23\x2c\x35\x3e\x47"
10493                         "\x50\x59\x62\x6b\x74\x7d\x86\x8f"
10494                         "\x98\xa1\xaa\xb3\xbc\xc5\xce\xd7"
10495                         "\xe0\xe9\xf2\xfb\x04\x0d\x16\x1f"
10496                         "\x28\x31\x3a\x43\x4c\x55\x5e\x67"
10497                         "\x70\x79\x82\x8b\x94\x9d\xa6\xaf"
10498                         "\xb8\xc1\xca\xd3\xdc\xe5\xee\xf7"
10499                         "\x00\x0b\x16\x21\x2c\x37\x42\x4d"
10500                         "\x58\x63\x6e\x79\x84\x8f\x9a\xa5"
10501                         "\xb0\xbb\xc6\xd1\xdc\xe7\xf2\xfd"
10502                         "\x08\x13\x1e\x29\x34\x3f\x4a\x55"
10503                         "\x60\x6b\x76\x81\x8c\x97\xa2\xad"
10504                         "\xb8\xc3\xce\xd9\xe4\xef\xfa\x05"
10505                         "\x10\x1b\x26\x31\x3c\x47\x52\x5d"
10506                         "\x68\x73\x7e\x89\x94\x9f\xaa\xb5"
10507                         "\xc0\xcb\xd6\xe1\xec\xf7\x02\x0d"
10508                         "\x18\x23\x2e\x39\x44\x4f\x5a\x65"
10509                         "\x70\x7b\x86\x91\x9c\xa7\xb2\xbd"
10510                         "\xc8\xd3\xde\xe9\xf4\xff\x0a\x15"
10511                         "\x20\x2b\x36\x41\x4c\x57\x62\x6d"
10512                         "\x78\x83\x8e\x99\xa4\xaf\xba\xc5"
10513                         "\xd0\xdb\xe6\xf1\xfc\x07\x12\x1d"
10514                         "\x28\x33\x3e\x49\x54\x5f\x6a\x75"
10515                         "\x80\x8b\x96\xa1\xac\xb7\xc2\xcd"
10516                         "\xd8\xe3\xee\xf9\x04\x0f\x1a\x25"
10517                         "\x30\x3b\x46\x51\x5c\x67\x72\x7d"
10518                         "\x88\x93\x9e\xa9\xb4\xbf\xca\xd5"
10519                         "\xe0\xeb\xf6\x01\x0c\x17\x22\x2d"
10520                         "\x38\x43\x4e\x59\x64\x6f\x7a\x85"
10521                         "\x90\x9b\xa6\xb1\xbc\xc7\xd2\xdd"
10522                         "\xe8\xf3\xfe\x09\x14\x1f\x2a\x35"
10523                         "\x40\x4b\x56\x61\x6c\x77\x82\x8d"
10524                         "\x98\xa3\xae\xb9\xc4\xcf\xda\xe5"
10525                         "\xf0\xfb\x06\x11\x1c\x27\x32\x3d"
10526                         "\x48\x53\x5e\x69\x74\x7f\x8a\x95"
10527                         "\xa0\xab\xb6\xc1\xcc\xd7\xe2\xed"
10528                         "\xf8\x03\x0e\x19\x24\x2f\x3a\x45"
10529                         "\x50\x5b\x66\x71\x7c\x87\x92\x9d"
10530                         "\xa8\xb3\xbe\xc9\xd4\xdf\xea\xf5"
10531                         "\x00\x0d\x1a\x27\x34\x41\x4e\x5b"
10532                         "\x68\x75\x82\x8f\x9c\xa9\xb6\xc3"
10533                         "\xd0\xdd\xea\xf7\x04\x11\x1e\x2b"
10534                         "\x38\x45\x52\x5f\x6c\x79\x86\x93"
10535                         "\xa0\xad\xba\xc7\xd4\xe1\xee\xfb"
10536                         "\x08\x15\x22\x2f\x3c\x49\x56\x63"
10537                         "\x70\x7d\x8a\x97\xa4\xb1\xbe\xcb"
10538                         "\xd8\xe5\xf2\xff\x0c\x19\x26\x33"
10539                         "\x40\x4d\x5a\x67\x74\x81\x8e\x9b"
10540                         "\xa8\xb5\xc2\xcf\xdc\xe9\xf6\x03"
10541                         "\x10\x1d\x2a\x37\x44\x51\x5e\x6b"
10542                         "\x78\x85\x92\x9f\xac\xb9\xc6\xd3"
10543                         "\xe0\xed\xfa\x07\x14\x21\x2e\x3b"
10544                         "\x48\x55\x62\x6f\x7c\x89\x96\xa3"
10545                         "\xb0\xbd\xca\xd7\xe4\xf1\xfe\x0b"
10546                         "\x18\x25\x32\x3f\x4c\x59\x66\x73"
10547                         "\x80\x8d\x9a\xa7\xb4\xc1\xce\xdb"
10548                         "\xe8\xf5\x02\x0f\x1c\x29\x36\x43"
10549                         "\x50\x5d\x6a\x77\x84\x91\x9e\xab"
10550                         "\xb8\xc5\xd2\xdf\xec\xf9\x06\x13"
10551                         "\x20\x2d\x3a\x47\x54\x61\x6e\x7b"
10552                         "\x88\x95\xa2\xaf\xbc\xc9\xd6\xe3"
10553                         "\xf0\xfd\x0a\x17\x24\x31\x3e\x4b"
10554                         "\x58\x65\x72\x7f\x8c\x99\xa6\xb3"
10555                         "\xc0\xcd\xda\xe7\xf4\x01\x0e\x1b"
10556                         "\x28\x35\x42\x4f\x5c\x69\x76\x83"
10557                         "\x90\x9d\xaa\xb7\xc4\xd1\xde\xeb"
10558                         "\xf8\x05\x12\x1f\x2c\x39\x46\x53"
10559                         "\x60\x6d\x7a\x87\x94\xa1\xae\xbb"
10560                         "\xc8\xd5\xe2\xef\xfc\x09\x16\x23"
10561                         "\x30\x3d\x4a\x57\x64\x71\x7e\x8b"
10562                         "\x98\xa5\xb2\xbf\xcc\xd9\xe6\xf3"
10563                         "\x00\x0f\x1e\x2d\x3c\x4b\x5a\x69"
10564                         "\x78\x87\x96\xa5\xb4\xc3\xd2\xe1"
10565                         "\xf0\xff\x0e\x1d\x2c\x3b\x4a\x59"
10566                         "\x68\x77\x86\x95\xa4\xb3\xc2\xd1"
10567                         "\xe0\xef\xfe\x0d\x1c\x2b\x3a\x49"
10568                         "\x58\x67\x76\x85\x94\xa3\xb2\xc1"
10569                         "\xd0\xdf\xee\xfd\x0c\x1b\x2a\x39"
10570                         "\x48\x57\x66\x75\x84\x93\xa2\xb1"
10571                         "\xc0\xcf\xde\xed\xfc\x0b\x1a\x29"
10572                         "\x38\x47\x56\x65\x74\x83\x92\xa1"
10573                         "\xb0\xbf\xce\xdd\xec\xfb\x0a\x19"
10574                         "\x28\x37\x46\x55\x64\x73\x82\x91"
10575                         "\xa0\xaf\xbe\xcd\xdc\xeb\xfa\x09"
10576                         "\x18\x27\x36\x45\x54\x63\x72\x81"
10577                         "\x90\x9f\xae\xbd\xcc\xdb\xea\xf9"
10578                         "\x08\x17\x26\x35\x44\x53\x62\x71"
10579                         "\x80\x8f\x9e\xad\xbc\xcb\xda\xe9"
10580                         "\xf8\x07\x16\x25\x34\x43\x52\x61"
10581                         "\x70\x7f\x8e\x9d\xac\xbb\xca\xd9"
10582                         "\xe8\xf7\x06\x15\x24\x33\x42\x51"
10583                         "\x60\x6f\x7e\x8d\x9c\xab\xba\xc9"
10584                         "\xd8\xe7\xf6\x05\x14\x23\x32\x41"
10585                         "\x50\x5f\x6e\x7d\x8c\x9b\xaa\xb9"
10586                         "\xc8\xd7\xe6\xf5\x04\x13\x22\x31"
10587                         "\x40\x4f\x5e\x6d\x7c\x8b\x9a\xa9"
10588                         "\xb8\xc7\xd6\xe5\xf4\x03\x12\x21"
10589                         "\x30\x3f\x4e\x5d\x6c\x7b\x8a\x99"
10590                         "\xa8\xb7\xc6\xd5\xe4\xf3\x02\x11"
10591                         "\x20\x2f\x3e\x4d\x5c\x6b\x7a\x89"
10592                         "\x98\xa7\xb6\xc5\xd4\xe3\xf2\x01"
10593                         "\x10\x1f\x2e\x3d\x4c\x5b\x6a\x79"
10594                         "\x88\x97\xa6\xb5\xc4\xd3\xe2\xf1"
10595                         "\x00\x11\x22\x33\x44\x55\x66\x77"
10596                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff"
10597                         "\x10\x21\x32\x43\x54\x65\x76\x87"
10598                         "\x98\xa9\xba\xcb\xdc\xed\xfe\x0f"
10599                         "\x20\x31\x42\x53\x64\x75\x86\x97"
10600                         "\xa8\xb9\xca\xdb\xec\xfd\x0e\x1f"
10601                         "\x30\x41\x52\x63\x74\x85\x96\xa7"
10602                         "\xb8\xc9\xda\xeb\xfc\x0d\x1e\x2f"
10603                         "\x40\x51\x62\x73\x84\x95\xa6\xb7"
10604                         "\xc8\xd9\xea\xfb\x0c\x1d\x2e\x3f"
10605                         "\x50\x61\x72\x83\x94\xa5\xb6\xc7"
10606                         "\xd8\xe9\xfa\x0b\x1c\x2d\x3e\x4f"
10607                         "\x60\x71\x82\x93\xa4\xb5\xc6\xd7"
10608                         "\xe8\xf9\x0a\x1b\x2c\x3d\x4e\x5f"
10609                         "\x70\x81\x92\xa3\xb4\xc5\xd6\xe7"
10610                         "\xf8\x09\x1a\x2b\x3c\x4d\x5e\x6f"
10611                         "\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7"
10612                         "\x08\x19\x2a\x3b\x4c\x5d\x6e\x7f"
10613                         "\x90\xa1\xb2\xc3\xd4\xe5\xf6\x07"
10614                         "\x18\x29\x3a\x4b\x5c\x6d\x7e\x8f"
10615                         "\xa0\xb1\xc2\xd3\xe4\xf5\x06\x17"
10616                         "\x28\x39\x4a\x5b\x6c\x7d\x8e\x9f"
10617                         "\xb0\xc1\xd2\xe3\xf4\x05\x16\x27"
10618                         "\x38\x49\x5a\x6b\x7c\x8d\x9e\xaf"
10619                         "\xc0\xd1\xe2\xf3\x04\x15\x26\x37"
10620                         "\x48\x59\x6a\x7b\x8c\x9d\xae\xbf"
10621                         "\xd0\xe1\xf2\x03\x14\x25\x36\x47"
10622                         "\x58\x69\x7a\x8b\x9c\xad\xbe\xcf"
10623                         "\xe0\xf1\x02\x13\x24\x35\x46\x57"
10624                         "\x68\x79\x8a\x9b\xac\xbd\xce\xdf"
10625                         "\xf0\x01\x12\x23\x34\x45\x56\x67"
10626                         "\x78\x89\x9a\xab\xbc\xcd\xde\xef"
10627                         "\x00\x13\x26\x39\x4c\x5f\x72\x85"
10628                         "\x98\xab\xbe\xd1\xe4\xf7\x0a\x1d"
10629                         "\x30\x43\x56\x69\x7c\x8f\xa2\xb5"
10630                         "\xc8\xdb\xee\x01\x14\x27\x3a\x4d"
10631                         "\x60\x73\x86\x99\xac\xbf\xd2\xe5"
10632                         "\xf8\x0b\x1e\x31\x44\x57\x6a\x7d"
10633                         "\x90\xa3\xb6\xc9\xdc\xef\x02\x15"
10634                         "\x28\x3b\x4e\x61\x74\x87\x9a\xad"
10635                         "\xc0\xd3\xe6\xf9\x0c\x1f\x32\x45"
10636                         "\x58\x6b\x7e\x91\xa4\xb7\xca\xdd"
10637                         "\xf0\x03\x16\x29\x3c\x4f\x62\x75"
10638                         "\x88\x9b\xae\xc1\xd4\xe7\xfa\x0d"
10639                         "\x20\x33\x46\x59\x6c\x7f\x92\xa5"
10640                         "\xb8\xcb\xde\xf1\x04\x17\x2a\x3d"
10641                         "\x50\x63\x76\x89\x9c\xaf\xc2\xd5"
10642                         "\xe8\xfb\x0e\x21\x34\x47\x5a\x6d"
10643                         "\x80\x93\xa6\xb9\xcc\xdf\xf2\x05"
10644                         "\x18\x2b\x3e\x51\x64\x77\x8a\x9d"
10645                         "\xb0\xc3\xd6\xe9\xfc\x0f\x22\x35"
10646                         "\x48\x5b\x6e\x81\x94\xa7\xba\xcd"
10647                         "\xe0\xf3\x06\x19\x2c\x3f\x52\x65"
10648                         "\x78\x8b\x9e\xb1\xc4\xd7\xea\xfd"
10649                         "\x10\x23\x36\x49\x5c\x6f\x82\x95"
10650                         "\xa8\xbb\xce\xe1\xf4\x07\x1a\x2d"
10651                         "\x40\x53\x66\x79\x8c\x9f\xb2\xc5"
10652                         "\xd8\xeb\xfe\x11\x24\x37\x4a\x5d"
10653                         "\x70\x83\x96\xa9\xbc\xcf\xe2\xf5"
10654                         "\x08\x1b\x2e\x41\x54\x67\x7a\x8d"
10655                         "\xa0\xb3\xc6\xd9\xec\xff\x12\x25"
10656                         "\x38\x4b\x5e\x71\x84\x97\xaa\xbd"
10657                         "\xd0\xe3\xf6\x09\x1c\x2f\x42\x55"
10658                         "\x68\x7b\x8e\xa1\xb4\xc7\xda\xed"
10659                         "\x00\x15\x2a\x3f\x54\x69\x7e\x93"
10660                         "\xa8\xbd\xd2\xe7\xfc\x11\x26\x3b"
10661                         "\x50\x65\x7a\x8f\xa4\xb9\xce\xe3"
10662                         "\xf8\x0d\x22\x37\x4c\x61\x76\x8b"
10663                         "\xa0\xb5\xca\xdf\xf4\x09\x1e\x33"
10664                         "\x48\x5d\x72\x87\x9c\xb1\xc6\xdb"
10665                         "\xf0\x05\x1a\x2f\x44\x59\x6e\x83"
10666                         "\x98\xad\xc2\xd7\xec\x01\x16\x2b"
10667                         "\x40\x55\x6a\x7f\x94\xa9\xbe\xd3"
10668                         "\xe8\xfd\x12\x27\x3c\x51\x66\x7b"
10669                         "\x90\xa5\xba\xcf\xe4\xf9\x0e\x23"
10670                         "\x38\x4d\x62\x77\x8c\xa1\xb6\xcb"
10671                         "\xe0\xf5\x0a\x1f\x34\x49\x5e\x73"
10672                         "\x88\x9d\xb2\xc7\xdc\xf1\x06\x1b"
10673                         "\x30\x45\x5a\x6f\x84\x99\xae\xc3"
10674                         "\xd8\xed\x02\x17\x2c\x41\x56\x6b"
10675                         "\x80\x95\xaa\xbf\xd4\xe9\xfe\x13"
10676                         "\x28\x3d\x52\x67\x7c\x91\xa6\xbb"
10677                         "\xd0\xe5\xfa\x0f\x24\x39\x4e\x63"
10678                         "\x78\x8d\xa2\xb7\xcc\xe1\xf6\x0b"
10679                         "\x20\x35\x4a\x5f\x74\x89\x9e\xb3"
10680                         "\xc8\xdd\xf2\x07\x1c\x31\x46\x5b"
10681                         "\x70\x85\x9a\xaf\xc4\xd9\xee\x03"
10682                         "\x18\x2d\x42\x57\x6c\x81\x96\xab"
10683                         "\xc0\xd5\xea\xff\x14\x29\x3e\x53"
10684                         "\x68\x7d\x92\xa7\xbc\xd1\xe6\xfb"
10685                         "\x10\x25\x3a\x4f\x64\x79\x8e\xa3"
10686                         "\xb8\xcd\xe2\xf7\x0c\x21\x36\x4b"
10687                         "\x60\x75\x8a\x9f\xb4\xc9\xde\xf3"
10688                         "\x08\x1d\x32\x47\x5c\x71\x86\x9b"
10689                         "\xb0\xc5\xda\xef\x04\x19\x2e\x43"
10690                         "\x58\x6d\x82\x97\xac\xc1\xd6\xeb"
10691                         "\x00\x17\x2e\x45\x5c\x73\x8a\xa1"
10692                         "\xb8\xcf\xe6\xfd\x14\x2b\x42\x59"
10693                         "\x70\x87\x9e\xb5\xcc\xe3\xfa\x11"
10694                         "\x28\x3f\x56\x6d\x84\x9b\xb2\xc9"
10695                         "\xe0\xf7\x0e\x25\x3c\x53\x6a\x81"
10696                         "\x98\xaf\xc6\xdd\xf4\x0b\x22\x39"
10697                         "\x50\x67\x7e\x95\xac\xc3\xda\xf1"
10698                         "\x08\x1f\x36\x4d\x64\x7b\x92\xa9"
10699                         "\xc0\xd7\xee\x05\x1c\x33\x4a\x61"
10700                         "\x78\x8f\xa6\xbd\xd4\xeb\x02\x19"
10701                         "\x30\x47\x5e\x75\x8c\xa3\xba\xd1"
10702                         "\xe8\xff\x16\x2d\x44\x5b\x72\x89"
10703                         "\xa0\xb7\xce\xe5\xfc\x13\x2a\x41"
10704                         "\x58\x6f\x86\x9d\xb4\xcb\xe2\xf9"
10705                         "\x10\x27\x3e\x55\x6c\x83\x9a\xb1"
10706                         "\xc8\xdf\xf6\x0d\x24\x3b\x52\x69"
10707                         "\x80\x97\xae\xc5\xdc\xf3\x0a\x21"
10708                         "\x38\x4f\x66\x7d\x94\xab\xc2\xd9"
10709                         "\xf0\x07\x1e\x35\x4c\x63\x7a\x91"
10710                         "\xa8\xbf\xd6\xed\x04\x1b\x32\x49"
10711                         "\x60\x77\x8e\xa5\xbc\xd3\xea\x01"
10712                         "\x18\x2f\x46\x5d\x74\x8b\xa2\xb9"
10713                         "\xd0\xe7\xfe\x15\x2c\x43\x5a\x71"
10714                         "\x88\x9f\xb6\xcd\xe4\xfb\x12\x29"
10715                         "\x40\x57\x6e\x85\x9c\xb3\xca\xe1"
10716                         "\xf8\x0f\x26\x3d\x54\x6b\x82\x99"
10717                         "\xb0\xc7\xde\xf5\x0c\x23\x3a\x51"
10718                         "\x68\x7f\x96\xad\xc4\xdb\xf2\x09"
10719                         "\x20\x37\x4e\x65\x7c\x93\xaa\xc1"
10720                         "\xd8\xef\x06\x1d\x34\x4b\x62\x79"
10721                         "\x90\xa7\xbe\xd5\xec\x03\x1a\x31"
10722                         "\x48\x5f\x76\x8d\xa4\xbb\xd2\xe9"
10723                         "\x00\x19\x32\x4b\x64\x7d\x96\xaf"
10724                         "\xc8\xe1\xfa\x13\x2c\x45\x5e\x77"
10725                         "\x90\xa9\xc2\xdb\xf4\x0d\x26\x3f"
10726                         "\x58\x71\x8a\xa3\xbc\xd5\xee\x07"
10727                         "\x20\x39\x52\x6b\x84\x9d\xb6\xcf"
10728                         "\xe8\x01\x1a\x33\x4c\x65\x7e\x97"
10729                         "\xb0\xc9\xe2\xfb\x14\x2d\x46\x5f"
10730                         "\x78\x91\xaa\xc3\xdc\xf5\x0e\x27"
10731                         "\x40\x59\x72\x8b\xa4\xbd\xd6\xef"
10732                         "\x08\x21\x3a\x53\x6c\x85\x9e\xb7"
10733                         "\xd0\xe9\x02\x1b\x34\x4d\x66\x7f"
10734                         "\x98\xb1\xca\xe3\xfc\x15\x2e\x47"
10735                         "\x60\x79\x92\xab\xc4\xdd\xf6\x0f"
10736                         "\x28\x41\x5a\x73\x8c\xa5\xbe\xd7"
10737                         "\xf0\x09\x22\x3b\x54\x6d\x86\x9f"
10738                         "\xb8\xd1\xea\x03\x1c\x35\x4e\x67"
10739                         "\x80\x99\xb2\xcb\xe4\xfd\x16\x2f"
10740                         "\x48\x61\x7a\x93\xac\xc5\xde\xf7"
10741                         "\x10\x29\x42\x5b\x74\x8d\xa6\xbf"
10742                         "\xd8\xf1\x0a\x23\x3c\x55\x6e\x87"
10743                         "\xa0\xb9\xd2\xeb\x04\x1d\x36\x4f"
10744                         "\x68\x81\x9a\xb3\xcc\xe5\xfe\x17"
10745                         "\x30\x49\x62\x7b\x94\xad\xc6\xdf"
10746                         "\xf8\x11\x2a\x43\x5c\x75\x8e\xa7"
10747                         "\xc0\xd9\xf2\x0b\x24\x3d\x56\x6f"
10748                         "\x88\xa1\xba\xd3\xec\x05\x1e\x37"
10749                         "\x50\x69\x82\x9b\xb4\xcd\xe6\xff"
10750                         "\x18\x31\x4a\x63\x7c\x95\xae\xc7"
10751                         "\xe0\xf9\x12\x2b\x44\x5d\x76\x8f"
10752                         "\xa8\xc1\xda\xf3\x0c\x25\x3e\x57"
10753                         "\x70\x89\xa2\xbb\xd4\xed\x06\x1f"
10754                         "\x38\x51\x6a\x83\x9c\xb5\xce\xe7"
10755                         "\x00\x1b\x36\x51\x6c\x87\xa2\xbd"
10756                         "\xd8\xf3\x0e\x29\x44\x5f\x7a\x95"
10757                         "\xb0\xcb\xe6\x01\x1c\x37\x52\x6d"
10758                         "\x88\xa3\xbe\xd9\xf4\x0f\x2a\x45"
10759                         "\x60\x7b\x96\xb1\xcc\xe7\x02\x1d"
10760                         "\x38\x53\x6e\x89\xa4\xbf\xda\xf5"
10761                         "\x10\x2b\x46\x61\x7c\x97\xb2\xcd"
10762                         "\xe8\x03\x1e\x39\x54\x6f\x8a\xa5"
10763                         "\xc0\xdb\xf6\x11\x2c\x47\x62\x7d"
10764                         "\x98\xb3\xce\xe9\x04\x1f\x3a\x55"
10765                         "\x70\x8b\xa6\xc1\xdc\xf7\x12\x2d"
10766                         "\x48\x63\x7e\x99\xb4\xcf\xea\x05"
10767                         "\x20\x3b\x56\x71\x8c\xa7\xc2\xdd"
10768                         "\xf8\x13\x2e\x49\x64\x7f\x9a\xb5"
10769                         "\xd0\xeb\x06\x21\x3c\x57\x72\x8d"
10770                         "\xa8\xc3\xde\xf9\x14\x2f\x4a\x65"
10771                         "\x80\x9b\xb6\xd1\xec\x07\x22\x3d"
10772                         "\x58\x73\x8e\xa9\xc4\xdf\xfa\x15"
10773                         "\x30\x4b\x66\x81\x9c\xb7\xd2\xed"
10774                         "\x08\x23\x3e\x59\x74\x8f\xaa\xc5"
10775                         "\xe0\xfb\x16\x31\x4c\x67\x82\x9d"
10776                         "\xb8\xd3\xee\x09\x24\x3f\x5a\x75"
10777                         "\x90\xab\xc6\xe1\xfc\x17\x32\x4d"
10778                         "\x68\x83\x9e\xb9\xd4\xef\x0a\x25"
10779                         "\x40\x5b\x76\x91\xac\xc7\xe2\xfd"
10780                         "\x18\x33\x4e\x69\x84\x9f\xba\xd5"
10781                         "\xf0\x0b\x26\x41\x5c\x77\x92\xad"
10782                         "\xc8\xe3\xfe\x19\x34\x4f\x6a\x85"
10783                         "\xa0\xbb\xd6\xf1\x0c\x27\x42\x5d"
10784                         "\x78\x93\xae\xc9\xe4\xff\x1a\x35"
10785                         "\x50\x6b\x86\xa1\xbc\xd7\xf2\x0d"
10786                         "\x28\x43\x5e\x79\x94\xaf\xca\xe5"
10787                         "\x00\x1d\x3a\x57\x74\x91\xae\xcb"
10788                         "\xe8\x05\x22\x3f\x5c\x79\x96\xb3"
10789                         "\xd0\xed\x0a\x27\x44\x61\x7e\x9b"
10790                         "\xb8\xd5\xf2\x0f\x2c\x49\x66\x83"
10791                         "\xa0\xbd\xda\xf7\x14\x31\x4e\x6b"
10792                         "\x88\xa5\xc2\xdf\xfc\x19\x36\x53"
10793                         "\x70\x8d\xaa\xc7\xe4\x01\x1e\x3b"
10794                         "\x58\x75\x92\xaf\xcc\xe9\x06\x23"
10795                         "\x40\x5d\x7a\x97\xb4\xd1\xee\x0b"
10796                         "\x28\x45\x62\x7f\x9c\xb9\xd6\xf3"
10797                         "\x10\x2d\x4a\x67\x84\xa1\xbe\xdb"
10798                         "\xf8\x15\x32\x4f\x6c\x89\xa6\xc3"
10799                         "\xe0\xfd\x1a\x37\x54\x71\x8e\xab"
10800                         "\xc8\xe5\x02\x1f\x3c\x59\x76\x93"
10801                         "\xb0\xcd\xea\x07\x24\x41\x5e\x7b"
10802                         "\x98\xb5\xd2\xef\x0c\x29\x46\x63"
10803                         "\x80\x9d\xba\xd7\xf4\x11\x2e\x4b"
10804                         "\x68\x85\xa2\xbf\xdc\xf9\x16\x33"
10805                         "\x50\x6d\x8a\xa7\xc4\xe1\xfe\x1b"
10806                         "\x38\x55\x72\x8f\xac\xc9\xe6\x03"
10807                         "\x20\x3d\x5a\x77\x94\xb1\xce\xeb"
10808                         "\x08\x25\x42\x5f\x7c\x99\xb6\xd3"
10809                         "\xf0\x0d\x2a\x47\x64\x81\x9e\xbb"
10810                         "\xd8\xf5\x12\x2f\x4c\x69\x86\xa3"
10811                         "\xc0\xdd\xfa\x17\x34\x51\x6e\x8b"
10812                         "\xa8\xc5\xe2\xff\x1c\x39\x56\x73"
10813                         "\x90\xad\xca\xe7\x04\x21\x3e\x5b"
10814                         "\x78\x95\xb2\xcf\xec\x09\x26\x43"
10815                         "\x60\x7d\x9a\xb7\xd4\xf1\x0e\x2b"
10816                         "\x48\x65\x82\x9f\xbc\xd9\xf6\x13"
10817                         "\x30\x4d\x6a\x87\xa4\xc1\xde\xfb"
10818                         "\x18\x35\x52\x6f\x8c\xa9\xc6\xe3"
10819                         "\x00\x1f\x3e\x5d\x7c\x9b\xba\xd9"
10820                         "\xf8\x17\x36\x55\x74\x93\xb2\xd1"
10821                         "\xf0\x0f\x2e\x4d\x6c\x8b\xaa\xc9"
10822                         "\xe8\x07\x26\x45\x64\x83\xa2\xc1"
10823                         "\xe0\xff\x1e\x3d\x5c\x7b\x9a\xb9"
10824                         "\xd8\xf7\x16\x35\x54\x73\x92\xb1"
10825                         "\xd0\xef\x0e\x2d\x4c\x6b\x8a\xa9"
10826                         "\xc8\xe7\x06\x25\x44\x63\x82\xa1"
10827                         "\xc0\xdf\xfe\x1d\x3c\x5b\x7a\x99"
10828                         "\xb8\xd7\xf6\x15\x34\x53\x72\x91"
10829                         "\xb0\xcf\xee\x0d\x2c\x4b\x6a\x89"
10830                         "\xa8\xc7\xe6\x05\x24\x43\x62\x81"
10831                         "\xa0\xbf\xde\xfd\x1c\x3b\x5a\x79"
10832                         "\x98\xb7\xd6\xf5\x14\x33\x52\x71"
10833                         "\x90\xaf\xce\xed\x0c\x2b\x4a\x69"
10834                         "\x88\xa7\xc6\xe5\x04\x23\x42\x61"
10835                         "\x80\x9f\xbe\xdd\xfc\x1b\x3a\x59"
10836                         "\x78\x97\xb6\xd5\xf4\x13\x32\x51"
10837                         "\x70\x8f\xae\xcd\xec\x0b\x2a\x49"
10838                         "\x68\x87\xa6\xc5\xe4\x03\x22\x41"
10839                         "\x60\x7f\x9e\xbd\xdc\xfb\x1a\x39"
10840                         "\x58\x77\x96\xb5\xd4\xf3\x12\x31"
10841                         "\x50\x6f\x8e\xad\xcc\xeb\x0a\x29"
10842                         "\x48\x67\x86\xa5\xc4\xe3\x02\x21"
10843                         "\x40\x5f\x7e\x9d\xbc\xdb\xfa\x19"
10844                         "\x38\x57\x76\x95\xb4\xd3\xf2\x11"
10845                         "\x30\x4f\x6e\x8d\xac\xcb\xea\x09"
10846                         "\x28\x47\x66\x85\xa4\xc3\xe2\x01"
10847                         "\x20\x3f\x5e\x7d\x9c\xbb\xda\xf9"
10848                         "\x18\x37\x56\x75\x94\xb3\xd2\xf1"
10849                         "\x10\x2f\x4e\x6d\x8c\xab\xca\xe9"
10850                         "\x08\x27\x46\x65\x84\xa3\xc2\xe1"
10851                         "\x00\x21\x42\x63",
10852                 .ilen = 4100,
10853                 .result =
10854                         "\xb5\x81\xf5\x64\x18\x73\xe3\xf0"
10855                         "\x4c\x13\xf2\x77\x18\x60\x65\x5e"
10856                         "\x29\x01\xce\x98\x55\x53\xf9\x0c"
10857                         "\x2a\x08\xd5\x09\xb3\x57\x55\x56"
10858                         "\xc5\xe9\x56\x90\xcb\x6a\xa3\xc0"
10859                         "\xff\xc4\x79\xb4\xd2\x97\x5d\xc4"
10860                         "\x43\xd1\xfe\x94\x7b\x88\x06\x5a"
10861                         "\xb2\x9e\x2c\xfc\x44\x03\xb7\x90"
10862                         "\xa0\xc1\xba\x6a\x33\xb8\xc7\xb2"
10863                         "\x9d\xe1\x12\x4f\xc0\x64\xd4\x01"
10864                         "\xfe\x8c\x7a\x66\xf7\xe6\x5a\x91"
10865                         "\xbb\xde\x56\x86\xab\x65\x21\x30"
10866                         "\x00\x84\x65\x24\xa5\x7d\x85\xb4"
10867                         "\xe3\x17\xed\x3a\xb7\x6f\xb4\x0b"
10868                         "\x0b\xaf\x15\xae\x5a\x8f\xf2\x0c"
10869                         "\x2f\x27\xf4\x09\xd8\xd2\x96\xb7"
10870                         "\x71\xf2\xc5\x99\x4d\x7e\x7f\x75"
10871                         "\x77\x89\x30\x8b\x59\xdb\xa2\xb2"
10872                         "\xa0\xf3\x19\x39\x2b\xc5\x7e\x3f"
10873                         "\x4f\xd9\xd3\x56\x28\x97\x44\xdc"
10874                         "\xc0\x8b\x77\x24\xd9\x52\xe7\xc5"
10875                         "\xaf\xf6\x7d\x59\xb2\x44\x05\x1d"
10876                         "\xb1\xb0\x11\xa5\x0f\xec\x33\xe1"
10877                         "\x6d\x1b\x4e\x1f\xff\x57\x91\xb4"
10878                         "\x5b\x9a\x96\xc5\x53\xbc\xae\x20"
10879                         "\x3c\xbb\x14\xe2\xe8\x22\x33\xc1"
10880                         "\x5e\x76\x9e\x46\x99\xf6\x2a\x15"
10881                         "\xc6\x97\x02\xa0\x66\x43\xd1\xa6"
10882                         "\x31\xa6\x9f\xfb\xf4\xd3\x69\xe5"
10883                         "\xcd\x76\x95\xb8\x7a\x82\x7f\x21"
10884                         "\x45\xff\x3f\xce\x55\xf6\x95\x10"
10885                         "\x08\x77\x10\x43\xc6\xf3\x09\xe5"
10886                         "\x68\xe7\x3c\xad\x00\x52\x45\x0d"
10887                         "\xfe\x2d\xc6\xc2\x94\x8c\x12\x1d"
10888                         "\xe6\x25\xae\x98\x12\x8e\x19\x9c"
10889                         "\x81\x68\xb1\x11\xf6\x69\xda\xe3"
10890                         "\x62\x08\x18\x7a\x25\x49\x28\xac"
10891                         "\xba\x71\x12\x0b\xe4\xa2\xe5\xc7"
10892                         "\x5d\x8e\xec\x49\x40\x21\xbf\x5a"
10893                         "\x98\xf3\x02\x68\x55\x03\x7f\x8a"
10894                         "\xe5\x94\x0c\x32\x5c\x07\x82\x63"
10895                         "\xaf\x6f\x91\x40\x84\x8e\x52\x25"
10896                         "\xd0\xb0\x29\x53\x05\xe2\x50\x7a"
10897                         "\x34\xeb\xc9\x46\x20\xa8\x3d\xde"
10898                         "\x7f\x16\x5f\x36\xc5\x2e\xdc\xd1"
10899                         "\x15\x47\xc7\x50\x40\x6d\x91\xc5"
10900                         "\xe7\x93\x95\x1a\xd3\x57\xbc\x52"
10901                         "\x33\xee\x14\x19\x22\x52\x89\xa7"
10902                         "\x4a\x25\x56\x77\x4b\xca\xcf\x0a"
10903                         "\xe1\xf5\x35\x85\x30\x7e\x59\x4a"
10904                         "\xbd\x14\x5b\xdf\xe3\x46\xcb\xac"
10905                         "\x1f\x6c\x96\x0e\xf4\x81\xd1\x99"
10906                         "\xca\x88\x63\x3d\x02\x58\x6b\xa9"
10907                         "\xe5\x9f\xb3\x00\xb2\x54\xc6\x74"
10908                         "\x1c\xbf\x46\xab\x97\xcc\xf8\x54"
10909                         "\x04\x07\x08\x52\xe6\xc0\xda\x93"
10910                         "\x74\x7d\x93\x99\x5d\x78\x68\xa6"
10911                         "\x2e\x6b\xd3\x6a\x69\xcc\x12\x6b"
10912                         "\xd4\xc7\xa5\xc6\xe7\xf6\x03\x04"
10913                         "\x5d\xcd\x61\x5e\x17\x40\xdc\xd1"
10914                         "\x5c\xf5\x08\xdf\x5c\x90\x85\xa4"
10915                         "\xaf\xf6\x78\xbb\x0d\xf1\xf4\xa4"
10916                         "\x54\x26\x72\x9e\x61\xfa\x86\xcf"
10917                         "\xe8\x9e\xa1\xe0\xc7\x48\x23\xae"
10918                         "\x5a\x90\xae\x75\x0a\x74\x18\x89"
10919                         "\x05\xb1\x92\xb2\x7f\xd0\x1b\xa6"
10920                         "\x62\x07\x25\x01\xc7\xc2\x4f\xf9"
10921                         "\xe8\xfe\x63\x95\x80\x07\xb4\x26"
10922                         "\xcc\xd1\x26\xb6\xc4\x3f\x9e\xcb"
10923                         "\x8e\x3b\x2e\x44\x16\xd3\x10\x9a"
10924                         "\x95\x08\xeb\xc8\xcb\xeb\xbf\x6f"
10925                         "\x0b\xcd\x1f\xc8\xca\x86\xaa\xec"
10926                         "\x33\xe6\x69\xf4\x45\x25\x86\x3a"
10927                         "\x22\x94\x4f\x00\x23\x6a\x44\xc2"
10928                         "\x49\x97\x33\xab\x36\x14\x0a\x70"
10929                         "\x24\xc3\xbe\x04\x3b\x79\xa0\xf9"
10930                         "\xb8\xe7\x76\x29\x22\x83\xd7\xf2"
10931                         "\x94\xf4\x41\x49\xba\x5f\x7b\x07"
10932                         "\xb5\xfb\xdb\x03\x1a\x9f\xb6\x4c"
10933                         "\xc2\x2e\x37\x40\x49\xc3\x38\x16"
10934                         "\xe2\x4f\x77\x82\xb0\x68\x4c\x71"
10935                         "\x1d\x57\x61\x9c\xd9\x4e\x54\x99"
10936                         "\x47\x13\x28\x73\x3c\xbb\x00\x90"
10937                         "\xf3\x4d\xc9\x0e\xfd\xe7\xb1\x71"
10938                         "\xd3\x15\x79\xbf\xcc\x26\x2f\xbd"
10939                         "\xad\x6c\x50\x69\x6c\x3e\x6d\x80"
10940                         "\x9a\xea\x78\xaf\x19\xb2\x0d\x4d"
10941                         "\xad\x04\x07\xae\x22\x90\x4a\x93"
10942                         "\x32\x0e\x36\x9b\x1b\x46\xba\x3b"
10943                         "\xb4\xac\xc6\xd1\xa2\x31\x53\x3b"
10944                         "\x2a\x3d\x45\xfe\x03\x61\x10\x85"
10945                         "\x17\x69\xa6\x78\xcc\x6c\x87\x49"
10946                         "\x53\xf9\x80\x10\xde\x80\xa2\x41"
10947                         "\x6a\xc3\x32\x02\xad\x6d\x3c\x56"
10948                         "\x00\x71\x51\x06\xa7\xbd\xfb\xef"
10949                         "\x3c\xb5\x9f\xfc\x48\x7d\x53\x7c"
10950                         "\x66\xb0\x49\x23\xc4\x47\x10\x0e"
10951                         "\xe5\x6c\x74\x13\xe6\xc5\x3f\xaa"
10952                         "\xde\xff\x07\x44\xdd\x56\x1b\xad"
10953                         "\x09\x77\xfb\x5b\x12\xb8\x0d\x38"
10954                         "\x17\x37\x35\x7b\x9b\xbc\xfe\xd4"
10955                         "\x7e\x8b\xda\x7e\x5b\x04\xa7\x22"
10956                         "\xa7\x31\xa1\x20\x86\xc7\x1b\x99"
10957                         "\xdb\xd1\x89\xf4\x94\xa3\x53\x69"
10958                         "\x8d\xe7\xe8\x74\x11\x8d\x74\xd6"
10959                         "\x07\x37\x91\x9f\xfd\x67\x50\x3a"
10960                         "\xc9\xe1\xf4\x36\xd5\xa0\x47\xd1"
10961                         "\xf9\xe5\x39\xa3\x31\xac\x07\x36"
10962                         "\x23\xf8\x66\x18\x14\x28\x34\x0f"
10963                         "\xb8\xd0\xe7\x29\xb3\x04\x4b\x55"
10964                         "\x01\x41\xb2\x75\x8d\xcb\x96\x85"
10965                         "\x3a\xfb\xab\x2b\x9e\xfa\x58\x20"
10966                         "\x44\x1f\xc0\x14\x22\x75\x61\xe8"
10967                         "\xaa\x19\xcf\xf1\x82\x56\xf4\xd7"
10968                         "\x78\x7b\x3d\x5f\xb3\x9e\x0b\x8a"
10969                         "\x57\x50\xdb\x17\x41\x65\x4d\xa3"
10970                         "\x02\xc9\x9c\x9c\x53\xfb\x39\x39"
10971                         "\x9b\x1d\x72\x24\xda\xb7\x39\xbe"
10972                         "\x13\x3b\xfa\x29\xda\x9e\x54\x64"
10973                         "\x6e\xba\xd8\xa1\xcb\xb3\x36\xfa"
10974                         "\xcb\x47\x85\xe9\x61\x38\xbc\xbe"
10975                         "\xc5\x00\x38\x2a\x54\xf7\xc4\xb9"
10976                         "\xb3\xd3\x7b\xa0\xa0\xf8\x72\x7f"
10977                         "\x8c\x8e\x82\x0e\xc6\x1c\x75\x9d"
10978                         "\xca\x8e\x61\x87\xde\xad\x80\xd2"
10979                         "\xf5\xf9\x80\xef\x15\x75\xaf\xf5"
10980                         "\x80\xfb\xff\x6d\x1e\x25\xb7\x40"
10981                         "\x61\x6a\x39\x5a\x6a\xb5\x31\xab"
10982                         "\x97\x8a\x19\x89\x44\x40\xc0\xa6"
10983                         "\xb4\x4e\x30\x32\x7b\x13\xe7\x67"
10984                         "\xa9\x8b\x57\x04\xc2\x01\xa6\xf4"
10985                         "\x28\x99\xad\x2c\x76\xa3\x78\xc2"
10986                         "\x4a\xe6\xca\x5c\x50\x6a\xc1\xb0"
10987                         "\x62\x4b\x10\x8e\x7c\x17\x43\xb3"
10988                         "\x17\x66\x1c\x3e\x8d\x69\xf0\x5a"
10989                         "\x71\xf5\x97\xdc\xd1\x45\xdd\x28"
10990                         "\xf3\x5d\xdf\x53\x7b\x11\xe5\xbc"
10991                         "\x4c\xdb\x1b\x51\x6b\xe9\xfb\x3d"
10992                         "\xc1\xc3\x2c\xb9\x71\xf5\xb6\xb2"
10993                         "\x13\x36\x79\x80\x53\xe8\xd3\xa6"
10994                         "\x0a\xaf\xfd\x56\x97\xf7\x40\x8e"
10995                         "\x45\xce\xf8\xb0\x9e\x5c\x33\x82"
10996                         "\xb0\x44\x56\xfc\x05\x09\xe9\x2a"
10997                         "\xac\x26\x80\x14\x1d\xc8\x3a\x35"
10998                         "\x4c\x82\x97\xfd\x76\xb7\xa9\x0a"
10999                         "\x35\x58\x79\x8e\x0f\x66\xea\xaf"
11000                         "\x51\x6c\x09\xa9\x6e\x9b\xcb\x9a"
11001                         "\x31\x47\xa0\x2f\x7c\x71\xb4\x4a"
11002                         "\x11\xaa\x8c\x66\xc5\x64\xe6\x3a"
11003                         "\x54\xda\x24\x6a\xc4\x41\x65\x46"
11004                         "\x82\xa0\x0a\x0f\x5f\xfb\x25\xd0"
11005                         "\x2c\x91\xa7\xee\xc4\x81\x07\x86"
11006                         "\x75\x5e\x33\x69\x97\xe4\x2c\xa8"
11007                         "\x9d\x9f\x0b\x6a\xbe\xad\x98\xda"
11008                         "\x6d\x94\x41\xda\x2c\x1e\x89\xc4"
11009                         "\xc2\xaf\x1e\x00\x05\x0b\x83\x60"
11010                         "\xbd\x43\xea\x15\x23\x7f\xb9\xac"
11011                         "\xee\x4f\x2c\xaf\x2a\xf3\xdf\xd0"
11012                         "\xf3\x19\x31\xbb\x4a\x74\x84\x17"
11013                         "\x52\x32\x2c\x7d\x61\xe4\xcb\xeb"
11014                         "\x80\x38\x15\x52\xcb\x6f\xea\xe5"
11015                         "\x73\x9c\xd9\x24\x69\xc6\x95\x32"
11016                         "\x21\xc8\x11\xe4\xdc\x36\xd7\x93"
11017                         "\x38\x66\xfb\xb2\x7f\x3a\xb9\xaf"
11018                         "\x31\xdd\x93\x75\x78\x8a\x2c\x94"
11019                         "\x87\x1a\x58\xec\x9e\x7d\x4d\xba"
11020                         "\xe1\xe5\x4d\xfc\xbc\xa4\x2a\x14"
11021                         "\xef\xcc\xa7\xec\xab\x43\x09\x18"
11022                         "\xd3\xab\x68\xd1\x07\x99\x44\x47"
11023                         "\xd6\x83\x85\x3b\x30\xea\xa9\x6b"
11024                         "\x63\xea\xc4\x07\xfb\x43\x2f\xa4"
11025                         "\xaa\xb0\xab\x03\x89\xce\x3f\x8c"
11026                         "\x02\x7c\x86\x54\xbc\x88\xaf\x75"
11027                         "\xd2\xdc\x63\x17\xd3\x26\xf6\x96"
11028                         "\xa9\x3c\xf1\x61\x8c\x11\x18\xcc"
11029                         "\xd6\xea\x5b\xe2\xcd\xf0\xf1\xb2"
11030                         "\xe5\x35\x90\x1f\x85\x4c\x76\x5b"
11031                         "\x66\xce\x44\xa4\x32\x9f\xe6\x7b"
11032                         "\x71\x6e\x9f\x58\x15\x67\x72\x87"
11033                         "\x64\x8e\x3a\x44\x45\xd4\x76\xfa"
11034                         "\xc2\xf6\xef\x85\x05\x18\x7a\x9b"
11035                         "\xba\x41\x54\xac\xf0\xfc\x59\x12"
11036                         "\x3f\xdf\xa0\xe5\x8a\x65\xfd\x3a"
11037                         "\x62\x8d\x83\x2c\x03\xbe\x05\x76"
11038                         "\x2e\x53\x49\x97\x94\x33\xae\x40"
11039                         "\x81\x15\xdb\x6e\xad\xaa\xf5\x4b"
11040                         "\xe3\x98\x70\xdf\xe0\x7c\xcd\xdb"
11041                         "\x02\xd4\x7d\x2f\xc1\xe6\xb4\xf3"
11042                         "\xd7\x0d\x7a\xd9\x23\x9e\x87\x2d"
11043                         "\xce\x87\xad\xcc\x72\x05\x00\x29"
11044                         "\xdc\x73\x7f\x64\xc1\x15\x0e\xc2"
11045                         "\xdf\xa7\x5f\xeb\x41\xa1\xcd\xef"
11046                         "\x5c\x50\x79\x2a\x56\x56\x71\x8c"
11047                         "\xac\xc0\x79\x50\x69\xca\x59\x32"
11048                         "\x65\xf2\x54\xe4\x52\x38\x76\xd1"
11049                         "\x5e\xde\x26\x9e\xfb\x75\x2e\x11"
11050                         "\xb5\x10\xf4\x17\x73\xf5\x89\xc7"
11051                         "\x4f\x43\x5c\x8e\x7c\xb9\x05\x52"
11052                         "\x24\x40\x99\xfe\x9b\x85\x0b\x6c"
11053                         "\x22\x3e\x8b\xae\x86\xa1\xd2\x79"
11054                         "\x05\x68\x6b\xab\xe3\x41\x49\xed"
11055                         "\x15\xa1\x8d\x40\x2d\x61\xdf\x1a"
11056                         "\x59\xc9\x26\x8b\xef\x30\x4c\x88"
11057                         "\x4b\x10\xf8\x8d\xa6\x92\x9f\x4b"
11058                         "\xf3\xc4\x53\x0b\x89\x5d\x28\x92"
11059                         "\xcf\x78\xb2\xc0\x5d\xed\x7e\xfc"
11060                         "\xc0\x12\x23\x5f\x5a\x78\x86\x43"
11061                         "\x6e\x27\xf7\x5a\xa7\x6a\xed\x19"
11062                         "\x04\xf0\xb3\x12\xd1\xbd\x0e\x89"
11063                         "\x6e\xbc\x96\xa8\xd8\x49\x39\x9f"
11064                         "\x7e\x67\xf0\x2e\x3e\x01\xa9\xba"
11065                         "\xec\x8b\x62\x8e\xcb\x4a\x70\x43"
11066                         "\xc7\xc2\xc4\xca\x82\x03\x73\xe9"
11067                         "\x11\xdf\xcf\x54\xea\xc9\xb0\x95"
11068                         "\x51\xc0\x13\x3d\x92\x05\xfa\xf4"
11069                         "\xa9\x34\xc8\xce\x6c\x3d\x54\xcc"
11070                         "\xc4\xaf\xf1\xdc\x11\x44\x26\xa2"
11071                         "\xaf\xf1\x85\x75\x7d\x03\x61\x68"
11072                         "\x4e\x78\xc6\x92\x7d\x86\x7d\x77"
11073                         "\xdc\x71\x72\xdb\xc6\xae\xa1\xcb"
11074                         "\x70\x9a\x0b\x19\xbe\x4a\x6c\x2a"
11075                         "\xe2\xba\x6c\x64\x9a\x13\x28\xdf"
11076                         "\x85\x75\xe6\x43\xf6\x87\x08\x68"
11077                         "\x6e\xba\x6e\x79\x9f\x04\xbc\x23"
11078                         "\x50\xf6\x33\x5c\x1f\x24\x25\xbe"
11079                         "\x33\x47\x80\x45\x56\xa3\xa7\xd7"
11080                         "\x7a\xb1\x34\x0b\x90\x3c\x9c\xad"
11081                         "\x44\x5f\x9e\x0e\x9d\xd4\xbd\x93"
11082                         "\x5e\xfa\x3c\xe0\xb0\xd9\xed\xf3"
11083                         "\xd6\x2e\xff\x24\xd8\x71\x6c\xed"
11084                         "\xaf\x55\xeb\x22\xac\x93\x68\x32"
11085                         "\x05\x5b\x47\xdd\xc6\x4a\xcb\xc7"
11086                         "\x10\xe1\x3c\x92\x1a\xf3\x23\x78"
11087                         "\x2b\xa1\xd2\x80\xf4\x12\xb1\x20"
11088                         "\x8f\xff\x26\x35\xdd\xfb\xc7\x4e"
11089                         "\x78\xf1\x2d\x50\x12\x77\xa8\x60"
11090                         "\x7c\x0f\xf5\x16\x2f\x63\x70\x2a"
11091                         "\xc0\x96\x80\x4e\x0a\xb4\x93\x35"
11092                         "\x5d\x1d\x3f\x56\xf7\x2f\xbb\x90"
11093                         "\x11\x16\x8f\xa2\xec\x47\xbe\xac"
11094                         "\x56\x01\x26\x56\xb1\x8c\xb2\x10"
11095                         "\xf9\x1a\xca\xf5\xd1\xb7\x39\x20"
11096                         "\x63\xf1\x69\x20\x4f\x13\x12\x1f"
11097                         "\x5b\x65\xfc\x98\xf7\xc4\x7a\xbe"
11098                         "\xf7\x26\x4d\x2b\x84\x7b\x42\xad"
11099                         "\xd8\x7a\x0a\xb4\xd8\x74\xbf\xc1"
11100                         "\xf0\x6e\xb4\x29\xa3\xbb\xca\x46"
11101                         "\x67\x70\x6a\x2d\xce\x0e\xa2\x8a"
11102                         "\xa9\x87\xbf\x05\xc4\xc1\x04\xa3"
11103                         "\xab\xd4\x45\x43\x8c\xb6\x02\xb0"
11104                         "\x41\xc8\xfc\x44\x3d\x59\xaa\x2e"
11105                         "\x44\x21\x2a\x8d\x88\x9d\x57\xf4"
11106                         "\xa0\x02\x77\xb8\xa6\xa0\xe6\x75"
11107                         "\x5c\x82\x65\x3e\x03\x5c\x29\x8f"
11108                         "\x38\x55\xab\x33\x26\xef\x9f\x43"
11109                         "\x52\xfd\x68\xaf\x36\xb4\xbb\x9a"
11110                         "\x58\x09\x09\x1b\xc3\x65\x46\x46"
11111                         "\x1d\xa7\x94\x18\x23\x50\x2c\xca"
11112                         "\x2c\x55\x19\x97\x01\x9d\x93\x3b"
11113                         "\x63\x86\xf2\x03\x67\x45\xd2\x72"
11114                         "\x28\x52\x6c\xf4\xe3\x1c\xb5\x11"
11115                         "\x13\xf1\xeb\x21\xc7\xd9\x56\x82"
11116                         "\x2b\x82\x39\xbd\x69\x54\xed\x62"
11117                         "\xc3\xe2\xde\x73\xd4\x6a\x12\xae"
11118                         "\x13\x21\x7f\x4b\x5b\xfc\xbf\xe8"
11119                         "\x2b\xbe\x56\xba\x68\x8b\x9a\xb1"
11120                         "\x6e\xfa\xbf\x7e\x5a\x4b\xf1\xac"
11121                         "\x98\x65\x85\xd1\x93\x53\xd3\x7b"
11122                         "\x09\xdd\x4b\x10\x6d\x84\xb0\x13"
11123                         "\x65\xbd\xcf\x52\x09\xc4\x85\xe2"
11124                         "\x84\x74\x15\x65\xb7\xf7\x51\xaf"
11125                         "\x55\xad\xa4\xd1\x22\x54\x70\x94"
11126                         "\xa0\x1c\x90\x41\xfd\x99\xd7\x5a"
11127                         "\x31\xef\xaa\x25\xd0\x7f\x4f\xea"
11128                         "\x1d\x55\x42\xe5\x49\xb0\xd0\x46"
11129                         "\x62\x36\x43\xb2\x82\x15\x75\x50"
11130                         "\xa4\x72\xeb\x54\x27\x1f\x8a\xe4"
11131                         "\x7d\xe9\x66\xc5\xf1\x53\xa4\xd1"
11132                         "\x0c\xeb\xb8\xf8\xbc\xd4\xe2\xe7"
11133                         "\xe1\xf8\x4b\xcb\xa9\xa1\xaf\x15"
11134                         "\x83\xcb\x72\xd0\x33\x79\x00\x2d"
11135                         "\x9f\xd7\xf1\x2e\x1e\x10\xe4\x45"
11136                         "\xc0\x75\x3a\x39\xea\x68\xf7\x5d"
11137                         "\x1b\x73\x8f\xe9\x8e\x0f\x72\x47"
11138                         "\xae\x35\x0a\x31\x7a\x14\x4d\x4a"
11139                         "\x6f\x47\xf7\x7e\x91\x6e\x74\x8b"
11140                         "\x26\x47\xf9\xc3\xf9\xde\x70\xf5"
11141                         "\x61\xab\xa9\x27\x9f\x82\xe4\x9c"
11142                         "\x89\x91\x3f\x2e\x6a\xfd\xb5\x49"
11143                         "\xe9\xfd\x59\x14\x36\x49\x40\x6d"
11144                         "\x32\xd8\x85\x42\xf3\xa5\xdf\x0c"
11145                         "\xa8\x27\xd7\x54\xe2\x63\x2f\xf2"
11146                         "\x7e\x8b\x8b\xe7\xf1\x9a\x95\x35"
11147                         "\x43\xdc\x3a\xe4\xb6\xf4\xd0\xdf"
11148                         "\x9c\xcb\x94\xf3\x21\xa0\x77\x50"
11149                         "\xe2\xc6\xc4\xc6\x5f\x09\x64\x5b"
11150                         "\x92\x90\xd8\xe1\xd1\xed\x4b\x42"
11151                         "\xd7\x37\xaf\x65\x3d\x11\x39\xb6"
11152                         "\x24\x8a\x60\xae\xd6\x1e\xbf\x0e"
11153                         "\x0d\xd7\xdc\x96\x0e\x65\x75\x4e"
11154                         "\x29\x06\x9d\xa4\x51\x3a\x10\x63"
11155                         "\x8f\x17\x07\xd5\x8e\x3c\xf4\x28"
11156                         "\x00\x5a\x5b\x05\x19\xd8\xc0\x6c"
11157                         "\xe5\x15\xe4\x9c\x9d\x71\x9d\x5e"
11158                         "\x94\x29\x1a\xa7\x80\xfa\x0e\x33"
11159                         "\x03\xdd\xb7\x3e\x9a\xa9\x26\x18"
11160                         "\x37\xa9\x64\x08\x4d\x94\x5a\x88"
11161                         "\xca\x35\xce\x81\x02\xe3\x1f\x1b"
11162                         "\x89\x1a\x77\x85\xe3\x41\x6d\x32"
11163                         "\x42\x19\x23\x7d\xc8\x73\xee\x25"
11164                         "\x85\x0d\xf8\x31\x25\x79\x1b\x6f"
11165                         "\x79\x25\xd2\xd8\xd4\x23\xfd\xf7"
11166                         "\x82\x36\x6a\x0c\x46\x22\x15\xe9"
11167                         "\xff\x72\x41\x91\x91\x7d\x3a\xb7"
11168                         "\xdd\x65\x99\x70\xf6\x8d\x84\xf8"
11169                         "\x67\x15\x20\x11\xd6\xb2\x55\x7b"
11170                         "\xdb\x87\xee\xef\x55\x89\x2a\x59"
11171                         "\x2b\x07\x8f\x43\x8a\x59\x3c\x01"
11172                         "\x8b\x65\x54\xa1\x66\xd5\x38\xbd"
11173                         "\xc6\x30\xa9\xcc\x49\xb6\xa8\x1b"
11174                         "\xb8\xc0\x0e\xe3\x45\x28\xe2\xff"
11175                         "\x41\x9f\x7e\x7c\xd1\xae\x9e\x25"
11176                         "\x3f\x4c\x7c\x7c\xf4\xa8\x26\x4d"
11177                         "\x5c\xfd\x4b\x27\x18\xf9\x61\x76"
11178                         "\x48\xba\x0c\x6b\xa9\x4d\xfc\xf5"
11179                         "\x3b\x35\x7e\x2f\x4a\xa9\xc2\x9a"
11180                         "\xae\xab\x86\x09\x89\xc9\xc2\x40"
11181                         "\x39\x2c\x81\xb3\xb8\x17\x67\xc2"
11182                         "\x0d\x32\x4a\x3a\x67\x81\xd7\x1a"
11183                         "\x34\x52\xc5\xdb\x0a\xf5\x63\x39"
11184                         "\xea\x1f\xe1\x7c\xa1\x9e\xc1\x35"
11185                         "\xe3\xb1\x18\x45\x67\xf9\x22\x38"
11186                         "\x95\xd9\x34\x34\x86\xc6\x41\x94"
11187                         "\x15\xf9\x5b\x41\xa6\x87\x8b\xf8"
11188                         "\xd5\xe1\x1b\xe2\x5b\xf3\x86\x10"
11189                         "\xff\xe6\xae\x69\x76\xbc\x0d\xb4"
11190                         "\x09\x90\x0c\xa2\x65\x0c\xad\x74"
11191                         "\xf5\xd7\xff\xda\xc1\xce\x85\xbe"
11192                         "\x00\xa7\xff\x4d\x2f\x65\xd3\x8c"
11193                         "\x86\x2d\x05\xe8\xed\x3e\x6b\x8b"
11194                         "\x0f\x3d\x83\x8c\xf1\x1d\x5b\x96"
11195                         "\x2e\xb1\x9c\xc2\x98\xe1\x70\xb9"
11196                         "\xba\x5c\x8a\x43\xd6\x34\xa7\x2d"
11197                         "\xc9\x92\xae\xf2\xa5\x7b\x05\x49"
11198                         "\xa7\x33\x34\x86\xca\xe4\x96\x23"
11199                         "\x76\x5b\xf2\xc6\xf1\x51\x28\x42"
11200                         "\x7b\xcc\x76\x8f\xfa\xa2\xad\x31"
11201                         "\xd4\xd6\x7a\x6d\x25\x25\x54\xe4"
11202                         "\x3f\x50\x59\xe1\x5c\x05\xb7\x27"
11203                         "\x48\xbf\x07\xec\x1b\x13\xbe\x2b"
11204                         "\xa1\x57\x2b\xd5\xab\xd7\xd0\x4c"
11205                         "\x1e\xcb\x71\x9b\xc5\x90\x85\xd3"
11206                         "\xde\x59\xec\x71\xeb\x89\xbb\xd0"
11207                         "\x09\x50\xe1\x16\x3f\xfd\x1c\x34"
11208                         "\xc3\x1c\xa1\x10\x77\x53\x98\xef"
11209                         "\xf2\xfd\xa5\x01\x59\xc2\x9b\x26"
11210                         "\xc7\x42\xd9\x49\xda\x58\x2b\x6e"
11211                         "\x9f\x53\x19\x76\x7e\xd9\xc9\x0e"
11212                         "\x68\xc8\x7f\x51\x22\x42\xef\x49"
11213                         "\xa4\x55\xb6\x36\xac\x09\xc7\x31"
11214                         "\x88\x15\x4b\x2e\x8f\x3a\x08\xf7"
11215                         "\xd8\xf7\xa8\xc5\xa9\x33\xa6\x45"
11216                         "\xe4\xc4\x94\x76\xf3\x0d\x8f\x7e"
11217                         "\xc8\xf6\xbc\x23\x0a\xb6\x4c\xd3"
11218                         "\x6a\xcd\x36\xc2\x90\x5c\x5c\x3c"
11219                         "\x65\x7b\xc2\xd6\xcc\xe6\x0d\x87"
11220                         "\x73\x2e\x71\x79\x16\x06\x63\x28"
11221                         "\x09\x15\xd8\x89\x38\x38\x3d\xb5"
11222                         "\x42\x1c\x08\x24\xf7\x2a\xd2\x9d"
11223                         "\xc8\xca\xef\xf9\x27\xd8\x07\x86"
11224                         "\xf7\x43\x0b\x55\x15\x3f\x9f\x83"
11225                         "\xef\xdc\x49\x9d\x2a\xc1\x54\x62"
11226                         "\xbd\x9b\x66\x55\x9f\xb7\x12\xf3"
11227                         "\x1b\x4d\x9d\x2a\x5c\xed\x87\x75"
11228                         "\x87\x26\xec\x61\x2c\xb4\x0f\x89"
11229                         "\xb0\xfb\x2e\x68\x5d\x15\xc7\x8d"
11230                         "\x2e\xc0\xd9\xec\xaf\x4f\xd2\x25"
11231                         "\x29\xe8\xd2\x26\x2b\x67\xe9\xfc"
11232                         "\x2b\xa8\x67\x96\x12\x1f\x5b\x96"
11233                         "\xc6\x14\x53\xaf\x44\xea\xd6\xe2"
11234                         "\x94\x98\xe4\x12\x93\x4c\x92\xe0"
11235                         "\x18\xa5\x8d\x2d\xe4\x71\x3c\x47"
11236                         "\x4c\xf7\xe6\x47\x9e\xc0\x68\xdf"
11237                         "\xd4\xf5\x5a\x74\xb1\x2b\x29\x03"
11238                         "\x19\x07\xaf\x90\x62\x5c\x68\x98"
11239                         "\x48\x16\x11\x02\x9d\xee\xb4\x9b"
11240                         "\xe5\x42\x7f\x08\xfd\x16\x32\x0b"
11241                         "\xd0\xb3\xfa\x2b\xb7\x99\xf9\x29"
11242                         "\xcd\x20\x45\x9f\xb3\x1a\x5d\xa2"
11243                         "\xaf\x4d\xe0\xbd\x42\x0d\xbc\x74"
11244                         "\x99\x9c\x8e\x53\x1a\xb4\x3e\xbd"
11245                         "\xa2\x9a\x2d\xf7\xf8\x39\x0f\x67"
11246                         "\x63\xfc\x6b\xc0\xaf\xb3\x4b\x4f"
11247                         "\x55\xc4\xcf\xa7\xc8\x04\x11\x3e"
11248                         "\x14\x32\xbb\x1b\x38\x77\xd6\x7f"
11249                         "\x54\x4c\xdf\x75\xf3\x07\x2d\x33"
11250                         "\x9b\xa8\x20\xe1\x7b\x12\xb5\xf3"
11251                         "\xef\x2f\xce\x72\xe5\x24\x60\xc1"
11252                         "\x30\xe2\xab\xa1\x8e\x11\x09\xa8"
11253                         "\x21\x33\x44\xfe\x7f\x35\x32\x93"
11254                         "\x39\xa7\xad\x8b\x79\x06\xb2\xcb"
11255                         "\x4e\xa9\x5f\xc7\xba\x74\x29\xec"
11256                         "\x93\xa0\x4e\x54\x93\xc0\xbc\x55"
11257                         "\x64\xf0\x48\xe5\x57\x99\xee\x75"
11258                         "\xd6\x79\x0f\x66\xb7\xc6\x57\x76"
11259                         "\xf7\xb7\xf3\x9c\xc5\x60\xe8\x7f"
11260                         "\x83\x76\xd6\x0e\xaa\xe6\x90\x39"
11261                         "\x1d\xa6\x32\x6a\x34\xe3\x55\xf8"
11262                         "\x58\xa0\x58\x7d\x33\xe0\x22\x39"
11263                         "\x44\x64\x87\x86\x5a\x2f\xa7\x7e"
11264                         "\x0f\x38\xea\xb0\x30\xcc\x61\xa5"
11265                         "\x6a\x32\xae\x1e\xf7\xe9\xd0\xa9"
11266                         "\x0c\x32\x4b\xb5\x49\x28\xab\x85"
11267                         "\x2f\x8e\x01\x36\x38\x52\xd0\xba"
11268                         "\xd6\x02\x78\xf8\x0e\x3e\x9c\x8b"
11269                         "\x6b\x45\x99\x3f\x5c\xfe\x58\xf1"
11270                         "\x5c\x94\x04\xe1\xf5\x18\x6d\x51"
11271                         "\xb2\x5d\x18\x20\xb6\xc2\x9a\x42"
11272                         "\x1d\xb3\xab\x3c\xb6\x3a\x13\x03"
11273                         "\xb2\x46\x82\x4f\xfc\x64\xbc\x4f"
11274                         "\xca\xfa\x9c\xc0\xd5\xa7\xbd\x11"
11275                         "\xb7\xe4\x5a\xf6\x6f\x4d\x4d\x54"
11276                         "\xea\xa4\x98\x66\xd4\x22\x3b\xd3"
11277                         "\x8f\x34\x47\xd9\x7c\xf4\x72\x3b"
11278                         "\x4d\x02\x77\xf6\xd6\xdd\x08\x0a"
11279                         "\x81\xe1\x86\x89\x3e\x56\x10\x3c"
11280                         "\xba\xd7\x81\x8c\x08\xbc\x8b\xe2"
11281                         "\x53\xec\xa7\x89\xee\xc8\x56\xb5"
11282                         "\x36\x2c\xb2\x03\xba\x99\xdd\x7c"
11283                         "\x48\xa0\xb0\xbc\x91\x33\xe9\xa8"
11284                         "\xcb\xcd\xcf\x59\x5f\x1f\x15\xe2"
11285                         "\x56\xf5\x4e\x01\x35\x27\x45\x77"
11286                         "\x47\xc8\xbc\xcb\x7e\x39\xc1\x97"
11287                         "\x28\xd3\x84\xfc\x2c\x3e\xc8\xad"
11288                         "\x9c\xf8\x8a\x61\x9c\x28\xaa\xc5"
11289                         "\x99\x20\x43\x85\x9d\xa5\xe2\x8b"
11290                         "\xb8\xae\xeb\xd0\x32\x0d\x52\x78"
11291                         "\x09\x56\x3f\xc7\xd8\x7e\x26\xfc"
11292                         "\x37\xfb\x6f\x04\xfc\xfa\x92\x10"
11293                         "\xac\xf8\x3e\x21\xdc\x8c\x21\x16"
11294                         "\x7d\x67\x6e\xf6\xcd\xda\xb6\x98"
11295                         "\x23\xab\x23\x3c\xb2\x10\xa0\x53"
11296                         "\x5a\x56\x9f\xc5\xd0\xff\xbb\xe4"
11297                         "\x98\x3c\x69\x1e\xdb\x38\x8f\x7e"
11298                         "\x0f\xd2\x98\x88\x81\x8b\x45\x67"
11299                         "\xea\x33\xf1\xeb\xe9\x97\x55\x2e"
11300                         "\xd9\xaa\xeb\x5a\xec\xda\xe1\x68"
11301                         "\xa8\x9d\x3c\x84\x7c\x05\x3d\x62"
11302                         "\x87\x8f\x03\x21\x28\x95\x0c\x89"
11303                         "\x25\x22\x4a\xb0\x93\xa9\x50\xa2"
11304                         "\x2f\x57\x6e\x18\x42\x19\x54\x0c"
11305                         "\x55\x67\xc6\x11\x49\xf4\x5c\xd2"
11306                         "\xe9\x3d\xdd\x8b\x48\x71\x21\x00"
11307                         "\xc3\x9a\x6c\x85\x74\x28\x83\x4a"
11308                         "\x1b\x31\x05\xe1\x06\x92\xe7\xda"
11309                         "\x85\x73\x78\x45\x20\x7f\xae\x13"
11310                         "\x7c\x33\x06\x22\xf4\x83\xf9\x35"
11311                         "\x3f\x6c\x71\xa8\x4e\x48\xbe\x9b"
11312                         "\xce\x8a\xba\xda\xbe\x28\x08\xf7"
11313                         "\xe2\x14\x8c\x71\xea\x72\xf9\x33"
11314                         "\xf2\x88\x3f\xd7\xbb\x69\x6c\x29"
11315                         "\x19\xdc\x84\xce\x1f\x12\x4f\xc8"
11316                         "\xaf\xa5\x04\xba\x5a\xab\xb0\xd9"
11317                         "\x14\x1f\x6c\x68\x98\x39\x89\x7a"
11318                         "\xd9\xd8\x2f\xdf\xa8\x47\x4a\x25"
11319                         "\xe2\xfb\x33\xf4\x59\x78\xe1\x68"
11320                         "\x85\xcf\xfe\x59\x20\xd4\x05\x1d"
11321                         "\x80\x99\xae\xbc\xca\xae\x0f\x2f"
11322                         "\x65\x43\x34\x8e\x7e\xac\xd3\x93"
11323                         "\x2f\xac\x6d\x14\x3d\x02\x07\x70"
11324                         "\x9d\xa4\xf3\x1b\x5c\x36\xfc\x01"
11325                         "\x73\x34\x85\x0c\x6c\xd6\xf1\xbd"
11326                         "\x3f\xdf\xee\xf5\xd9\xba\x56\xef"
11327                         "\xf4\x9b\x6b\xee\x9f\x5a\x78\x6d"
11328                         "\x32\x19\xf4\xf7\xf8\x4c\x69\x0b"
11329                         "\x4b\xbc\xbb\xb7\xf2\x85\xaf\x70"
11330                         "\x75\x24\x6c\x54\xa7\x0e\x4d\x1d"
11331                         "\x01\xbf\x08\xac\xcf\x7f\x2c\xe3"
11332                         "\x14\x89\x5e\x70\x5a\x99\x92\xcd"
11333                         "\x01\x84\xc8\xd2\xab\xe5\x4f\x58"
11334                         "\xe7\x0f\x2f\x0e\xff\x68\xea\xfd"
11335                         "\x15\xb3\x17\xe6\xb0\xe7\x85\xd8"
11336                         "\x23\x2e\x05\xc7\xc9\xc4\x46\x1f"
11337                         "\xe1\x9e\x49\x20\x23\x24\x4d\x7e"
11338                         "\x29\x65\xff\xf4\xb6\xfd\x1a\x85"
11339                         "\xc4\x16\xec\xfc\xea\x7b\xd6\x2c"
11340                         "\x43\xf8\xb7\xbf\x79\xc0\x85\xcd"
11341                         "\xef\xe1\x98\xd3\xa5\xf7\x90\x8c"
11342                         "\xe9\x7f\x80\x6b\xd2\xac\x4c\x30"
11343                         "\xa7\xc6\x61\x6c\xd2\xf9\x2c\xff"
11344                         "\x30\xbc\x22\x81\x7d\x93\x12\xe4"
11345                         "\x0a\xcd\xaf\xdd\xe8\xab\x0a\x1e"
11346                         "\x13\xa4\x27\xc3\x5f\xf7\x4b\xbb"
11347                         "\x37\x09\x4b\x91\x6f\x92\x4f\xaf"
11348                         "\x52\xee\xdf\xef\x09\x6f\xf7\x5c"
11349                         "\x6e\x12\x17\x72\x63\x57\xc7\xba"
11350                         "\x3b\x6b\x38\x32\x73\x1b\x9c\x80"
11351                         "\xc1\x7a\xc6\xcf\xcd\x35\xc0\x6b"
11352                         "\x31\x1a\x6b\xe9\xd8\x2c\x29\x3f"
11353                         "\x96\xfb\xb6\xcd\x13\x91\x3b\xc2"
11354                         "\xd2\xa3\x31\x8d\xa4\xcd\x57\xcd"
11355                         "\x13\x3d\x64\xfd\x06\xce\xe6\xdc"
11356                         "\x0c\x24\x43\x31\x40\x57\xf1\x72"
11357                         "\x17\xe3\x3a\x63\x6d\x35\xcf\x5d"
11358                         "\x97\x40\x59\xdd\xf7\x3c\x02\xf7"
11359                         "\x1c\x7e\x05\xbb\xa9\x0d\x01\xb1"
11360                         "\x8e\xc0\x30\xa9\x53\x24\xc9\x89"
11361                         "\x84\x6d\xaa\xd0\xcd\x91\xc2\x4d"
11362                         "\x91\xb0\x89\xe2\xbf\x83\x44\xaa"
11363                         "\x28\x72\x23\xa0\xc2\xad\xad\x1c"
11364                         "\xfc\x3f\x09\x7a\x0b\xdc\xc5\x1b"
11365                         "\x87\x13\xc6\x5b\x59\x8d\xf2\xc8"
11366                         "\xaf\xdf\x11\x95",
11367                 .rlen   = 4100,
11368                 .np     = 2,
11369                 .tap    = { 4064, 36 },
11370         },
11371 };
11372
11373 /*
11374  * CTS (Cipher Text Stealing) mode tests
11375  */
11376 #define CTS_MODE_ENC_TEST_VECTORS 6
11377 #define CTS_MODE_DEC_TEST_VECTORS 6
11378 static struct cipher_testvec cts_mode_enc_tv_template[] = {
11379         { /* from rfc3962 */
11380                 .klen   = 16,
11381                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11382                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11383                 .ilen   = 17,
11384                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11385                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11386                           "\x20",
11387                 .rlen   = 17,
11388                 .result = "\xc6\x35\x35\x68\xf2\xbf\x8c\xb4"
11389                           "\xd8\xa5\x80\x36\x2d\xa7\xff\x7f"
11390                           "\x97",
11391         }, {
11392                 .klen   = 16,
11393                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11394                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11395                 .ilen   = 31,
11396                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11397                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11398                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11399                           "\x20\x47\x61\x75\x27\x73\x20",
11400                 .rlen   = 31,
11401                 .result = "\xfc\x00\x78\x3e\x0e\xfd\xb2\xc1"
11402                           "\xd4\x45\xd4\xc8\xef\xf7\xed\x22"
11403                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11404                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5",
11405         }, {
11406                 .klen   = 16,
11407                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11408                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11409                 .ilen   = 32,
11410                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11411                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11412                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11413                           "\x20\x47\x61\x75\x27\x73\x20\x43",
11414                 .rlen   = 32,
11415                 .result = "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11416                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
11417                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11418                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84",
11419         }, {
11420                 .klen   = 16,
11421                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11422                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11423                 .ilen   = 47,
11424                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11425                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11426                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11427                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11428                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11429                           "\x70\x6c\x65\x61\x73\x65\x2c",
11430                 .rlen   = 47,
11431                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11432                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11433                           "\xb3\xff\xfd\x94\x0c\x16\xa1\x8c"
11434                           "\x1b\x55\x49\xd2\xf8\x38\x02\x9e"
11435                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11436                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5",
11437         }, {
11438                 .klen   = 16,
11439                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11440                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11441                 .ilen   = 48,
11442                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11443                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11444                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11445                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11446                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11447                           "\x70\x6c\x65\x61\x73\x65\x2c\x20",
11448                 .rlen   = 48,
11449                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11450                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11451                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
11452                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8"
11453                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11454                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8",
11455         }, {
11456                 .klen   = 16,
11457                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11458                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11459                 .ilen   = 64,
11460                 .input  = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11461                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11462                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11463                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11464                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11465                           "\x70\x6c\x65\x61\x73\x65\x2c\x20"
11466                           "\x61\x6e\x64\x20\x77\x6f\x6e\x74"
11467                           "\x6f\x6e\x20\x73\x6f\x75\x70\x2e",
11468                 .rlen   = 64,
11469                 .result = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11470                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11471                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11472                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
11473                           "\x48\x07\xef\xe8\x36\xee\x89\xa5"
11474                           "\x26\x73\x0d\xbc\x2f\x7b\xc8\x40"
11475                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
11476                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8",
11477         }
11478 };
11479
11480 static struct cipher_testvec cts_mode_dec_tv_template[] = {
11481         { /* from rfc3962 */
11482                 .klen   = 16,
11483                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11484                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11485                 .rlen   = 17,
11486                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11487                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11488                           "\x20",
11489                 .ilen   = 17,
11490                 .input  = "\xc6\x35\x35\x68\xf2\xbf\x8c\xb4"
11491                           "\xd8\xa5\x80\x36\x2d\xa7\xff\x7f"
11492                           "\x97",
11493         }, {
11494                 .klen   = 16,
11495                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11496                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11497                 .rlen   = 31,
11498                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11499                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11500                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11501                           "\x20\x47\x61\x75\x27\x73\x20",
11502                 .ilen   = 31,
11503                 .input  = "\xfc\x00\x78\x3e\x0e\xfd\xb2\xc1"
11504                           "\xd4\x45\xd4\xc8\xef\xf7\xed\x22"
11505                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11506                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5",
11507         }, {
11508                 .klen   = 16,
11509                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11510                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11511                 .rlen   = 32,
11512                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11513                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11514                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11515                           "\x20\x47\x61\x75\x27\x73\x20\x43",
11516                 .ilen   = 32,
11517                 .input  = "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11518                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
11519                           "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11520                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84",
11521         }, {
11522                 .klen   = 16,
11523                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11524                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11525                 .rlen   = 47,
11526                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11527                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11528                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11529                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11530                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11531                           "\x70\x6c\x65\x61\x73\x65\x2c",
11532                 .ilen   = 47,
11533                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11534                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11535                           "\xb3\xff\xfd\x94\x0c\x16\xa1\x8c"
11536                           "\x1b\x55\x49\xd2\xf8\x38\x02\x9e"
11537                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11538                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5",
11539         }, {
11540                 .klen   = 16,
11541                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11542                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11543                 .rlen   = 48,
11544                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11545                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11546                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11547                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11548                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11549                           "\x70\x6c\x65\x61\x73\x65\x2c\x20",
11550                 .ilen   = 48,
11551                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11552                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11553                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
11554                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8"
11555                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11556                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8",
11557         }, {
11558                 .klen   = 16,
11559                 .key    = "\x63\x68\x69\x63\x6b\x65\x6e\x20"
11560                           "\x74\x65\x72\x69\x79\x61\x6b\x69",
11561                 .rlen   = 64,
11562                 .result = "\x49\x20\x77\x6f\x75\x6c\x64\x20"
11563                           "\x6c\x69\x6b\x65\x20\x74\x68\x65"
11564                           "\x20\x47\x65\x6e\x65\x72\x61\x6c"
11565                           "\x20\x47\x61\x75\x27\x73\x20\x43"
11566                           "\x68\x69\x63\x6b\x65\x6e\x2c\x20"
11567                           "\x70\x6c\x65\x61\x73\x65\x2c\x20"
11568                           "\x61\x6e\x64\x20\x77\x6f\x6e\x74"
11569                           "\x6f\x6e\x20\x73\x6f\x75\x70\x2e",
11570                 .ilen   = 64,
11571                 .input  = "\x97\x68\x72\x68\xd6\xec\xcc\xc0"
11572                           "\xc0\x7b\x25\xe2\x5e\xcf\xe5\x84"
11573                           "\x39\x31\x25\x23\xa7\x86\x62\xd5"
11574                           "\xbe\x7f\xcb\xcc\x98\xeb\xf5\xa8"
11575                           "\x48\x07\xef\xe8\x36\xee\x89\xa5"
11576                           "\x26\x73\x0d\xbc\x2f\x7b\xc8\x40"
11577                           "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0"
11578                           "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8",
11579         }
11580 };
11581
11582 /*
11583  * Compression stuff.
11584  */
11585 #define COMP_BUF_SIZE           512
11586
11587 struct comp_testvec {
11588         int inlen, outlen;
11589         char input[COMP_BUF_SIZE];
11590         char output[COMP_BUF_SIZE];
11591 };
11592
11593 struct pcomp_testvec {
11594         void *params;
11595         unsigned int paramsize;
11596         int inlen, outlen;
11597         char input[COMP_BUF_SIZE];
11598         char output[COMP_BUF_SIZE];
11599 };
11600
11601 /*
11602  * Deflate test vectors (null-terminated strings).
11603  * Params: winbits=-11, Z_DEFAULT_COMPRESSION, MAX_MEM_LEVEL.
11604  */
11605
11606 #define DEFLATE_COMP_TEST_VECTORS 2
11607 #define DEFLATE_DECOMP_TEST_VECTORS 2
11608
11609 static struct comp_testvec deflate_comp_tv_template[] = {
11610         {
11611                 .inlen  = 70,
11612                 .outlen = 38,
11613                 .input  = "Join us now and share the software "
11614                         "Join us now and share the software ",
11615                 .output = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
11616                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
11617                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
11618                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
11619                           "\x71\xbc\x08\x2b\x01\x00",
11620         }, {
11621                 .inlen  = 191,
11622                 .outlen = 122,
11623                 .input  = "This document describes a compression method based on the DEFLATE"
11624                         "compression algorithm.  This document defines the application of "
11625                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
11626                 .output = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
11627                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
11628                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
11629                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
11630                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
11631                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
11632                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
11633                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
11634                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
11635                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
11636                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
11637                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
11638                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
11639                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
11640                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
11641                           "\xfa\x02",
11642         },
11643 };
11644
11645 static struct comp_testvec deflate_decomp_tv_template[] = {
11646         {
11647                 .inlen  = 122,
11648                 .outlen = 191,
11649                 .input  = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
11650                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
11651                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
11652                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
11653                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
11654                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
11655                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
11656                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
11657                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
11658                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
11659                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
11660                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
11661                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
11662                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
11663                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
11664                           "\xfa\x02",
11665                 .output = "This document describes a compression method based on the DEFLATE"
11666                         "compression algorithm.  This document defines the application of "
11667                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
11668         }, {
11669                 .inlen  = 38,
11670                 .outlen = 70,
11671                 .input  = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
11672                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
11673                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
11674                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
11675                           "\x71\xbc\x08\x2b\x01\x00",
11676                 .output = "Join us now and share the software "
11677                         "Join us now and share the software ",
11678         },
11679 };
11680
11681 #define ZLIB_COMP_TEST_VECTORS 2
11682 #define ZLIB_DECOMP_TEST_VECTORS 2
11683
11684 static const struct {
11685         struct nlattr nla;
11686         int val;
11687 } deflate_comp_params[] = {
11688         {
11689                 .nla = {
11690                         .nla_len        = NLA_HDRLEN + sizeof(int),
11691                         .nla_type       = ZLIB_COMP_LEVEL,
11692                 },
11693                 .val                    = Z_DEFAULT_COMPRESSION,
11694         }, {
11695                 .nla = {
11696                         .nla_len        = NLA_HDRLEN + sizeof(int),
11697                         .nla_type       = ZLIB_COMP_METHOD,
11698                 },
11699                 .val                    = Z_DEFLATED,
11700         }, {
11701                 .nla = {
11702                         .nla_len        = NLA_HDRLEN + sizeof(int),
11703                         .nla_type       = ZLIB_COMP_WINDOWBITS,
11704                 },
11705                 .val                    = -11,
11706         }, {
11707                 .nla = {
11708                         .nla_len        = NLA_HDRLEN + sizeof(int),
11709                         .nla_type       = ZLIB_COMP_MEMLEVEL,
11710                 },
11711                 .val                    = MAX_MEM_LEVEL,
11712         }, {
11713                 .nla = {
11714                         .nla_len        = NLA_HDRLEN + sizeof(int),
11715                         .nla_type       = ZLIB_COMP_STRATEGY,
11716                 },
11717                 .val                    = Z_DEFAULT_STRATEGY,
11718         }
11719 };
11720
11721 static const struct {
11722         struct nlattr nla;
11723         int val;
11724 } deflate_decomp_params[] = {
11725         {
11726                 .nla = {
11727                         .nla_len        = NLA_HDRLEN + sizeof(int),
11728                         .nla_type       = ZLIB_DECOMP_WINDOWBITS,
11729                 },
11730                 .val                    = -11,
11731         }
11732 };
11733
11734 static struct pcomp_testvec zlib_comp_tv_template[] = {
11735         {
11736                 .params = &deflate_comp_params,
11737                 .paramsize = sizeof(deflate_comp_params),
11738                 .inlen  = 70,
11739                 .outlen = 38,
11740                 .input  = "Join us now and share the software "
11741                         "Join us now and share the software ",
11742                 .output = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
11743                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
11744                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
11745                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
11746                           "\x71\xbc\x08\x2b\x01\x00",
11747         }, {
11748                 .params = &deflate_comp_params,
11749                 .paramsize = sizeof(deflate_comp_params),
11750                 .inlen  = 191,
11751                 .outlen = 122,
11752                 .input  = "This document describes a compression method based on the DEFLATE"
11753                         "compression algorithm.  This document defines the application of "
11754                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
11755                 .output = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
11756                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
11757                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
11758                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
11759                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
11760                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
11761                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
11762                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
11763                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
11764                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
11765                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
11766                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
11767                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
11768                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
11769                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
11770                           "\xfa\x02",
11771         },
11772 };
11773
11774 static struct pcomp_testvec zlib_decomp_tv_template[] = {
11775         {
11776                 .params = &deflate_decomp_params,
11777                 .paramsize = sizeof(deflate_decomp_params),
11778                 .inlen  = 122,
11779                 .outlen = 191,
11780                 .input  = "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
11781                           "\xbf\xb2\x2f\xc8\x1f\x10\x04\x09"
11782                           "\x89\xc2\x85\x3f\x70\xb1\x2f\xf8"
11783                           "\x24\xdb\x67\xd9\x47\xc1\xef\x49"
11784                           "\x68\x12\x51\xae\x76\x67\xd6\x27"
11785                           "\x19\x88\x1a\xde\x85\xab\x21\xf2"
11786                           "\x08\x5d\x16\x1e\x20\x04\x2d\xad"
11787                           "\xf3\x18\xa2\x15\x85\x2d\x69\xc4"
11788                           "\x42\x83\x23\xb6\x6c\x89\x71\x9b"
11789                           "\xef\xcf\x8b\x9f\xcf\x33\xca\x2f"
11790                           "\xed\x62\xa9\x4c\x80\xff\x13\xaf"
11791                           "\x52\x37\xed\x0e\x52\x6b\x59\x02"
11792                           "\xd9\x4e\xe8\x7a\x76\x1d\x02\x98"
11793                           "\xfe\x8a\x87\x83\xa3\x4f\x56\x8a"
11794                           "\xb8\x9e\x8e\x5c\x57\xd3\xa0\x79"
11795                           "\xfa\x02",
11796                 .output = "This document describes a compression method based on the DEFLATE"
11797                         "compression algorithm.  This document defines the application of "
11798                         "the DEFLATE algorithm to the IP Payload Compression Protocol.",
11799         }, {
11800                 .params = &deflate_decomp_params,
11801                 .paramsize = sizeof(deflate_decomp_params),
11802                 .inlen  = 38,
11803                 .outlen = 70,
11804                 .input  = "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
11805                           "\xc8\xcb\x2f\x57\x48\xcc\x4b\x51"
11806                           "\x28\xce\x48\x2c\x4a\x55\x28\xc9"
11807                           "\x48\x55\x28\xce\x4f\x2b\x29\x07"
11808                           "\x71\xbc\x08\x2b\x01\x00",
11809                 .output = "Join us now and share the software "
11810                         "Join us now and share the software ",
11811         },
11812 };
11813
11814 /*
11815  * LZO test vectors (null-terminated strings).
11816  */
11817 #define LZO_COMP_TEST_VECTORS 2
11818 #define LZO_DECOMP_TEST_VECTORS 2
11819
11820 static struct comp_testvec lzo_comp_tv_template[] = {
11821         {
11822                 .inlen  = 70,
11823                 .outlen = 46,
11824                 .input  = "Join us now and share the software "
11825                         "Join us now and share the software ",
11826                 .output = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
11827                         "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
11828                         "\x64\x20\x73\x68\x61\x72\x65\x20"
11829                         "\x74\x68\x65\x20\x73\x6f\x66\x74"
11830                         "\x77\x70\x01\x01\x4a\x6f\x69\x6e"
11831                         "\x3d\x88\x00\x11\x00\x00",
11832         }, {
11833                 .inlen  = 159,
11834                 .outlen = 133,
11835                 .input  = "This document describes a compression method based on the LZO "
11836                         "compression algorithm.  This document defines the application of "
11837                         "the LZO algorithm used in UBIFS.",
11838                 .output = "\x00\x2b\x54\x68\x69\x73\x20\x64"
11839                           "\x6f\x63\x75\x6d\x65\x6e\x74\x20"
11840                           "\x64\x65\x73\x63\x72\x69\x62\x65"
11841                           "\x73\x20\x61\x20\x63\x6f\x6d\x70"
11842                           "\x72\x65\x73\x73\x69\x6f\x6e\x20"
11843                           "\x6d\x65\x74\x68\x6f\x64\x20\x62"
11844                           "\x61\x73\x65\x64\x20\x6f\x6e\x20"
11845                           "\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
11846                           "\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
11847                           "\x69\x74\x68\x6d\x2e\x20\x20\x54"
11848                           "\x68\x69\x73\x2a\x54\x01\x02\x66"
11849                           "\x69\x6e\x65\x73\x94\x06\x05\x61"
11850                           "\x70\x70\x6c\x69\x63\x61\x74\x76"
11851                           "\x0a\x6f\x66\x88\x02\x60\x09\x27"
11852                           "\xf0\x00\x0c\x20\x75\x73\x65\x64"
11853                           "\x20\x69\x6e\x20\x55\x42\x49\x46"
11854                           "\x53\x2e\x11\x00\x00",
11855         },
11856 };
11857
11858 static struct comp_testvec lzo_decomp_tv_template[] = {
11859         {
11860                 .inlen  = 133,
11861                 .outlen = 159,
11862                 .input  = "\x00\x2b\x54\x68\x69\x73\x20\x64"
11863                           "\x6f\x63\x75\x6d\x65\x6e\x74\x20"
11864                           "\x64\x65\x73\x63\x72\x69\x62\x65"
11865                           "\x73\x20\x61\x20\x63\x6f\x6d\x70"
11866                           "\x72\x65\x73\x73\x69\x6f\x6e\x20"
11867                           "\x6d\x65\x74\x68\x6f\x64\x20\x62"
11868                           "\x61\x73\x65\x64\x20\x6f\x6e\x20"
11869                           "\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
11870                           "\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
11871                           "\x69\x74\x68\x6d\x2e\x20\x20\x54"
11872                           "\x68\x69\x73\x2a\x54\x01\x02\x66"
11873                           "\x69\x6e\x65\x73\x94\x06\x05\x61"
11874                           "\x70\x70\x6c\x69\x63\x61\x74\x76"
11875                           "\x0a\x6f\x66\x88\x02\x60\x09\x27"
11876                           "\xf0\x00\x0c\x20\x75\x73\x65\x64"
11877                           "\x20\x69\x6e\x20\x55\x42\x49\x46"
11878                           "\x53\x2e\x11\x00\x00",
11879                 .output = "This document describes a compression method based on the LZO "
11880                         "compression algorithm.  This document defines the application of "
11881                         "the LZO algorithm used in UBIFS.",
11882         }, {
11883                 .inlen  = 46,
11884                 .outlen = 70,
11885                 .input  = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
11886                           "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
11887                           "\x64\x20\x73\x68\x61\x72\x65\x20"
11888                           "\x74\x68\x65\x20\x73\x6f\x66\x74"
11889                           "\x77\x70\x01\x01\x4a\x6f\x69\x6e"
11890                           "\x3d\x88\x00\x11\x00\x00",
11891                 .output = "Join us now and share the software "
11892                         "Join us now and share the software ",
11893         },
11894 };
11895
11896 /*
11897  * Michael MIC test vectors from IEEE 802.11i
11898  */
11899 #define MICHAEL_MIC_TEST_VECTORS 6
11900
11901 static struct hash_testvec michael_mic_tv_template[] = {
11902         {
11903                 .key = "\x00\x00\x00\x00\x00\x00\x00\x00",
11904                 .ksize = 8,
11905                 .plaintext = zeroed_string,
11906                 .psize = 0,
11907                 .digest = "\x82\x92\x5c\x1c\xa1\xd1\x30\xb8",
11908         },
11909         {
11910                 .key = "\x82\x92\x5c\x1c\xa1\xd1\x30\xb8",
11911                 .ksize = 8,
11912                 .plaintext = "M",
11913                 .psize = 1,
11914                 .digest = "\x43\x47\x21\xca\x40\x63\x9b\x3f",
11915         },
11916         {
11917                 .key = "\x43\x47\x21\xca\x40\x63\x9b\x3f",
11918                 .ksize = 8,
11919                 .plaintext = "Mi",
11920                 .psize = 2,
11921                 .digest = "\xe8\xf9\xbe\xca\xe9\x7e\x5d\x29",
11922         },
11923         {
11924                 .key = "\xe8\xf9\xbe\xca\xe9\x7e\x5d\x29",
11925                 .ksize = 8,
11926                 .plaintext = "Mic",
11927                 .psize = 3,
11928                 .digest = "\x90\x03\x8f\xc6\xcf\x13\xc1\xdb",
11929         },
11930         {
11931                 .key = "\x90\x03\x8f\xc6\xcf\x13\xc1\xdb",
11932                 .ksize = 8,
11933                 .plaintext = "Mich",
11934                 .psize = 4,
11935                 .digest = "\xd5\x5e\x10\x05\x10\x12\x89\x86",
11936         },
11937         {
11938                 .key = "\xd5\x5e\x10\x05\x10\x12\x89\x86",
11939                 .ksize = 8,
11940                 .plaintext = "Michael",
11941                 .psize = 7,
11942                 .digest = "\x0a\x94\x2b\x12\x4e\xca\xa5\x46",
11943         }
11944 };
11945
11946 /*
11947  * CRC32C test vectors
11948  */
11949 #define CRC32C_TEST_VECTORS 14
11950
11951 static struct hash_testvec crc32c_tv_template[] = {
11952         {
11953                 .psize = 0,
11954                 .digest = "\x00\x00\x00\x00",
11955         },
11956         {
11957                 .key = "\x87\xa9\xcb\xed",
11958                 .ksize = 4,
11959                 .psize = 0,
11960                 .digest = "\x78\x56\x34\x12",
11961         },
11962         {
11963                 .key = "\xff\xff\xff\xff",
11964                 .ksize = 4,
11965                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
11966                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
11967                              "\x11\x12\x13\x14\x15\x16\x17\x18"
11968                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
11969                              "\x21\x22\x23\x24\x25\x26\x27\x28",
11970                 .psize = 40,
11971                 .digest = "\x7f\x15\x2c\x0e",
11972         },
11973         {
11974                 .key = "\xff\xff\xff\xff",
11975                 .ksize = 4,
11976                 .plaintext = "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
11977                              "\x31\x32\x33\x34\x35\x36\x37\x38"
11978                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
11979                              "\x41\x42\x43\x44\x45\x46\x47\x48"
11980                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50",
11981                 .psize = 40,
11982                 .digest = "\xf6\xeb\x80\xe9",
11983         },
11984         {
11985                 .key = "\xff\xff\xff\xff",
11986                 .ksize = 4,
11987                 .plaintext = "\x51\x52\x53\x54\x55\x56\x57\x58"
11988                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
11989                              "\x61\x62\x63\x64\x65\x66\x67\x68"
11990                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
11991                              "\x71\x72\x73\x74\x75\x76\x77\x78",
11992                 .psize = 40,
11993                 .digest = "\xed\xbd\x74\xde",
11994         },
11995         {
11996                 .key = "\xff\xff\xff\xff",
11997                 .ksize = 4,
11998                 .plaintext = "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
11999                              "\x81\x82\x83\x84\x85\x86\x87\x88"
12000                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
12001                              "\x91\x92\x93\x94\x95\x96\x97\x98"
12002                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0",
12003                 .psize = 40,
12004                 .digest = "\x62\xc8\x79\xd5",
12005         },
12006         {
12007                 .key = "\xff\xff\xff\xff",
12008                 .ksize = 4,
12009                 .plaintext = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
12010                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
12011                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
12012                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
12013                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8",
12014                 .psize = 40,
12015                 .digest = "\xd0\x9a\x97\xba",
12016         },
12017         {
12018                 .key = "\xff\xff\xff\xff",
12019                 .ksize = 4,
12020                 .plaintext = "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
12021                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
12022                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
12023                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
12024                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
12025                 .psize = 40,
12026                 .digest = "\x13\xd9\x29\x2b",
12027         },
12028         {
12029                 .key = "\x80\xea\xd3\xf1",
12030                 .ksize = 4,
12031                 .plaintext = "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
12032                              "\x31\x32\x33\x34\x35\x36\x37\x38"
12033                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
12034                              "\x41\x42\x43\x44\x45\x46\x47\x48"
12035                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50",
12036                 .psize = 40,
12037                 .digest = "\x0c\xb5\xe2\xa2",
12038         },
12039         {
12040                 .key = "\xf3\x4a\x1d\x5d",
12041                 .ksize = 4,
12042                 .plaintext = "\x51\x52\x53\x54\x55\x56\x57\x58"
12043                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
12044                              "\x61\x62\x63\x64\x65\x66\x67\x68"
12045                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
12046                              "\x71\x72\x73\x74\x75\x76\x77\x78",
12047                 .psize = 40,
12048                 .digest = "\xd1\x7f\xfb\xa6",
12049         },
12050         {
12051                 .key = "\x2e\x80\x04\x59",
12052                 .ksize = 4,
12053                 .plaintext = "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
12054                              "\x81\x82\x83\x84\x85\x86\x87\x88"
12055                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
12056                              "\x91\x92\x93\x94\x95\x96\x97\x98"
12057                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0",
12058                 .psize = 40,
12059                 .digest = "\x59\x33\xe6\x7a",
12060         },
12061         {
12062                 .key = "\xa6\xcc\x19\x85",
12063                 .ksize = 4,
12064                 .plaintext = "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
12065                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
12066                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
12067                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
12068                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8",
12069                 .psize = 40,
12070                 .digest = "\xbe\x03\x01\xd2",
12071         },
12072         {
12073                 .key = "\x41\xfc\xfe\x2d",
12074                 .ksize = 4,
12075                 .plaintext = "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
12076                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
12077                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
12078                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
12079                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
12080                 .psize = 40,
12081                 .digest = "\x75\xd3\xc5\x24",
12082         },
12083         {
12084                 .key = "\xff\xff\xff\xff",
12085                 .ksize = 4,
12086                 .plaintext = "\x01\x02\x03\x04\x05\x06\x07\x08"
12087                              "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
12088                              "\x11\x12\x13\x14\x15\x16\x17\x18"
12089                              "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
12090                              "\x21\x22\x23\x24\x25\x26\x27\x28"
12091                              "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
12092                              "\x31\x32\x33\x34\x35\x36\x37\x38"
12093                              "\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
12094                              "\x41\x42\x43\x44\x45\x46\x47\x48"
12095                              "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50"
12096                              "\x51\x52\x53\x54\x55\x56\x57\x58"
12097                              "\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
12098                              "\x61\x62\x63\x64\x65\x66\x67\x68"
12099                              "\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
12100                              "\x71\x72\x73\x74\x75\x76\x77\x78"
12101                              "\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
12102                              "\x81\x82\x83\x84\x85\x86\x87\x88"
12103                              "\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
12104                              "\x91\x92\x93\x94\x95\x96\x97\x98"
12105                              "\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0"
12106                              "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8"
12107                              "\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
12108                              "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8"
12109                              "\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
12110                              "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8"
12111                              "\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
12112                              "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
12113                              "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
12114                              "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8"
12115                              "\xe9\xea\xeb\xec\xed\xee\xef\xf0",
12116                 .psize = 240,
12117                 .digest = "\x75\xd3\xc5\x24",
12118                 .np = 2,
12119                 .tap = { 31, 209 }
12120         },
12121 };
12122
12123 #endif  /* _CRYPTO_TESTMGR_H */