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