Merge tag 'imx-fixes-4.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
[linux-drm-fsl-dcu.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              160
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 short psize;
45         unsigned char np;
46         unsigned char ksize;
47 };
48
49 /*
50  * cipher_testvec:      structure to describe a cipher test
51  * @key:        A pointer to a key used by the test
52  * @klen:       The length of @key
53  * @iv:         A pointer to the IV used by the test
54  * @input:      A pointer to data used as input
55  * @ilen        The length of data in @input
56  * @result:     A pointer to what the test need to produce
57  * @rlen:       The length of data in @result
58  * @fail:       If set to one, the test need to fail
59  * @wk:         Does the test need CRYPTO_TFM_REQ_WEAK_KEY
60  *              ( e.g. test needs to fail due to a weak key )
61  * @np:         numbers of SG to distribute data in (from 1 to MAX_TAP)
62  * @tap:        How to distribute data in @np SGs
63  * @also_non_np:        if set to 1, the test will be also done without
64  *                      splitting data in @np SGs
65  */
66
67 struct cipher_testvec {
68         char *key;
69         char *iv;
70         char *input;
71         char *result;
72         unsigned short tap[MAX_TAP];
73         int np;
74         unsigned char also_non_np;
75         bool fail;
76         unsigned char wk; /* weak key flag */
77         unsigned char klen;
78         unsigned short ilen;
79         unsigned short rlen;
80 };
81
82 struct aead_testvec {
83         char *key;
84         char *iv;
85         char *input;
86         char *assoc;
87         char *result;
88         unsigned char tap[MAX_TAP];
89         unsigned char atap[MAX_TAP];
90         int np;
91         int anp;
92         bool fail;
93         unsigned char novrfy;   /* ccm dec verification failure expected */
94         unsigned char wk; /* weak key flag */
95         unsigned char klen;
96         unsigned short ilen;
97         unsigned short alen;
98         unsigned short rlen;
99 };
100
101 struct cprng_testvec {
102         char *key;
103         char *dt;
104         char *v;
105         char *result;
106         unsigned char klen;
107         unsigned short dtlen;
108         unsigned short vlen;
109         unsigned short rlen;
110         unsigned short loops;
111 };
112
113 struct drbg_testvec {
114         unsigned char *entropy;
115         size_t entropylen;
116         unsigned char *entpra;
117         unsigned char *entprb;
118         size_t entprlen;
119         unsigned char *addtla;
120         unsigned char *addtlb;
121         size_t addtllen;
122         unsigned char *pers;
123         size_t perslen;
124         unsigned char *expected;
125         size_t expectedlen;
126 };
127
128 struct akcipher_testvec {
129         unsigned char *key;
130         unsigned char *m;
131         unsigned char *c;
132         unsigned int key_len;
133         unsigned int m_size;
134         unsigned int c_size;
135         bool public_key_vec;
136 };
137
138 static char zeroed_string[48];
139
140 /*
141  * RSA test vectors. Borrowed from openSSL.
142  */
143 #ifdef CONFIG_CRYPTO_FIPS
144 #define RSA_TEST_VECTORS        2
145 #else
146 #define RSA_TEST_VECTORS        4
147 #endif
148 static struct akcipher_testvec rsa_tv_template[] = {
149         {
150 #ifndef CONFIG_CRYPTO_FIPS
151         .key =
152         "\x30\x81\x88" /* sequence of 136 bytes */
153         "\x02\x41" /* modulus - integer of 65 bytes */
154         "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
155         "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
156         "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
157         "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
158         "\xF5"
159         "\x02\x01\x11" /* public key - integer of 1 byte */
160         "\x02\x40" /* private key - integer of 64 bytes */
161         "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
162         "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
163         "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
164         "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51",
165         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
166         .c =
167         "\x63\x1c\xcd\x7b\xe1\x7e\xe4\xde\xc9\xa8\x89\xa1\x74\xcb\x3c\x63"
168         "\x7d\x24\xec\x83\xc3\x15\xe4\x7f\x73\x05\x34\xd1\xec\x22\xbb\x8a"
169         "\x5e\x32\x39\x6d\xc1\x1d\x7d\x50\x3b\x9f\x7a\xad\xf0\x2e\x25\x53"
170         "\x9f\x6e\xbd\x4c\x55\x84\x0c\x9b\xcf\x1a\x4b\x51\x1e\x9e\x0c\x06",
171         .key_len = 139,
172         .m_size = 8,
173         .c_size = 64,
174         }, {
175         .key =
176         "\x30\x82\x01\x0B" /* sequence of 267 bytes */
177         "\x02\x81\x81" /* modulus - integer of 129 bytes */
178         "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
179         "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
180         "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
181         "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80"
182         "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25"
183         "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39"
184         "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68"
185         "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
186         "\xCB"
187         "\x02\x01\x11" /* public key - integer of 1 byte */
188         "\x02\x81\x81"  /* private key - integer of 129 bytes */
189         "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD"
190         "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41"
191         "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69"
192         "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA"
193         "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94"
194         "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A"
195         "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94"
196         "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3"
197         "\xC1",
198         .key_len = 271,
199         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
200         .c =
201         "\x74\x1b\x55\xac\x47\xb5\x08\x0a\x6e\x2b\x2d\xf7\x94\xb8\x8a\x95"
202         "\xed\xa3\x6b\xc9\x29\xee\xb2\x2c\x80\xc3\x39\x3b\x8c\x62\x45\x72"
203         "\xc2\x7f\x74\x81\x91\x68\x44\x48\x5a\xdc\xa0\x7e\xa7\x0b\x05\x7f"
204         "\x0e\xa0\x6c\xe5\x8f\x19\x4d\xce\x98\x47\x5f\xbd\x5f\xfe\xe5\x34"
205         "\x59\x89\xaf\xf0\xba\x44\xd7\xf1\x1a\x50\x72\xef\x5e\x4a\xb6\xb7"
206         "\x54\x34\xd1\xc4\x83\x09\xdf\x0f\x91\x5f\x7d\x91\x70\x2f\xd4\x13"
207         "\xcc\x5e\xa4\x6c\xc3\x4d\x28\xef\xda\xaf\xec\x14\x92\xfc\xa3\x75"
208         "\x13\xb4\xc1\xa1\x11\xfc\x40\x2f\x4c\x9d\xdf\x16\x76\x11\x20\x6b",
209         .m_size = 8,
210         .c_size = 128,
211         }, {
212 #endif
213         .key =
214         "\x30\x82\x02\x0D" /* sequence of 525 bytes */
215         "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
216         "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
217         "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
218         "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
219         "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
220         "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
221         "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
222         "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
223         "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
224         "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
225         "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
226         "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
227         "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
228         "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
229         "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
230         "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
231         "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
232         "\x02\x03\x01\x00\x01" /* public key - integer of 3 bytes */
233         "\x02\x82\x01\x00" /* private key - integer of 256 bytes */
234         "\x52\x41\xF4\xDA\x7B\xB7\x59\x55\xCA\xD4\x2F\x0F\x3A\xCB\xA4\x0D"
235         "\x93\x6C\xCC\x9D\xC1\xB2\xFB\xFD\xAE\x40\x31\xAC\x69\x52\x21\x92"
236         "\xB3\x27\xDF\xEA\xEE\x2C\x82\xBB\xF7\x40\x32\xD5\x14\xC4\x94\x12"
237         "\xEC\xB8\x1F\xCA\x59\xE3\xC1\x78\xF3\x85\xD8\x47\xA5\xD7\x02\x1A"
238         "\x65\x79\x97\x0D\x24\xF4\xF0\x67\x6E\x75\x2D\xBF\x10\x3D\xA8\x7D"
239         "\xEF\x7F\x60\xE4\xE6\x05\x82\x89\x5D\xDF\xC6\xD2\x6C\x07\x91\x33"
240         "\x98\x42\xF0\x02\x00\x25\x38\xC5\x85\x69\x8A\x7D\x2F\x95\x6C\x43"
241         "\x9A\xB8\x81\xE2\xD0\x07\x35\xAA\x05\x41\xC9\x1E\xAF\xE4\x04\x3B"
242         "\x19\xB8\x73\xA2\xAC\x4B\x1E\x66\x48\xD8\x72\x1F\xAC\xF6\xCB\xBC"
243         "\x90\x09\xCA\xEC\x0C\xDC\xF9\x2C\xD7\xEB\xAE\xA3\xA4\x47\xD7\x33"
244         "\x2F\x8A\xCA\xBC\x5E\xF0\x77\xE4\x97\x98\x97\xC7\x10\x91\x7D\x2A"
245         "\xA6\xFF\x46\x83\x97\xDE\xE9\xE2\x17\x03\x06\x14\xE2\xD7\xB1\x1D"
246         "\x77\xAF\x51\x27\x5B\x5E\x69\xB8\x81\xE6\x11\xC5\x43\x23\x81\x04"
247         "\x62\xFF\xE9\x46\xB8\xD8\x44\xDB\xA5\xCC\x31\x54\x34\xCE\x3E\x82"
248         "\xD6\xBF\x7A\x0B\x64\x21\x6D\x88\x7E\x5B\x45\x12\x1E\x63\x8D\x49"
249         "\xA7\x1D\xD9\x1E\x06\xCD\xE8\xBA\x2C\x8C\x69\x32\xEA\xBE\x60\x71",
250         .key_len = 529,
251         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
252         .c =
253         "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
254         "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
255         "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
256         "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
257         "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
258         "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
259         "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
260         "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
261         "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
262         "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
263         "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
264         "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
265         "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
266         "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
267         "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
268         "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
269         .m_size = 8,
270         .c_size = 256,
271         }, {
272         .key =
273         "\x30\x82\x01\x09" /* sequence of 265 bytes */
274         "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
275         "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
276         "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
277         "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
278         "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
279         "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
280         "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
281         "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
282         "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
283         "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
284         "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
285         "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
286         "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
287         "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
288         "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
289         "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
290         "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
291         "\x02\x03\x01\x00\x01", /* public key - integer of 3 bytes */
292         .key_len = 269,
293         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
294         .c =
295         "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
296         "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
297         "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
298         "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
299         "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
300         "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
301         "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
302         "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
303         "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
304         "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
305         "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
306         "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
307         "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
308         "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
309         "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
310         "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
311         .m_size = 8,
312         .c_size = 256,
313         .public_key_vec = true,
314         }
315 };
316
317 /*
318  * MD4 test vectors from RFC1320
319  */
320 #define MD4_TEST_VECTORS        7
321
322 static struct hash_testvec md4_tv_template [] = {
323         {
324                 .plaintext = "",
325                 .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
326                           "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
327         }, {
328                 .plaintext = "a",
329                 .psize  = 1,
330                 .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
331                           "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
332         }, {
333                 .plaintext = "abc",
334                 .psize  = 3,
335                 .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
336                           "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
337         }, {
338                 .plaintext = "message digest",
339                 .psize  = 14,
340                 .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
341                         "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
342         }, {
343                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
344                 .psize  = 26,
345                 .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
346                           "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
347                 .np     = 2,
348                 .tap    = { 13, 13 },
349         }, {
350                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
351                 .psize  = 62,
352                 .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
353                           "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
354         }, {
355                 .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
356                            "45678901234567890",
357                 .psize  = 80,
358                 .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
359                           "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
360         },
361 };
362
363 /*
364  * MD5 test vectors from RFC1321
365  */
366 #define MD5_TEST_VECTORS        7
367
368 static struct hash_testvec md5_tv_template[] = {
369         {
370                 .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
371                           "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
372         }, {
373                 .plaintext = "a",
374                 .psize  = 1,
375                 .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
376                           "\x31\xc3\x99\xe2\x69\x77\x26\x61",
377         }, {
378                 .plaintext = "abc",
379                 .psize  = 3,
380                 .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
381                           "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
382         }, {
383                 .plaintext = "message digest",
384                 .psize  = 14,
385                 .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
386                           "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
387         }, {
388                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
389                 .psize  = 26,
390                 .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
391                           "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
392                 .np     = 2,
393                 .tap    = {13, 13}
394         }, {
395                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
396                 .psize  = 62,
397                 .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
398                           "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
399         }, {
400                 .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
401                            "345678901234567890",
402                 .psize  = 80,
403                 .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
404                           "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
405         }
406
407 };
408
409 /*
410  * RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
411  */
412 #define RMD128_TEST_VECTORS     10
413
414 static struct hash_testvec rmd128_tv_template[] = {
415         {
416                 .digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
417                           "\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
418         }, {
419                 .plaintext = "a",
420                 .psize  = 1,
421                 .digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
422                           "\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
423         }, {
424                 .plaintext = "abc",
425                 .psize  = 3,
426                 .digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
427                           "\x84\x63\x6b\x0f\x69\x14\x4c\x77",
428         }, {
429                 .plaintext = "message digest",
430                 .psize  = 14,
431                 .digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
432                           "\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
433         }, {
434                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
435                 .psize  = 26,
436                 .digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
437                           "\x10\x71\x49\x22\xb3\x71\x83\x4e",
438         }, {
439                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
440                              "fghijklmnopqrstuvwxyz0123456789",
441                 .psize  = 62,
442                 .digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
443                           "\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
444         }, {
445                 .plaintext = "1234567890123456789012345678901234567890"
446                              "1234567890123456789012345678901234567890",
447                 .psize  = 80,
448                 .digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
449                           "\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
450         }, {
451                 .plaintext = "abcdbcdecdefdefgefghfghighij"
452                              "hijkijkljklmklmnlmnomnopnopq",
453                 .psize  = 56,
454                 .digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
455                           "\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
456                 .np     = 2,
457                 .tap    = { 28, 28 },
458         }, {
459                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
460                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
461                              "lmnopqrsmnopqrstnopqrstu",
462                 .psize  = 112,
463                 .digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
464                           "\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
465         }, {
466                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
467                 .psize  = 32,
468                 .digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
469                           "\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
470         }
471 };
472
473 /*
474  * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
475  */
476 #define RMD160_TEST_VECTORS     10
477
478 static struct hash_testvec rmd160_tv_template[] = {
479         {
480                 .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
481                           "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
482         }, {
483                 .plaintext = "a",
484                 .psize  = 1,
485                 .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
486                           "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
487         }, {
488                 .plaintext = "abc",
489                 .psize  = 3,
490                 .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
491                           "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
492         }, {
493                 .plaintext = "message digest",
494                 .psize  = 14,
495                 .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
496                           "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
497         }, {
498                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
499                 .psize  = 26,
500                 .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
501                           "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
502         }, {
503                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
504                              "fghijklmnopqrstuvwxyz0123456789",
505                 .psize  = 62,
506                 .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
507                           "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
508         }, {
509                 .plaintext = "1234567890123456789012345678901234567890"
510                              "1234567890123456789012345678901234567890",
511                 .psize  = 80,
512                 .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
513                           "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
514         }, {
515                 .plaintext = "abcdbcdecdefdefgefghfghighij"
516                              "hijkijkljklmklmnlmnomnopnopq",
517                 .psize  = 56,
518                 .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
519                           "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
520                 .np     = 2,
521                 .tap    = { 28, 28 },
522         }, {
523                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
524                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
525                              "lmnopqrsmnopqrstnopqrstu",
526                 .psize  = 112,
527                 .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
528                           "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
529         }, {
530                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
531                 .psize  = 32,
532                 .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
533                           "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
534         }
535 };
536
537 /*
538  * RIPEMD-256 test vectors
539  */
540 #define RMD256_TEST_VECTORS     8
541
542 static struct hash_testvec rmd256_tv_template[] = {
543         {
544                 .digest = "\x02\xba\x4c\x4e\x5f\x8e\xcd\x18"
545                           "\x77\xfc\x52\xd6\x4d\x30\xe3\x7a"
546                           "\x2d\x97\x74\xfb\x1e\x5d\x02\x63"
547                           "\x80\xae\x01\x68\xe3\xc5\x52\x2d",
548         }, {
549                 .plaintext = "a",
550                 .psize  = 1,
551                 .digest = "\xf9\x33\x3e\x45\xd8\x57\xf5\xd9"
552                           "\x0a\x91\xba\xb7\x0a\x1e\xba\x0c"
553                           "\xfb\x1b\xe4\xb0\x78\x3c\x9a\xcf"
554                           "\xcd\x88\x3a\x91\x34\x69\x29\x25",
555         }, {
556                 .plaintext = "abc",
557                 .psize  = 3,
558                 .digest = "\xaf\xbd\x6e\x22\x8b\x9d\x8c\xbb"
559                           "\xce\xf5\xca\x2d\x03\xe6\xdb\xa1"
560                           "\x0a\xc0\xbc\x7d\xcb\xe4\x68\x0e"
561                           "\x1e\x42\xd2\xe9\x75\x45\x9b\x65",
562         }, {
563                 .plaintext = "message digest",
564                 .psize  = 14,
565                 .digest = "\x87\xe9\x71\x75\x9a\x1c\xe4\x7a"
566                           "\x51\x4d\x5c\x91\x4c\x39\x2c\x90"
567                           "\x18\xc7\xc4\x6b\xc1\x44\x65\x55"
568                           "\x4a\xfc\xdf\x54\xa5\x07\x0c\x0e",
569         }, {
570                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
571                 .psize  = 26,
572                 .digest = "\x64\x9d\x30\x34\x75\x1e\xa2\x16"
573                           "\x77\x6b\xf9\xa1\x8a\xcc\x81\xbc"
574                           "\x78\x96\x11\x8a\x51\x97\x96\x87"
575                           "\x82\xdd\x1f\xd9\x7d\x8d\x51\x33",
576         }, {
577                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
578                              "fghijklmnopqrstuvwxyz0123456789",
579                 .psize  = 62,
580                 .digest = "\x57\x40\xa4\x08\xac\x16\xb7\x20"
581                           "\xb8\x44\x24\xae\x93\x1c\xbb\x1f"
582                           "\xe3\x63\xd1\xd0\xbf\x40\x17\xf1"
583                           "\xa8\x9f\x7e\xa6\xde\x77\xa0\xb8",
584         }, {
585                 .plaintext = "1234567890123456789012345678901234567890"
586                              "1234567890123456789012345678901234567890",
587                 .psize  = 80,
588                 .digest = "\x06\xfd\xcc\x7a\x40\x95\x48\xaa"
589                           "\xf9\x13\x68\xc0\x6a\x62\x75\xb5"
590                           "\x53\xe3\xf0\x99\xbf\x0e\xa4\xed"
591                           "\xfd\x67\x78\xdf\x89\xa8\x90\xdd",
592         }, {
593                 .plaintext = "abcdbcdecdefdefgefghfghighij"
594                              "hijkijkljklmklmnlmnomnopnopq",
595                 .psize  = 56,
596                 .digest = "\x38\x43\x04\x55\x83\xaa\xc6\xc8"
597                           "\xc8\xd9\x12\x85\x73\xe7\xa9\x80"
598                           "\x9a\xfb\x2a\x0f\x34\xcc\xc3\x6e"
599                           "\xa9\xe7\x2f\x16\xf6\x36\x8e\x3f",
600                 .np     = 2,
601                 .tap    = { 28, 28 },
602         }
603 };
604
605 /*
606  * RIPEMD-320 test vectors
607  */
608 #define RMD320_TEST_VECTORS     8
609
610 static struct hash_testvec rmd320_tv_template[] = {
611         {
612                 .digest = "\x22\xd6\x5d\x56\x61\x53\x6c\xdc\x75\xc1"
613                           "\xfd\xf5\xc6\xde\x7b\x41\xb9\xf2\x73\x25"
614                           "\xeb\xc6\x1e\x85\x57\x17\x7d\x70\x5a\x0e"
615                           "\xc8\x80\x15\x1c\x3a\x32\xa0\x08\x99\xb8",
616         }, {
617                 .plaintext = "a",
618                 .psize  = 1,
619                 .digest = "\xce\x78\x85\x06\x38\xf9\x26\x58\xa5\xa5"
620                           "\x85\x09\x75\x79\x92\x6d\xda\x66\x7a\x57"
621                           "\x16\x56\x2c\xfc\xf6\xfb\xe7\x7f\x63\x54"
622                           "\x2f\x99\xb0\x47\x05\xd6\x97\x0d\xff\x5d",
623         }, {
624                 .plaintext = "abc",
625                 .psize  = 3,
626                 .digest = "\xde\x4c\x01\xb3\x05\x4f\x89\x30\xa7\x9d"
627                           "\x09\xae\x73\x8e\x92\x30\x1e\x5a\x17\x08"
628                           "\x5b\xef\xfd\xc1\xb8\xd1\x16\x71\x3e\x74"
629                           "\xf8\x2f\xa9\x42\xd6\x4c\xdb\xc4\x68\x2d",
630         }, {
631                 .plaintext = "message digest",
632                 .psize  = 14,
633                 .digest = "\x3a\x8e\x28\x50\x2e\xd4\x5d\x42\x2f\x68"
634                           "\x84\x4f\x9d\xd3\x16\xe7\xb9\x85\x33\xfa"
635                           "\x3f\x2a\x91\xd2\x9f\x84\xd4\x25\xc8\x8d"
636                           "\x6b\x4e\xff\x72\x7d\xf6\x6a\x7c\x01\x97",
637         }, {
638                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
639                 .psize  = 26,
640                 .digest = "\xca\xbd\xb1\x81\x0b\x92\x47\x0a\x20\x93"
641                           "\xaa\x6b\xce\x05\x95\x2c\x28\x34\x8c\xf4"
642                           "\x3f\xf6\x08\x41\x97\x51\x66\xbb\x40\xed"
643                           "\x23\x40\x04\xb8\x82\x44\x63\xe6\xb0\x09",
644         }, {
645                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
646                              "fghijklmnopqrstuvwxyz0123456789",
647                 .psize  = 62,
648                 .digest = "\xed\x54\x49\x40\xc8\x6d\x67\xf2\x50\xd2"
649                           "\x32\xc3\x0b\x7b\x3e\x57\x70\xe0\xc6\x0c"
650                           "\x8c\xb9\xa4\xca\xfe\x3b\x11\x38\x8a\xf9"
651                           "\x92\x0e\x1b\x99\x23\x0b\x84\x3c\x86\xa4",
652         }, {
653                 .plaintext = "1234567890123456789012345678901234567890"
654                              "1234567890123456789012345678901234567890",
655                 .psize  = 80,
656                 .digest = "\x55\x78\x88\xaf\x5f\x6d\x8e\xd6\x2a\xb6"
657                           "\x69\x45\xc6\xd2\xa0\xa4\x7e\xcd\x53\x41"
658                           "\xe9\x15\xeb\x8f\xea\x1d\x05\x24\x95\x5f"
659                           "\x82\x5d\xc7\x17\xe4\xa0\x08\xab\x2d\x42",
660         }, {
661                 .plaintext = "abcdbcdecdefdefgefghfghighij"
662                              "hijkijkljklmklmnlmnomnopnopq",
663                 .psize  = 56,
664                 .digest = "\xd0\x34\xa7\x95\x0c\xf7\x22\x02\x1b\xa4"
665                           "\xb8\x4d\xf7\x69\xa5\xde\x20\x60\xe2\x59"
666                           "\xdf\x4c\x9b\xb4\xa4\x26\x8c\x0e\x93\x5b"
667                           "\xbc\x74\x70\xa9\x69\xc9\xd0\x72\xa1\xac",
668                 .np     = 2,
669                 .tap    = { 28, 28 },
670         }
671 };
672
673 #define CRCT10DIF_TEST_VECTORS  3
674 static struct hash_testvec crct10dif_tv_template[] = {
675         {
676                 .plaintext = "abc",
677                 .psize  = 3,
678 #ifdef __LITTLE_ENDIAN
679                 .digest = "\x3b\x44",
680 #else
681                 .digest = "\x44\x3b",
682 #endif
683         }, {
684                 .plaintext = "1234567890123456789012345678901234567890"
685                              "123456789012345678901234567890123456789",
686                 .psize  = 79,
687 #ifdef __LITTLE_ENDIAN
688                 .digest = "\x70\x4b",
689 #else
690                 .digest = "\x4b\x70",
691 #endif
692         }, {
693                 .plaintext =
694                 "abcddddddddddddddddddddddddddddddddddddddddddddddddddddd",
695                 .psize  = 56,
696 #ifdef __LITTLE_ENDIAN
697                 .digest = "\xe3\x9c",
698 #else
699                 .digest = "\x9c\xe3",
700 #endif
701                 .np     = 2,
702                 .tap    = { 28, 28 }
703         }
704 };
705
706 /*
707  * SHA1 test vectors  from from FIPS PUB 180-1
708  * Long vector from CAVS 5.0
709  */
710 #define SHA1_TEST_VECTORS       6
711
712 static struct hash_testvec sha1_tv_template[] = {
713         {
714                 .plaintext = "",
715                 .psize  = 0,
716                 .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55"
717                           "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09",
718         }, {
719                 .plaintext = "abc",
720                 .psize  = 3,
721                 .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
722                           "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
723         }, {
724                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
725                 .psize  = 56,
726                 .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
727                           "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
728                 .np     = 2,
729                 .tap    = { 28, 28 }
730         }, {
731                 .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
732                              "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
733                              "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
734                              "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
735                              "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
736                              "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
737                              "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
738                              "\x72\x28\x26\xc0\x66\x86\x9e\xda"
739                              "\xcd\x73\xb2\x54\x80\x35\x18\x58"
740                              "\x13\xe2\x26\x34\xa9\xda\x44\x00"
741                              "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
742                              "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
743                              "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
744                              "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
745                              "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
746                              "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
747                              "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
748                              "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
749                              "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
750                              "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
751                              "\x5a\x90\x11",
752                 .psize  = 163,
753                 .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
754                           "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
755                 .np     = 4,
756                 .tap    = { 63, 64, 31, 5 }
757         }, {
758                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
759                 .psize  = 64,
760                 .digest = "\xc8\x71\xf6\x9a\x63\xcc\xa9\x84\x84\x82"
761                           "\x64\xe7\x79\x95\x5d\xd7\x19\x41\x7c\x91",
762         }, {
763                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
764                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
765                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
766                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
767                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
768                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
769                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
770                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
771                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
772                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
773                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
774                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
775                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
776                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
777                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
778                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
779                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
780                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
781                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
782                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
783                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
784                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
785                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
786                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
787                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
788                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
789                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
790                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
791                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
792                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
793                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
794                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
795                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
796                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
797                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
798                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
799                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
800                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
801                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
802                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
803                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
804                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
805                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
806                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
807                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
808                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
809                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
810                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
811                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
812                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
813                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
814                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
815                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
816                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
817                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
818                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
819                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
820                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
821                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
822                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
823                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
824                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
825                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
826                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
827                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
828                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
829                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
830                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
831                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
832                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
833                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
834                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
835                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
836                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
837                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
838                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
839                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
840                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
841                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
842                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
843                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
844                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
845                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
846                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
847                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
848                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
849                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
850                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
851                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
852                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
853                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
854                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
855                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
856                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
857                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
858                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
859                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
860                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
861                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
862                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
863                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
864                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
865                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
866                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
867                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
868                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
869                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
870                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
871                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
872                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
873                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
874                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
875                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
876                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
877                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
878                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
879                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
880                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
881                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
882                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
883                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
884                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
885                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
886                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
887                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
888                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
889                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
890                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
891                 .psize     = 1023,
892                 .digest    = "\xb8\xe3\x54\xed\xc5\xfc\xef\xa4"
893                              "\x55\x73\x4a\x81\x99\xe4\x47\x2a"
894                              "\x30\xd6\xc9\x85",
895         }
896 };
897
898
899 /*
900  * SHA224 test vectors from from FIPS PUB 180-2
901  */
902 #define SHA224_TEST_VECTORS     5
903
904 static struct hash_testvec sha224_tv_template[] = {
905         {
906                 .plaintext = "",
907                 .psize  = 0,
908                 .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9"
909                           "\x47\x61\x02\xbb\x28\x82\x34\xc4"
910                           "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a"
911                           "\xc5\xb3\xe4\x2f",
912         }, {
913                 .plaintext = "abc",
914                 .psize  = 3,
915                 .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
916                           "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
917                           "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
918                           "\xE3\x6C\x9D\xA7",
919         }, {
920                 .plaintext =
921                 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
922                 .psize  = 56,
923                 .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
924                           "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
925                           "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
926                           "\x52\x52\x25\x25",
927                 .np     = 2,
928                 .tap    = { 28, 28 }
929         }, {
930                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
931                 .psize  = 64,
932                 .digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01"
933                           "\x42\xfd\x10\x92\xaa\x4e\x04\x08"
934                           "\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c"
935                           "\xef\x3b\xcb\x0e",
936         }, {
937                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
938                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
939                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
940                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
941                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
942                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
943                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
944                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
945                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
946                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
947                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
948                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
949                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
950                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
951                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
952                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
953                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
954                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
955                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
956                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
957                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
958                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
959                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
960                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
961                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
962                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
963                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
964                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
965                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
966                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
967                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
968                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
969                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
970                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
971                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
972                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
973                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
974                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
975                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
976                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
977                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
978                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
979                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
980                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
981                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
982                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
983                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
984                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
985                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
986                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
987                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
988                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
989                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
990                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
991                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
992                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
993                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
994                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
995                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
996                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
997                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
998                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
999                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1000                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1001                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1002                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1003                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1004                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1005                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1006                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1007                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1008                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1009                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1010                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1011                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1012                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1013                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1014                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1015                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1016                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1017                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1018                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1019                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1020                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1021                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1022                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1023                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1024                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1025                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1026                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1027                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1028                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1029                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1030                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1031                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1032                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1033                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1034                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1035                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1036                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1037                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1038                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1039                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1040                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1041                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1042                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1043                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1044                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1045                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1046                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1047                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1048                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1049                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1050                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1051                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1052                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1053                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1054                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1055                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1056                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1057                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1058                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1059                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1060                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1061                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1062                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1063                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1064                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1065                 .psize     = 1023,
1066                 .digest    = "\x98\x43\x07\x63\x75\xe0\xa7\x1c"
1067                              "\x78\xb1\x8b\xfd\x04\xf5\x2d\x91"
1068                              "\x20\x48\xa4\x28\xff\x55\xb1\xd3"
1069                              "\xe6\xf9\x4f\xcc",
1070         }
1071 };
1072
1073 /*
1074  * SHA256 test vectors from from NIST
1075  */
1076 #define SHA256_TEST_VECTORS     5
1077
1078 static struct hash_testvec sha256_tv_template[] = {
1079         {
1080                 .plaintext = "",
1081                 .psize  = 0,
1082                 .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14"
1083                           "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
1084                           "\x27\xae\x41\xe4\x64\x9b\x93\x4c"
1085                           "\xa4\x95\x99\x1b\x78\x52\xb8\x55",
1086         }, {
1087                 .plaintext = "abc",
1088                 .psize  = 3,
1089                 .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
1090                           "\x41\x41\x40\xde\x5d\xae\x22\x23"
1091                           "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
1092                           "\xb4\x10\xff\x61\xf2\x00\x15\xad",
1093         }, {
1094                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1095                 .psize  = 56,
1096                 .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
1097                           "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
1098                           "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
1099                           "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
1100                 .np     = 2,
1101                 .tap    = { 28, 28 }
1102         }, {
1103                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1104                 .psize  = 64,
1105                 .digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4"
1106                           "\x2c\x32\x29\x32\x19\xbb\xfb\xfa"
1107                           "\xd6\xff\x94\xa3\x72\x91\x85\x66"
1108                           "\x3b\xa7\x87\x77\x58\xa3\x40\x3a",
1109         }, {
1110                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1111                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1112                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1113                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1114                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1115                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1116                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1117                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1118                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1119                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1120                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1121                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1122                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1123                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1124                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1125                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1126                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1127                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1128                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1129                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1130                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1131                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1132                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1133                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1134                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1135                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1136                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1137                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1138                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1139                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1140                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1141                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1142                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1143                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1144                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1145                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1146                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1147                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1148                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1149                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1150                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1151                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1152                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1153                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1154                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1155                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1156                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1157                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1158                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1159                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1160                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1161                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1162                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1163                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1164                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1165                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1166                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1167                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1168                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1169                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1170                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1171                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1172                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1173                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1174                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1175                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1176                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1177                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1178                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1179                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1180                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1181                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1182                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1183                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1184                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1185                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1186                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1187                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1188                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1189                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1190                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1191                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1192                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1193                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1194                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1195                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1196                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1197                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1198                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1199                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1200                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1201                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1202                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1203                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1204                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1205                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1206                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1207                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1208                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1209                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1210                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1211                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1212                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1213                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1214                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1215                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1216                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1217                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1218                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1219                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1220                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1221                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1222                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1223                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1224                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1225                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1226                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1227                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1228                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1229                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1230                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1231                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1232                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1233                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1234                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1235                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1236                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1237                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1238                 .psize     = 1023,
1239                 .digest    = "\xc5\xce\x0c\xca\x01\x4f\x53\x3a"
1240                              "\x32\x32\x17\xcc\xd4\x6a\x71\xa9"
1241                              "\xf3\xed\x50\x10\x64\x8e\x06\xbe"
1242                              "\x9b\x4a\xa6\xbb\x05\x89\x59\x51",
1243         }
1244 };
1245
1246 /*
1247  * SHA384 test vectors from from NIST and kerneli
1248  */
1249 #define SHA384_TEST_VECTORS     6
1250
1251 static struct hash_testvec sha384_tv_template[] = {
1252         {
1253                 .plaintext = "",
1254                 .psize  = 0,
1255                 .digest = "\x38\xb0\x60\xa7\x51\xac\x96\x38"
1256                           "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a"
1257                           "\x21\xfd\xb7\x11\x14\xbe\x07\x43"
1258                           "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda"
1259                           "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb"
1260                           "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b",
1261         }, {
1262                 .plaintext= "abc",
1263                 .psize  = 3,
1264                 .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
1265                           "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
1266                           "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
1267                           "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
1268                           "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
1269                           "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
1270         }, {
1271                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1272                 .psize  = 56,
1273                 .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
1274                           "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
1275                           "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
1276                           "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
1277                           "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
1278                           "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
1279         }, {
1280                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
1281                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
1282                 .psize  = 112,
1283                 .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
1284                           "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
1285                           "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
1286                           "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
1287                           "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
1288                           "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
1289         }, {
1290                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
1291                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
1292                 .psize  = 104,
1293                 .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
1294                           "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
1295                           "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
1296                           "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
1297                           "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
1298                           "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
1299                 .np     = 4,
1300                 .tap    = { 26, 26, 26, 26 }
1301         }, {
1302                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1303                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1304                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1305                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1306                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1307                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1308                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1309                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1310                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1311                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1312                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1313                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1314                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1315                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1316                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1317                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1318                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1319                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1320                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1321                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1322                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1323                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1324                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1325                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1326                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1327                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1328                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1329                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1330                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1331                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1332                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1333                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1334                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1335                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1336                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1337                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1338                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1339                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1340                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1341                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1342                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1343                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1344                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1345                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1346                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1347                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1348                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1349                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1350                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1351                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1352                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1353                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1354                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1355                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1356                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1357                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1358                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1359                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1360                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1361                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1362                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1363                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1364                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1365                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1366                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1367                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1368                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1369                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1370                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1371                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1372                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1373                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1374                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1375                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1376                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1377                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1378                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1379                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1380                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1381                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1382                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1383                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1384                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1385                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1386                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1387                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1388                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1389                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1390                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1391                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1392                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1393                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1394                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1395                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1396                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1397                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1398                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1399                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1400                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1401                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1402                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1403                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1404                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1405                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1406                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1407                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1408                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1409                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1410                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1411                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1412                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1413                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1414                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1415                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1416                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1417                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1418                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1419                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1420                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1421                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1422                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1423                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1424                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1425                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1426                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1427                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1428                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1429                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1430                 .psize     = 1023,
1431                 .digest    = "\x4d\x97\x23\xc8\xea\x7a\x7c\x15"
1432                              "\xb8\xff\x97\x9c\xf5\x13\x4f\x31"
1433                              "\xde\x67\xf7\x24\x73\xcd\x70\x1c"
1434                              "\x03\x4a\xba\x8a\x87\x49\xfe\xdc"
1435                              "\x75\x29\x62\x83\xae\x3f\x17\xab"
1436                              "\xfd\x10\x4d\x8e\x17\x1c\x1f\xca",
1437         }
1438 };
1439
1440 /*
1441  * SHA512 test vectors from from NIST and kerneli
1442  */
1443 #define SHA512_TEST_VECTORS     6
1444
1445 static struct hash_testvec sha512_tv_template[] = {
1446         {
1447                 .plaintext = "",
1448                 .psize  = 0,
1449                 .digest = "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd"
1450                           "\xf1\x54\x28\x50\xd6\x6d\x80\x07"
1451                           "\xd6\x20\xe4\x05\x0b\x57\x15\xdc"
1452                           "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
1453                           "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0"
1454                           "\xff\x83\x18\xd2\x87\x7e\xec\x2f"
1455                           "\x63\xb9\x31\xbd\x47\x41\x7a\x81"
1456                           "\xa5\x38\x32\x7a\xf9\x27\xda\x3e",
1457         }, {
1458                 .plaintext = "abc",
1459                 .psize  = 3,
1460                 .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
1461                           "\xcc\x41\x73\x49\xae\x20\x41\x31"
1462                           "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
1463                           "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
1464                           "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
1465                           "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
1466                           "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
1467                           "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
1468         }, {
1469                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1470                 .psize  = 56,
1471                 .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
1472                           "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
1473                           "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
1474                           "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
1475                           "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
1476                           "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
1477                           "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
1478                           "\x54\xec\x63\x12\x38\xca\x34\x45",
1479         }, {
1480                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
1481                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
1482                 .psize  = 112,
1483                 .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
1484                           "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
1485                           "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
1486                           "\x72\x99\xae\xad\xb6\x88\x90\x18"
1487                           "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
1488                           "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
1489                           "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
1490                           "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
1491         }, {
1492                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
1493                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
1494                 .psize  = 104,
1495                 .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
1496                           "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
1497                           "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
1498                           "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
1499                           "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
1500                           "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
1501                           "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
1502                           "\xed\xb4\x19\x87\x23\x28\x50\xc9",
1503                 .np     = 4,
1504                 .tap    = { 26, 26, 26, 26 }
1505         }, {
1506                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1507                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1508                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1509                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1510                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1511                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1512                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1513                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1514                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1515                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1516                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1517                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1518                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1519                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1520                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1521                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1522                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1523                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1524                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1525                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1526                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1527                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1528                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1529                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1530                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1531                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1532                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1533                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1534                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1535                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1536                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1537                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1538                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1539                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1540                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1541                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1542                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1543                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1544                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1545                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1546                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1547                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1548                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1549                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1550                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1551                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1552                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1553                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1554                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1555                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1556                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1557                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1558                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1559                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1560                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1561                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1562                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1563                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1564                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1565                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1566                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1567                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1568                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1569                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1570                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1571                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1572                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1573                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1574                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1575                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1576                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1577                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1578                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1579                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1580                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1581                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1582                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1583                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1584                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1585                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1586                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1587                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1588                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1589                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1590                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1591                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1592                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1593                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1594                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1595                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1596                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1597                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1598                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1599                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1600                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1601                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1602                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1603                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1604                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1605                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1606                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1607                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1608                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1609                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1610                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1611                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1612                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1613                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1614                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1615                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1616                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1617                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1618                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1619                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1620                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1621                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1622                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1623                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1624                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1625                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1626                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1627                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1628                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1629                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1630                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1631                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1632                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1633                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1634                 .psize     = 1023,
1635                 .digest    = "\x76\xc9\xd4\x91\x7a\x5f\x0f\xaa"
1636                              "\x13\x39\xf3\x01\x7a\xfa\xe5\x41"
1637                              "\x5f\x0b\xf8\xeb\x32\xfc\xbf\xb0"
1638                              "\xfa\x8c\xcd\x17\x83\xe2\xfa\xeb"
1639                              "\x1c\x19\xde\xe2\x75\xdc\x34\x64"
1640                              "\x5f\x35\x9c\x61\x2f\x10\xf9\xec"
1641                              "\x59\xca\x9d\xcc\x25\x0c\x43\xba"
1642                              "\x85\xa8\xf8\xfe\xb5\x24\xb2\xee",
1643         }
1644 };
1645
1646
1647 /*
1648  * WHIRLPOOL test vectors from Whirlpool package
1649  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
1650  * submission
1651  */
1652 #define WP512_TEST_VECTORS      8
1653
1654 static struct hash_testvec wp512_tv_template[] = {
1655         {
1656                 .plaintext = "",
1657                 .psize  = 0,
1658                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
1659                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
1660                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
1661                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
1662                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
1663                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
1664                           "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
1665                           "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
1666
1667
1668         }, {
1669                 .plaintext = "a",
1670                 .psize  = 1,
1671                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
1672                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
1673                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
1674                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
1675                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
1676                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
1677                           "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
1678                           "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
1679         }, {
1680                 .plaintext = "abc",
1681                 .psize  = 3,
1682                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
1683                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
1684                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
1685                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
1686                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
1687                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
1688                           "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
1689                           "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
1690         }, {
1691                 .plaintext = "message digest",
1692                 .psize  = 14,
1693                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
1694                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
1695                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
1696                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
1697                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
1698                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
1699                           "\x92\xED\x92\x00\x52\x83\x8F\x33"
1700                           "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
1701         }, {
1702                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
1703                 .psize  = 26,
1704                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
1705                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
1706                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
1707                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
1708                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
1709                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
1710                           "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
1711                           "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
1712         }, {
1713                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1714                            "abcdefghijklmnopqrstuvwxyz0123456789",
1715                 .psize  = 62,
1716                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
1717                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
1718                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
1719                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
1720                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
1721                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
1722                           "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
1723                           "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
1724         }, {
1725                 .plaintext = "1234567890123456789012345678901234567890"
1726                            "1234567890123456789012345678901234567890",
1727                 .psize  = 80,
1728                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
1729                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
1730                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
1731                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
1732                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
1733                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
1734                           "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
1735                           "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
1736         }, {
1737                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
1738                 .psize  = 32,
1739                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
1740                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
1741                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
1742                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
1743                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
1744                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
1745                           "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
1746                           "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
1747         },
1748 };
1749
1750 #define WP384_TEST_VECTORS      8
1751
1752 static struct hash_testvec wp384_tv_template[] = {
1753         {
1754                 .plaintext = "",
1755                 .psize  = 0,
1756                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
1757                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
1758                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
1759                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
1760                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
1761                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
1762
1763
1764         }, {
1765                 .plaintext = "a",
1766                 .psize  = 1,
1767                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
1768                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
1769                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
1770                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
1771                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
1772                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
1773         }, {
1774                 .plaintext = "abc",
1775                 .psize  = 3,
1776                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
1777                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
1778                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
1779                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
1780                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
1781                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
1782         }, {
1783                 .plaintext = "message digest",
1784                 .psize  = 14,
1785                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
1786                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
1787                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
1788                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
1789                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
1790                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
1791         }, {
1792                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
1793                 .psize  = 26,
1794                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
1795                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
1796                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
1797                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
1798                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
1799                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
1800         }, {
1801                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1802                            "abcdefghijklmnopqrstuvwxyz0123456789",
1803                 .psize  = 62,
1804                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
1805                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
1806                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
1807                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
1808                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
1809                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
1810         }, {
1811                 .plaintext = "1234567890123456789012345678901234567890"
1812                            "1234567890123456789012345678901234567890",
1813                 .psize  = 80,
1814                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
1815                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
1816                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
1817                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
1818                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
1819                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
1820         }, {
1821                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
1822                 .psize  = 32,
1823                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
1824                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
1825                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
1826                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
1827                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
1828                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
1829         },
1830 };
1831
1832 #define WP256_TEST_VECTORS      8
1833
1834 static struct hash_testvec wp256_tv_template[] = {
1835         {
1836                 .plaintext = "",
1837                 .psize  = 0,
1838                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
1839                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
1840                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
1841                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
1842
1843
1844         }, {
1845                 .plaintext = "a",
1846                 .psize  = 1,
1847                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
1848                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
1849                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
1850                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
1851         }, {
1852                 .plaintext = "abc",
1853                 .psize  = 3,
1854                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
1855                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
1856                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
1857                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
1858         }, {
1859                 .plaintext = "message digest",
1860                 .psize  = 14,
1861                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
1862                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
1863                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
1864                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
1865         }, {
1866                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
1867                 .psize  = 26,
1868                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
1869                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
1870                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
1871                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
1872         }, {
1873                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1874                            "abcdefghijklmnopqrstuvwxyz0123456789",
1875                 .psize  = 62,
1876                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
1877                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
1878                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
1879                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
1880         }, {
1881                 .plaintext = "1234567890123456789012345678901234567890"
1882                            "1234567890123456789012345678901234567890",
1883                 .psize  = 80,
1884                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
1885                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
1886                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
1887                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
1888         }, {
1889                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
1890                 .psize  = 32,
1891                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
1892                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
1893                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
1894                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
1895         },
1896 };
1897
1898 /*
1899  * TIGER test vectors from Tiger website
1900  */
1901 #define TGR192_TEST_VECTORS     6
1902
1903 static struct hash_testvec tgr192_tv_template[] = {
1904         {
1905                 .plaintext = "",
1906                 .psize  = 0,
1907                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
1908                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
1909                           "\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
1910         }, {
1911                 .plaintext = "abc",
1912                 .psize  = 3,
1913                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
1914                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
1915                           "\x93\x5f\x7b\x95\x1c\x13\x29\x51",
1916         }, {
1917                 .plaintext = "Tiger",
1918                 .psize  = 5,
1919                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
1920                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
1921                           "\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
1922         }, {
1923                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1924                 .psize  = 64,
1925                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
1926                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
1927                           "\xb5\x86\x44\x50\x34\xa5\xa3\x86",
1928         }, {
1929                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
1930                 .psize  = 64,
1931                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
1932                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
1933                           "\x57\x89\x65\x65\x97\x5f\x91\x97",
1934         }, {
1935                 .plaintext = "Tiger - A Fast New Hash Function, "
1936                            "by Ross Anderson and Eli Biham, "
1937                            "proceedings of Fast Software Encryption 3, "
1938                            "Cambridge, 1996.",
1939                 .psize  = 125,
1940                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
1941                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
1942                           "\xdd\x68\x15\x1d\x50\x39\x74\xfc",
1943         },
1944 };
1945
1946 #define TGR160_TEST_VECTORS     6
1947
1948 static struct hash_testvec tgr160_tv_template[] = {
1949         {
1950                 .plaintext = "",
1951                 .psize  = 0,
1952                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
1953                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
1954                           "\xf3\x73\xde\x2d",
1955         }, {
1956                 .plaintext = "abc",
1957                 .psize  = 3,
1958                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
1959                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
1960                           "\x93\x5f\x7b\x95",
1961         }, {
1962                 .plaintext = "Tiger",
1963                 .psize  = 5,
1964                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
1965                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
1966                           "\x37\x79\x0c\x11",
1967         }, {
1968                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1969                 .psize  = 64,
1970                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
1971                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
1972                           "\xb5\x86\x44\x50",
1973         }, {
1974                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
1975                 .psize  = 64,
1976                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
1977                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
1978                           "\x57\x89\x65\x65",
1979         }, {
1980                 .plaintext = "Tiger - A Fast New Hash Function, "
1981                            "by Ross Anderson and Eli Biham, "
1982                            "proceedings of Fast Software Encryption 3, "
1983                            "Cambridge, 1996.",
1984                 .psize  = 125,
1985                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
1986                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
1987                           "\xdd\x68\x15\x1d",
1988         },
1989 };
1990
1991 #define TGR128_TEST_VECTORS     6
1992
1993 static struct hash_testvec tgr128_tv_template[] = {
1994         {
1995                 .plaintext = "",
1996                 .psize  = 0,
1997                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
1998                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
1999         }, {
2000                 .plaintext = "abc",
2001                 .psize  = 3,
2002                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
2003                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
2004         }, {
2005                 .plaintext = "Tiger",
2006                 .psize  = 5,
2007                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
2008                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
2009         }, {
2010                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
2011                 .psize  = 64,
2012                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
2013                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
2014         }, {
2015                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
2016                 .psize  = 64,
2017                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
2018                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
2019         }, {
2020                 .plaintext = "Tiger - A Fast New Hash Function, "
2021                            "by Ross Anderson and Eli Biham, "
2022                            "proceedings of Fast Software Encryption 3, "
2023                            "Cambridge, 1996.",
2024                 .psize  = 125,
2025                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
2026                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
2027         },
2028 };
2029
2030 #define GHASH_TEST_VECTORS 6
2031
2032 static struct hash_testvec ghash_tv_template[] =
2033 {
2034         {
2035                 .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03"
2036                           "\xff\xca\xff\x95\xf8\x30\xf0\x61",
2037                 .ksize  = 16,
2038                 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
2039                              "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
2040                 .psize  = 16,
2041                 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
2042                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
2043         }, {
2044                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2045                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2046                 .ksize  = 16,
2047                 .plaintext = "what do ya want for nothing?",
2048                 .psize  = 28,
2049                 .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce"
2050                           "\x0d\x61\x06\x27\x66\x51\xd5\xe2",
2051                 .np     = 2,
2052                 .tap    = {14, 14}
2053         }, {
2054                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2055                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2056                 .ksize  = 16,
2057                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2058                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2059                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2060                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2061                 .psize  = 50,
2062                 .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96"
2063                           "\xe1\x96\xe1\x96\xe1\x96\xe1\x96",
2064         }, {
2065                 .key    = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
2066                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
2067                 .ksize  = 16,
2068                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2069                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2070                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2071                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2072                 .psize  = 50,
2073                 .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2"
2074                           "\x49\xed\x6e\x32\x7a\xa9\xbe\x08",
2075         }, {
2076                 .key    = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
2077                           "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
2078                 .ksize  = 16,
2079                 .plaintext = "Test With Truncation",
2080                 .psize  = 20,
2081                 .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28"
2082                           "\x23\xf7\x93\xf7\x19\xf5\x96\xd9",
2083         }, {
2084                 .key    = "\x0a\x1b\x2c\x3d\x4e\x5f\x64\x71"
2085                         "\x82\x93\xa4\xb5\xc6\xd7\xe8\xf9",
2086                 .ksize  = 16,
2087                 .plaintext = "\x56\x6f\x72\x20\x6c\x61\x75\x74"
2088                         "\x65\x72\x20\x4c\x61\x75\x73\x63"
2089                         "\x68\x65\x6e\x20\x75\x6e\x64\x20"
2090                         "\x53\x74\x61\x75\x6e\x65\x6e\x20"
2091                         "\x73\x65\x69\x20\x73\x74\x69\x6c"
2092                         "\x6c\x2c\x0a\x64\x75\x20\x6d\x65"
2093                         "\x69\x6e\x20\x74\x69\x65\x66\x74"
2094                         "\x69\x65\x66\x65\x73\x20\x4c\x65"
2095                         "\x62\x65\x6e\x3b\x0a\x64\x61\x73"
2096                         "\x73\x20\x64\x75\x20\x77\x65\x69"
2097                         "\xc3\x9f\x74\x20\x77\x61\x73\x20"
2098                         "\x64\x65\x72\x20\x57\x69\x6e\x64"
2099                         "\x20\x64\x69\x72\x20\x77\x69\x6c"
2100                         "\x6c\x2c\x0a\x65\x68\x20\x6e\x6f"
2101                         "\x63\x68\x20\x64\x69\x65\x20\x42"
2102                         "\x69\x72\x6b\x65\x6e\x20\x62\x65"
2103                         "\x62\x65\x6e\x2e\x0a\x0a\x55\x6e"
2104                         "\x64\x20\x77\x65\x6e\x6e\x20\x64"
2105                         "\x69\x72\x20\x65\x69\x6e\x6d\x61"
2106                         "\x6c\x20\x64\x61\x73\x20\x53\x63"
2107                         "\x68\x77\x65\x69\x67\x65\x6e\x20"
2108                         "\x73\x70\x72\x61\x63\x68\x2c\x0a"
2109                         "\x6c\x61\x73\x73\x20\x64\x65\x69"
2110                         "\x6e\x65\x20\x53\x69\x6e\x6e\x65"
2111                         "\x20\x62\x65\x73\x69\x65\x67\x65"
2112                         "\x6e\x2e\x0a\x4a\x65\x64\x65\x6d"
2113                         "\x20\x48\x61\x75\x63\x68\x65\x20"
2114                         "\x67\x69\x62\x74\x20\x64\x69\x63"
2115                         "\x68\x2c\x20\x67\x69\x62\x20\x6e"
2116                         "\x61\x63\x68\x2c\x0a\x65\x72\x20"
2117                         "\x77\x69\x72\x64\x20\x64\x69\x63"
2118                         "\x68\x20\x6c\x69\x65\x62\x65\x6e"
2119                         "\x20\x75\x6e\x64\x20\x77\x69\x65"
2120                         "\x67\x65\x6e\x2e\x0a\x0a\x55\x6e"
2121                         "\x64\x20\x64\x61\x6e\x6e\x20\x6d"
2122                         "\x65\x69\x6e\x65\x20\x53\x65\x65"
2123                         "\x6c\x65\x20\x73\x65\x69\x74\x20"
2124                         "\x77\x65\x69\x74\x2c\x20\x73\x65"
2125                         "\x69\x20\x77\x65\x69\x74\x2c\x0a"
2126                         "\x64\x61\x73\x73\x20\x64\x69\x72"
2127                         "\x20\x64\x61\x73\x20\x4c\x65\x62"
2128                         "\x65\x6e\x20\x67\x65\x6c\x69\x6e"
2129                         "\x67\x65\x2c\x0a\x62\x72\x65\x69"
2130                         "\x74\x65\x20\x64\x69\x63\x68\x20"
2131                         "\x77\x69\x65\x20\x65\x69\x6e\x20"
2132                         "\x46\x65\x69\x65\x72\x6b\x6c\x65"
2133                         "\x69\x64\x0a\xc3\xbc\x62\x65\x72"
2134                         "\x20\x64\x69\x65\x20\x73\x69\x6e"
2135                         "\x6e\x65\x6e\x64\x65\x6e\x20\x44"
2136                         "\x69\x6e\x67\x65\x2e\x2e\x2e\x0a",
2137                 .psize  = 400,
2138                 .digest = "\xad\xb1\xc1\xe9\x56\x70\x31\x1d"
2139                         "\xbb\x5b\xdf\x5e\x70\x72\x1a\x57",
2140         },
2141 };
2142
2143 /*
2144  * HMAC-MD5 test vectors from RFC2202
2145  * (These need to be fixed to not use strlen).
2146  */
2147 #define HMAC_MD5_TEST_VECTORS   7
2148
2149 static struct hash_testvec hmac_md5_tv_template[] =
2150 {
2151         {
2152                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2153                 .ksize  = 16,
2154                 .plaintext = "Hi There",
2155                 .psize  = 8,
2156                 .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
2157                           "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
2158         }, {
2159                 .key    = "Jefe",
2160                 .ksize  = 4,
2161                 .plaintext = "what do ya want for nothing?",
2162                 .psize  = 28,
2163                 .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
2164                           "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
2165                 .np     = 2,
2166                 .tap    = {14, 14}
2167         }, {
2168                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2169                 .ksize  = 16,
2170                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2171                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2172                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2173                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2174                 .psize  = 50,
2175                 .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
2176                           "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
2177         }, {
2178                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2179                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2180                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2181                 .ksize  = 25,
2182                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2183                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2184                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2185                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2186                 .psize  = 50,
2187                 .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
2188                           "\x3a\x75\x16\x47\x46\xff\xaa\x79",
2189         }, {
2190                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2191                 .ksize  = 16,
2192                 .plaintext = "Test With Truncation",
2193                 .psize  = 20,
2194                 .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
2195                           "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
2196         }, {
2197                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2198                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2199                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2200                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2201                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2202                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2203                         "\xaa\xaa",
2204                 .ksize  = 80,
2205                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2206                 .psize  = 54,
2207                 .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
2208                           "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
2209         }, {
2210                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2211                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2212                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2213                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2214                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2215                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2216                         "\xaa\xaa",
2217                 .ksize  = 80,
2218                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2219                            "Block-Size Data",
2220                 .psize  = 73,
2221                 .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
2222                           "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
2223         },
2224 };
2225
2226 /*
2227  * HMAC-RIPEMD128 test vectors from RFC2286
2228  */
2229 #define HMAC_RMD128_TEST_VECTORS        7
2230
2231 static struct hash_testvec hmac_rmd128_tv_template[] = {
2232         {
2233                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2234                 .ksize  = 16,
2235                 .plaintext = "Hi There",
2236                 .psize  = 8,
2237                 .digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
2238                           "\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
2239         }, {
2240                 .key    = "Jefe",
2241                 .ksize  = 4,
2242                 .plaintext = "what do ya want for nothing?",
2243                 .psize  = 28,
2244                 .digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
2245                           "\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
2246                 .np     = 2,
2247                 .tap    = { 14, 14 },
2248         }, {
2249                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2250                 .ksize  = 16,
2251                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2252                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2253                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2254                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2255                 .psize  = 50,
2256                 .digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
2257                           "\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
2258         }, {
2259                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2260                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2261                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2262                 .ksize  = 25,
2263                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2264                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2265                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2266                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2267                 .psize  = 50,
2268                 .digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
2269                           "\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
2270         }, {
2271                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2272                 .ksize  = 16,
2273                 .plaintext = "Test With Truncation",
2274                 .psize  = 20,
2275                 .digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
2276                           "\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
2277         }, {
2278                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2279                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2280                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2281                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2282                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2283                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2284                         "\xaa\xaa",
2285                 .ksize  = 80,
2286                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2287                 .psize  = 54,
2288                 .digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
2289                           "\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
2290         }, {
2291                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2292                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2293                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2294                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2295                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2296                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2297                         "\xaa\xaa",
2298                 .ksize  = 80,
2299                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2300                            "Block-Size Data",
2301                 .psize  = 73,
2302                 .digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
2303                           "\x06\x90\xc2\x37\x63\x5f\x30\xc5",
2304         },
2305 };
2306
2307 /*
2308  * HMAC-RIPEMD160 test vectors from RFC2286
2309  */
2310 #define HMAC_RMD160_TEST_VECTORS        7
2311
2312 static struct hash_testvec hmac_rmd160_tv_template[] = {
2313         {
2314                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2315                 .ksize  = 20,
2316                 .plaintext = "Hi There",
2317                 .psize  = 8,
2318                 .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
2319                           "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
2320         }, {
2321                 .key    = "Jefe",
2322                 .ksize  = 4,
2323                 .plaintext = "what do ya want for nothing?",
2324                 .psize  = 28,
2325                 .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
2326                           "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
2327                 .np     = 2,
2328                 .tap    = { 14, 14 },
2329         }, {
2330                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2331                 .ksize  = 20,
2332                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2333                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2334                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2335                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2336                 .psize  = 50,
2337                 .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
2338                           "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
2339         }, {
2340                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2341                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2342                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2343                 .ksize  = 25,
2344                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2345                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2346                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2347                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2348                 .psize  = 50,
2349                 .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
2350                           "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
2351         }, {
2352                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2353                 .ksize  = 20,
2354                 .plaintext = "Test With Truncation",
2355                 .psize  = 20,
2356                 .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
2357                           "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
2358         }, {
2359                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2360                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2361                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2362                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2363                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2364                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2365                         "\xaa\xaa",
2366                 .ksize  = 80,
2367                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2368                 .psize  = 54,
2369                 .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
2370                           "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
2371         }, {
2372                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2373                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2374                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2375                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2376                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2377                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2378                         "\xaa\xaa",
2379                 .ksize  = 80,
2380                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2381                            "Block-Size Data",
2382                 .psize  = 73,
2383                 .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
2384                           "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
2385         },
2386 };
2387
2388 /*
2389  * HMAC-SHA1 test vectors from RFC2202
2390  */
2391 #define HMAC_SHA1_TEST_VECTORS  7
2392
2393 static struct hash_testvec hmac_sha1_tv_template[] = {
2394         {
2395                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2396                 .ksize  = 20,
2397                 .plaintext = "Hi There",
2398                 .psize  = 8,
2399                 .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
2400                           "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
2401                           "\x46\xbe",
2402         }, {
2403                 .key    = "Jefe",
2404                 .ksize  = 4,
2405                 .plaintext = "what do ya want for nothing?",
2406                 .psize  = 28,
2407                 .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
2408                           "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
2409                 .np     = 2,
2410                 .tap    = { 14, 14 }
2411         }, {
2412                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2413                 .ksize  = 20,
2414                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2415                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2416                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2417                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2418                 .psize  = 50,
2419                 .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
2420                           "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
2421         }, {
2422                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2423                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2424                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2425                 .ksize  = 25,
2426                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2427                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2428                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2429                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2430                 .psize  = 50,
2431                 .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
2432                           "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
2433         }, {
2434                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2435                 .ksize  = 20,
2436                 .plaintext = "Test With Truncation",
2437                 .psize  = 20,
2438                 .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
2439                           "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
2440         }, {
2441                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2442                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2443                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2444                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2445                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2446                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2447                         "\xaa\xaa",
2448                 .ksize  = 80,
2449                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2450                 .psize  = 54,
2451                 .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
2452                           "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
2453         }, {
2454                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2455                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2456                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2457                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2458                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2459                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2460                         "\xaa\xaa",
2461                 .ksize  = 80,
2462                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2463                            "Block-Size Data",
2464                 .psize  = 73,
2465                 .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
2466                           "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
2467         },
2468 };
2469
2470
2471 /*
2472  * SHA224 HMAC test vectors from RFC4231
2473  */
2474 #define HMAC_SHA224_TEST_VECTORS    4
2475
2476 static struct hash_testvec hmac_sha224_tv_template[] = {
2477         {
2478                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2479                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2480                         "\x0b\x0b\x0b\x0b",
2481                 .ksize  = 20,
2482                 /*  ("Hi There") */
2483                 .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
2484                 .psize  = 8,
2485                 .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
2486                         "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
2487                         "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
2488                         "\x53\x68\x4b\x22",
2489         }, {
2490                 .key    = "Jefe",
2491                 .ksize  = 4,
2492                 /* ("what do ya want for nothing?") */
2493                 .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
2494                         "\x79\x61\x20\x77\x61\x6e\x74\x20"
2495                         "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
2496                         "\x69\x6e\x67\x3f",
2497                 .psize  = 28,
2498                 .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
2499                         "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
2500                         "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
2501                         "\x8f\xd0\x5e\x44",
2502                 .np = 4,
2503                 .tap    = { 7, 7, 7, 7 }
2504         }, {
2505                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2506                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2507                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2508                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2509                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2510                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2511                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2512                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2513                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2514                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2515                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2516                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2517                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2518                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2519                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2520                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2521                         "\xaa\xaa\xaa",
2522                 .ksize  = 131,
2523                 /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
2524                 .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
2525                         "\x6e\x67\x20\x4c\x61\x72\x67\x65"
2526                         "\x72\x20\x54\x68\x61\x6e\x20\x42"
2527                         "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
2528                         "\x65\x20\x4b\x65\x79\x20\x2d\x20"
2529                         "\x48\x61\x73\x68\x20\x4b\x65\x79"
2530                         "\x20\x46\x69\x72\x73\x74",
2531                 .psize  = 54,
2532                 .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
2533                         "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
2534                         "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
2535                         "\x3f\xa6\x87\x0e",
2536         }, {
2537                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2538                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2539                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2540                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2541                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2542                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2543                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2544                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2545                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2546                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2547                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2548                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2549                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2550                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2551                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2552                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2553                         "\xaa\xaa\xaa",
2554                 .ksize  = 131,
2555                 /* ("This is a test using a larger than block-size key and a")
2556                 (" larger than block-size data. The key needs to be")
2557                         (" hashed before being used by the HMAC algorithm.") */
2558                 .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
2559                         "\x61\x20\x74\x65\x73\x74\x20\x75"
2560                         "\x73\x69\x6e\x67\x20\x61\x20\x6c"
2561                         "\x61\x72\x67\x65\x72\x20\x74\x68"
2562                         "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
2563                         "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
2564                         "\x79\x20\x61\x6e\x64\x20\x61\x20"
2565                         "\x6c\x61\x72\x67\x65\x72\x20\x74"
2566                         "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
2567                         "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
2568                         "\x61\x74\x61\x2e\x20\x54\x68\x65"
2569                         "\x20\x6b\x65\x79\x20\x6e\x65\x65"
2570                         "\x64\x73\x20\x74\x6f\x20\x62\x65"
2571                         "\x20\x68\x61\x73\x68\x65\x64\x20"
2572                         "\x62\x65\x66\x6f\x72\x65\x20\x62"
2573                         "\x65\x69\x6e\x67\x20\x75\x73\x65"
2574                         "\x64\x20\x62\x79\x20\x74\x68\x65"
2575                         "\x20\x48\x4d\x41\x43\x20\x61\x6c"
2576                         "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
2577                 .psize  = 152,
2578                 .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
2579                         "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
2580                         "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
2581                         "\xf6\xf5\x65\xd1",
2582         },
2583 };
2584
2585 /*
2586  * HMAC-SHA256 test vectors from
2587  * draft-ietf-ipsec-ciph-sha-256-01.txt
2588  */
2589 #define HMAC_SHA256_TEST_VECTORS        10
2590
2591 static struct hash_testvec hmac_sha256_tv_template[] = {
2592         {
2593                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2594                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2595                           "\x11\x12\x13\x14\x15\x16\x17\x18"
2596                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
2597                 .ksize  = 32,
2598                 .plaintext = "abc",
2599                 .psize  = 3,
2600                 .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
2601                           "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
2602                           "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
2603                           "\x92\x75\x90\x21\xcf\xab\x81\x81",
2604         }, {
2605                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2606                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2607                           "\x11\x12\x13\x14\x15\x16\x17\x18"
2608                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
2609                 .ksize  = 32,
2610                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
2611                 .psize  = 56,
2612                 .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
2613                           "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
2614                           "\xe6\x98\xe3\x61\x19\x42\x11\x49"
2615                           "\xea\x8c\x71\x24\x56\x69\x7d\x30",
2616         }, {
2617                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2618                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2619                           "\x11\x12\x13\x14\x15\x16\x17\x18"
2620                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
2621                 .ksize  = 32,
2622                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
2623                            "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
2624                 .psize  = 112,
2625                 .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
2626                           "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
2627                           "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
2628                           "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
2629         }, {
2630                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2631                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2632                         "\x0b\x0b\x0b\x0b\x0b\x0b",
2633                 .ksize  = 32,
2634                 .plaintext = "Hi There",
2635                 .psize  = 8,
2636                 .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
2637                           "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
2638                           "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
2639                           "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
2640         }, {
2641                 .key    = "Jefe",
2642                 .ksize  = 4,
2643                 .plaintext = "what do ya want for nothing?",
2644                 .psize  = 28,
2645                 .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
2646                           "\x6a\x04\x24\x26\x08\x95\x75\xc7"
2647                           "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
2648                           "\x9d\xec\x58\xb9\x64\xec\x38\x43",
2649                 .np     = 2,
2650                 .tap    = { 14, 14 }
2651         }, {
2652                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2653                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2654                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2655                 .ksize  = 32,
2656                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2657                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2658                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2659                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2660                 .psize  = 50,
2661                 .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
2662                           "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
2663                           "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
2664                           "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
2665         }, {
2666                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2667                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2668                           "\x11\x12\x13\x14\x15\x16\x17\x18"
2669                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
2670                           "\x21\x22\x23\x24\x25",
2671                 .ksize  = 37,
2672                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2673                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2674                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2675                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2676                 .psize  = 50,
2677                 .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
2678                           "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
2679                           "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
2680                           "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
2681         }, {
2682                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
2683                         "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
2684                         "\x0c\x0c\x0c\x0c\x0c\x0c",
2685                 .ksize  = 32,
2686                 .plaintext = "Test With Truncation",
2687                 .psize  = 20,
2688                 .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
2689                           "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
2690                           "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
2691                           "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
2692         }, {
2693                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2694                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2695                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2696                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2697                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2698                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2699                         "\xaa\xaa",
2700                 .ksize  = 80,
2701                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2702                 .psize  = 54,
2703                 .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
2704                           "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
2705                           "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
2706                           "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
2707         }, {
2708                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2709                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2710                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2711                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2712                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2713                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2714                         "\xaa\xaa",
2715                 .ksize  = 80,
2716                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
2717                            "One Block-Size Data",
2718                 .psize  = 73,
2719                 .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
2720                           "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
2721                           "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
2722                           "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
2723         },
2724 };
2725
2726 #define CMAC_AES_TEST_VECTORS 6
2727
2728 static struct hash_testvec aes_cmac128_tv_template[] = {
2729         { /* From NIST Special Publication 800-38B, AES-128 */
2730                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
2731                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
2732                 .plaintext      = zeroed_string,
2733                 .digest         = "\xbb\x1d\x69\x29\xe9\x59\x37\x28"
2734                                   "\x7f\xa3\x7d\x12\x9b\x75\x67\x46",
2735                 .psize          = 0,
2736                 .ksize          = 16,
2737         }, {
2738                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
2739                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
2740                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
2741                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
2742                 .digest         = "\x07\x0a\x16\xb4\x6b\x4d\x41\x44"
2743                                   "\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c",
2744                 .psize          = 16,
2745                 .ksize          = 16,
2746         }, {
2747                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
2748                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
2749                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
2750                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
2751                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
2752                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
2753                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11",
2754                 .digest         = "\xdf\xa6\x67\x47\xde\x9a\xe6\x30"
2755                                   "\x30\xca\x32\x61\x14\x97\xc8\x27",
2756                 .psize          = 40,
2757                 .ksize          = 16,
2758         }, {
2759                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
2760                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
2761                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
2762                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
2763                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
2764                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
2765                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
2766                            &nbs