~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/crypto/testmgr.h

Version: ~ [ linux-5.12-rc1 ] ~ [ linux-5.11.2 ] ~ [ linux-5.10.19 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.101 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.177 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.222 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.258 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.258 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Algorithm testing framework and tests.
  4  *
  5  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
  6  * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
  7  * Copyright (c) 2007 Nokia Siemens Networks
  8  * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
  9  * Copyright (c) 2019 Google LLC
 10  *
 11  * Updated RFC4106 AES-GCM testing. Some test vectors were taken from
 12  * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
 13  * gcm/gcm-test-vectors.tar.gz
 14  *     Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
 15  *              Adrian Hoban <adrian.hoban@intel.com>
 16  *              Gabriele Paoloni <gabriele.paoloni@intel.com>
 17  *              Tadeusz Struk (tadeusz.struk@intel.com)
 18  *     Copyright (c) 2010, Intel Corporation.
 19  */
 20 #ifndef _CRYPTO_TESTMGR_H
 21 #define _CRYPTO_TESTMGR_H
 22 
 23 #include <linux/oid_registry.h>
 24 
 25 #define MAX_IVLEN               32
 26 
 27 /*
 28  * hash_testvec:        structure to describe a hash (message digest) test
 29  * @key:        Pointer to key (NULL if none)
 30  * @plaintext:  Pointer to source data
 31  * @digest:     Pointer to expected digest
 32  * @psize:      Length of source data in bytes
 33  * @ksize:      Length of @key in bytes (0 if no key)
 34  * @setkey_error: Expected error from setkey()
 35  * @digest_error: Expected error from digest()
 36  */
 37 struct hash_testvec {
 38         const char *key;
 39         const char *plaintext;
 40         const char *digest;
 41         unsigned int psize;
 42         unsigned short ksize;
 43         int setkey_error;
 44         int digest_error;
 45 };
 46 
 47 /*
 48  * cipher_testvec:      structure to describe a symmetric cipher test
 49  * @key:        Pointer to key
 50  * @klen:       Length of @key in bytes
 51  * @iv:         Pointer to IV.  If NULL, an all-zeroes IV is used.
 52  * @iv_out:     Pointer to output IV, if applicable for the cipher.
 53  * @ptext:      Pointer to plaintext
 54  * @ctext:      Pointer to ciphertext
 55  * @len:        Length of @ptext and @ctext in bytes
 56  * @wk:         Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
 57  *              ( e.g. test needs to fail due to a weak key )
 58  * @fips_skip:  Skip the test vector in FIPS mode
 59  * @generates_iv: Encryption should ignore the given IV, and output @iv_out.
 60  *                Decryption takes @iv_out.  Needed for AES Keywrap ("kw(aes)").
 61  * @setkey_error: Expected error from setkey()
 62  * @crypt_error: Expected error from encrypt() and decrypt()
 63  */
 64 struct cipher_testvec {
 65         const char *key;
 66         const char *iv;
 67         const char *iv_out;
 68         const char *ptext;
 69         const char *ctext;
 70         unsigned char wk; /* weak key flag */
 71         unsigned short klen;
 72         unsigned int len;
 73         bool fips_skip;
 74         bool generates_iv;
 75         int setkey_error;
 76         int crypt_error;
 77 };
 78 
 79 /*
 80  * aead_testvec:        structure to describe an AEAD test
 81  * @key:        Pointer to key
 82  * @iv:         Pointer to IV.  If NULL, an all-zeroes IV is used.
 83  * @ptext:      Pointer to plaintext
 84  * @assoc:      Pointer to associated data
 85  * @ctext:      Pointer to the full authenticated ciphertext.  For AEADs that
 86  *              produce a separate "ciphertext" and "authentication tag", these
 87  *              two parts are concatenated: ciphertext || tag.
 88  * @novrfy:     Decryption verification failure expected?
 89  * @wk:         Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
 90  *              (e.g. setkey() needs to fail due to a weak key)
 91  * @klen:       Length of @key in bytes
 92  * @plen:       Length of @ptext in bytes
 93  * @alen:       Length of @assoc in bytes
 94  * @clen:       Length of @ctext in bytes
 95  * @setkey_error: Expected error from setkey()
 96  * @setauthsize_error: Expected error from setauthsize()
 97  * @crypt_error: Expected error from encrypt() and decrypt()
 98  */
 99 struct aead_testvec {
100         const char *key;
101         const char *iv;
102         const char *ptext;
103         const char *assoc;
104         const char *ctext;
105         unsigned char novrfy;
106         unsigned char wk;
107         unsigned char klen;
108         unsigned int plen;
109         unsigned int clen;
110         unsigned int alen;
111         int setkey_error;
112         int setauthsize_error;
113         int crypt_error;
114 };
115 
116 struct cprng_testvec {
117         const char *key;
118         const char *dt;
119         const char *v;
120         const char *result;
121         unsigned char klen;
122         unsigned short dtlen;
123         unsigned short vlen;
124         unsigned short rlen;
125         unsigned short loops;
126 };
127 
128 struct drbg_testvec {
129         const unsigned char *entropy;
130         size_t entropylen;
131         const unsigned char *entpra;
132         const unsigned char *entprb;
133         size_t entprlen;
134         const unsigned char *addtla;
135         const unsigned char *addtlb;
136         size_t addtllen;
137         const unsigned char *pers;
138         size_t perslen;
139         const unsigned char *expected;
140         size_t expectedlen;
141 };
142 
143 struct akcipher_testvec {
144         const unsigned char *key;
145         const unsigned char *params;
146         const unsigned char *m;
147         const unsigned char *c;
148         unsigned int key_len;
149         unsigned int param_len;
150         unsigned int m_size;
151         unsigned int c_size;
152         bool public_key_vec;
153         bool siggen_sigver_test;
154         enum OID algo;
155 };
156 
157 struct kpp_testvec {
158         const unsigned char *secret;
159         const unsigned char *b_secret;
160         const unsigned char *b_public;
161         const unsigned char *expected_a_public;
162         const unsigned char *expected_ss;
163         unsigned short secret_size;
164         unsigned short b_secret_size;
165         unsigned short b_public_size;
166         unsigned short expected_a_public_size;
167         unsigned short expected_ss_size;
168         bool genkey;
169 };
170 
171 static const char zeroed_string[48];
172 
173 /*
174  * RSA test vectors. Borrowed from openSSL.
175  */
176 static const struct akcipher_testvec rsa_tv_template[] = {
177         {
178 #ifndef CONFIG_CRYPTO_FIPS
179         .key =
180         "\x30\x81\x9A" /* sequence of 154 bytes */
181         "\x02\x01\x01" /* version - integer of 1 byte */
182         "\x02\x41" /* modulus - integer of 65 bytes */
183         "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
184         "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
185         "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
186         "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
187         "\xF5"
188         "\x02\x01\x11" /* public key - integer of 1 byte */
189         "\x02\x40" /* private key - integer of 64 bytes */
190         "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
191         "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
192         "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
193         "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"
194         "\x02\x01\x00" /* prime1 - integer of 1 byte */
195         "\x02\x01\x00" /* prime2 - integer of 1 byte */
196         "\x02\x01\x00" /* exponent1 - integer of 1 byte */
197         "\x02\x01\x00" /* exponent2 - integer of 1 byte */
198         "\x02\x01\x00", /* coefficient - integer of 1 byte */
199         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
200         .c =
201         "\x63\x1c\xcd\x7b\xe1\x7e\xe4\xde\xc9\xa8\x89\xa1\x74\xcb\x3c\x63"
202         "\x7d\x24\xec\x83\xc3\x15\xe4\x7f\x73\x05\x34\xd1\xec\x22\xbb\x8a"
203         "\x5e\x32\x39\x6d\xc1\x1d\x7d\x50\x3b\x9f\x7a\xad\xf0\x2e\x25\x53"
204         "\x9f\x6e\xbd\x4c\x55\x84\x0c\x9b\xcf\x1a\x4b\x51\x1e\x9e\x0c\x06",
205         .key_len = 157,
206         .m_size = 8,
207         .c_size = 64,
208         }, {
209         .key =
210         "\x30\x82\x01\x1D" /* sequence of 285 bytes */
211         "\x02\x01\x01" /* version - integer of 1 byte */
212         "\x02\x81\x81" /* modulus - integer of 129 bytes */
213         "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
214         "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
215         "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
216         "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80"
217         "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25"
218         "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39"
219         "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68"
220         "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
221         "\xCB"
222         "\x02\x01\x11" /* public key - integer of 1 byte */
223         "\x02\x81\x81"  /* private key - integer of 129 bytes */
224         "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD"
225         "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41"
226         "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69"
227         "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA"
228         "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94"
229         "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A"
230         "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94"
231         "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3"
232         "\xC1"
233         "\x02\x01\x00" /* prime1 - integer of 1 byte */
234         "\x02\x01\x00" /* prime2 - integer of 1 byte */
235         "\x02\x01\x00" /* exponent1 - integer of 1 byte */
236         "\x02\x01\x00" /* exponent2 - integer of 1 byte */
237         "\x02\x01\x00", /* coefficient - integer of 1 byte */
238         .key_len = 289,
239         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
240         .c =
241         "\x74\x1b\x55\xac\x47\xb5\x08\x0a\x6e\x2b\x2d\xf7\x94\xb8\x8a\x95"
242         "\xed\xa3\x6b\xc9\x29\xee\xb2\x2c\x80\xc3\x39\x3b\x8c\x62\x45\x72"
243         "\xc2\x7f\x74\x81\x91\x68\x44\x48\x5a\xdc\xa0\x7e\xa7\x0b\x05\x7f"
244         "\x0e\xa0\x6c\xe5\x8f\x19\x4d\xce\x98\x47\x5f\xbd\x5f\xfe\xe5\x34"
245         "\x59\x89\xaf\xf0\xba\x44\xd7\xf1\x1a\x50\x72\xef\x5e\x4a\xb6\xb7"
246         "\x54\x34\xd1\xc4\x83\x09\xdf\x0f\x91\x5f\x7d\x91\x70\x2f\xd4\x13"
247         "\xcc\x5e\xa4\x6c\xc3\x4d\x28\xef\xda\xaf\xec\x14\x92\xfc\xa3\x75"
248         "\x13\xb4\xc1\xa1\x11\xfc\x40\x2f\x4c\x9d\xdf\x16\x76\x11\x20\x6b",
249         .m_size = 8,
250         .c_size = 128,
251         }, {
252 #endif
253         .key =
254         "\x30\x82\x02\x1F" /* sequence of 543 bytes */
255         "\x02\x01\x01" /* version - integer of 1 byte */
256         "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
257         "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
258         "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
259         "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
260         "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
261         "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
262         "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
263         "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
264         "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
265         "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
266         "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
267         "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
268         "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
269         "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
270         "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
271         "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
272         "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
273         "\x02\x03\x01\x00\x01" /* public key - integer of 3 bytes */
274         "\x02\x82\x01\x00" /* private key - integer of 256 bytes */
275         "\x52\x41\xF4\xDA\x7B\xB7\x59\x55\xCA\xD4\x2F\x0F\x3A\xCB\xA4\x0D"
276         "\x93\x6C\xCC\x9D\xC1\xB2\xFB\xFD\xAE\x40\x31\xAC\x69\x52\x21\x92"
277         "\xB3\x27\xDF\xEA\xEE\x2C\x82\xBB\xF7\x40\x32\xD5\x14\xC4\x94\x12"
278         "\xEC\xB8\x1F\xCA\x59\xE3\xC1\x78\xF3\x85\xD8\x47\xA5\xD7\x02\x1A"
279         "\x65\x79\x97\x0D\x24\xF4\xF0\x67\x6E\x75\x2D\xBF\x10\x3D\xA8\x7D"
280         "\xEF\x7F\x60\xE4\xE6\x05\x82\x89\x5D\xDF\xC6\xD2\x6C\x07\x91\x33"
281         "\x98\x42\xF0\x02\x00\x25\x38\xC5\x85\x69\x8A\x7D\x2F\x95\x6C\x43"
282         "\x9A\xB8\x81\xE2\xD0\x07\x35\xAA\x05\x41\xC9\x1E\xAF\xE4\x04\x3B"
283         "\x19\xB8\x73\xA2\xAC\x4B\x1E\x66\x48\xD8\x72\x1F\xAC\xF6\xCB\xBC"
284         "\x90\x09\xCA\xEC\x0C\xDC\xF9\x2C\xD7\xEB\xAE\xA3\xA4\x47\xD7\x33"
285         "\x2F\x8A\xCA\xBC\x5E\xF0\x77\xE4\x97\x98\x97\xC7\x10\x91\x7D\x2A"
286         "\xA6\xFF\x46\x83\x97\xDE\xE9\xE2\x17\x03\x06\x14\xE2\xD7\xB1\x1D"
287         "\x77\xAF\x51\x27\x5B\x5E\x69\xB8\x81\xE6\x11\xC5\x43\x23\x81\x04"
288         "\x62\xFF\xE9\x46\xB8\xD8\x44\xDB\xA5\xCC\x31\x54\x34\xCE\x3E\x82"
289         "\xD6\xBF\x7A\x0B\x64\x21\x6D\x88\x7E\x5B\x45\x12\x1E\x63\x8D\x49"
290         "\xA7\x1D\xD9\x1E\x06\xCD\xE8\xBA\x2C\x8C\x69\x32\xEA\xBE\x60\x71"
291         "\x02\x01\x00" /* prime1 - integer of 1 byte */
292         "\x02\x01\x00" /* prime2 - integer of 1 byte */
293         "\x02\x01\x00" /* exponent1 - integer of 1 byte */
294         "\x02\x01\x00" /* exponent2 - integer of 1 byte */
295         "\x02\x01\x00", /* coefficient - integer of 1 byte */
296         .key_len = 547,
297         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
298         .c =
299         "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
300         "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
301         "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
302         "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
303         "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
304         "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
305         "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
306         "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
307         "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
308         "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
309         "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
310         "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
311         "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
312         "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
313         "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
314         "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
315         .m_size = 8,
316         .c_size = 256,
317         }, {
318         .key =
319         "\x30\x82\x01\x09" /* sequence of 265 bytes */
320         "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
321         "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
322         "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
323         "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
324         "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
325         "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
326         "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
327         "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
328         "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
329         "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
330         "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
331         "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
332         "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
333         "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
334         "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
335         "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
336         "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
337         "\x02\x03\x01\x00\x01", /* public key - integer of 3 bytes */
338         .key_len = 269,
339         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
340         .c =
341         "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
342         "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
343         "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
344         "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
345         "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
346         "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
347         "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
348         "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
349         "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
350         "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
351         "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
352         "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
353         "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
354         "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
355         "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
356         "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
357         .m_size = 8,
358         .c_size = 256,
359         .public_key_vec = true,
360 #ifndef CONFIG_CRYPTO_FIPS
361         }, {
362         .key =
363         "\x30\x82\x09\x29" /* sequence of 2345 bytes */
364         "\x02\x01\x00" /* version integer of 1 byte */
365         "\x02\x82\x02\x01" /* modulus - integer of 513 bytes */
366         "\x00\xC3\x8B\x55\x7B\x73\x4D\xFF\xE9\x9B\xC6\xDC\x67\x3C\xB4\x8E"
367         "\xA0\x86\xED\xF2\xB9\x50\x5C\x54\x5C\xBA\xE4\xA1\xB2\xA7\xAE\x2F"
368         "\x1B\x7D\xF1\xFB\xAC\x79\xC5\xDF\x1A\x00\xC9\xB2\xC1\x61\x25\x33"
369         "\xE6\x9C\xE9\xCF\xD6\x27\xC4\x4E\x44\x30\x44\x5E\x08\xA1\x87\x52"
370         "\xCC\x6B\x97\x70\x8C\xBC\xA5\x06\x31\x0C\xD4\x2F\xD5\x7D\x26\x24"
371         "\xA2\xE2\xAC\x78\xF4\x53\x14\xCE\xF7\x19\x2E\xD7\xF7\xE6\x0C\xB9"
372         "\x56\x7F\x0B\xF1\xB1\xE2\x43\x70\xBD\x86\x1D\xA1\xCC\x2B\x19\x08"
373         "\x76\xEF\x91\xAC\xBF\x20\x24\x0D\x38\xC0\x89\xB8\x9A\x70\xB3\x64"
374         "\xD9\x8F\x80\x41\x10\x5B\x9F\xB1\xCB\x76\x43\x00\x21\x25\x36\xD4"
375         "\x19\xFC\x55\x95\x10\xE4\x26\x74\x98\x2C\xD9\xBD\x0B\x2B\x04\xC2"
376         "\xAC\x82\x38\xB4\xDD\x4C\x04\x7E\x51\x36\x40\x1E\x0B\xC4\x7C\x25"
377         "\xDD\x4B\xB2\xE7\x20\x0A\x57\xF9\xB4\x94\xC3\x08\x33\x22\x6F\x8B"
378         "\x48\xDB\x03\x68\x5A\x5B\xBA\xAE\xF3\xAD\xCF\xC3\x6D\xBA\xF1\x28"
379         "\x67\x7E\x6C\x79\x07\xDE\xFC\xED\xE7\x96\xE3\x6C\xE0\x2C\x87\xF8"
380         "\x02\x01\x28\x38\x43\x21\x53\x84\x69\x75\x78\x15\x7E\xEE\xD2\x1B"
381         "\xB9\x23\x40\xA8\x86\x1E\x38\x83\xB2\x73\x1D\x53\xFB\x9E\x2A\x8A"
382         "\xB2\x75\x35\x01\xC3\xC3\xC4\x94\xE8\x84\x86\x64\x81\xF4\x42\xAA"
383         "\x3C\x0E\xD6\x4F\xBC\x0A\x09\x2D\xE7\x1B\xD4\x10\xA8\x54\xEA\x89"
384         "\x84\x8A\xCB\xF7\x5A\x3C\xCA\x76\x08\x29\x62\xB4\x6A\x22\xDF\x14"
385         "\x95\x71\xFD\xB6\x86\x39\xB8\x8B\xF8\x91\x7F\x38\xAA\x14\xCD\xE5"
386         "\xF5\x1D\xC2\x6D\x53\x69\x52\x84\x7F\xA3\x1A\x5E\x26\x04\x83\x06"
387         "\x73\x52\x56\xCF\x76\x26\xC9\xDD\x75\xD7\xFC\xF4\x69\xD8\x7B\x55"
388         "\xB7\x68\x13\x53\xB9\xE7\x89\xC3\xE8\xD6\x6E\xA7\x6D\xEA\x81\xFD"
389         "\xC4\xB7\x05\x5A\xB7\x41\x0A\x23\x8E\x03\x8A\x1C\xAE\xD3\x1E\xCE"
390         "\xE3\x5E\xFC\x19\x4A\xEE\x61\x9B\x8E\xE5\xE5\xDD\x85\xF9\x41\xEC"
391         "\x14\x53\x92\xF7\xDD\x06\x85\x02\x91\xE3\xEB\x6C\x43\x03\xB1\x36"
392         "\x7B\x89\x5A\xA8\xEB\xFC\xD5\xA8\x35\xDC\x81\xD9\x5C\xBD\xCA\xDC"
393         "\x9B\x98\x0B\x06\x5D\x0C\x5B\xEE\xF3\xD5\xCC\x57\xC9\x71\x2F\x90"
394         "\x3B\x3C\xF0\x8E\x4E\x35\x48\xAE\x63\x74\xA9\xFC\x72\x75\x8E\x34"
395         "\xA8\xF2\x1F\xEA\xDF\x3A\x37\x2D\xE5\x39\x39\xF8\x57\x58\x3C\x04"
396         "\xFE\x87\x06\x98\xBC\x7B\xD3\x21\x36\x60\x25\x54\xA7\x3D\xFA\x91"
397         "\xCC\xA8\x0B\x92\x8E\xB4\xF7\x06\xFF\x1E\x95\xCB\x07\x76\x97\x3B"
398         "\x9D"
399         "\x02\x03\x01\x00\x01" /* public key integer of 3 bytes */
400         "\x02\x82\x02\x00" /* private key integer of 512 bytes */
401         "\x74\xA9\xE0\x6A\x32\xB4\xCA\x85\xD9\x86\x9F\x60\x88\x7B\x40\xCC"
402         "\xCD\x33\x91\xA8\xB6\x25\x1F\xBF\xE3\x51\x1C\x97\xB6\x2A\xD9\xB8"
403         "\x11\x40\x19\xE3\x21\x13\xC8\xB3\x7E\xDC\xD7\x65\x40\x4C\x2D\xD6"
404         "\xDC\xAF\x32\x6C\x96\x75\x2C\x2C\xCA\x8F\x3F\x7A\xEE\xC4\x09\xC6"
405         "\x24\x3A\xC9\xCF\x6D\x8D\x17\x50\x94\x52\xD3\xE7\x0F\x2F\x7E\x94"
406         "\x1F\xA0\xBE\xD9\x25\xE8\x38\x42\x7C\x27\xD2\x79\xF8\x2A\x87\x38"
407         "\xEF\xBB\x74\x8B\xA8\x6E\x8C\x08\xC6\xC7\x4F\x0C\xBC\x79\xC6\xEF"
408         "\x0E\xA7\x5E\xE4\xF8\x8C\x09\xC7\x5E\x37\xCC\x87\x77\xCD\xCF\xD1"
409         "\x6D\x28\x1B\xA9\x62\xC0\xB8\x16\xA7\x8B\xF9\xBB\xCC\xB4\x15\x7F"
410         "\x1B\x69\x03\xF2\x7B\xEB\xE5\x8C\x14\xD6\x23\x4F\x52\x6F\x18\xA6"
411         "\x4B\x5B\x01\xAD\x35\xF9\x48\x53\xB3\x86\x35\x66\xD7\xE7\x29\xC0"
412         "\x09\xB5\xC6\xE6\xFA\xC4\xDA\x19\xBE\xD7\x4D\x41\x14\xBE\x6F\xDF"
413         "\x1B\xAB\xC0\xCA\x88\x07\xAC\xF1\x7D\x35\x83\x67\x28\x2D\x50\xE9"
414         "\xCE\x27\x71\x5E\x1C\xCF\xD2\x30\x65\x79\x72\x2F\x9C\xE1\xD2\x39"
415         "\x7F\xEF\x3B\x01\xF2\x14\x1D\xDF\xBD\x51\xD3\xA1\x53\x62\xCF\x5F"
416         "\x79\x84\xCE\x06\x96\x69\x29\x49\x82\x1C\x71\x4A\xA1\x66\xC8\x2F"
417         "\xFD\x7B\x96\x7B\xFC\xC4\x26\x58\xC4\xFC\x7C\xAF\xB5\xE8\x95\x83"
418         "\x87\xCB\x46\xDE\x97\xA7\xB3\xA2\x54\x5B\xD7\xAF\xAB\xEB\xC8\xF3"
419         "\x55\x9D\x48\x2B\x30\x9C\xDC\x26\x4B\xC2\x89\x45\x13\xB2\x01\x9A"
420         "\xA4\x65\xC3\xEC\x24\x2D\x26\x97\xEB\x80\x8A\x9D\x03\xBC\x59\x66"
421         "\x9E\xE2\xBB\xBB\x63\x19\x64\x93\x11\x7B\x25\x65\x30\xCD\x5B\x4B"
422         "\x2C\xFF\xDC\x2D\x30\x87\x1F\x3C\x88\x07\xD0\xFC\x48\xCC\x05\x8A"
423         "\xA2\xC8\x39\x3E\xD5\x51\xBC\x0A\xBE\x6D\xA8\xA0\xF6\x88\x06\x79"
424         "\x13\xFF\x1B\x45\xDA\x54\xC9\x24\x25\x8A\x75\x0A\x26\xD1\x69\x81"
425         "\x14\x14\xD1\x79\x7D\x8E\x76\xF2\xE0\xEB\xDD\x0F\xDE\xC2\xEC\x80"
426         "\xD7\xDC\x16\x99\x92\xBE\xCB\x40\x0C\xCE\x7C\x3B\x46\xA2\x5B\x5D"
427         "\x0C\x45\xEB\xE1\x00\xDE\x72\x50\xB1\xA6\x0B\x76\xC5\x8D\xFC\x82"
428         "\x38\x6D\x99\x14\x1D\x1A\x4A\xD3\x7C\x53\xB8\x12\x46\xA2\x30\x38"
429         "\x82\xF4\x96\x6E\x8C\xCE\x47\x0D\xAF\x0A\x3B\x45\xB7\x43\x95\x43"
430         "\x9E\x02\x2C\x44\x07\x6D\x1F\x3C\x66\x89\x09\xB6\x1F\x06\x30\xCC"
431         "\xAD\xCE\x7D\x9A\xDE\x3E\xFB\x6C\xE4\x58\x43\xD2\x4F\xA5\x9E\x5E"
432         "\xA7\x7B\xAE\x3A\xF6\x7E\xD9\xDB\xD3\xF5\xC5\x41\xAF\xE6\x9C\x91"
433         "\x02\x82\x01\x01" /* prime1 - integer of 257 bytes */
434         "\x00\xE0\xA6\x6C\xF0\xA2\xF8\x81\x85\x36\x43\xD0\x13\x0B\x33\x8B"
435         "\x8F\x78\x3D\xAC\xC7\x5E\x46\x6A\x7F\x05\xAE\x3E\x26\x0A\xA6\xD0"
436         "\x51\xF3\xC8\x61\xF5\x77\x22\x48\x10\x87\x4C\xD5\xA4\xD5\xAE\x2D"
437         "\x4E\x7A\xFE\x1C\x31\xE7\x6B\xFF\xA4\x69\x20\xF9\x2A\x0B\x99\xBE"
438         "\x7C\x32\x68\xAD\xB0\xC6\x94\x81\x41\x75\xDC\x06\x78\x0A\xB4\xCF"
439         "\xCD\x1B\x2D\x31\xE4\x7B\xEA\xA8\x35\x99\x75\x57\xC6\x0E\xF6\x78"
440         "\x4F\xA0\x92\x4A\x00\x1B\xE7\x96\xF2\x5B\xFD\x2C\x0A\x0A\x13\x81"
441         "\xAF\xCB\x59\x87\x31\xD9\x83\x65\xF2\x22\x48\xD0\x03\x67\x39\xF6"
442         "\xFF\xA8\x36\x07\x3A\x68\xE3\x7B\xA9\x64\xFD\x9C\xF7\xB1\x3D\xBF"
443         "\x26\x5C\xCC\x7A\xFC\xA2\x8F\x51\xD1\xE1\xE2\x3C\xEC\x06\x75\x7C"
444         "\x34\xF9\xA9\x33\x70\x11\xAD\x5A\xDC\x5F\xCF\x50\xF6\x23\x2F\x39"
445         "\xAC\x92\x48\x53\x4D\x01\x96\x3C\xD8\xDC\x1F\x23\x23\x78\x80\x34"
446         "\x54\x14\x76\x8B\xB6\xBB\xFB\x88\x78\x31\x59\x28\xD2\xB1\x75\x17"
447         "\x88\x04\x4A\x78\x62\x18\x2E\xF5\xFB\x9B\xEF\x15\xD8\x16\x47\xC6"
448         "\x42\xB1\x02\xDA\x9E\xE3\x84\x90\xB4\x2D\xC3\xCE\x13\xC9\x12\x7D"
449         "\x3E\xCD\x39\x39\xC9\xAD\xA1\x1A\xE6\xD5\xAD\x5A\x09\x4D\x1B\x0C"
450         "\xAB"
451         "\x02\x82\x01\x01" /* prime 2 - integer of 257 bytes */
452         "\x00\xDE\xD5\x1B\xF6\xCD\x83\xB1\xC6\x47\x7E\xB9\xC0\x6B\xA9\xB8"
453         "\x02\xF3\xAE\x40\x5D\xFC\xD3\xE5\x4E\xF1\xE3\x39\x04\x52\x84\x89"
454         "\x40\x37\xBB\xC2\xCD\x7F\x71\x77\x17\xDF\x6A\x4C\x31\x24\x7F\xB9"
455         "\x7E\x7F\xC8\x43\x4A\x3C\xEB\x8D\x1B\x7F\x21\x51\x67\x45\x8F\xA0"
456         "\x36\x29\x3A\x18\x45\xA5\x32\xEC\x74\x88\x3C\x98\x5D\x67\x3B\xD7"
457         "\x51\x1F\xE9\xAE\x09\x01\xDE\xDE\x7C\xFB\x60\xD1\xA5\x6C\xE9\x6A"
458         "\x93\x04\x02\x3A\xBB\x67\x02\xB9\xFD\x23\xF0\x02\x2B\x49\x85\xC9"
459         "\x5B\xE7\x4B\xDF\xA3\xF4\xEE\x59\x4C\x45\xEF\x8B\xC1\x6B\xDE\xDE"
460         "\xBC\x1A\xFC\xD2\x76\x3F\x33\x74\xA9\x8E\xA3\x7E\x0C\xC6\xCE\x70"
461         "\xA1\x5B\xA6\x77\xEA\x76\xEB\x18\xCE\xB9\xD7\x78\x8D\xAE\x06\xBB"
462         "\xD3\x1F\x16\x0D\x05\xAB\x4F\xC6\x52\xC8\x6B\x36\x51\x7D\x1D\x27"
463         "\xAF\x88\x9A\x6F\xCC\x25\x2E\x74\x06\x72\xCE\x9E\xDB\xE0\x9D\x30"
464         "\xEF\x55\xA5\x58\x21\xA7\x42\x12\x2C\x2C\x23\x87\xC1\x0F\xE8\x51"
465         "\xDA\x53\xDA\xFC\x05\x36\xDF\x08\x0E\x08\x36\xBE\x5C\x86\x9E\xCA"
466         "\x68\x90\x33\x12\x0B\x14\x82\xAB\x90\x1A\xD4\x49\x32\x9C\xBD\xAA"
467         "\xAB\x4E\x38\xF1\xEE\xED\x3D\x3F\xE8\xBD\x48\x56\xA6\x64\xEE\xC8"
468         "\xD7"
469         "\x02\x82\x01\x01" /* exponent 1 - integer of 257 bytes */
470         "\x00\x96\x5E\x6F\x8F\x06\xD6\xE6\x03\x1F\x96\x76\x81\x38\xBF\x30"
471         "\xCC\x40\x84\xAF\xD0\xE7\x06\xA5\x24\x0E\xCE\x59\xA5\x26\xFE\x0F"
472         "\x74\xBB\x83\xC6\x26\x02\xAF\x3C\xA3\x6B\x9C\xFF\x68\x0C\xEB\x40"
473         "\x42\x46\xCB\x2E\x5E\x2C\xF4\x3A\x32\x77\x77\xED\xAF\xBA\x02\x17"
474         "\xE1\x93\xF0\x43\x4A\x8F\x31\x39\xEF\x72\x0F\x6B\x79\x10\x59\x84"
475         "\xBA\x5A\x55\x7F\x0E\xDB\xEE\xEE\xD6\xA9\xB8\x44\x9F\x3A\xC6\xB9"
476         "\x33\x3B\x5C\x90\x11\xD0\x9B\xCC\x8A\xBF\x0E\x10\x5B\x4B\xF1\x50"
477         "\x9E\x35\xB3\xE0\x6D\x7A\x95\x9C\x38\x5D\xC0\x75\x13\xC2\x15\xA7"
478         "\x81\xEA\xBA\xF7\x4D\x9E\x85\x9D\xF1\x7D\xBA\xD0\x45\x6F\x2A\xD0"
479         "\x76\xC2\x28\xD0\xAD\xA7\xB5\xDC\xE3\x6A\x99\xFF\x83\x50\xB3\x75"
480         "\x07\x14\x91\xAF\xEF\x74\xB5\x9F\x9A\xE0\xBA\xA9\x0B\x87\xF3\x85"
481         "\x5C\x40\xB2\x0E\xA7\xFD\xC6\xED\x45\x8E\xD9\x7C\xB0\xB2\x68\xC6"
482         "\x1D\xFD\x70\x78\x06\x41\x7F\x95\x12\x36\x9D\xE2\x58\x5D\x15\xEE"
483         "\x41\x49\xF5\xFA\xEC\x56\x19\xA0\xE6\xE0\xB2\x40\xE1\xD9\xD0\x03"
484         "\x22\x02\xCF\xD1\x3C\x07\x38\x65\x8F\x65\x0E\xAA\x32\xCE\x25\x05"
485         "\x16\x73\x51\xB9\x9F\x88\x0B\xCD\x30\xF3\x97\xCC\x2B\x6B\xA4\x0E"
486         "\x6F"
487         "\x02\x82\x01\x00" /* exponent 2 - integer of 256 bytes */
488         "\x2A\x5F\x3F\xB8\x08\x90\x58\x47\xA9\xE4\xB1\x11\xA3\xE7\x5B\xF4"
489         "\x43\xBE\x08\xC3\x56\x86\x3C\x7E\x6C\x84\x96\x9C\xF9\xCB\xF6\x05"
490         "\x5E\x13\xB8\x11\x37\x80\xAD\xF2\xBE\x2B\x0A\x5D\xF5\xE0\xCB\xB7"
491         "\x00\x39\x66\x82\x41\x5F\x51\x2F\xBF\x56\xE8\x91\xC8\xAA\x6C\xFE"
492         "\x9F\x8C\x4A\x7D\x43\xD2\x91\x1F\xFF\x9F\xF6\x21\x1C\xB6\x46\x55"
493         "\x48\xCA\x38\xAB\xC1\xCD\x4D\x65\x5A\xAF\xA8\x6D\xDA\x6D\xF0\x34"
494         "\x10\x79\x14\x0D\xFA\xA2\x8C\x17\x54\xB4\x18\xD5\x7E\x5F\x90\x50"
495         "\x87\x84\xE7\xFB\xD7\x61\x53\x5D\xAB\x96\xC7\x6E\x7A\x42\xA0\xFC"
496         "\x07\xED\xB7\x5F\x80\xD9\x19\xFF\xFB\xFD\x9E\xC4\x73\x31\x62\x3D"
497         "\x6C\x9E\x15\x03\x62\xA5\x85\xCC\x19\x8E\x9D\x7F\xE3\x6D\xA8\x5D"
498         "\x96\xF5\xAC\x78\x3D\x81\x27\xE7\x29\xF1\x29\x1D\x09\xBB\x77\x86"
499         "\x6B\x65\x62\x88\xE1\x31\x1A\x22\xF7\xC5\xCE\x73\x65\x1C\xBE\xE7"
500         "\x63\xD3\xD3\x14\x63\x27\xAF\x28\xF3\x23\xB6\x76\xC1\xBD\x9D\x82"
501         "\xF4\x9B\x19\x7D\x2C\x57\xF0\xC2\x2A\x51\xAE\x95\x0D\x8C\x38\x54"
502         "\xF5\xC6\xA0\x51\xB7\x0E\xB9\xEC\xE7\x0D\x22\xF6\x1A\xD3\xFE\x16"
503         "\x21\x03\xB7\x0D\x85\xD3\x35\xC9\xDD\xE4\x59\x85\xBE\x7F\xA1\x75"
504         "\x02\x82\x01\x01" /* coefficient - integer of 257 bytes */
505         "\x00\xB9\x48\xD2\x54\x2F\x19\x54\x64\xAE\x62\x80\x61\x89\x80\xB4"
506         "\x48\x0B\x8D\x7E\x1B\x0F\x50\x08\x82\x3F\xED\x75\x84\xB7\x13\xE4"
507         "\xF8\x8D\xA8\xBB\x54\x21\x4C\x5A\x54\x07\x16\x4B\xB4\xA4\x9E\x30"
508         "\xBF\x7A\x30\x1B\x39\x60\xA3\x21\x53\xFB\xB0\xDC\x0F\x7C\x2C\xFB"
509         "\xAA\x95\x7D\x51\x39\x28\x33\x1F\x25\x31\x53\xF5\xD2\x64\x2B\xF2"
510         "\x1E\xB3\xC0\x6A\x0B\xC9\xA4\x42\x64\x5C\xFB\x15\xA3\xE8\x4C\x3A"
511         "\x9C\x3C\xBE\xA3\x39\x83\x23\xE3\x6D\x18\xCC\xC2\xDC\x63\x8D\xBA"
512         "\x98\xE0\xE0\x31\x4A\x2B\x37\x9C\x4D\x6B\xF3\x9F\x51\xE4\x43\x5C"
513         "\x83\x5F\xBF\x5C\xFE\x92\x45\x01\xAF\xF5\xC2\xF4\xB7\x56\x93\xA5"
514         "\xF4\xAA\x67\x3C\x48\x37\xBD\x9A\x3C\xFE\xA5\x9A\xB0\xD1\x6B\x85"
515         "\xDD\x81\xD4\xFA\xAD\x31\x83\xA8\x22\x9B\xFD\xB4\x61\xDC\x7A\x51"
516         "\x59\x62\x10\x1B\x7E\x44\xA3\xFE\x90\x51\x5A\x3E\x02\x87\xAD\xFA"
517         "\xDD\x0B\x1F\x3D\x35\xAF\xEE\x13\x85\x51\xA7\x42\xC0\xEE\x9E\x20"
518         "\xE9\xD0\x29\xB2\xE4\x21\xE4\x6D\x62\xB9\xF4\x48\x4A\xD8\x46\x8E"
519         "\x61\xA6\x2C\x5D\xDF\x8F\x97\x2B\x3A\x75\x1D\x83\x17\x6F\xC6\xB0"
520         "\xDE\xFC\x14\x25\x06\x5A\x60\xBB\xB8\x21\x89\xD1\xEF\x57\xF1\x71"
521         "\x3D",
522         .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
523         .c =
524         "\x5c\xce\x9c\xd7\x9a\x9e\xa1\xfe\x7a\x82\x3c\x68\x27\x98\xe3\x5d"
525         "\xd5\xd7\x07\x29\xf5\xfb\xc3\x1a\x7f\x63\x1e\x62\x31\x3b\x19\x87"
526         "\x79\x4f\xec\x7b\xf3\xcb\xea\x9b\x95\x52\x3a\x40\xe5\x87\x7b\x72"
527         "\xd1\x72\xc9\xfb\x54\x63\xd8\xc9\xd7\x2c\xfc\x7b\xc3\x14\x1e\xbc"
528         "\x18\xb4\x34\xa1\xbf\x14\xb1\x37\x31\x6e\xf0\x1b\x35\x19\x54\x07"
529         "\xf7\x99\xec\x3e\x63\xe2\xcd\x61\x28\x65\xc3\xcd\xb1\x38\x36\xa5"
530         "\xb2\xd7\xb0\xdc\x1f\xf5\xef\x19\xc7\x53\x32\x2d\x1c\x26\xda\xe4"
531         "\x0d\xd6\x90\x7e\x28\xd8\xdc\xe4\x61\x05\xd2\x25\x90\x01\xd3\x96"
532         "\x6d\xa6\xcf\x58\x20\xbb\x03\xf4\x01\xbc\x79\xb9\x18\xd8\xb8\xba"
533         "\xbd\x93\xfc\xf2\x62\x5d\x8c\x66\x1e\x0e\x84\x59\x93\xdd\xe2\x93"
534         "\xa2\x62\x7d\x08\x82\x7a\xdd\xfc\xb8\xbc\xc5\x4f\x9c\x4e\xbf\xb4"
535         "\xfc\xf4\xc5\x01\xe8\x00\x70\x4d\x28\x26\xcc\x2e\xfe\x0e\x58\x41"
536         "\x8b\xec\xaf\x7c\x4b\x54\xd0\xa0\x64\xf9\x32\xf4\x2e\x47\x65\x0a"
537         "\x67\x88\x39\x3a\xdb\xb2\xdb\x7b\xb5\xf6\x17\xa8\xd9\xc6\x5e\x28"
538         "\x13\x82\x8a\x99\xdb\x60\x08\xa5\x23\x37\xfa\x88\x90\x31\xc8\x9d"
539         "\x8f\xec\xfb\x85\x9f\xb1\xce\xa6\x24\x50\x46\x44\x47\xcb\x65\xd1"
540         "\xdf\xc0\xb1\x6c\x90\x1f\x99\x8e\x4d\xd5\x9e\x31\x07\x66\x87\xdf"
541         "\x01\xaa\x56\x3c\x71\xe0\x2b\x6f\x67\x3b\x23\xed\xc2\xbd\x03\x30"
542         "\x79\x76\x02\x10\x10\x98\x85\x8a\xff\xfd\x0b\xda\xa5\xd9\x32\x48"
543         "\x02\xa0\x0b\xb9\x2a\x8a\x18\xca\xc6\x8f\x3f\xbb\x16\xb2\xaa\x98"
544         "\x27\xe3\x60\x43\xed\x15\x70\xd4\x57\x15\xfe\x19\xd4\x9b\x13\x78"
545         "\x8a\xf7\x21\xf1\xa2\xa2\x2d\xb3\x09\xcf\x44\x91\x6e\x08\x3a\x30"
546         "\x81\x3e\x90\x93\x8a\x67\x33\x00\x59\x54\x9a\x25\xd3\x49\x8e\x9f"
547         "\xc1\x4b\xe5\x86\xf3\x50\x4c\xbc\xc5\xd3\xf5\x3a\x54\xe1\x36\x3f"
548         "\xe2\x5a\xb4\x37\xc0\xeb\x70\x35\xec\xf6\xb7\xe8\x44\x3b\x7b\xf3"
549         "\xf1\xf2\x1e\xdb\x60\x7d\xd5\xbe\xf0\x71\x34\x90\x4c\xcb\xd4\x35"
550         "\x51\xc7\xdd\xd8\xc9\x81\xf5\x5d\x57\x46\x2c\xb1\x7b\x9b\xaa\xcb"
551         "\xd1\x22\x25\x49\x44\xa3\xd4\x6b\x29\x7b\xd8\xb2\x07\x93\xbf\x3d"
552         "\x52\x49\x84\x79\xef\xb8\xe5\xc4\xad\xca\xa8\xc6\xf6\xa6\x76\x70"
553         "\x5b\x0b\xe5\x83\xc6\x0e\xef\x55\xf2\xe7\xff\x04\xea\xe6\x13\xbe"
554         "\x40\xe1\x40\x45\x48\x66\x75\x31\xae\x35\x64\x91\x11\x6f\xda\xee"
555         "\x26\x86\x45\x6f\x0b\xd5\x9f\x03\xb1\x65\x5b\xdb\xa4\xe4\xf9\x45",
556         .key_len = 2349,
557         .m_size = 8,
558         .c_size = 512,
559 #endif
560         }
561 };
562 
563 /*
564  * EC-RDSA test vectors are generated by gost-engine.
565  */
566 static const struct akcipher_testvec ecrdsa_tv_template[] = {
567         {
568         .key =
569         "\x04\x40\xd5\xa7\x77\xf9\x26\x2f\x8c\xbd\xcc\xe3\x1f\x01\x94\x05"
570         "\x3d\x2f\xec\xb5\x00\x34\xf5\x51\x6d\x3b\x90\x4b\x23\x28\x6f\x1d"
571         "\xc8\x36\x61\x60\x36\xec\xbb\xb4\x0b\x95\x4e\x54\x4f\x15\x21\x05"
572         "\xd8\x52\x66\x44\x31\x7e\x5d\xc5\xd1\x26\x00\x5f\x60\xd8\xf0\xc7"
573         "\x27\xfc",
574         .key_len = 66,
575         .params = /* OID_gostCPSignA */
576         "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x01\x06\x08\x2a\x85\x03"
577         "\x07\x01\x01\x02\x02",
578         .param_len = 21,
579         .c =
580         "\x41\x32\x09\x73\xa4\xc1\x38\xd6\x63\x7d\x8b\xf7\x50\x3f\xda\x9f"
581         "\x68\x48\xc1\x50\xe3\x42\x3a\x9b\x2b\x28\x12\x2a\xa7\xc2\x75\x31"
582         "\x65\x77\x8c\x3c\x9e\x0d\x56\xb2\xf9\xdc\x04\x33\x3e\xb0\x9e\xf9"
583         "\x74\x4e\x59\xb3\x83\xf2\x91\x27\xda\x5e\xc7\x33\xc0\xc1\x8f\x41",
584         .c_size = 64,
585         .algo = OID_gost2012PKey256,
586         .m =
587         "\x75\x1b\x9b\x40\x25\xb9\x96\xd2\x9b\x00\x41\xb3\x58\xbf\x23\x14"
588         "\x79\xd2\x76\x64\xa3\xbd\x66\x10\x79\x05\x5a\x06\x42\xec\xb9\xc9",
589         .m_size = 32,
590         .public_key_vec = true,
591         .siggen_sigver_test = true,
592         },
593         {
594         .key =
595         "\x04\x40\x66\x6f\xd6\xb7\x06\xd0\xf5\xa5\x6f\x69\x5c\xa5\x13\x45"
596         "\x14\xdd\xcb\x12\x9c\x1b\xf5\x28\x64\x7a\x49\x48\x29\x14\x66\x42"
597         "\xb8\x1b\x5c\xf9\x56\x6d\x08\x3b\xce\xbb\x62\x2f\xc2\x3c\xc5\x49"
598         "\x93\x27\x70\x20\xcc\x79\xeb\xdc\x76\x8e\x48\x6e\x04\x96\xc3\x29"
599         "\xa0\x73",
600         .key_len = 66,
601         .params = /* OID_gostCPSignB */
602         "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x02\x06\x08\x2a\x85\x03"
603         "\x07\x01\x01\x02\x02",
604         .param_len = 21,
605         .c =
606         "\x45\x6d\x4a\x03\x1d\x5c\x0b\x17\x79\xe7\x19\xdb\xbf\x81\x9f\x82"
607         "\xae\x06\xda\xf5\x47\x00\x05\x80\xc3\x16\x06\x9a\x8e\x7c\xb2\x8e"
608         "\x7f\x74\xaa\xec\x6b\x7b\x7f\x8b\xc6\x0b\x10\x42\x4e\x91\x2c\xdf"
609         "\x7b\x8b\x15\xf4\x9e\x59\x0f\xc7\xa4\x68\x2e\xce\x89\xdf\x84\xe9",
610         .c_size = 64,
611         .algo = OID_gost2012PKey256,
612         .m =
613         "\xd0\x54\x00\x27\x6a\xeb\xce\x6c\xf5\xf6\xfb\x57\x18\x18\x21\x13"
614         "\x11\x23\x4a\x70\x43\x52\x7a\x68\x11\x65\x45\x37\xbb\x25\xb7\x40",
615         .m_size = 32,
616         .public_key_vec = true,
617         .siggen_sigver_test = true,
618         },
619         {
620         .key =
621         "\x04\x40\x05\x91\xa9\x7d\xcb\x87\xdc\x98\xa1\xbf\xff\xdd\x20\x61"
622         "\xaa\x58\x3b\x2d\x8e\x9c\x41\x9d\x4f\xc6\x23\x17\xf9\xca\x60\x65"
623         "\xbc\x97\x97\xf6\x6b\x24\xe8\xac\xb1\xa7\x61\x29\x3c\x71\xdc\xad"
624         "\xcb\x20\xbe\x96\xe8\xf4\x44\x2e\x49\xd5\x2c\xb9\xc9\x3b\x9c\xaa"
625         "\xba\x15",
626         .key_len = 66,
627         .params = /* OID_gostCPSignC */
628         "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x03\x06\x08\x2a\x85\x03"
629         "\x07\x01\x01\x02\x02",
630         .param_len = 21,
631         .c =
632         "\x3b\x2e\x2e\x74\x74\x47\xda\xea\x93\x90\x6a\xe2\xf5\xf5\xe6\x46"
633         "\x11\xfc\xab\xdc\x52\xbc\x58\xdb\x45\x44\x12\x4a\xf7\xd0\xab\xc9"
634         "\x73\xba\x64\xab\x0d\xac\x4e\x72\x10\xa8\x04\xf6\x1e\xe0\x48\x6a"
635         "\xcd\xe8\xe3\x78\x73\x77\x82\x24\x8d\xf1\xd3\xeb\x4c\x25\x7e\xc0",
636         .c_size = 64,
637         .algo = OID_gost2012PKey256,
638         .m =
639         "\x52\x33\xf4\x3f\x7b\x5d\xcf\x20\xee\xe4\x5c\xab\x0b\x3f\x14\xd6"
640         "\x9f\x16\xc6\x1c\xb1\x3f\x84\x41\x69\xec\x34\xfd\xf1\xf9\xa3\x39",
641         .m_size = 32,
642         .public_key_vec = true,
643         .siggen_sigver_test = true,
644         },
645         {
646         .key =
647         "\x04\x81\x80\x85\x46\x8f\x16\xf8\x7a\x7e\x4a\xc3\x81\x9e\xf1\x6e"
648         "\x94\x1e\x5d\x02\x87\xea\xfa\xa0\x0a\x17\x70\x49\x64\xad\x95\x68"
649         "\x60\x0a\xf0\x57\x29\x41\x79\x30\x3c\x61\x69\xf2\xa6\x94\x87\x17"
650         "\x54\xfa\x97\x2c\xe6\x1e\x0a\xbb\x55\x10\x57\xbe\xf7\xc1\x77\x2b"
651         "\x11\x74\x0a\x50\x37\x14\x10\x2a\x45\xfc\x7a\xae\x1c\x4c\xce\x08"
652         "\x05\xb7\xa4\x50\xc8\x3d\x39\x3d\xdc\x5c\x8f\x96\x6c\xe7\xfc\x21"
653         "\xc3\x2d\x1e\x9f\x11\xb3\xec\x22\x18\x8a\x8c\x08\x6b\x8b\xed\xf5"
654         "\xc5\x47\x3c\x7e\x73\x59\x44\x1e\x77\x83\x84\x52\x9e\x3b\x7d\xff"
655         "\x9d\x86\x1a",
656         .key_len = 131,
657         .params = /* OID_gostTC26Sign512A */
658         "\x30\x0b\x06\x09\x2a\x85\x03\x07\x01\x02\x01\x02\x01",
659         .param_len = 13,
660         .c =
661         "\x92\x81\x74\x5f\x95\x48\x38\x87\xd9\x8f\x5e\xc8\x8a\xbb\x01\x4e"
662         "\xb0\x75\x3c\x2f\xc7\x5a\x08\x4c\x68\xab\x75\x01\x32\x75\x75\xb5"
663         "\x37\xe0\x74\x6d\x94\x84\x31\x2a\x6b\xf4\xf7\xb7\xa7\x39\x7b\x46"
664         "\x07\xf0\x98\xbd\x33\x18\xa1\x72\xb2\x6d\x54\xe3\xde\x91\xc2\x2e"
665         "\x4f\x6a\xf8\xb7\xec\xa8\x83\xc9\x8f\xd9\xce\x7c\x45\x06\x02\xf4"
666         "\x4f\x21\xb5\x24\x3d\xb4\xb5\xd8\x58\x42\xbe\x2d\x29\xae\x93\xc0"
667         "\x13\x41\x96\x35\x08\x69\xe8\x36\xc7\xd1\x83\x81\xd7\xca\xfb\xc0"
668         "\xd2\xb7\x78\x32\x3e\x30\x1a\x1e\xce\xdc\x34\x35\xc6\xad\x68\x24",
669         .c_size = 128,
670         .algo = OID_gost2012PKey512,
671         .m =
672         "\x1f\x70\xb5\xe9\x55\x12\xd6\x88\xcc\x55\xb9\x0c\x7f\xc4\x94\xf2"
673         "\x04\x77\x41\x12\x02\xd6\xf1\x1f\x83\x56\xe9\xd6\x5a\x6a\x72\xb9"
674         "\x6e\x8e\x24\x2a\x84\xf1\xba\x67\xe8\xbf\xff\xc1\xd3\xde\xfb\xc6"
675         "\xa8\xf6\x80\x01\xb9\x27\xac\xd8\x45\x96\x66\xa1\xee\x48\x08\x3f",
676         .m_size = 64,
677         .public_key_vec = true,
678         .siggen_sigver_test = true,
679         },
680         {
681         .key =
682         "\x04\x81\x80\x28\xf3\x2b\x92\x04\x32\xea\x66\x20\xde\xa0\x2f\x74"
683         "\xbf\x2d\xf7\xb5\x30\x76\xb1\xc8\xee\x38\x9f\xea\xe5\xad\xc6\xa3"
684         "\x28\x1e\x51\x3d\x67\xa3\x41\xcc\x6b\x81\xe2\xe2\x9e\x82\xf3\x78"
685         "\x56\xd7\x2e\xb2\xb5\xbe\xb4\x50\x21\x05\xe5\x29\x82\xef\x15\x1b"
686         "\xc0\xd7\x30\xd6\x2f\x96\xe8\xff\x99\x4c\x25\xcf\x9a\xfc\x54\x30"
687         "\xce\xdf\x59\xe9\xc6\x45\xce\xe4\x22\xe8\x01\xd5\xcd\x2f\xaa\x78"
688         "\x99\xc6\x04\x1e\x6f\x4c\x25\x6a\x76\xad\xff\x48\xf3\xb3\xb4\xd6"
689         "\x14\x5c\x2c\x0e\xea\xa2\x4b\xb9\x7e\x89\x77\x02\x3a\x29\xc8\x16"
690         "\x8e\x78\x48",
691         .key_len = 131,
692         .params = /* OID_gostTC26Sign512B */
693         "\x30\x0b\x06\x09\x2a\x85\x03\x07\x01\x02\x01\x02\x02",
694         .param_len = 13,
695         .c =
696         "\x0a\xed\xb6\x27\xea\xa7\xa6\x7e\x2f\xc1\x02\x21\x74\xce\x27\xd2"
697         "\xee\x8a\x92\x4d\xa9\x43\x2d\xa4\x5b\xdc\x23\x02\xfc\x3a\xf3\xb2"
698         "\x10\x93\x0b\x40\x1b\x75\x95\x3e\x39\x41\x37\xb9\xab\x51\x09\xeb"
699         "\xf1\xb9\x49\x58\xec\x58\xc7\xf9\x2e\xb9\xc9\x40\xf2\x00\x39\x7e"
700         "\x3f\xde\x72\xe3\x85\x67\x06\xbe\xd8\xb8\xc1\x81\x1e\xe3\x0a\xfe"
701         "\xce\xd3\x77\x92\x56\x8c\x58\xf9\x37\x60\x2d\xe6\x8b\x66\xa3\xdd"
702         "\xd2\xf0\xf8\xda\x1b\x20\xbc\x9c\xec\x29\x5d\xd1\x8f\xcc\x37\xd1"
703         "\x3b\x8d\xb7\xc1\xe0\xb8\x3b\xef\x14\x1b\x87\xbc\xc1\x03\x9a\x93",
704         .c_size = 128,
705         .algo = OID_gost2012PKey512,
706         .m =
707         "\x11\x24\x21\x27\xf2\x42\x9f\xce\x5a\xf9\x01\x70\xe0\x07\x2b\x57"
708         "\xfb\x7d\x77\x5e\x74\x66\xe6\xa5\x40\x4c\x1a\x85\x18\xff\xd0\x63"
709         "\xe0\x39\xd3\xd6\xe5\x17\xf8\xc3\x4b\xc6\x1c\x33\x1a\xca\xa6\x66"
710         "\x6d\xf4\xd2\x45\xc2\x83\xa0\x42\x95\x05\x9d\x89\x8e\x0a\xca\xcc",
711         .m_size = 64,
712         .public_key_vec = true,
713         .siggen_sigver_test = true,
714         },
715 };
716 
717 /*
718  * PKCS#1 RSA test vectors. Obtained from CAVS testing.
719  */
720 static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = {
721         {
722         .key =
723         "\x30\x82\x03\x1f\x02\x01\x00\x02\x82\x01\x01\x00\xd7\x1e\x77\x82"
724         "\x8c\x92\x31\xe7\x69\x02\xa2\xd5\x5c\x78\xde\xa2\x0c\x8f\xfe\x28"
725         "\x59\x31\xdf\x40\x9c\x60\x61\x06\xb9\x2f\x62\x40\x80\x76\xcb\x67"
726         "\x4a\xb5\x59\x56\x69\x17\x07\xfa\xf9\x4c\xbd\x6c\x37\x7a\x46\x7d"
727         "\x70\xa7\x67\x22\xb3\x4d\x7a\x94\xc3\xba\x4b\x7c\x4b\xa9\x32\x7c"
728         "\xb7\x38\x95\x45\x64\xa4\x05\xa8\x9f\x12\x7c\x4e\xc6\xc8\x2d\x40"
729         "\x06\x30\xf4\x60\xa6\x91\xbb\x9b\xca\x04\x79\x11\x13\x75\xf0\xae"
730         "\xd3\x51\x89\xc5\x74\xb9\xaa\x3f\xb6\x83\xe4\x78\x6b\xcd\xf9\x5c"
731         "\x4c\x85\xea\x52\x3b\x51\x93\xfc\x14\x6b\x33\x5d\x30\x70\xfa\x50"
732         "\x1b\x1b\x38\x81\x13\x8d\xf7\xa5\x0c\xc0\x8e\xf9\x63\x52\x18\x4e"
733         "\xa9\xf9\xf8\x5c\x5d\xcd\x7a\x0d\xd4\x8e\x7b\xee\x91\x7b\xad\x7d"
734         "\xb4\x92\xd5\xab\x16\x3b\x0a\x8a\xce\x8e\xde\x47\x1a\x17\x01\x86"
735         "\x7b\xab\x99\xf1\x4b\x0c\x3a\x0d\x82\x47\xc1\x91\x8c\xbb\x2e\x22"
736         "\x9e\x49\x63\x6e\x02\xc1\xc9\x3a\x9b\xa5\x22\x1b\x07\x95\xd6\x10"
737         "\x02\x50\xfd\xfd\xd1\x9b\xbe\xab\xc2\xc0\x74\xd7\xec\x00\xfb\x11"
738         "\x71\xcb\x7a\xdc\x81\x79\x9f\x86\x68\x46\x63\x82\x4d\xb7\xf1\xe6"
739         "\x16\x6f\x42\x63\xf4\x94\xa0\xca\x33\xcc\x75\x13\x02\x82\x01\x00"
740         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
741         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
742         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
743         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
744         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
745         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
746         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
747         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
748         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
749         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
750         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
751         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
752         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
753         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
754         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
755         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01"
756         "\x02\x82\x01\x00\x62\xb5\x60\x31\x4f\x3f\x66\x16\xc1\x60\xac\x47"
757         "\x2a\xff\x6b\x69\x00\x4a\xb2\x5c\xe1\x50\xb9\x18\x74\xa8\xe4\xdc"
758         "\xa8\xec\xcd\x30\xbb\xc1\xc6\xe3\xc6\xac\x20\x2a\x3e\x5e\x8b\x12"
759         "\xe6\x82\x08\x09\x38\x0b\xab\x7c\xb3\xcc\x9c\xce\x97\x67\xdd\xef"
760         "\x95\x40\x4e\x92\xe2\x44\xe9\x1d\xc1\x14\xfd\xa9\xb1\xdc\x71\x9c"
761         "\x46\x21\xbd\x58\x88\x6e\x22\x15\x56\xc1\xef\xe0\xc9\x8d\xe5\x80"
762         "\x3e\xda\x7e\x93\x0f\x52\xf6\xf5\xc1\x91\x90\x9e\x42\x49\x4f\x8d"
763         "\x9c\xba\x38\x83\xe9\x33\xc2\x50\x4f\xec\xc2\xf0\xa8\xb7\x6e\x28"
764         "\x25\x56\x6b\x62\x67\xfe\x08\xf1\x56\xe5\x6f\x0e\x99\xf1\xe5\x95"
765         "\x7b\xef\xeb\x0a\x2c\x92\x97\x57\x23\x33\x36\x07\xdd\xfb\xae\xf1"
766         "\xb1\xd8\x33\xb7\x96\x71\x42\x36\xc5\xa4\xa9\x19\x4b\x1b\x52\x4c"
767         "\x50\x69\x91\xf0\x0e\xfa\x80\x37\x4b\xb5\xd0\x2f\xb7\x44\x0d\xd4"
768         "\xf8\x39\x8d\xab\x71\x67\x59\x05\x88\x3d\xeb\x48\x48\x33\x88\x4e"
769         "\xfe\xf8\x27\x1b\xd6\x55\x60\x5e\x48\xb7\x6d\x9a\xa8\x37\xf9\x7a"
770         "\xde\x1b\xcd\x5d\x1a\x30\xd4\xe9\x9e\x5b\x3c\x15\xf8\x9c\x1f\xda"
771         "\xd1\x86\x48\x55\xce\x83\xee\x8e\x51\xc7\xde\x32\x12\x47\x7d\x46"
772         "\xb8\x35\xdf\x41\x02\x01\x00\x02\x01\x00\x02\x01\x00\x02\x01\x00"
773         "\x02\x01\x00",
774         .key_len = 804,
775         /*
776          * m is SHA256 hash of following message:
777          * "\x49\x41\xbe\x0a\x0c\xc9\xf6\x35\x51\xe4\x27\x56\x13\x71\x4b\xd0"
778          * "\x36\x92\x84\x89\x1b\xf8\x56\x4a\x72\x61\x14\x69\x4f\x5e\x98\xa5"
779          * "\x80\x5a\x37\x51\x1f\xd8\xf5\xb5\x63\xfc\xf4\xb1\xbb\x4d\x33\xa3"
780          * "\x1e\xb9\x75\x8b\x9c\xda\x7e\x6d\x3a\x77\x85\xf7\xfc\x4e\xe7\x64"
781          * "\x43\x10\x19\xa0\x59\xae\xe0\xad\x4b\xd3\xc4\x45\xf7\xb1\xc2\xc1"
782          * "\x65\x01\x41\x39\x5b\x45\x47\xed\x2b\x51\xed\xe3\xd0\x09\x10\xd2"
783          * "\x39\x6c\x4a\x3f\xe5\xd2\x20\xe6\xb0\x71\x7d\x5b\xed\x26\x60\xf1"
784          * "\xb4\x73\xd1\xdb\x7d\xc4\x19\x91\xee\xf6\x32\x76\xf2\x19\x7d\xb7"
785          */
786         .m =
787         "\x3e\xc8\xa1\x26\x20\x54\x44\x52\x48\x0d\xe5\x66\xf3\xb3\xf5\x04"
788         "\xbe\x10\xa8\x48\x94\x22\x2d\xdd\xba\x7a\xb4\x76\x8d\x79\x98\x89",
789         .m_size = 32,
790         .c =
791         "\xc7\xa3\x98\xeb\x43\xd1\x08\xc2\x3d\x78\x45\x04\x70\xc9\x01\xee"
792         "\xf8\x85\x37\x7c\x0b\xf9\x19\x70\x5c\x45\x7b\x2f\x3a\x0b\xb7\x8b"
793         "\xc4\x0d\x7b\x3a\x64\x0b\x0f\xdb\x78\xa9\x0b\xfd\x8d\x82\xa4\x86"
794         "\x39\xbf\x21\xb8\x84\xc4\xce\x9f\xc2\xe8\xb6\x61\x46\x17\xb9\x4e"
795         "\x0b\x57\x05\xb4\x4f\xf9\x9c\x93\x2d\x9b\xd5\x48\x1d\x80\x12\xef"
796         "\x3a\x77\x7f\xbc\xb5\x8e\x2b\x6b\x7c\xfc\x9f\x8c\x9d\xa2\xc4\x85"
797         "\xb0\x87\xe9\x17\x9b\xb6\x23\x62\xd2\xa9\x9f\x57\xe8\xf7\x04\x45"
798         "\x24\x3a\x45\xeb\xeb\x6a\x08\x8e\xaf\xc8\xa0\x84\xbc\x5d\x13\x38"
799         "\xf5\x17\x8c\xa3\x96\x9b\xa9\x38\x8d\xf0\x35\xad\x32\x8a\x72\x5b"
800         "\xdf\x21\xab\x4b\x0e\xa8\x29\xbb\x61\x54\xbf\x05\xdb\x84\x84\xde"
801         "\xdd\x16\x36\x31\xda\xf3\x42\x6d\x7a\x90\x22\x9b\x11\x29\xa6\xf8"
802         "\x30\x61\xda\xd3\x8b\x54\x1e\x42\xd1\x47\x1d\x6f\xd1\xcd\x42\x0b"
803         "\xd1\xe4\x15\x85\x7e\x08\xd6\x59\x64\x4c\x01\x34\x91\x92\x26\xe8"
804         "\xb0\x25\x8c\xf8\xf4\xfa\x8b\xc9\x31\x33\x76\x72\xfb\x64\x92\x9f"
805         "\xda\x62\x8d\xe1\x2a\x71\x91\x43\x40\x61\x3c\x5a\xbe\x86\xfc\x5b"
806         "\xe6\xf9\xa9\x16\x31\x1f\xaf\x25\x6d\xc2\x4a\x23\x6e\x63\x02\xa2",
807         .c_size = 256,
808         .siggen_sigver_test = true,
809         }
810 };
811 
812 static const struct kpp_testvec dh_tv_template[] = {
813         {
814         .secret =
815 #ifdef __LITTLE_ENDIAN
816         "\x01\x00" /* type */
817         "\x15\x02" /* len */
818         "\x00\x01\x00\x00" /* key_size */
819         "\x00\x01\x00\x00" /* p_size */
820         "\x00\x00\x00\x00" /* q_size */
821         "\x01\x00\x00\x00" /* g_size */
822 #else
823         "\x00\x01" /* type */
824         "\x02\x15" /* len */
825         "\x00\x00\x01\x00" /* key_size */
826         "\x00\x00\x01\x00" /* p_size */
827         "\x00\x00\x00\x00" /* q_size */
828         "\x00\x00\x00\x01" /* g_size */
829 #endif
830         /* xa */
831         "\x44\xc1\x48\x36\xa7\x2b\x6f\x4e\x43\x03\x68\xad\x31\x00\xda\xf3"
832         "\x2a\x01\xa8\x32\x63\x5f\x89\x32\x1f\xdf\x4c\xa1\x6a\xbc\x10\x15"
833         "\x90\x35\xc9\x26\x41\xdf\x7b\xaa\x56\x56\x3d\x85\x44\xb5\xc0\x8e"
834         "\x37\x83\x06\x50\xb3\x5f\x0e\x28\x2c\xd5\x46\x15\xe3\xda\x7d\x74"
835         "\x87\x13\x91\x4f\xd4\x2d\xf6\xc7\x5e\x14\x2c\x11\xc2\x26\xb4\x3a"
836         "\xe3\xb2\x36\x20\x11\x3b\x22\xf2\x06\x65\x66\xe2\x57\x58\xf8\x22"
837         "\x1a\x94\xbd\x2b\x0e\x8c\x55\xad\x61\x23\x45\x2b\x19\x1e\x63\x3a"
838         "\x13\x61\xe3\xa0\x79\x70\x3e\x6d\x98\x32\xbc\x7f\x82\xc3\x11\xd8"
839         "\xeb\x53\xb5\xfc\xb5\xd5\x3c\x4a\xea\x92\x3e\x01\xce\x15\x65\xd4"
840         "\xaa\x85\xc1\x11\x90\x83\x31\x6e\xfe\xe7\x7f\x7d\xed\xab\xf9\x29"
841         "\xf8\xc7\xf1\x68\xc6\xb7\xe4\x1f\x2f\x28\xa0\xc9\x1a\x50\x64\x29"
842         "\x4b\x01\x6d\x1a\xda\x46\x63\x21\x07\x40\x8c\x8e\x4c\x6f\xb5\xe5"
843         "\x12\xf3\xc2\x1b\x48\x27\x5e\x27\x01\xb1\xaa\xed\x68\x9b\x83\x18"
844         "\x8f\xb1\xeb\x1f\x04\xd1\x3c\x79\xed\x4b\xf7\x0a\x33\xdc\xe0\xc6"
845         "\xd8\x02\x51\x59\x00\x74\x30\x07\x4c\x2d\xac\xe4\x13\xf1\x80\xf0"
846         "\xce\xfa\xff\xa9\xce\x29\x46\xdd\x9d\xad\xd1\xc3\xc6\x58\x1a\x63"
847         /* p */
848         "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
849         "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
850         "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
851         "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
852         "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
853         "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
854         "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
855         "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
856         "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
857         "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
858         "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
859         "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
860         "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
861         "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
862         "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
863         "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
864         /* g */
865         "\x02",
866         .b_public =
867         "\x2a\x67\x5c\xfd\x63\x5d\xc0\x97\x0a\x8b\xa2\x1f\xf8\x8a\xcb\x54"
868         "\xca\x2f\xd3\x49\x3f\x01\x8e\x87\xfe\xcc\x94\xa0\x3e\xd4\x26\x79"
869         "\x9a\x94\x3c\x11\x81\x58\x5c\x60\x3d\xf5\x98\x90\x89\x64\x62\x1f"
870         "\xbd\x05\x6d\x2b\xcd\x84\x40\x9b\x4a\x1f\xe0\x19\xf1\xca\x20\xb3"
871         "\x4e\xa0\x4f\x15\xcc\xa5\xfe\xa5\xb4\xf5\x0b\x18\x7a\x5a\x37\xaa"
872         "\x58\x00\x19\x7f\xe2\xa3\xd9\x1c\x44\x57\xcc\xde\x2e\xc1\x38\xea"
873         "\xeb\xe3\x90\x40\xc4\x6c\xf7\xcd\xe9\x22\x50\x71\xf5\x7c\xdb\x37"
874         "\x0e\x80\xc3\xed\x7e\xb1\x2b\x2f\xbe\x71\xa6\x11\xa5\x9d\xf5\x39"
875         "\xf1\xa2\xe5\x85\xbc\x25\x91\x4e\x84\x8d\x26\x9f\x4f\xe6\x0f\xa6"
876         "\x2b\x6b\xf9\x0d\xaf\x6f\xbb\xfa\x2d\x79\x15\x31\x57\xae\x19\x60"
877         "\x22\x0a\xf5\xfd\x98\x0e\xbf\x5d\x49\x75\x58\x37\xbc\x7f\xf5\x21"
878         "\x56\x1e\xd5\xb3\x50\x0b\xca\x96\xf3\xd1\x3f\xb3\x70\xa8\x6d\x63"
879         "\x48\xfb\x3d\xd7\x29\x91\x45\xb5\x48\xcd\xb6\x78\x30\xf2\x3f\x1e"
880         "\xd6\x22\xd6\x35\x9b\xf9\x1f\x85\xae\xab\x4b\xd7\xe0\xc7\x86\x67"
881         "\x3f\x05\x7f\xa6\x0d\x2f\x0d\xbf\x53\x5f\x4d\x2c\x6d\x5e\x57\x40"
882         "\x30\x3a\x23\x98\xf9\xb4\x32\xf5\x32\x83\xdd\x0b\xae\x33\x97\x2f",
883         .expected_a_public =
884         "\x5c\x24\xdf\xeb\x5b\x4b\xf8\xc5\xef\x39\x48\x82\xe0\x1e\x62\xee"
885         "\x8a\xae\xdf\x93\x6c\x2b\x16\x95\x92\x16\x3f\x16\x7b\x75\x03\x85"
886         "\xd9\xf1\x69\xc2\x14\x87\x45\xfc\xa4\x19\xf6\xf0\xa4\xf3\xec\xd4"
887         "\x6c\x5c\x03\x3b\x94\xc2\x2f\x92\xe4\xce\xb3\xe4\x72\xe8\x17\xe6"
888         "\x23\x7e\x00\x01\x09\x59\x13\xbf\xc1\x2f\x99\xa9\x07\xaa\x02\x23"
889         "\x4a\xca\x39\x4f\xbc\xec\x0f\x27\x4f\x19\x93\x6c\xb9\x30\x52\xfd"
890         "\x2b\x9d\x86\xf1\x06\x1e\xb6\x56\x27\x4a\xc9\x8a\xa7\x8a\x48\x5e"
891         "\xb5\x60\xcb\xdf\xff\x03\x26\x10\xbf\x90\x8f\x46\x60\xeb\x9b\x9a"
892         "\xd6\x6f\x44\x91\x03\x92\x18\x2c\x96\x5e\x40\x19\xfb\xf4\x4f\x3a"
893         "\x02\x7b\xaf\xcc\x22\x20\x79\xb9\xf8\x9f\x8f\x85\x6b\xec\x44\xbb"
894         "\xe6\xa8\x8e\xb1\xe8\x2c\xee\x64\xee\xf8\xbd\x00\xf3\xe2\x2b\x93"
895         "\xcd\xe7\xc4\xdf\xc9\x19\x46\xfe\xb6\x07\x73\xc1\x8a\x64\x79\x26"
896         "\xe7\x30\xad\x2a\xdf\xe6\x8f\x59\xf5\x81\xbf\x4a\x29\x91\xe7\xb7"
897         "\xcf\x48\x13\x27\x75\x79\x40\xd9\xd6\x32\x52\x4e\x6a\x86\xae\x6f"
898         "\xc2\xbf\xec\x1f\xc2\x69\xb2\xb6\x59\xe5\xa5\x17\xa4\x77\xb7\x62"
899         "\x46\xde\xe8\xd2\x89\x78\x9a\xef\xa3\xb5\x8f\x26\xec\x80\xda\x39",
900         .expected_ss =
901         "\x8f\xf3\xac\xa2\xea\x22\x11\x5c\x45\x65\x1a\x77\x75\x2e\xcf\x46"
902         "\x23\x14\x1e\x67\x53\x4d\x35\xb0\x38\x1d\x4e\xb9\x41\x9a\x21\x24"
903         "\x6e\x9f\x40\xfe\x90\x51\xb1\x06\xa4\x7b\x87\x17\x2f\xe7\x5e\x22"
904         "\xf0\x7b\x54\x84\x0a\xac\x0a\x90\xd2\xd7\xe8\x7f\xe7\xe3\x30\x75"
905         "\x01\x1f\x24\x75\x56\xbe\xcc\x8d\x1e\x68\x0c\x41\x72\xd3\xfa\xbb"
906         "\xe5\x9c\x60\xc7\x28\x77\x0c\xbe\x89\xab\x08\xd6\x21\xe7\x2e\x1a"
907         "\x58\x7a\xca\x4f\x22\xf3\x2b\x30\xfd\xf4\x98\xc1\xa3\xf8\xf6\xcc"
908         "\xa9\xe4\xdb\x5b\xee\xd5\x5c\x6f\x62\x4c\xd1\x1a\x02\x2a\x23\xe4"
909         "\xb5\x57\xf3\xf9\xec\x04\x83\x54\xfe\x08\x5e\x35\xac\xfb\xa8\x09"
910         "\x82\x32\x60\x11\xb2\x16\x62\x6b\xdf\xda\xde\x9c\xcb\x63\x44\x6c"
911         "\x59\x26\x6a\x8f\xb0\x24\xcb\xa6\x72\x48\x1e\xeb\xe0\xe1\x09\x44"
912         "\xdd\xee\x66\x6d\x84\xcf\xa5\xc1\xb8\x36\x74\xd3\x15\x96\xc3\xe4"
913         "\xc6\x5a\x4d\x23\x97\x0c\x5c\xcb\xa9\xf5\x29\xc2\x0e\xff\x93\x82"
914         "\xd3\x34\x49\xad\x64\xa6\xb1\xc0\x59\x28\x75\x60\xa7\x8a\xb0\x11"
915         "\x56\x89\x42\x74\x11\xf5\xf6\x5e\x6f\x16\x54\x6a\xb1\x76\x4d\x50"
916         "\x8a\x68\xc1\x5b\x82\xb9\x0d\x00\x32\x50\xed\x88\x87\x48\x92\x17",
917         .secret_size = 533,
918         .b_public_size = 256,
919         .expected_a_public_size = 256,
920         .expected_ss_size = 256,
921         },
922         {
923         .secret =
924 #ifdef __LITTLE_ENDIAN
925         "\x01\x00" /* type */
926         "\x15\x02" /* len */
927         "\x00\x01\x00\x00" /* key_size */
928         "\x00\x01\x00\x00" /* p_size */
929         "\x00\x00\x00\x00" /* q_size */
930         "\x01\x00\x00\x00" /* g_size */
931 #else
932         "\x00\x01" /* type */
933         "\x02\x15" /* len */
934         "\x00\x00\x01\x00" /* key_size */
935         "\x00\x00\x01\x00" /* p_size */
936         "\x00\x00\x00\x00" /* q_size */
937         "\x00\x00\x00\x01" /* g_size */
938 #endif
939         /* xa */
940         "\x4d\x75\xa8\x6e\xba\x23\x3a\x0c\x63\x56\xc8\xc9\x5a\xa7\xd6\x0e"
941         "\xed\xae\x40\x78\x87\x47\x5f\xe0\xa7\x7b\xba\x84\x88\x67\x4e\xe5"
942         "\x3c\xcc\x5c\x6a\xe7\x4a\x20\xec\xbe\xcb\xf5\x52\x62\x9f\x37\x80"
943         "\x0c\x72\x7b\x83\x66\xa4\xf6\x7f\x95\x97\x1c\x6a\x5c\x7e\xf1\x67"
944         "\x37\xb3\x93\x39\x3d\x0b\x55\x35\xd9\xe5\x22\x04\x9f\xf8\xc1\x04"
945         "\xce\x13\xa5\xac\xe1\x75\x05\xd1\x2b\x53\xa2\x84\xef\xb1\x18\xf4"
946         "\x66\xdd\xea\xe6\x24\x69\x5a\x49\xe0\x7a\xd8\xdf\x1b\xb7\xf1\x6d"
947         "\x9b\x50\x2c\xc8\x1c\x1c\xa3\xb4\x37\xfb\x66\x3f\x67\x71\x73\xa9"
948         "\xff\x5f\xd9\xa2\x25\x6e\x25\x1b\x26\x54\xbf\x0c\xc6\xdb\xea\x0a"
949         "\x52\x6c\x16\x7c\x27\x68\x15\x71\x58\x73\x9d\xe6\xc2\x80\xaa\x97"
950         "\x31\x66\xfb\xa6\xfb\xfd\xd0\x9c\x1d\xbe\x81\x48\xf5\x9a\x32\xf1"
951         "\x69\x62\x18\x78\xae\x72\x36\xe6\x94\x27\xd1\xff\x18\x4f\x28\x6a"
952         "\x16\xbd\x6a\x60\xee\xe5\xf9\x6d\x16\xe4\xb8\xa6\x41\x9b\x23\x7e"
953         "\xf7\x9d\xd1\x1d\x03\x15\x66\x3a\xcf\xb6\x2c\x13\x96\x2c\x52\x21"
954         "\xe4\x2d\x48\x7a\x8a\x5d\xb2\x88\xed\x98\x61\x79\x8b\x6a\x1e\x5f"
955         "\xd0\x8a\x2d\x99\x5a\x2b\x0f\xbc\xef\x53\x8f\x32\xc1\xa2\x99\x26"
956         /* p */
957         "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
958         "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
959         "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
960         "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
961         "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
962         "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
963         "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
964         "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
965         "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
966         "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
967         "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
968         "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
969         "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
970         "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
971         "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
972         "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
973         /* g */
974         "\x02",
975         .b_public =
976         "\x99\x4d\xd9\x01\x84\x8e\x4a\x5b\xb8\xa5\x64\x8c\x6c\x00\x5c\x0e"
977         "\x1e\x1b\xee\x5d\x9f\x53\xe3\x16\x70\x01\xed\xbf\x4f\x14\x36\x6e"
978         "\xe4\x43\x45\x43\x49\xcc\xb1\xb0\x2a\xc0\x6f\x22\x55\x42\x17\x94"
979         "\x18\x83\xd7\x2a\x5c\x51\x54\xf8\x4e\x7c\x10\xda\x76\x68\x57\x77"
980         "\x1e\x62\x03\x30\x04\x7b\x4c\x39\x9c\x54\x01\x54\xec\xef\xb3\x55"
981         "\xa4\xc0\x24\x6d\x3d\xbd\xcc\x46\x5b\x00\x96\xc7\xea\x93\xd1\x3f"
982         "\xf2\x6a\x72\xe3\xf2\xc1\x92\x24\x5b\xda\x48\x70\x2c\xa9\x59\x97"
983         "\x19\xb1\xd6\x54\xb3\x9c\x2e\xb0\x63\x07\x9b\x5e\xac\xb5\xf2\xb1"
984         "\x5b\xf8\xf3\xd7\x2d\x37\x9b\x68\x6c\xf8\x90\x07\xbc\x37\x9a\xa5"
985         "\xe2\x91\x12\x25\x47\x77\xe3\x3d\xb2\x95\x69\x44\x0b\x91\x1e\xaf"
986         "\x7c\x8c\x7c\x34\x41\x6a\xab\x60\x6e\xc6\x52\xec\x7e\x94\x0a\x37"
987         "\xec\x98\x90\xdf\x3f\x02\xbd\x23\x52\xdd\xd9\xe5\x31\x80\x74\x25"
988         "\xb6\xd2\xd3\xcc\xd5\xcc\x6d\xf9\x7e\x4d\x78\xab\x77\x51\xfa\x77"
989         "\x19\x94\x49\x8c\x05\xd4\x75\xed\xd2\xb3\x64\x57\xe0\x52\x99\xc0"
990         "\x83\xe3\xbb\x5e\x2b\xf1\xd2\xc0\xb1\x37\x36\x0b\x7c\xb5\x63\x96"
991         "\x8e\xde\x04\x23\x11\x95\x62\x11\x9a\xce\x6f\x63\xc8\xd5\xd1\x8f",
992         .expected_a_public =
993         "\x90\x89\xe4\x82\xd6\x0a\xcf\x1a\xae\xce\x1b\x66\xa7\x19\x71\x18"
994         "\x8f\x95\x4b\x5b\x80\x45\x4a\x5a\x43\x99\x4d\x37\xcf\xa3\xa7\x28"
995         "\x9c\xc7\x73\xf1\xb2\x17\xf6\x99\xe3\x6b\x56\xcb\x3e\x35\x60\x7d"
996         "\x65\xc7\x84\x6b\x3e\x60\xee\xcd\xd2\x70\xe7\xc9\x32\x1c\xf0\xb4"
997         "\xf9\x52\xd9\x88\x75\xfd\x40\x2c\xa7\xbe\x19\x1c\x0a\xae\x93\xe1"
998         "\x71\xc7\xcd\x4f\x33\x5c\x10\x7d\x39\x56\xfc\x73\x84\xb2\x67\xc3"
999         "\x77\x26\x20\x97\x2b\xf8\x13\x43\x93\x9c\x9a\xa4\x08\xc7\x34\x83"
1000         "\xe6\x98\x61\xe7\x16\x30\x2c\xb1\xdb\x2a\xb2\xcc\xc3\x02\xa5\x3c"
1001         "\x71\x50\x14\x83\xc7\xbb\xa4\xbe\x98\x1b\xfe\xcb\x43\xe9\x97\x62"
1002         "\xd6\xf0\x8c\xcb\x1c\xba\x1e\xa8\xa6\xa6\x50\xfc\x85\x7d\x47\xbf"
1003         "\xf4\x3e\x23\xd3\x5f\xb2\x71\x3e\x40\x94\xaa\x87\x83\x2c\x6c\x8e"
1004         "\x60\xfd\xdd\xf7\xf4\x76\x03\xd3\x1d\xec\x18\x51\xa3\xf2\x44\x1a"
1005         "\x3f\xb4\x7c\x18\x0d\x68\x65\x92\x54\x0d\x2d\x81\x16\xf1\x84\x66"
1006         "\x89\x92\xd0\x1a\x5e\x1f\x42\x46\x5b\xe5\x83\x86\x80\xd9\xcd\x3a"
1007         "\x5a\x2f\xb9\x59\x9b\xe4\x43\x84\x64\xf3\x09\x1a\x0a\xa2\x64\x0f"
1008         "\x77\x4e\x8d\x8b\xe6\x88\xd1\xfc\xaf\x8f\xdf\x1d\xbc\x31\xb3\xbd",
1009         .expected_ss =
1010         "\x34\xc3\x35\x14\x88\x46\x26\x23\x97\xbb\xdd\x28\x5c\x94\xf6\x47"
1011         "\xca\xb3\x19\xaf\xca\x44\x9b\xc2\x7d\x89\xfd\x96\x14\xfd\x6d\x58"
1012         "\xd8\xc4\x6b\x61\x2a\x0d\xf2\x36\x45\xc8\xe4\xa4\xed\x81\x53\x81"
1013         "\x66\x1e\xe0\x5a\xb1\x78\x2d\x0b\x5c\xb4\xd1\xfc\x90\xc6\x9c\xdb"
1014         "\x5a\x30\x0b\x14\x7d\xbe\xb3\x7d\xb1\xb2\x76\x3c\x6c\xef\x74\x6b"
1015         "\xe7\x1f\x64\x0c\xab\x65\xe1\x76\x5c\x3d\x83\xb5\x8a\xfb\xaf\x0f"
1016         "\xf2\x06\x14\x8f\xa0\xf6\xc1\x89\x78\xf2\xba\x72\x73\x3c\xf7\x76"
1017         "\x21\x67\xbc\x24\x31\xb8\x09\x65\x0f\x0c\x02\x32\x4a\x98\x14\xfc"
1018         "\x72\x2c\x25\x60\x68\x5f\x2f\x30\x1e\x5b\xf0\x3b\xd1\xa2\x87\xa0"
1019         "\x54\xdf\xdb\xc0\xee\x0a\x0f\x47\xc9\x90\x20\x2c\xf9\xe3\x52\xad"
1020         "\x27\x65\x8d\x54\x8d\xa8\xa1\xf3\xed\x15\xd4\x94\x28\x90\x31\x93"
1021         "\x1b\xc0\x51\xbb\x43\x5d\x76\x3b\x1d\x2a\x71\x50\xea\x5d\x48\x94"
1022         "\x7f\x6f\xf1\x48\xdb\x30\xe5\xae\x64\x79\xd9\x7a\xdb\xc6\xff\xd8"
1023         "\x5e\x5a\x64\xbd\xf6\x85\x04\xe8\x28\x6a\xac\xef\xce\x19\x8e\x9a"
1024         "\xfe\x75\xc0\x27\x69\xe3\xb3\x7b\x21\xa7\xb1\x16\xa4\x85\x23\xee"
1025         "\xb0\x1b\x04\x6e\xbd\xab\x16\xde\xfd\x86\x6b\xa9\x95\xd7\x0b\xfd",
1026         .secret_size = 533,
1027         .b_public_size = 256,
1028         .expected_a_public_size = 256,
1029         .expected_ss_size = 256,
1030         }
1031 };
1032 
1033 static const struct kpp_testvec curve25519_tv_template[] = {
1034 {
1035         .secret = (u8[32]){ 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d,
1036                      0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45,
1037                      0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a,
1038                      0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a },
1039         .b_public = (u8[32]){ 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4,
1040                     0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37,
1041                     0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d,
1042                     0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f },
1043         .expected_ss = (u8[32]){ 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1,
1044                     0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35, 0x0f, 0x25,
1045                     0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1, 0x9e, 0x33,
1046                     0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 },
1047         .secret_size = 32,
1048         .b_public_size = 32,
1049         .expected_ss_size = 32,
1050 
1051 },
1052 {
1053         .secret = (u8[32]){ 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b,
1054                      0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6,
1055                      0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd,
1056                      0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb },
1057         .b_public = (u8[32]){ 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
1058                     0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
1059                     0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
1060                     0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a },
1061         .expected_ss = (u8[32]){ 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1,
1062                     0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35, 0x0f, 0x25,
1063                     0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1, 0x9e, 0x33,
1064                     0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 },
1065         .secret_size = 32,
1066         .b_public_size = 32,
1067         .expected_ss_size = 32,
1068 
1069 },
1070 {
1071         .secret = (u8[32]){ 1 },
1072         .b_public = (u8[32]){ 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1073                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1074                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1075                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1076         .expected_ss = (u8[32]){ 0x3c, 0x77, 0x77, 0xca, 0xf9, 0x97, 0xb2, 0x64,
1077                     0x41, 0x60, 0x77, 0x66, 0x5b, 0x4e, 0x22, 0x9d,
1078                     0x0b, 0x95, 0x48, 0xdc, 0x0c, 0xd8, 0x19, 0x98,
1079                     0xdd, 0xcd, 0xc5, 0xc8, 0x53, 0x3c, 0x79, 0x7f },
1080         .secret_size = 32,
1081         .b_public_size = 32,
1082         .expected_ss_size = 32,
1083 
1084 },
1085 {
1086         .secret = (u8[32]){ 1 },
1087         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1088                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1089                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1090                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1091         .expected_ss = (u8[32]){ 0xb3, 0x2d, 0x13, 0x62, 0xc2, 0x48, 0xd6, 0x2f,
1092                     0xe6, 0x26, 0x19, 0xcf, 0xf0, 0x4d, 0xd4, 0x3d,
1093                     0xb7, 0x3f, 0xfc, 0x1b, 0x63, 0x08, 0xed, 0xe3,
1094                     0x0b, 0x78, 0xd8, 0x73, 0x80, 0xf1, 0xe8, 0x34 },
1095         .secret_size = 32,
1096         .b_public_size = 32,
1097         .expected_ss_size = 32,
1098 
1099 },
1100 {
1101         .secret = (u8[32]){ 0xa5, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d,
1102                      0x3b, 0x16, 0x15, 0x4b, 0x82, 0x46, 0x5e, 0xdd,
1103                      0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc, 0x5a, 0x18,
1104                      0x50, 0x6a, 0x22, 0x44, 0xba, 0x44, 0x9a, 0xc4 },
1105         .b_public = (u8[32]){ 0xe6, 0xdb, 0x68, 0x67, 0x58, 0x30, 0x30, 0xdb,
1106                     0x35, 0x94, 0xc1, 0xa4, 0x24, 0xb1, 0x5f, 0x7c,
1107                     0x72, 0x66, 0x24, 0xec, 0x26, 0xb3, 0x35, 0x3b,
1108                     0x10, 0xa9, 0x03, 0xa6, 0xd0, 0xab, 0x1c, 0x4c },
1109         .expected_ss = (u8[32]){ 0xc3, 0xda, 0x55, 0x37, 0x9d, 0xe9, 0xc6, 0x90,
1110                     0x8e, 0x94, 0xea, 0x4d, 0xf2, 0x8d, 0x08, 0x4f,
1111                     0x32, 0xec, 0xcf, 0x03, 0x49, 0x1c, 0x71, 0xf7,
1112                     0x54, 0xb4, 0x07, 0x55, 0x77, 0xa2, 0x85, 0x52 },
1113         .secret_size = 32,
1114         .b_public_size = 32,
1115         .expected_ss_size = 32,
1116 
1117 },
1118 {
1119         .secret = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0x0a, 0xff, 0xff, 0xff,
1120                      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1121                      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1122                      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1123         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1124                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1125                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1126                     0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0xfb, 0x9f },
1127         .expected_ss = (u8[32]){ 0x77, 0x52, 0xb6, 0x18, 0xc1, 0x2d, 0x48, 0xd2,
1128                     0xc6, 0x93, 0x46, 0x83, 0x81, 0x7c, 0xc6, 0x57,
1129                     0xf3, 0x31, 0x03, 0x19, 0x49, 0x48, 0x20, 0x05,
1130                     0x42, 0x2b, 0x4e, 0xae, 0x8d, 0x1d, 0x43, 0x23 },
1131         .secret_size = 32,
1132         .b_public_size = 32,
1133         .expected_ss_size = 32,
1134 
1135 },
1136 {
1137         .secret = (u8[32]){ 0x8e, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1138                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1139                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1140                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1141         .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1142                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1143                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1144                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x06 },
1145         .expected_ss = (u8[32]){ 0x5a, 0xdf, 0xaa, 0x25, 0x86, 0x8e, 0x32, 0x3d,
1146                     0xae, 0x49, 0x62, 0xc1, 0x01, 0x5c, 0xb3, 0x12,
1147                     0xe1, 0xc5, 0xc7, 0x9e, 0x95, 0x3f, 0x03, 0x99,
1148                     0xb0, 0xba, 0x16, 0x22, 0xf3, 0xb6, 0xf7, 0x0c },
1149         .secret_size = 32,
1150         .b_public_size = 32,
1151         .expected_ss_size = 32,
1152 
1153 },
1154 /* wycheproof - normal case */
1155 {
1156         .secret = (u8[32]){ 0x48, 0x52, 0x83, 0x4d, 0x9d, 0x6b, 0x77, 0xda,
1157                      0xde, 0xab, 0xaa, 0xf2, 0xe1, 0x1d, 0xca, 0x66,
1158                      0xd1, 0x9f, 0xe7, 0x49, 0x93, 0xa7, 0xbe, 0xc3,
1159                      0x6c, 0x6e, 0x16, 0xa0, 0x98, 0x3f, 0xea, 0xba },
1160         .b_public = (u8[32]){ 0x9c, 0x64, 0x7d, 0x9a, 0xe5, 0x89, 0xb9, 0xf5,
1161                     0x8f, 0xdc, 0x3c, 0xa4, 0x94, 0x7e, 0xfb, 0xc9,
1162                     0x15, 0xc4, 0xb2, 0xe0, 0x8e, 0x74, 0x4a, 0x0e,
1163                     0xdf, 0x46, 0x9d, 0xac, 0x59, 0xc8, 0xf8, 0x5a },
1164         .expected_ss = (u8[32]){ 0x87, 0xb7, 0xf2, 0x12, 0xb6, 0x27, 0xf7, 0xa5,
1165                     0x4c, 0xa5, 0xe0, 0xbc, 0xda, 0xdd, 0xd5, 0x38,
1166                     0x9d, 0x9d, 0xe6, 0x15, 0x6c, 0xdb, 0xcf, 0x8e,
1167                     0xbe, 0x14, 0xff, 0xbc, 0xfb, 0x43, 0x65, 0x51 },
1168         .secret_size = 32,
1169         .b_public_size = 32,
1170         .expected_ss_size = 32,
1171 
1172 },
1173 /* wycheproof - public key on twist */
1174 {
1175         .secret = (u8[32]){ 0x58, 0x8c, 0x06, 0x1a, 0x50, 0x80, 0x4a, 0xc4,
1176                      0x88, 0xad, 0x77, 0x4a, 0xc7, 0x16, 0xc3, 0xf5,
1177                      0xba, 0x71, 0x4b, 0x27, 0x12, 0xe0, 0x48, 0x49,
1178                      0x13, 0x79, 0xa5, 0x00, 0x21, 0x19, 0x98, 0xa8 },
1179         .b_public = (u8[32]){ 0x63, 0xaa, 0x40, 0xc6, 0xe3, 0x83, 0x46, 0xc5,
1180                     0xca, 0xf2, 0x3a, 0x6d, 0xf0, 0xa5, 0xe6, 0xc8,
1181                     0x08, 0x89, 0xa0, 0x86, 0x47, 0xe5, 0x51, 0xb3,
1182                     0x56, 0x34, 0x49, 0xbe, 0xfc, 0xfc, 0x97, 0x33 },
1183         .expected_ss = (u8[32]){ 0xb1, 0xa7, 0x07, 0x51, 0x94, 0x95, 0xff, 0xff,
1184                     0xb2, 0x98, 0xff, 0x94, 0x17, 0x16, 0xb0, 0x6d,
1185                     0xfa, 0xb8, 0x7c, 0xf8, 0xd9, 0x11, 0x23, 0xfe,
1186                     0x2b, 0xe9, 0xa2, 0x33, 0xdd, 0xa2, 0x22, 0x12 },
1187         .secret_size = 32,
1188         .b_public_size = 32,
1189         .expected_ss_size = 32,
1190 
1191 },
1192 /* wycheproof - public key on twist */
1193 {
1194         .secret = (u8[32]){ 0xb0, 0x5b, 0xfd, 0x32, 0xe5, 0x53, 0x25, 0xd9,
1195                      0xfd, 0x64, 0x8c, 0xb3, 0x02, 0x84, 0x80, 0x39,
1196                      0x00, 0x0b, 0x39, 0x0e, 0x44, 0xd5, 0x21, 0xe5,
1197                      0x8a, 0xab, 0x3b, 0x29, 0xa6, 0x96, 0x0b, 0xa8 },
1198         .b_public = (u8[32]){ 0x0f, 0x83, 0xc3, 0x6f, 0xde, 0xd9, 0xd3, 0x2f,
1199                     0xad, 0xf4, 0xef, 0xa3, 0xae, 0x93, 0xa9, 0x0b,
1200                     0xb5, 0xcf, 0xa6, 0x68, 0x93, 0xbc, 0x41, 0x2c,
1201                     0x43, 0xfa, 0x72, 0x87, 0xdb, 0xb9, 0x97, 0x79 },
1202         .expected_ss = (u8[32]){ 0x67, 0xdd, 0x4a, 0x6e, 0x16, 0x55, 0x33, 0x53,
1203                     0x4c, 0x0e, 0x3f, 0x17, 0x2e, 0x4a, 0xb8, 0x57,
1204                     0x6b, 0xca, 0x92, 0x3a, 0x5f, 0x07, 0xb2, 0xc0,
1205                     0x69, 0xb4, 0xc3, 0x10, 0xff, 0x2e, 0x93, 0x5b },
1206         .secret_size = 32,
1207         .b_public_size = 32,
1208         .expected_ss_size = 32,
1209 
1210 },
1211 /* wycheproof - public key on twist */
1212 {
1213         .secret = (u8[32]){ 0x70, 0xe3, 0x4b, 0xcb, 0xe1, 0xf4, 0x7f, 0xbc,
1214                      0x0f, 0xdd, 0xfd, 0x7c, 0x1e, 0x1a, 0xa5, 0x3d,
1215                      0x57, 0xbf, 0xe0, 0xf6, 0x6d, 0x24, 0x30, 0x67,
1216                      0xb4, 0x24, 0xbb, 0x62, 0x10, 0xbe, 0xd1, 0x9c },
1217         .b_public = (u8[32]){ 0x0b, 0x82, 0x11, 0xa2, 0xb6, 0x04, 0x90, 0x97,
1218                     0xf6, 0x87, 0x1c, 0x6c, 0x05, 0x2d, 0x3c, 0x5f,
1219                     0xc1, 0xba, 0x17, 0xda, 0x9e, 0x32, 0xae, 0x45,
1220                     0x84, 0x03, 0xb0, 0x5b, 0xb2, 0x83, 0x09, 0x2a },
1221         .expected_ss = (u8[32]){ 0x4a, 0x06, 0x38, 0xcf, 0xaa, 0x9e, 0xf1, 0x93,
1222                     0x3b, 0x47, 0xf8, 0x93, 0x92, 0x96, 0xa6, 0xb2,
1223                     0x5b, 0xe5, 0x41, 0xef, 0x7f, 0x70, 0xe8, 0x44,
1224                     0xc0, 0xbc, 0xc0, 0x0b, 0x13, 0x4d, 0xe6, 0x4a },
1225         .secret_size = 32,
1226         .b_public_size = 32,
1227         .expected_ss_size = 32,
1228 
1229 },
1230 /* wycheproof - public key on twist */
1231 {
1232         .secret = (u8[32]){ 0x68, 0xc1, 0xf3, 0xa6, 0x53, 0xa4, 0xcd, 0xb1,
1233                      0xd3, 0x7b, 0xba, 0x94, 0x73, 0x8f, 0x8b, 0x95,
1234                      0x7a, 0x57, 0xbe, 0xb2, 0x4d, 0x64, 0x6e, 0x99,
1235                      0x4d, 0xc2, 0x9a, 0x27, 0x6a, 0xad, 0x45, 0x8d },
1236         .b_public = (u8[32]){ 0x34, 0x3a, 0xc2, 0x0a, 0x3b, 0x9c, 0x6a, 0x27,
1237                     0xb1, 0x00, 0x81, 0x76, 0x50, 0x9a, 0xd3, 0x07,
1238                     0x35, 0x85, 0x6e, 0xc1, 0xc8, 0xd8, 0xfc, 0xae,
1239                     0x13, 0x91, 0x2d, 0x08, 0xd1, 0x52, 0xf4, 0x6c },
1240         .expected_ss = (u8[32]){ 0x39, 0x94, 0x91, 0xfc, 0xe8, 0xdf, 0xab, 0x73,
1241                     0xb4, 0xf9, 0xf6, 0x11, 0xde, 0x8e, 0xa0, 0xb2,
1242                     0x7b, 0x28, 0xf8, 0x59, 0x94, 0x25, 0x0b, 0x0f,
1243                     0x47, 0x5d, 0x58, 0x5d, 0x04, 0x2a, 0xc2, 0x07 },
1244         .secret_size = 32,
1245         .b_public_size = 32,
1246         .expected_ss_size = 32,
1247 
1248 },
1249 /* wycheproof - public key on twist */
1250 {
1251         .secret = (u8[32]){ 0xd8, 0x77, 0xb2, 0x6d, 0x06, 0xdf, 0xf9, 0xd9,
1252                      0xf7, 0xfd, 0x4c, 0x5b, 0x37, 0x69, 0xf8, 0xcd,
1253                      0xd5, 0xb3, 0x05, 0x16, 0xa5, 0xab, 0x80, 0x6b,
1254                      0xe3, 0x24, 0xff, 0x3e, 0xb6, 0x9e, 0xa0, 0xb2 },
1255         .b_public = (u8[32]){ 0xfa, 0x69, 0x5f, 0xc7, 0xbe, 0x8d, 0x1b, 0xe5,
1256                     0xbf, 0x70, 0x48, 0x98, 0xf3, 0x88, 0xc4, 0x52,
1257                     0xba, 0xfd, 0xd3, 0xb8, 0xea, 0xe8, 0x05, 0xf8,
1258                     0x68, 0x1a, 0x8d, 0x15, 0xc2, 0xd4, 0xe1, 0x42 },
1259         .expected_ss = (u8[32]){ 0x2c, 0x4f, 0xe1, 0x1d, 0x49, 0x0a, 0x53, 0x86,
1260                     0x17, 0x76, 0xb1, 0x3b, 0x43, 0x54, 0xab, 0xd4,
1261                     0xcf, 0x5a, 0x97, 0x69, 0x9d, 0xb6, 0xe6, 0xc6,
1262                     0x8c, 0x16, 0x26, 0xd0, 0x76, 0x62, 0xf7, 0x58 },
1263         .secret_size = 32,
1264         .b_public_size = 32,
1265         .expected_ss_size = 32,
1266 
1267 },
1268 /* wycheproof - edge case on twist */
1269 {
1270         .secret = (u8[32]){ 0x38, 0xdd, 0xe9, 0xf3, 0xe7, 0xb7, 0x99, 0x04,
1271                      0x5f, 0x9a, 0xc3, 0x79, 0x3d, 0x4a, 0x92, 0x77,
1272                      0xda, 0xde, 0xad, 0xc4, 0x1b, 0xec, 0x02, 0x90,
1273                      0xf8, 0x1f, 0x74, 0x4f, 0x73, 0x77, 0x5f, 0x84 },
1274         .b_public = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1275                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1276                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1277                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1278         .expected_ss = (u8[32]){ 0x9a, 0x2c, 0xfe, 0x84, 0xff, 0x9c, 0x4a, 0x97,
1279                     0x39, 0x62, 0x5c, 0xae, 0x4a, 0x3b, 0x82, 0xa9,
1280                     0x06, 0x87, 0x7a, 0x44, 0x19, 0x46, 0xf8, 0xd7,
1281                     0xb3, 0xd7, 0x95, 0xfe, 0x8f, 0x5d, 0x16, 0x39 },
1282         .secret_size = 32,
1283         .b_public_size = 32,
1284         .expected_ss_size = 32,
1285 
1286 },
1287 /* wycheproof - edge case on twist */
1288 {
1289         .secret = (u8[32]){ 0x98, 0x57, 0xa9, 0x14, 0xe3, 0xc2, 0x90, 0x36,
1290                      0xfd, 0x9a, 0x44, 0x2b, 0xa5, 0x26, 0xb5, 0xcd,
1291                      0xcd, 0xf2, 0x82, 0x16, 0x15, 0x3e, 0x63, 0x6c,
1292                      0x10, 0x67, 0x7a, 0xca, 0xb6, 0xbd, 0x6a, 0xa5 },
1293         .b_public = (u8[32]){ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1294                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1295                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1296                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1297         .expected_ss = (u8[32]){ 0x4d, 0xa4, 0xe0, 0xaa, 0x07, 0x2c, 0x23, 0x2e,
1298                     0xe2, 0xf0, 0xfa, 0x4e, 0x51, 0x9a, 0xe5, 0x0b,
1299                     0x52, 0xc1, 0xed, 0xd0, 0x8a, 0x53, 0x4d, 0x4e,
1300                     0xf3, 0x46, 0xc2, 0xe1, 0x06, 0xd2, 0x1d, 0x60 },
1301         .secret_size = 32,
1302         .b_public_size = 32,
1303         .expected_ss_size = 32,
1304 
1305 },
1306 /* wycheproof - edge case on twist */
1307 {
1308         .secret = (u8[32]){ 0x48, 0xe2, 0x13, 0x0d, 0x72, 0x33, 0x05, 0xed,
1309                      0x05, 0xe6, 0xe5, 0x89, 0x4d, 0x39, 0x8a, 0x5e,
1310                      0x33, 0x36, 0x7a, 0x8c, 0x6a, 0xac, 0x8f, 0xcd,
1311                      0xf0, 0xa8, 0x8e, 0x4b, 0x42, 0x82, 0x0d, 0xb7 },
1312         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff,
1313                     0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
1314                     0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00,
1315                     0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00 },
1316         .expected_ss = (u8[32]){ 0x9e, 0xd1, 0x0c, 0x53, 0x74, 0x7f, 0x64, 0x7f,
1317                     0x82, 0xf4, 0x51, 0x25, 0xd3, 0xde, 0x15, 0xa1,
1318                     0xe6, 0xb8, 0x24, 0x49, 0x6a, 0xb4, 0x04, 0x10,
1319                     0xff, 0xcc, 0x3c, 0xfe, 0x95, 0x76, 0x0f, 0x3b },
1320         .secret_size = 32,
1321         .b_public_size = 32,
1322         .expected_ss_size = 32,
1323 
1324 },
1325 /* wycheproof - edge case on twist */
1326 {
1327         .secret = (u8[32]){ 0x28, 0xf4, 0x10, 0x11, 0x69, 0x18, 0x51, 0xb3,
1328                      0xa6, 0x2b, 0x64, 0x15, 0x53, 0xb3, 0x0d, 0x0d,
1329                      0xfd, 0xdc, 0xb8, 0xff, 0xfc, 0xf5, 0x37, 0x00,
1330                      0xa7, 0xbe, 0x2f, 0x6a, 0x87, 0x2e, 0x9f, 0xb0 },
1331         .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00,
1332                     0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
1333                     0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff,
1334                     0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f },
1335         .expected_ss = (u8[32]){ 0xcf, 0x72, 0xb4, 0xaa, 0x6a, 0xa1, 0xc9, 0xf8,
1336                     0x94, 0xf4, 0x16, 0x5b, 0x86, 0x10, 0x9a, 0xa4,
1337                     0x68, 0x51, 0x76, 0x48, 0xe1, 0xf0, 0xcc, 0x70,
1338                     0xe1, 0xab, 0x08, 0x46, 0x01, 0x76, 0x50, 0x6b },
1339         .secret_size = 32,
1340         .b_public_size = 32,
1341         .expected_ss_size = 32,
1342 
1343 },
1344 /* wycheproof - edge case on twist */
1345 {
1346         .secret = (u8[32]){ 0x18, 0xa9, 0x3b, 0x64, 0x99, 0xb9, 0xf6, 0xb3,
1347                      0x22, 0x5c, 0xa0, 0x2f, 0xef, 0x41, 0x0e, 0x0a,
1348                      0xde, 0xc2, 0x35, 0x32, 0x32, 0x1d, 0x2d, 0x8e,
1349                      0xf1, 0xa6, 0xd6, 0x02, 0xa8, 0xc6, 0x5b, 0x83 },
1350         .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1351                     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1352                     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1353                     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f },
1354         .expected_ss = (u8[32]){ 0x5d, 0x50, 0xb6, 0x28, 0x36, 0xbb, 0x69, 0x57,
1355                     0x94, 0x10, 0x38, 0x6c, 0xf7, 0xbb, 0x81, 0x1c,
1356                     0x14, 0xbf, 0x85, 0xb1, 0xc7, 0xb1, 0x7e, 0x59,
1357                     0x24, 0xc7, 0xff, 0xea, 0x91, 0xef, 0x9e, 0x12 },
1358         .secret_size = 32,
1359         .b_public_size = 32,
1360         .expected_ss_size = 32,
1361 
1362 },
1363 /* wycheproof - edge case on twist */
1364 {
1365         .secret = (u8[32]){ 0xc0, 0x1d, 0x13, 0x05, 0xa1, 0x33, 0x8a, 0x1f,
1366                      0xca, 0xc2, 0xba, 0x7e, 0x2e, 0x03, 0x2b, 0x42,
1367                      0x7e, 0x0b, 0x04, 0x90, 0x31, 0x65, 0xac, 0xa9,
1368                      0x57, 0xd8, 0xd0, 0x55, 0x3d, 0x87, 0x17, 0xb0 },
1369         .b_public = (u8[32]){ 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1370                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1371                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1372                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1373         .expected_ss = (u8[32]){ 0x19, 0x23, 0x0e, 0xb1, 0x48, 0xd5, 0xd6, 0x7c,
1374                     0x3c, 0x22, 0xab, 0x1d, 0xae, 0xff, 0x80, 0xa5,
1375                     0x7e, 0xae, 0x42, 0x65, 0xce, 0x28, 0x72, 0x65,
1376                     0x7b, 0x2c, 0x80, 0x99, 0xfc, 0x69, 0x8e, 0x50 },
1377         .secret_size = 32,
1378         .b_public_size = 32,
1379         .expected_ss_size = 32,
1380 
1381 },
1382 /* wycheproof - edge case for public key */
1383 {
1384         .secret = (u8[32]){ 0x38, 0x6f, 0x7f, 0x16, 0xc5, 0x07, 0x31, 0xd6,
1385                      0x4f, 0x82, 0xe6, 0xa1, 0x70, 0xb1, 0x42, 0xa4,
1386                      0xe3, 0x4f, 0x31, 0xfd, 0x77, 0x68, 0xfc, 0xb8,
1387                      0x90, 0x29, 0x25, 0xe7, 0xd1, 0xe2, 0x1a, 0xbe },
1388         .b_public = (u8[32]){ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1389                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1390                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1391                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1392         .expected_ss = (u8[32]){ 0x0f, 0xca, 0xb5, 0xd8, 0x42, 0xa0, 0x78, 0xd7,
1393                     0xa7, 0x1f, 0xc5, 0x9b, 0x57, 0xbf, 0xb4, 0xca,
1394                     0x0b, 0xe6, 0x87, 0x3b, 0x49, 0xdc, 0xdb, 0x9f,
1395                     0x44, 0xe1, 0x4a, 0xe8, 0xfb, 0xdf, 0xa5, 0x42 },
1396         .secret_size = 32,
1397         .b_public_size = 32,
1398         .expected_ss_size = 32,
1399 
1400 },
1401 /* wycheproof - edge case for public key */
1402 {
1403         .secret = (u8[32]){ 0xe0, 0x23, 0xa2, 0x89, 0xbd, 0x5e, 0x90, 0xfa,
1404                      0x28, 0x04, 0xdd, 0xc0, 0x19, 0xa0, 0x5e, 0xf3,
1405                      0xe7, 0x9d, 0x43, 0x4b, 0xb6, 0xea, 0x2f, 0x52,
1406                      0x2e, 0xcb, 0x64, 0x3a, 0x75, 0x29, 0x6e, 0x95 },
1407         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1408                     0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1409                     0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1410                     0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 },
1411         .expected_ss = (u8[32]){ 0x54, 0xce, 0x8f, 0x22, 0x75, 0xc0, 0x77, 0xe3,
1412                     0xb1, 0x30, 0x6a, 0x39, 0x39, 0xc5, 0xe0, 0x3e,
1413                     0xef, 0x6b, 0xbb, 0x88, 0x06, 0x05, 0x44, 0x75,
1414                     0x8d, 0x9f, 0xef, 0x59, 0xb0, 0xbc, 0x3e, 0x4f },
1415         .secret_size = 32,
1416         .b_public_size = 32,
1417         .expected_ss_size = 32,
1418 
1419 },
1420 /* wycheproof - edge case for public key */
1421 {
1422         .secret = (u8[32]){ 0x68, 0xf0, 0x10, 0xd6, 0x2e, 0xe8, 0xd9, 0x26,
1423                      0x05, 0x3a, 0x36, 0x1c, 0x3a, 0x75, 0xc6, 0xea,
1424                      0x4e, 0xbd, 0xc8, 0x60, 0x6a, 0xb2, 0x85, 0x00,
1425                      0x3a, 0x6f, 0x8f, 0x40, 0x76, 0xb0, 0x1e, 0x83 },
1426         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1427                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1428                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1429                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03 },
1430         .expected_ss = (u8[32]){ 0xf1, 0x36, 0x77, 0x5c, 0x5b, 0xeb, 0x0a, 0xf8,
1431                     0x11, 0x0a, 0xf1, 0x0b, 0x20, 0x37, 0x23, 0x32,
1432                     0x04, 0x3c, 0xab, 0x75, 0x24, 0x19, 0x67, 0x87,
1433                     0x75, 0xa2, 0x23, 0xdf, 0x57, 0xc9, 0xd3, 0x0d },
1434         .secret_size = 32,
1435         .b_public_size = 32,
1436         .expected_ss_size = 32,
1437 
1438 },
1439 /* wycheproof - edge case for public key */
1440 {
1441         .secret = (u8[32]){ 0x58, 0xeb, 0xcb, 0x35, 0xb0, 0xf8, 0x84, 0x5c,
1442                      0xaf, 0x1e, 0xc6, 0x30, 0xf9, 0x65, 0x76, 0xb6,
1443                      0x2c, 0x4b, 0x7b, 0x6c, 0x36, 0xb2, 0x9d, 0xeb,
1444                      0x2c, 0xb0, 0x08, 0x46, 0x51, 0x75, 0x5c, 0x96 },
1445         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xfb, 0xff,
1446                     0xff, 0xdf, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff,
1447                     0xfe, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xf7, 0xff,
1448                     0xff, 0xf7, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x3f },
1449         .expected_ss = (u8[32]){ 0xbf, 0x9a, 0xff, 0xd0, 0x6b, 0x84, 0x40, 0x85,
1450                     0x58, 0x64, 0x60, 0x96, 0x2e, 0xf2, 0x14, 0x6f,
1451                     0xf3, 0xd4, 0x53, 0x3d, 0x94, 0x44, 0xaa, 0xb0,
1452                     0x06, 0xeb, 0x88, 0xcc, 0x30, 0x54, 0x40, 0x7d },
1453         .secret_size = 32,
1454         .b_public_size = 32,
1455         .expected_ss_size = 32,
1456 
1457 },
1458 /* wycheproof - edge case for public key */
1459 {
1460         .secret = (u8[32]){ 0x18, 0x8c, 0x4b, 0xc5, 0xb9, 0xc4, 0x4b, 0x38,
1461                      0xbb, 0x65, 0x8b, 0x9b, 0x2a, 0xe8, 0x2d, 0x5b,
1462                      0x01, 0x01, 0x5e, 0x09, 0x31, 0x84, 0xb1, 0x7c,
1463                      0xb7, 0x86, 0x35, 0x03, 0xa7, 0x83, 0xe1, 0xbb },
1464         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1465                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1466                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1467                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1468         .expected_ss = (u8[32]){ 0xd4, 0x80, 0xde, 0x04, 0xf6, 0x99, 0xcb, 0x3b,
1469                     0xe0, 0x68, 0x4a, 0x9c, 0xc2, 0xe3, 0x12, 0x81,
1470                     0xea, 0x0b, 0xc5, 0xa9, 0xdc, 0xc1, 0x57, 0xd3,
1471                     0xd2, 0x01, 0x58, 0xd4, 0x6c, 0xa5, 0x24, 0x6d },
1472         .secret_size = 32,
1473         .b_public_size = 32,
1474         .expected_ss_size = 32,
1475 
1476 },
1477 /* wycheproof - edge case for public key */
1478 {
1479         .secret = (u8[32]){ 0xe0, 0x6c, 0x11, 0xbb, 0x2e, 0x13, 0xce, 0x3d,
1480                      0xc7, 0x67, 0x3f, 0x67, 0xf5, 0x48, 0x22, 0x42,
1481                      0x90, 0x94, 0x23, 0xa9, 0xae, 0x95, 0xee, 0x98,
1482                      0x6a, 0x98, 0x8d, 0x98, 0xfa, 0xee, 0x23, 0xa2 },
1483         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1484                     0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1485                     0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1486                     0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f },
1487         .expected_ss = (u8[32]){ 0x4c, 0x44, 0x01, 0xcc, 0xe6, 0xb5, 0x1e, 0x4c,
1488                     0xb1, 0x8f, 0x27, 0x90, 0x24, 0x6c, 0x9b, 0xf9,
1489                     0x14, 0xdb, 0x66, 0x77, 0x50, 0xa1, 0xcb, 0x89,
1490                     0x06, 0x90, 0x92, 0xaf, 0x07, 0x29, 0x22, 0x76 },
1491         .secret_size = 32,
1492         .b_public_size = 32,
1493         .expected_ss_size = 32,
1494 
1495 },
1496 /* wycheproof - edge case for public key */
1497 {
1498         .secret = (u8[32]){ 0xc0, 0x65, 0x8c, 0x46, 0xdd, 0xe1, 0x81, 0x29,
1499                      0x29, 0x38, 0x77, 0x53, 0x5b, 0x11, 0x62, 0xb6,
1500                      0xf9, 0xf5, 0x41, 0x4a, 0x23, 0xcf, 0x4d, 0x2c,
1501                      0xbc, 0x14, 0x0a, 0x4d, 0x99, 0xda, 0x2b, 0x8f },
1502         .b_public = (u8[32]){ 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1503                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1504                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1505                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1506         .expected_ss = (u8[32]){ 0x57, 0x8b, 0xa8, 0xcc, 0x2d, 0xbd, 0xc5, 0x75,
1507                     0xaf, 0xcf, 0x9d, 0xf2, 0xb3, 0xee, 0x61, 0x89,
1508                     0xf5, 0x33, 0x7d, 0x68, 0x54, 0xc7, 0x9b, 0x4c,
1509                     0xe1, 0x65, 0xea, 0x12, 0x29, 0x3b, 0x3a, 0x0f },
1510         .secret_size = 32,
1511         .b_public_size = 32,
1512         .expected_ss_size = 32,
1513 
1514 },
1515 /* wycheproof - public key >= p */
1516 {
1517         .secret = (u8[32]){ 0xf0, 0x1e, 0x48, 0xda, 0xfa, 0xc9, 0xd7, 0xbc,
1518                      0xf5, 0x89, 0xcb, 0xc3, 0x82, 0xc8, 0x78, 0xd1,
1519                      0x8b, 0xda, 0x35, 0x50, 0x58, 0x9f, 0xfb, 0x5d,
1520                      0x50, 0xb5, 0x23, 0xbe, 0xbe, 0x32, 0x9d, 0xae },
1521         .b_public = (u8[32]){ 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1522                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1523                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1524                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1525         .expected_ss = (u8[32]){ 0xbd, 0x36, 0xa0, 0x79, 0x0e, 0xb8, 0x83, 0x09,
1526                     0x8c, 0x98, 0x8b, 0x21, 0x78, 0x67, 0x73, 0xde,
1527                     0x0b, 0x3a, 0x4d, 0xf1, 0x62, 0x28, 0x2c, 0xf1,
1528                     0x10, 0xde, 0x18, 0xdd, 0x48, 0x4c, 0xe7, 0x4b },
1529         .secret_size = 32,
1530         .b_public_size = 32,
1531         .expected_ss_size = 32,
1532 
1533 },
1534 /* wycheproof - public key >= p */
1535 {
1536         .secret = (u8[32]){ 0x28, 0x87, 0x96, 0xbc, 0x5a, 0xff, 0x4b, 0x81,
1537                      0xa3, 0x75, 0x01, 0x75, 0x7b, 0xc0, 0x75, 0x3a,
1538                      0x3c, 0x21, 0x96, 0x47, 0x90, 0xd3, 0x86, 0x99,
1539                      0x30, 0x8d, 0xeb, 0xc1, 0x7a, 0x6e, 0xaf, 0x8d },
1540         .b_public = (u8[32]){ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1541                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1542                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1543                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1544         .expected_ss = (u8[32]){ 0xb4, 0xe0, 0xdd, 0x76, 0xda, 0x7b, 0x07, 0x17,
1545                     0x28, 0xb6, 0x1f, 0x85, 0x67, 0x71, 0xaa, 0x35,
1546                     0x6e, 0x57, 0xed, 0xa7, 0x8a, 0x5b, 0x16, 0x55,
1547                     0xcc, 0x38, 0x20, 0xfb, 0x5f, 0x85, 0x4c, 0x5c },
1548         .secret_size = 32,
1549         .b_public_size = 32,
1550         .expected_ss_size = 32,
1551 
1552 },
1553 /* wycheproof - public key >= p */
1554 {
1555         .secret = (u8[32]){ 0x98, 0xdf, 0x84, 0x5f, 0x66, 0x51, 0xbf, 0x11,
1556                      0x38, 0x22, 0x1f, 0x11, 0x90, 0x41, 0xf7, 0x2b,
1557                      0x6d, 0xbc, 0x3c, 0x4a, 0xce, 0x71, 0x43, 0xd9,
1558                      0x9f, 0xd5, 0x5a, 0xd8, 0x67, 0x48, 0x0d, 0xa8 },
1559         .b_public = (u8[32]){ 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1560                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1561                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1562                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1563         .expected_ss = (u8[32]){ 0x6f, 0xdf, 0x6c, 0x37, 0x61, 0x1d, 0xbd, 0x53,
1564                     0x04, 0xdc, 0x0f, 0x2e, 0xb7, 0xc9, 0x51, 0x7e,
1565                     0xb3, 0xc5, 0x0e, 0x12, 0xfd, 0x05, 0x0a, 0xc6,
1566                     0xde, 0xc2, 0x70, 0x71, 0xd4, 0xbf, 0xc0, 0x34 },
1567         .secret_size = 32,
1568         .b_public_size = 32,
1569         .expected_ss_size = 32,
1570 
1571 },
1572 /* wycheproof - public key >= p */
1573 {
1574         .secret = (u8[32]){ 0xf0, 0x94, 0x98, 0xe4, 0x6f, 0x02, 0xf8, 0x78,
1575                      0x82, 0x9e, 0x78, 0xb8, 0x03, 0xd3, 0x16, 0xa2,
1576                      0xed, 0x69, 0x5d, 0x04, 0x98, 0xa0, 0x8a, 0xbd,
1577                      0xf8, 0x27, 0x69, 0x30, 0xe2, 0x4e, 0xdc, 0xb0 },
1578         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1579                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1580                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1581                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1582         .expected_ss = (u8[32]){ 0x4c, 0x8f, 0xc4, 0xb1, 0xc6, 0xab, 0x88, 0xfb,
1583                     0x21, 0xf1, 0x8f, 0x6d, 0x4c, 0x81, 0x02, 0x40,
1584                     0xd4, 0xe9, 0x46, 0x51, 0xba, 0x44, 0xf7, 0xa2,
1585                     0xc8, 0x63, 0xce, 0xc7, 0xdc, 0x56, 0x60, 0x2d },
1586         .secret_size = 32,
1587         .b_public_size = 32,
1588         .expected_ss_size = 32,
1589 
1590 },
1591 /* wycheproof - public key >= p */
1592 {
1593         .secret = (u8[32]){ 0x18, 0x13, 0xc1, 0x0a, 0x5c, 0x7f, 0x21, 0xf9,
1594                      0x6e, 0x17, 0xf2, 0x88, 0xc0, 0xcc, 0x37, 0x60,
1595                      0x7c, 0x04, 0xc5, 0xf5, 0xae, 0xa2, 0xdb, 0x13,
1596                      0x4f, 0x9e, 0x2f, 0xfc, 0x66, 0xbd, 0x9d, 0xb8 },
1597         .b_public = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1598                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1599                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1600                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
1601         .expected_ss = (u8[32]){ 0x1c, 0xd0, 0xb2, 0x82, 0x67, 0xdc, 0x54, 0x1c,
1602                     0x64, 0x2d, 0x6d, 0x7d, 0xca, 0x44, 0xa8, 0xb3,
1603                     0x8a, 0x63, 0x73, 0x6e, 0xef, 0x5c, 0x4e, 0x65,
1604                     0x01, 0xff, 0xbb, 0xb1, 0x78, 0x0c, 0x03, 0x3c },
1605         .secret_size = 32,
1606         .b_public_size = 32,
1607         .expected_ss_size = 32,
1608 
1609 },
1610 /* wycheproof - public key >= p */
1611 {
1612         .secret = (u8[32]){ 0x78, 0x57, 0xfb, 0x80, 0x86, 0x53, 0x64, 0x5a,
1613                      0x0b, 0xeb, 0x13, 0x8a, 0x64, 0xf5, 0xf4, 0xd7,
1614                      0x33, 0xa4, 0x5e, 0xa8, 0x4c, 0x3c, 0xda, 0x11,
1615                      0xa9, 0xc0, 0x6f, 0x7e, 0x71, 0x39, 0x14, 0x9e },
1616         .b_public = (u8[32]){ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1617                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1618                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1619                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
1620         .expected_ss = (u8[32]){ 0x87, 0x55, 0xbe, 0x01, 0xc6, 0x0a, 0x7e, 0x82,
1621                     0x5c, 0xff, 0x3e, 0x0e, 0x78, 0xcb, 0x3a, 0xa4,
1622                     0x33, 0x38, 0x61, 0x51, 0x6a, 0xa5, 0x9b, 0x1c,
1623                     0x51, 0xa8, 0xb2, 0xa5, 0x43, 0xdf, 0xa8, 0x22 },
1624         .secret_size = 32,
1625         .b_public_size = 32,
1626         .expected_ss_size = 32,
1627 
1628 },
1629 /* wycheproof - public key >= p */
1630 {
1631         .secret = (u8[32]){ 0xe0, 0x3a, 0xa8, 0x42, 0xe2, 0xab, 0xc5, 0x6e,
1632                      0x81, 0xe8, 0x7b, 0x8b, 0x9f, 0x41, 0x7b, 0x2a,
1633                      0x1e, 0x59, 0x13, 0xc7, 0x23, 0xee, 0xd2, 0x8d,
1634                      0x75, 0x2f, 0x8d, 0x47, 0xa5, 0x9f, 0x49, 0x8f },
1635         .b_public = (u8[32]){ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1636                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1637                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1638                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
1639         .expected_ss = (u8[32]){ 0x54, 0xc9, 0xa1, 0xed, 0x95, 0xe5, 0x46, 0xd2,
1640                     0x78, 0x22, 0xa3, 0x60, 0x93, 0x1d, 0xda, 0x60,
1641                     0xa1, 0xdf, 0x04, 0x9d, 0xa6, 0xf9, 0x04, 0x25,
1642                     0x3c, 0x06, 0x12, 0xbb, 0xdc, 0x08, 0x74, 0x76 },
1643         .secret_size = 32,
1644         .b_public_size = 32,
1645         .expected_ss_size = 32,
1646 
1647 },
1648 /* wycheproof - public key >= p */
1649 {
1650         .secret = (u8[32]){ 0xf8, 0xf7, 0x07, 0xb7, 0x99, 0x9b, 0x18, 0xcb,
1651                      0x0d, 0x6b, 0x96, 0x12, 0x4f, 0x20, 0x45, 0x97,
1652                      0x2c, 0xa2, 0x74, 0xbf, 0xc1, 0x54, 0xad, 0x0c,
1653                      0x87, 0x03, 0x8c, 0x24, 0xc6, 0xd0, 0xd4, 0xb2 },
1654         .b_public = (u8[32]){ 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1655                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1656                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1657                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1658         .expected_ss = (u8[32]){ 0xcc, 0x1f, 0x40, 0xd7, 0x43, 0xcd, 0xc2, 0x23,
1659                     0x0e, 0x10, 0x43, 0xda, 0xba, 0x8b, 0x75, 0xe8,
1660                     0x10, 0xf1, 0xfb, 0xab, 0x7f, 0x25, 0x52, 0x69,
1661                     0xbd, 0x9e, 0xbb, 0x29, 0xe6, 0xbf, 0x49, 0x4f },
1662         .secret_size = 32,
1663         .b_public_size = 32,
1664         .expected_ss_size = 32,
1665 
1666 },
1667 /* wycheproof - public key >= p */
1668 {
1669         .secret = (u8[32]){ 0xa0, 0x34, 0xf6, 0x84, 0xfa, 0x63, 0x1e, 0x1a,
1670                      0x34, 0x81, 0x18, 0xc1, 0xce, 0x4c, 0x98, 0x23,
1671                      0x1f, 0x2d, 0x9e, 0xec, 0x9b, 0xa5, 0x36, 0x5b,
1672                      0x4a, 0x05, 0xd6, 0x9a, 0x78, 0x5b, 0x07, 0x96 },
1673         .b_public = (u8[32]){ 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1674                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1675                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1676                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1677         .expected_ss = (u8[32]){ 0x54, 0x99, 0x8e, 0xe4, 0x3a, 0x5b, 0x00, 0x7b,
1678                     0xf4, 0x99, 0xf0, 0x78, 0xe7, 0x36, 0x52, 0x44,
1679                     0x00, 0xa8, 0xb5, 0xc7, 0xe9, 0xb9, 0xb4, 0x37,
1680                     0x71, 0x74, 0x8c, 0x7c, 0xdf, 0x88, 0x04, 0x12 },
1681         .secret_size = 32,
1682         .b_public_size = 32,
1683         .expected_ss_size = 32,
1684 
1685 },
1686 /* wycheproof - public key >= p */
1687 {
1688         .secret = (u8[32]){ 0x30, 0xb6, 0xc6, 0xa0, 0xf2, 0xff, 0xa6, 0x80,
1689                      0x76, 0x8f, 0x99, 0x2b, 0xa8, 0x9e, 0x15, 0x2d,
1690                      0x5b, 0xc9, 0x89, 0x3d, 0x38, 0xc9, 0x11, 0x9b,
1691                      0xe4, 0xf7, 0x67, 0xbf, 0xab, 0x6e, 0x0c, 0xa5 },
1692         .b_public = (u8[32]){ 0xdc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1693                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1694                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1695                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1696         .expected_ss = (u8[32]){ 0xea, 0xd9, 0xb3, 0x8e, 0xfd, 0xd7, 0x23, 0x63,
1697                     0x79, 0x34, 0xe5, 0x5a, 0xb7, 0x17, 0xa7, 0xae,
1698                     0x09, 0xeb, 0x86, 0xa2, 0x1d, 0xc3, 0x6a, 0x3f,
1699                     0xee, 0xb8, 0x8b, 0x75, 0x9e, 0x39, 0x1e, 0x09 },
1700         .secret_size = 32,
1701         .b_public_size = 32,
1702         .expected_ss_size = 32,
1703 
1704 },
1705 /* wycheproof - public key >= p */
1706 {
1707         .secret = (u8[32]){ 0x90, 0x1b, 0x9d, 0xcf, 0x88, 0x1e, 0x01, 0xe0,
1708                      0x27, 0x57, 0x50, 0x35, 0xd4, 0x0b, 0x43, 0xbd,
1709                      0xc1, 0xc5, 0x24, 0x2e, 0x03, 0x08, 0x47, 0x49,
1710                      0x5b, 0x0c, 0x72, 0x86, 0x46, 0x9b, 0x65, 0x91 },
1711         .b_public = (u8[32]){ 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1712                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1713                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1714                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1715         .expected_ss = (u8[32]){ 0x60, 0x2f, 0xf4, 0x07, 0x89, 0xb5, 0x4b, 0x41,
1716                     0x80, 0x59, 0x15, 0xfe, 0x2a, 0x62, 0x21, 0xf0,
1717                     0x7a, 0x50, 0xff, 0xc2, 0xc3, 0xfc, 0x94, 0xcf,
1718                     0x61, 0xf1, 0x3d, 0x79, 0x04, 0xe8, 0x8e, 0x0e },
1719         .secret_size = 32,
1720         .b_public_size = 32,
1721         .expected_ss_size = 32,
1722 
1723 },
1724 /* wycheproof - public key >= p */
1725 {
1726         .secret = (u8[32]){ 0x80, 0x46, 0x67, 0x7c, 0x28, 0xfd, 0x82, 0xc9,
1727                      0xa1, 0xbd, 0xb7, 0x1a, 0x1a, 0x1a, 0x34, 0xfa,
1728                      0xba, 0x12, 0x25, 0xe2, 0x50, 0x7f, 0xe3, 0xf5,
1729                      0x4d, 0x10, 0xbd, 0x5b, 0x0d, 0x86, 0x5f, 0x8e },
1730         .b_public = (u8[32]){ 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1731                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1732                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1733                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1734         .expected_ss = (u8[32]){ 0xe0, 0x0a, 0xe8, 0xb1, 0x43, 0x47, 0x12, 0x47,
1735                     0xba, 0x24, 0xf1, 0x2c, 0x88, 0x55, 0x36, 0xc3,
1736                     0xcb, 0x98, 0x1b, 0x58, 0xe1, 0xe5, 0x6b, 0x2b,
1737                     0xaf, 0x35, 0xc1, 0x2a, 0xe1, 0xf7, 0x9c, 0x26 },
1738         .secret_size = 32,
1739         .b_public_size = 32,
1740         .expected_ss_size = 32,
1741 
1742 },
1743 /* wycheproof - public key >= p */
1744 {
1745         .secret = (u8[32]){ 0x60, 0x2f, 0x7e, 0x2f, 0x68, 0xa8, 0x46, 0xb8,
1746                      0x2c, 0xc2, 0x69, 0xb1, 0xd4, 0x8e, 0x93, 0x98,
1747                      0x86, 0xae, 0x54, 0xfd, 0x63, 0x6c, 0x1f, 0xe0,
1748                      0x74, 0xd7, 0x10, 0x12, 0x7d, 0x47, 0x24, 0x91 },
1749         .b_public = (u8[32]){ 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1750                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1751                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1752                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1753         .expected_ss = (u8[32]){ 0x98, 0xcb, 0x9b, 0x50, 0xdd, 0x3f, 0xc2, 0xb0,
1754                     0xd4, 0xf2, 0xd2, 0xbf, 0x7c, 0x5c, 0xfd, 0xd1,
1755                     0x0c, 0x8f, 0xcd, 0x31, 0xfc, 0x40, 0xaf, 0x1a,
1756                     0xd4, 0x4f, 0x47, 0xc1, 0x31, 0x37, 0x63, 0x62 },
1757         .secret_size = 32,
1758         .b_public_size = 32,
1759         .expected_ss_size = 32,
1760 
1761 },
1762 /* wycheproof - public key >= p */
1763 {
1764         .secret = (u8[32]){ 0x60, 0x88, 0x7b, 0x3d, 0xc7, 0x24, 0x43, 0x02,
1765                      0x6e, 0xbe, 0xdb, 0xbb, 0xb7, 0x06, 0x65, 0xf4,
1766                      0x2b, 0x87, 0xad, 0xd1, 0x44, 0x0e, 0x77, 0x68,
1767                      0xfb, 0xd7, 0xe8, 0xe2, 0xce, 0x5f, 0x63, 0x9d },
1768         .b_public = (u8[32]){ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1769                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1770                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1771                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1772         .expected_ss = (u8[32]){ 0x38, 0xd6, 0x30, 0x4c, 0x4a, 0x7e, 0x6d, 0x9f,
1773                     0x79, 0x59, 0x33, 0x4f, 0xb5, 0x24, 0x5b, 0xd2,
1774                     0xc7, 0x54, 0x52, 0x5d, 0x4c, 0x91, 0xdb, 0x95,
1775                     0x02, 0x06, 0x92, 0x62, 0x34, 0xc1, 0xf6, 0x33 },
1776         .secret_size = 32,
1777         .b_public_size = 32,
1778         .expected_ss_size = 32,
1779 
1780 },
1781 /* wycheproof - public key >= p */
1782 {
1783         .secret = (u8[32]){ 0x78, 0xd3, 0x1d, 0xfa, 0x85, 0x44, 0x97, 0xd7,
1784                      0x2d, 0x8d, 0xef, 0x8a, 0x1b, 0x7f, 0xb0, 0x06,
1785                      0xce, 0xc2, 0xd8, 0xc4, 0x92, 0x46, 0x47, 0xc9,
1786                      0x38, 0x14, 0xae, 0x56, 0xfa, 0xed, 0xa4, 0x95 },
1787         .b_public = (u8[32]){ 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1788                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1789                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1790                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1791         .expected_ss = (u8[32]){ 0x78, 0x6c, 0xd5, 0x49, 0x96, 0xf0, 0x14, 0xa5,
1792                     0xa0, 0x31, 0xec, 0x14, 0xdb, 0x81, 0x2e, 0xd0,
1793                     0x83, 0x55, 0x06, 0x1f, 0xdb, 0x5d, 0xe6, 0x80,
1794                     0xa8, 0x00, 0xac, 0x52, 0x1f, 0x31, 0x8e, 0x23 },
1795         .secret_size = 32,
1796         .b_public_size = 32,
1797         .expected_ss_size = 32,
1798 
1799 },
1800 /* wycheproof - public key >= p */
1801 {
1802         .secret = (u8[32]){ 0xc0, 0x4c, 0x5b, 0xae, 0xfa, 0x83, 0x02, 0xdd,
1803                      0xde, 0xd6, 0xa4, 0xbb, 0x95, 0x77, 0x61, 0xb4,
1804                      0xeb, 0x97, 0xae, 0xfa, 0x4f, 0xc3, 0xb8, 0x04,
1805                      0x30, 0x85, 0xf9, 0x6a, 0x56, 0x59, 0xb3, 0xa5 },
1806         .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1807                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1808                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1809                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1810         .expected_ss = (u8[32]){ 0x29, 0xae, 0x8b, 0xc7, 0x3e, 0x9b, 0x10, 0xa0,
1811                     0x8b, 0x4f, 0x68, 0x1c, 0x43, 0xc3, 0xe0, 0xac,
1812                     0x1a, 0x17, 0x1d, 0x31, 0xb3, 0x8f, 0x1a, 0x48,
1813                     0xef, 0xba, 0x29, 0xae, 0x63, 0x9e, 0xa1, 0x34 },
1814         .secret_size = 32,
1815         .b_public_size = 32,
1816         .expected_ss_size = 32,
1817 
1818 },
1819 /* wycheproof - RFC 7748 */
1820 {
1821         .secret = (u8[32]){ 0xa0, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d,
1822                      0x3b, 0x16, 0x15, 0x4b, 0x82, 0x46, 0x5e, 0xdd,
1823                      0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc, 0x5a, 0x18,
1824                      0x50, 0x6a, 0x22, 0x44, 0xba, 0x44, 0x9a, 0x44 },
1825         .b_public = (u8[32]){ 0xe6, 0xdb, 0x68, 0x67, 0x58, 0x30, 0x30, 0xdb,
1826                     0x35, 0x94, 0xc1, 0xa4, 0x24, 0xb1, 0x5f, 0x7c,
1827                     0x72, 0x66, 0x24, 0xec, 0x26, 0xb3, 0x35, 0x3b,
1828                     0x10, 0xa9, 0x03, 0xa6, 0xd0, 0xab, 0x1c, 0x4c },
1829         .expected_ss = (u8[32]){ 0xc3, 0xda, 0x55, 0x37, 0x9d, 0xe9, 0xc6, 0x90,
1830                     0x8e, 0x94, 0xea, 0x4d, 0xf2, 0x8d, 0x08, 0x4f,
1831                     0x32, 0xec, 0xcf, 0x03, 0x49, 0x1c, 0x71, 0xf7,
1832                     0x54, 0xb4, 0x07, 0x55, 0x77, 0xa2, 0x85, 0x52 },
1833         .secret_size = 32,
1834         .b_public_size = 32,
1835         .expected_ss_size = 32,
1836 
1837 },
1838 /* wycheproof - RFC 7748 */
1839 {
1840         .secret = (u8[32]){ 0x48, 0x66, 0xe9, 0xd4, 0xd1, 0xb4, 0x67, 0x3c,
1841                      0x5a, 0xd2, 0x26, 0x91, 0x95, 0x7d, 0x6a, 0xf5,
1842                      0xc1, 0x1b, 0x64, 0x21, 0xe0, 0xea, 0x01, 0xd4,
1843                      0x2c, 0xa4, 0x16, 0x9e, 0x79, 0x18, 0xba, 0x4d },
1844         .b_public = (u8[32]){ 0xe5, 0x21, 0x0f, 0x12, 0x78, 0x68, 0x11, 0xd3,
1845                     0xf4, 0xb7, 0x95, 0x9d, 0x05, 0x38, 0xae, 0x2c,
1846                     0x31, 0xdb, 0xe7, 0x10, 0x6f, 0xc0, 0x3c, 0x3e,
1847                     0xfc, 0x4c, 0xd5, 0x49, 0xc7, 0x15, 0xa4, 0x13 },
1848         .expected_ss = (u8[32]){ 0x95, 0xcb, 0xde, 0x94, 0x76, 0xe8, 0x90, 0x7d,
1849                     0x7a, 0xad, 0xe4, 0x5c, 0xb4, 0xb8, 0x73, 0xf8,
1850                     0x8b, 0x59, 0x5a, 0x68, 0x79, 0x9f, 0xa1, 0x52,
1851                     0xe6, 0xf8, 0xf7, 0x64, 0x7a, 0xac, 0x79, 0x57 },
1852         .secret_size = 32,
1853         .b_public_size = 32,
1854         .expected_ss_size = 32,
1855 
1856 },
1857 /* wycheproof - edge case for shared secret */
1858 {
1859         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1860                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1861                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1862                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1863         .b_public = (u8[32]){ 0x0a, 0xb4, 0xe7, 0x63, 0x80, 0xd8, 0x4d, 0xde,
1864                     0x4f, 0x68, 0x33, 0xc5, 0x8f, 0x2a, 0x9f, 0xb8,
1865                     0xf8, 0x3b, 0xb0, 0x16, 0x9b, 0x17, 0x2b, 0xe4,
1866                     0xb6, 0xe0, 0x59, 0x28, 0x87, 0x74, 0x1a, 0x36 },
1867         .expected_ss = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1868                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1869                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1870                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1871         .secret_size = 32,
1872         .b_public_size = 32,
1873         .expected_ss_size = 32,
1874 
1875 },
1876 /* wycheproof - edge case for shared secret */
1877 {
1878         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1879                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1880                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1881                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1882         .b_public = (u8[32]){ 0x89, 0xe1, 0x0d, 0x57, 0x01, 0xb4, 0x33, 0x7d,
1883                     0x2d, 0x03, 0x21, 0x81, 0x53, 0x8b, 0x10, 0x64,
1884                     0xbd, 0x40, 0x84, 0x40, 0x1c, 0xec, 0xa1, 0xfd,
1885                     0x12, 0x66, 0x3a, 0x19, 0x59, 0x38, 0x80, 0x00 },
1886         .expected_ss = (u8[32]){ 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1887                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1888                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1889                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1890         .secret_size = 32,
1891         .b_public_size = 32,
1892         .expected_ss_size = 32,
1893 
1894 },
1895 /* wycheproof - edge case for shared secret */
1896 {
1897         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1898                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1899                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1900                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1901         .b_public = (u8[32]){ 0x2b, 0x55, 0xd3, 0xaa, 0x4a, 0x8f, 0x80, 0xc8,
1902                     0xc0, 0xb2, 0xae, 0x5f, 0x93, 0x3e, 0x85, 0xaf,
1903                     0x49, 0xbe, 0xac, 0x36, 0xc2, 0xfa, 0x73, 0x94,
1904                     0xba, 0xb7, 0x6c, 0x89, 0x33, 0xf8, 0xf8, 0x1d },
1905         .expected_ss = (u8[32]){ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1906                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1907                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1908                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1909         .secret_size = 32,
1910         .b_public_size = 32,
1911         .expected_ss_size = 32,
1912 
1913 },
1914 /* wycheproof - edge case for shared secret */
1915 {
1916         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1917                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1918                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1919                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1920         .b_public = (u8[32]){ 0x63, 0xe5, 0xb1, 0xfe, 0x96, 0x01, 0xfe, 0x84,
1921                     0x38, 0x5d, 0x88, 0x66, 0xb0, 0x42, 0x12, 0x62,
1922                     0xf7, 0x8f, 0xbf, 0xa5, 0xaf, 0xf9, 0x58, 0x5e,
1923                     0x62, 0x66, 0x79, 0xb1, 0x85, 0x47, 0xd9, 0x59 },
1924         .expected_ss = (u8[32]){ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1925                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1926                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1927                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1928         .secret_size = 32,
1929         .b_public_size = 32,
1930         .expected_ss_size = 32,
1931 
1932 },
1933 /* wycheproof - edge case for shared secret */
1934 {
1935         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1936                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1937                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1938                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1939         .b_public = (u8[32]){ 0xe4, 0x28, 0xf3, 0xda, 0xc1, 0x78, 0x09, 0xf8,
1940                     0x27, 0xa5, 0x22, 0xce, 0x32, 0x35, 0x50, 0x58,
1941                     0xd0, 0x73, 0x69, 0x36, 0x4a, 0xa7, 0x89, 0x02,
1942                     0xee, 0x10, 0x13, 0x9b, 0x9f, 0x9d, 0xd6, 0x53 },
1943         .expected_ss = (u8[32]){ 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1944                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1945                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1946                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1947         .secret_size = 32,
1948         .b_public_size = 32,
1949         .expected_ss_size = 32,
1950 
1951 },
1952 /* wycheproof - edge case for shared secret */
1953 {
1954         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1955                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1956                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1957                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1958         .b_public = (u8[32]){ 0xb3, 0xb5, 0x0e, 0x3e, 0xd3, 0xa4, 0x07, 0xb9,
1959                     0x5d, 0xe9, 0x42, 0xef, 0x74, 0x57, 0x5b, 0x5a,
1960                     0xb8, 0xa1, 0x0c, 0x09, 0xee, 0x10, 0x35, 0x44,
1961                     0xd6, 0x0b, 0xdf, 0xed, 0x81, 0x38, 0xab, 0x2b },
1962         .expected_ss = (u8[32]){ 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1963                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1964                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1965                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1966         .secret_size = 32,
1967         .b_public_size = 32,
1968         .expected_ss_size = 32,
1969 
1970 },
1971 /* wycheproof - edge case for shared secret */
1972 {
1973         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1974                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1975                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1976                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1977         .b_public = (u8[32]){ 0x21, 0x3f, 0xff, 0xe9, 0x3d, 0x5e, 0xa8, 0xcd,
1978                     0x24, 0x2e, 0x46, 0x28, 0x44, 0x02, 0x99, 0x22,
1979                     0xc4, 0x3c, 0x77, 0xc9, 0xe3, 0xe4, 0x2f, 0x56,
1980                     0x2f, 0x48, 0x5d, 0x24, 0xc5, 0x01, 0xa2, 0x0b },
1981         .expected_ss = (u8[32]){ 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1982                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1983                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1984                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1985         .secret_size = 32,
1986         .b_public_size = 32,
1987         .expected_ss_size = 32,
1988 
1989 },
1990 /* wycheproof - edge case for shared secret */
1991 {
1992         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
1993                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
1994                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
1995                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
1996         .b_public = (u8[32]){ 0x91, 0xb2, 0x32, 0xa1, 0x78, 0xb3, 0xcd, 0x53,
1997                     0x09, 0x32, 0x44, 0x1e, 0x61, 0x39, 0x41, 0x8f,
1998                     0x72, 0x17, 0x22, 0x92, 0xf1, 0xda, 0x4c, 0x18,
1999                     0x34, 0xfc, 0x5e, 0xbf, 0xef, 0xb5, 0x1e, 0x3f },
2000         .expected_ss = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2001                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2002                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2003                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03 },
2004         .secret_size = 32,
2005         .b_public_size = 32,
2006         .expected_ss_size = 32,
2007 
2008 },
2009 /* wycheproof - edge case for shared secret */
2010 {
2011         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2012                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2013                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2014                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2015         .b_public = (u8[32]){ 0x04, 0x5c, 0x6e, 0x11, 0xc5, 0xd3, 0x32, 0x55,
2016                     0x6c, 0x78, 0x22, 0xfe, 0x94, 0xeb, 0xf8, 0x9b,
2017                     0x56, 0xa3, 0x87, 0x8d, 0xc2, 0x7c, 0xa0, 0x79,
2018                     0x10, 0x30, 0x58, 0x84, 0x9f, 0xab, 0xcb, 0x4f },
2019         .expected_ss = (u8[32]){ 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2020                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2021                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2022                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2023         .secret_size = 32,
2024         .b_public_size = 32,
2025         .expected_ss_size = 32,
2026 
2027 },
2028 /* wycheproof - edge case for shared secret */
2029 {
2030         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2031                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2032                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2033                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2034         .b_public = (u8[32]){ 0x1c, 0xa2, 0x19, 0x0b, 0x71, 0x16, 0x35, 0x39,
2035                     0x06, 0x3c, 0x35, 0x77, 0x3b, 0xda, 0x0c, 0x9c,
2036                     0x92, 0x8e, 0x91, 0x36, 0xf0, 0x62, 0x0a, 0xeb,
2037                     0x09, 0x3f, 0x09, 0x91, 0x97, 0xb7, 0xf7, 0x4e },
2038         .expected_ss = (u8[32]){ 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2039                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2040                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2041                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2042         .secret_size = 32,
2043         .b_public_size = 32,
2044         .expected_ss_size = 32,
2045 
2046 },
2047 /* wycheproof - edge case for shared secret */
2048 {
2049         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2050                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2051                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2052                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2053         .b_public = (u8[32]){ 0xf7, 0x6e, 0x90, 0x10, 0xac, 0x33, 0xc5, 0x04,
2054                     0x3b, 0x2d, 0x3b, 0x76, 0xa8, 0x42, 0x17, 0x10,
2055                     0x00, 0xc4, 0x91, 0x62, 0x22, 0xe9, 0xe8, 0x58,
2056                     0x97, 0xa0, 0xae, 0xc7, 0xf6, 0x35, 0x0b, 0x3c },
2057         .expected_ss = (u8[32]){ 0xdd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2058                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2059                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2060                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2061         .secret_size = 32,
2062         .b_public_size = 32,
2063         .expected_ss_size = 32,
2064 
2065 },
2066 /* wycheproof - edge case for shared secret */
2067 {
2068         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2069                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2070                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2071                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2072         .b_public = (u8[32]){ 0xbb, 0x72, 0x68, 0x8d, 0x8f, 0x8a, 0xa7, 0xa3,
2073                     0x9c, 0xd6, 0x06, 0x0c, 0xd5, 0xc8, 0x09, 0x3c,
2074                     0xde, 0xc6, 0xfe, 0x34, 0x19, 0x37, 0xc3, 0x88,
2075                     0x6a, 0x99, 0x34, 0x6c, 0xd0, 0x7f, 0xaa, 0x55 },
2076         .expected_ss = (u8[32]){ 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2077                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2078                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2079                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2080         .secret_size = 32,
2081         .b_public_size = 32,
2082         .expected_ss_size = 32,
2083 
2084 },
2085 /* wycheproof - edge case for shared secret */
2086 {
2087         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2088                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2089                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2090                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2091         .b_public = (u8[32]){ 0x88, 0xfd, 0xde, 0xa1, 0x93, 0x39, 0x1c, 0x6a,
2092                     0x59, 0x33, 0xef, 0x9b, 0x71, 0x90, 0x15, 0x49,
2093                     0x44, 0x72, 0x05, 0xaa, 0xe9, 0xda, 0x92, 0x8a,
2094                     0x6b, 0x91, 0xa3, 0x52, 0xba, 0x10, 0xf4, 0x1f },
2095         .expected_ss = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2096                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2097                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2098                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 },
2099         .secret_size = 32,
2100         .b_public_size = 32,
2101         .expected_ss_size = 32,
2102 
2103 },
2104 /* wycheproof - edge case for shared secret */
2105 {
2106         .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2107                      0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2108                      0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2109                      0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2110         .b_public = (u8[32]){ 0x30, 0x3b, 0x39, 0x2f, 0x15, 0x31, 0x16, 0xca,
2111                     0xd9, 0xcc, 0x68, 0x2a, 0x00, 0xcc, 0xc4, 0x4c,
2112                     0x95, 0xff, 0x0d, 0x3b, 0xbe, 0x56, 0x8b, 0xeb,
2113                     0x6c, 0x4e, 0x73, 0x9b, 0xaf, 0xdc, 0x2c, 0x68 },
2114         .expected_ss = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2115                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2116                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2117                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00 },
2118         .secret_size = 32,
2119         .b_public_size = 32,
2120         .expected_ss_size = 32,
2121 
2122 },
2123 /* wycheproof - checking for overflow */
2124 {
2125         .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2126                      0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2127                      0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2128                      0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2129         .b_public = (u8[32]){ 0xfd, 0x30, 0x0a, 0xeb, 0x40, 0xe1, 0xfa, 0x58,
2130                     0x25, 0x18, 0x41, 0x2b, 0x49, 0xb2, 0x08, 0xa7,
2131                     0x84, 0x2b, 0x1e, 0x1f, 0x05, 0x6a, 0x04, 0x01,
2132                     0x78, 0xea, 0x41, 0x41, 0x53, 0x4f, 0x65, 0x2d },
2133         .expected_ss = (u8[32]){ 0xb7, 0x34, 0x10, 0x5d, 0xc2, 0x57, 0x58, 0x5d,
2134                     0x73, 0xb5, 0x66, 0xcc, 0xb7, 0x6f, 0x06, 0x27,
2135                     0x95, 0xcc, 0xbe, 0xc8, 0x91, 0x28, 0xe5, 0x2b,
2136                     0x02, 0xf3, 0xe5, 0x96, 0x39, 0xf1, 0x3c, 0x46 },
2137         .secret_size = 32,
2138         .b_public_size = 32,
2139         .expected_ss_size = 32,
2140 
2141 },
2142 /* wycheproof - checking for overflow */
2143 {
2144         .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2145                      0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2146                      0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2147                      0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2148         .b_public = (u8[32]){ 0xc8, 0xef, 0x79, 0xb5, 0x14, 0xd7, 0x68, 0x26,
2149                     0x77, 0xbc, 0x79, 0x31, 0xe0, 0x6e, 0xe5, 0xc2,
2150                     0x7c, 0x9b, 0x39, 0x2b, 0x4a, 0xe9, 0x48, 0x44,
2151                     0x73, 0xf5, 0x54, 0xe6, 0x67, 0x8e, 0xcc, 0x2e },
2152         .expected_ss = (u8[32]){ 0x64, 0x7a, 0x46, 0xb6, 0xfc, 0x3f, 0x40, 0xd6,
2153                     0x21, 0x41, 0xee, 0x3c, 0xee, 0x70, 0x6b, 0x4d,
2154                     0x7a, 0x92, 0x71, 0x59, 0x3a, 0x7b, 0x14, 0x3e,
2155                     0x8e, 0x2e, 0x22, 0x79, 0x88, 0x3e, 0x45, 0x50 },
2156         .secret_size = 32,
2157         .b_public_size = 32,
2158         .expected_ss_size = 32,
2159 
2160 },
2161 /* wycheproof - checking for overflow */
2162 {
2163         .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2164                      0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2165                      0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2166                      0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2167         .b_public = (u8[32]){ 0x64, 0xae, 0xac, 0x25, 0x04, 0x14, 0x48, 0x61,
2168                     0x53, 0x2b, 0x7b, 0xbc, 0xb6, 0xc8, 0x7d, 0x67,
2169                     0xdd, 0x4c, 0x1f, 0x07, 0xeb, 0xc2, 0xe0, 0x6e,
2170                     0xff, 0xb9, 0x5a, 0xec, 0xc6, 0x17, 0x0b, 0x2c },
2171         .expected_ss = (u8[32]){ 0x4f, 0xf0, 0x3d, 0x5f, 0xb4, 0x3c, 0xd8, 0x65,
2172                     0x7a, 0x3c, 0xf3, 0x7c, 0x13, 0x8c, 0xad, 0xce,
2173                     0xcc, 0xe5, 0x09, 0xe4, 0xeb, 0xa0, 0x89, 0xd0,
2174                     0xef, 0x40, 0xb4, 0xe4, 0xfb, 0x94, 0x61, 0x55 },
2175         .secret_size = 32,
2176         .b_public_size = 32,
2177         .expected_ss_size = 32,
2178 
2179 },
2180 /* wycheproof - checking for overflow */
2181 {
2182         .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2183                      0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2184                      0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2185                      0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2186         .b_public = (u8[32]){ 0xbf, 0x68, 0xe3, 0x5e, 0x9b, 0xdb, 0x7e, 0xee,
2187                     0x1b, 0x50, 0x57, 0x02, 0x21, 0x86, 0x0f, 0x5d,
2188                     0xcd, 0xad, 0x8a, 0xcb, 0xab, 0x03, 0x1b, 0x14,
2189                     0x97, 0x4c, 0xc4, 0x90, 0x13, 0xc4, 0x98, 0x31 },
2190         .expected_ss = (u8[32]){ 0x21, 0xce, 0xe5, 0x2e, 0xfd, 0xbc, 0x81, 0x2e,
2191                     0x1d, 0x02, 0x1a, 0x4a, 0xf1, 0xe1, 0xd8, 0xbc,
2192                     0x4d, 0xb3, 0xc4, 0x00, 0xe4, 0xd2, 0xa2, 0xc5,
2193                     0x6a, 0x39, 0x26, 0xdb, 0x4d, 0x99, 0xc6, 0x5b },
2194         .secret_size = 32,
2195         .b_public_size = 32,
2196         .expected_ss_size = 32,
2197 
2198 },
2199 /* wycheproof - checking for overflow */
2200 {
2201         .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2202                      0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2203                      0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2204                      0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2205         .b_public = (u8[32]){ 0x53, 0x47, 0xc4, 0x91, 0x33, 0x1a, 0x64, 0xb4,
2206                     0x3d, 0xdc, 0x68, 0x30, 0x34, 0xe6, 0x77, 0xf5,
2207                     0x3d, 0xc3, 0x2b, 0x52, 0xa5, 0x2a, 0x57, 0x7c,
2208                     0x15, 0xa8, 0x3b, 0xf2, 0x98, 0xe9, 0x9f, 0x19 },
2209         .expected_ss = (u8[32]){ 0x18, 0xcb, 0x89, 0xe4, 0xe2, 0x0c, 0x0c, 0x2b,
2210                     0xd3, 0x24, 0x30, 0x52, 0x45, 0x26, 0x6c, 0x93,
2211                     0x27, 0x69, 0x0b, 0xbe, 0x79, 0xac, 0xb8, 0x8f,
2212                     0x5b, 0x8f, 0xb3, 0xf7, 0x4e, 0xca, 0x3e, 0x52 },
2213         .secret_size = 32,
2214         .b_public_size = 32,
2215         .expected_ss_size = 32,
2216 
2217 },
2218 /* wycheproof - private key == -1 (mod order) */
2219 {
2220         .secret = (u8[32]){ 0xa0, 0x23, 0xcd, 0xd0, 0x83, 0xef, 0x5b, 0xb8,
2221                      0x2f, 0x10, 0xd6, 0x2e, 0x59, 0xe1, 0x5a, 0x68,
2222                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2223                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50 },
2224         .b_public = (u8[32]){ 0x25, 0x8e, 0x04, 0x52, 0x3b, 0x8d, 0x25, 0x3e,
2225                     0xe6, 0x57, 0x19, 0xfc, 0x69, 0x06, 0xc6, 0x57,
2226                     0x19, 0x2d, 0x80, 0x71, 0x7e, 0xdc, 0x82, 0x8f,
2227                     0xa0, 0xaf, 0x21, 0x68, 0x6e, 0x2f, 0xaa, 0x75 },
2228         .expected_ss = (u8[32]){ 0x25, 0x8e, 0x04, 0x52, 0x3b, 0x8d, 0x25, 0x3e,
2229                     0xe6, 0x57, 0x19, 0xfc, 0x69, 0x06, 0xc6, 0x57,
2230                     0x19, 0x2d, 0x80, 0x71, 0x7e, 0xdc, 0x82, 0x8f,
2231                     0xa0, 0xaf, 0x21, 0x68, 0x6e, 0x2f, 0xaa, 0x75 },
2232         .secret_size = 32,
2233         .b_public_size = 32,
2234         .expected_ss_size = 32,
2235 
2236 },
2237 /* wycheproof - private key == 1 (mod order) on twist */
2238 {
2239         .secret = (u8[32]){ 0x58, 0x08, 0x3d, 0xd2, 0x61, 0xad, 0x91, 0xef,
2240                      0xf9, 0x52, 0x32, 0x2e, 0xc8, 0x24, 0xc6, 0x82,
2241                      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2242                      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f },
2243         .b_public = (u8[32]){ 0x2e, 0xae, 0x5e, 0xc3, 0xdd, 0x49, 0x4e, 0x9f,
2244                     0x2d, 0x37, 0xd2, 0x58, 0xf8, 0x73, 0xa8, 0xe6,
2245                     0xe9, 0xd0, 0xdb, 0xd1, 0xe3, 0x83, 0xef, 0x64,
2246                     0xd9, 0x8b, 0xb9, 0x1b, 0x3e, 0x0b, 0xe0, 0x35 },
2247         .expected_ss = (u8[32]){ 0x2e, 0xae, 0x5e, 0xc3, 0xdd, 0x49, 0x4e, 0x9f,
2248                     0x2d, 0x37, 0xd2, 0x58, 0xf8, 0x73, 0xa8, 0xe6,
2249                     0xe9, 0xd0, 0xdb, 0xd1, 0xe3, 0x83, 0xef, 0x64,
2250                     0xd9, 0x8b, 0xb9, 0x1b, 0x3e, 0x0b, 0xe0, 0x35 },
2251         .secret_size = 32,
2252         .b_public_size = 32,
2253         .expected_ss_size = 32,
2254 
2255 }
2256 };
2257 
2258 static const struct kpp_testvec ecdh_tv_template[] = {
2259         {
2260 #ifndef CONFIG_CRYPTO_FIPS
2261         .secret =
2262 #ifdef __LITTLE_ENDIAN
2263         "\x02\x00" /* type */
2264         "\x20\x00" /* len */
2265         "\x01\x00" /* curve_id */
2266         "\x18\x00" /* key_size */
2267 #else
2268         "\x00\x02" /* type */
2269         "\x00\x20" /* len */
2270         "\x00\x01" /* curve_id */
2271         "\x00\x18" /* key_size */
2272 #endif
2273         "\xb5\x05\xb1\x71\x1e\xbf\x8c\xda"
2274         "\x4e\x19\x1e\x62\x1f\x23\x23\x31"
2275         "\x36\x1e\xd3\x84\x2f\xcc\x21\x72",
2276         .b_public =
2277         "\xc3\xba\x67\x4b\x71\xec\xd0\x76"
2278         "\x7a\x99\x75\x64\x36\x13\x9a\x94"
2279         "\x5d\x8b\xdc\x60\x90\x91\xfd\x3f"
2280         "\xb0\x1f\x8a\x0a\x68\xc6\x88\x6e"
2281         "\x83\x87\xdd\x67\x09\xf8\x8d\x96"
2282         "\x07\xd6\xbd\x1c\xe6\x8d\x9d\x67",
2283         .expected_a_public =
2284         "\x1a\x04\xdb\xa5\xe1\xdd\x4e\x79"
2285         "\xa3\xe6\xef\x0e\x5c\x80\x49\x85"
2286         "\xfa\x78\xb4\xef\x49\xbd\x4c\x7c"
2287         "\x22\x90\x21\x02\xf9\x1b\x81\x5d"
2288         "\x0c\x8a\xa8\x98\xd6\x27\x69\x88"
2289         "\x5e\xbc\x94\xd8\x15\x9e\x21\xce",
2290         .expected_ss =
2291         "\xf4\x57\xcc\x4f\x1f\x4e\x31\xcc"
2292         "\xe3\x40\x60\xc8\x06\x93\xc6\x2e"
2293         "\x99\x80\x81\x28\xaf\xc5\x51\x74",
2294         .secret_size = 32,
2295         .b_public_size = 48,
2296         .expected_a_public_size = 48,
2297         .expected_ss_size = 24
2298         }, {
2299 #endif
2300         .secret =
2301 #ifdef __LITTLE_ENDIAN
2302         "\x02\x00" /* type */
2303         "\x28\x00" /* len */
2304         "\x02\x00" /* curve_id */
2305         "\x20\x00" /* key_size */
2306 #else
2307         "\x00\x02" /* type */
2308         "\x00\x28" /* len */
2309         "\x00\x02" /* curve_id */
2310         "\x00\x20" /* key_size */
2311 #endif
2312         "\x24\xd1\x21\xeb\xe5\xcf\x2d\x83"
2313         "\xf6\x62\x1b\x6e\x43\x84\x3a\xa3"
2314         "\x8b\xe0\x86\xc3\x20\x19\xda\x92"
2315         "\x50\x53\x03\xe1\xc0\xea\xb8\x82",
2316         .expected_a_public =
2317         "\x1a\x7f\xeb\x52\x00\xbd\x3c\x31"
2318         "\x7d\xb6\x70\xc1\x86\xa6\xc7\xc4"
2319         "\x3b\xc5\x5f\x6c\x6f\x58\x3c\xf5"
2320         "\xb6\x63\x82\x77\x33\x24\xa1\x5f"
2321         "\x6a\xca\x43\x6f\xf7\x7e\xff\x02"
2322         "\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
2323         "\x6a\x02\x6e\x41\x87\x68\x38\x77"
2324         "\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
2325         .expected_ss =
2326         "\xea\x17\x6f\x7e\x6e\x57\x26\x38"
2327         "\x8b\xfb\x41\xeb\xba\xc8\x6d\xa5"
2328         "\xa8\x72\xd1\xff\xc9\x47\x3d\xaa"
2329         "\x58\x43\x9f\x34\x0f\x8c\xf3\xc9",
2330         .b_public =
2331         "\xcc\xb4\xda\x74\xb1\x47\x3f\xea"
2332         "\x6c\x70\x9e\x38\x2d\xc7\xaa\xb7"
2333         "\x29\xb2\x47\x03\x19\xab\xdd\x34"
2334         "\xbd\xa8\x2c\x93\xe1\xa4\x74\xd9"
2335         "\x64\x63\xf7\x70\x20\x2f\xa4\xe6"
2336         "\x9f\x4a\x38\xcc\xc0\x2c\x49\x2f"
2337         "\xb1\x32\xbb\xaf\x22\x61\xda\xcb"
2338         "\x6f\xdb\xa9\xaa\xfc\x77\x81\xf3",
2339         .secret_size = 40,
2340         .b_public_size = 64,
2341         .expected_a_public_size = 64,
2342         .expected_ss_size = 32
2343         }, {
2344         .secret =
2345 #ifdef __LITTLE_ENDIAN
2346         "\x02\x00" /* type */
2347         "\x08\x00" /* len */
2348         "\x02\x00" /* curve_id */
2349         "\x00\x00", /* key_size */
2350 #else
2351         "\x00\x02" /* type */
2352         "\x00\x08" /* len */
2353         "\x00\x02" /* curve_id */
2354         "\x00\x00", /* key_size */
2355 #endif
2356         .b_secret =
2357 #ifdef __LITTLE_ENDIAN
2358         "\x02\x00" /* type */
2359         "\x28\x00" /* len */
2360         "\x02\x00" /* curve_id */
2361         "\x20\x00" /* key_size */
2362 #else
2363         "\x00\x02" /* type */
2364         "\x00\x28" /* len */
2365         "\x00\x02" /* curve_id */
2366         "\x00\x20" /* key_size */
2367 #endif
2368         "\x24\xd1\x21\xeb\xe5\xcf\x2d\x83"
2369         "\xf6\x62\x1b\x6e\x43\x84\x3a\xa3"
2370         "\x8b\xe0\x86\xc3\x20\x19\xda\x92"
2371         "\x50\x53\x03\xe1\xc0\xea\xb8\x82",
2372         .b_public =
2373         "\x1a\x7f\xeb\x52\x00\xbd\x3c\x31"
2374         "\x7d\xb6\x70\xc1\x86\xa6\xc7\xc4"
2375         "\x3b\xc5\x5f\x6c\x6f\x58\x3c\xf5"
2376         "\xb6\x63\x82\x77\x33\x24\xa1\x5f"
2377         "\x6a\xca\x43\x6f\xf7\x7e\xff\x02"
2378         "\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
2379         "\x6a\x02\x6e\x41\x87\x68\x38\x77"
2380         "\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
2381         .secret_size = 8,
2382         .b_secret_size = 40,
2383         .b_public_size = 64,
2384         .expected_a_public_size = 64,
2385         .expected_ss_size = 32,
2386         .genkey = true,
2387         }
2388 };
2389 
2390 /*
2391  * MD4 test vectors from RFC1320
2392  */
2393 static const struct hash_testvec md4_tv_template[] = {
2394         {
2395                 .plaintext = "",
2396                 .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
2397                           "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
2398         }, {
2399                 .plaintext = "a",
2400                 .psize  = 1,
2401                 .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
2402                           "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
2403         }, {
2404                 .plaintext = "abc",
2405                 .psize  = 3,
2406                 .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
2407                           "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
2408         }, {
2409                 .plaintext = "message digest",
2410                 .psize  = 14,
2411                 .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
2412                         "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
2413         }, {
2414                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
2415                 .psize  = 26,
2416                 .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
2417                           "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
2418         }, {
2419                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
2420                 .psize  = 62,
2421                 .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
2422                           "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
2423         }, {
2424                 .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
2425                            "45678901234567890",
2426                 .psize  = 80,
2427                 .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
2428                           "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
2429         },
2430 };
2431 
2432 static const struct hash_testvec sha3_224_tv_template[] = {
2433         {
2434                 .plaintext = "",
2435                 .digest = "\x6b\x4e\x03\x42\x36\x67\xdb\xb7"
2436                                 "\x3b\x6e\x15\x45\x4f\x0e\xb1\xab"
2437                                 "\xd4\x59\x7f\x9a\x1b\x07\x8e\x3f"
2438                                 "\x5b\x5a\x6b\xc7",
2439         }, {
2440                 .plaintext = "a",
2441                 .psize  = 1,
2442                 .digest = "\x9e\x86\xff\x69\x55\x7c\xa9\x5f"
2443                                 "\x40\x5f\x08\x12\x69\x68\x5b\x38"
2444                                 "\xe3\xa8\x19\xb3\x09\xee\x94\x2f"
2445                                 "\x48\x2b\x6a\x8b",
2446         }, {
2447                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
2448                                 "jklmklmnlmnomnopnopq",
2449                 .psize  = 56,
2450                 .digest = "\x8a\x24\x10\x8b\x15\x4a\xda\x21"
2451                                 "\xc9\xfd\x55\x74\x49\x44\x79\xba"
2452                                 "\x5c\x7e\x7a\xb7\x6e\xf2\x64\xea"
2453                                 "\xd0\xfc\xce\x33",
2454         }, {
2455                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2456                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2457                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2458                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2459                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2460                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2461                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2462                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2463                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2464                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2465                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2466                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2467                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2468                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2469                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2470                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2471                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2472                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2473                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2474                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2475                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2476                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2477                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2478                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2479                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2480                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2481                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2482                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2483                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2484                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2485                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2486                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2487                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2488                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2489                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2490                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2491                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2492                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2493                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2494                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2495                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2496                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2497                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2498                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2499                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2500                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2501                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2502                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2503                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2504                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2505                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2506                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2507                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2508                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2509                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2510                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2511                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2512                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2513                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2514                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
2515                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
2516                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
2517                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
2518                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
2519                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
2520                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
2521                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
2522                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
2523                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
2524                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
2525                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
2526                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
2527                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
2528                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
2529                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
2530                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
2531                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
2532                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
2533                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
2534                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
2535                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
2536                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
2537                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
2538                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
2539                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
2540                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
2541                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
2542                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
2543                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
2544                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
2545                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
2546                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
2547                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
2548                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
2549                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
2550                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
2551                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
2552                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
2553                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
2554                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
2555                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
2556                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
2557                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
2558                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
2559                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
2560                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
2561                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
2562                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
2563                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
2564                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
2565                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
2566                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
2567                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
2568                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
2569                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
2570                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
2571                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
2572                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
2573                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
2574                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
2575                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
2576                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
2577                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
2578                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
2579                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
2580                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
2581                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
2582                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
2583                 .psize     = 1023,
2584                 .digest    = "\x7d\x0f\x2f\xb7\x65\x3b\xa7\x26"
2585                              "\xc3\x88\x20\x71\x15\x06\xe8\x2d"
2586                              "\xa3\x92\x44\xab\x3e\xe7\xff\x86"
2587                              "\xb6\x79\x10\x72",
2588         },
2589 };
2590 
2591 static const struct hash_testvec sha3_256_tv_template[] = {
2592         {
2593                 .plaintext = "",
2594                 .digest = "\xa7\xff\xc6\xf8\xbf\x1e\xd7\x66"
2595                                 "\x51\xc1\x47\x56\xa0\x61\xd6\x62"
2596                                 "\xf5\x80\xff\x4d\xe4\x3b\x49\xfa"
2597                                 "\x82\xd8\x0a\x4b\x80\xf8\x43\x4a",
2598         }, {
2599                 .plaintext = "a",
2600                 .psize  = 1,
2601                 .digest = "\x80\x08\x4b\xf2\xfb\xa0\x24\x75"
2602                                 "\x72\x6f\xeb\x2c\xab\x2d\x82\x15"
2603                                 "\xea\xb1\x4b\xc6\xbd\xd8\xbf\xb2"
2604                                 "\xc8\x15\x12\x57\x03\x2e\xcd\x8b",
2605         }, {
2606                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
2607                              "jklmklmnlmnomnopnopq",
2608                 .psize  = 56,
2609                 .digest = "\x41\xc0\xdb\xa2\xa9\xd6\x24\x08"
2610                                 "\x49\x10\x03\x76\xa8\x23\x5e\x2c"
2611                                 "\x82\xe1\xb9\x99\x8a\x99\x9e\x21"
2612                                 "\xdb\x32\xdd\x97\x49\x6d\x33\x76",
2613         }, {
2614                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2615                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2616                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2617                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2618                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2619                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2620                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2621                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2622                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2623                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2624                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2625                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2626                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2627                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2628                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2629                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2630                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2631                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2632                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2633                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2634                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2635                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2636                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2637                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2638                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2639                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2640                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2641                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2642                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2643                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2644                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2645                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2646                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2647                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2648                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2649                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2650                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2651                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2652                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2653                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2654                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2655                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2656                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2657                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2658                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2659                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2660                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2661                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2662                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2663                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2664                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2665                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2666                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2667                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2668                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2669                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2670                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2671                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2672                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2673                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
2674                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
2675                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
2676                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
2677                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
2678                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
2679                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
2680                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
2681                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
2682                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
2683                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
2684                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
2685                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
2686                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
2687                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
2688                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
2689                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
2690                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
2691                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
2692                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
2693                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
2694                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
2695                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
2696                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
2697                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
2698                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
2699                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
2700                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
2701                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
2702                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
2703                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
2704                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
2705                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
2706                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
2707                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
2708                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
2709                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
2710                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
2711                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
2712                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
2713                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
2714                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
2715                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
2716                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
2717                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
2718                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
2719                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
2720                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
2721                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
2722                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
2723                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
2724                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
2725                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
2726                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
2727                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
2728                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
2729                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
2730                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
2731                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
2732                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
2733                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
2734                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
2735                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
2736                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
2737                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
2738                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
2739                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
2740                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
2741                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
2742                 .psize     = 1023,
2743                 .digest    = "\xde\x41\x04\xbd\xda\xda\xd9\x71"
2744                              "\xf7\xfa\x80\xf5\xea\x11\x03\xb1"
2745                              "\x3b\x6a\xbc\x5f\xb9\x66\x26\xf7"
2746                              "\x8a\x97\xbb\xf2\x07\x08\x38\x30",
2747         },
2748 };
2749 
2750 
2751 static const struct hash_testvec sha3_384_tv_template[] = {
2752         {
2753                 .plaintext = "",
2754                 .digest = "\x0c\x63\xa7\x5b\x84\x5e\x4f\x7d"
2755                                 "\x01\x10\x7d\x85\x2e\x4c\x24\x85"
2756                                 "\xc5\x1a\x50\xaa\xaa\x94\xfc\x61"
2757                                 "\x99\x5e\x71\xbb\xee\x98\x3a\x2a"
2758                                 "\xc3\x71\x38\x31\x26\x4a\xdb\x47"
2759                                 "\xfb\x6b\xd1\xe0\x58\xd5\xf0\x04",
2760         }, {
2761                 .plaintext = "a",
2762                 .psize  = 1,
2763                 .digest = "\x18\x15\xf7\x74\xf3\x20\x49\x1b"
2764                                 "\x48\x56\x9e\xfe\xc7\x94\xd2\x49"
2765                                 "\xee\xb5\x9a\xae\x46\xd2\x2b\xf7"
2766                                 "\x7d\xaf\xe2\x5c\x5e\xdc\x28\xd7"
2767                                 "\xea\x44\xf9\x3e\xe1\x23\x4a\xa8"
2768                                 "\x8f\x61\xc9\x19\x12\xa4\xcc\xd9",
2769         }, {
2770                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
2771                              "jklmklmnlmnomnopnopq",
2772                 .psize  = 56,
2773                 .digest = "\x99\x1c\x66\x57\x55\xeb\x3a\x4b"
2774                                 "\x6b\xbd\xfb\x75\xc7\x8a\x49\x2e"
2775                                 "\x8c\x56\xa2\x2c\x5c\x4d\x7e\x42"
2776                                 "\x9b\xfd\xbc\x32\xb9\xd4\xad\x5a"
2777                                 "\xa0\x4a\x1f\x07\x6e\x62\xfe\xa1"
2778                                 "\x9e\xef\x51\xac\xd0\x65\x7c\x22",
2779         }, {
2780                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2781                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2782                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2783                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2784                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2785                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2786                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2787                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2788                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2789                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2790                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2791                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2792                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2793                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2794                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2795                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2796                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2797                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2798                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2799                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2800                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2801                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2802                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2803                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2804                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2805                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2806                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2807                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2808                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2809                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2810                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2811                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2812                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2813                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2814                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2815                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2816                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2817                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2818                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2819                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2820                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2821                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2822                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2823                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2824                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2825                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2826                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2827                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2828                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2829                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2830                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2831                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2832                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2833                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2834                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2835                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2836                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2837                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2838                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2839                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
2840                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
2841                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
2842                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
2843                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
2844                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
2845                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
2846                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
2847                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
2848                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
2849                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
2850                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
2851                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
2852                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
2853                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
2854                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
2855                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
2856                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
2857                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
2858                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
2859                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
2860                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
2861                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
2862                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
2863                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
2864                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
2865                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
2866                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
2867                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
2868                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
2869                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
2870                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
2871                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
2872                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
2873                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
2874                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
2875                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
2876                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
2877                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
2878                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
2879                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
2880                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
2881                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
2882                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
2883                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
2884                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
2885                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
2886                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
2887                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
2888                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
2889                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
2890                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
2891                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
2892                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
2893                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
2894                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
2895                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
2896                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
2897                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
2898                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
2899                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
2900                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
2901                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
2902                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
2903                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
2904                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
2905                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
2906                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
2907                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
2908                 .psize     = 1023,
2909                 .digest    = "\x1b\x19\x4d\x8f\xd5\x36\x87\x71"
2910                              "\xcf\xca\x30\x85\x9b\xc1\x25\xc7"
2911                              "\x00\xcb\x73\x8a\x8e\xd4\xfe\x2b"
2912                              "\x1a\xa2\xdc\x2e\x41\xfd\x52\x51"
2913                              "\xd2\x21\xae\x2d\xc7\xae\x8c\x40"
2914                              "\xb9\xe6\x56\x48\x03\xcd\x88\x6b",
2915         },
2916 };
2917 
2918 
2919 static const struct hash_testvec sha3_512_tv_template[] = {
2920         {
2921                 .plaintext = "",
2922                 .digest = "\xa6\x9f\x73\xcc\xa2\x3a\x9a\xc5"
2923                                 "\xc8\xb5\x67\xdc\x18\x5a\x75\x6e"
2924                                 "\x97\xc9\x82\x16\x4f\xe2\x58\x59"
2925                                 "\xe0\xd1\xdc\xc1\x47\x5c\x80\xa6"
2926                                 "\x15\xb2\x12\x3a\xf1\xf5\xf9\x4c"
2927                                 "\x11\xe3\xe9\x40\x2c\x3a\xc5\x58"
2928                                 "\xf5\x00\x19\x9d\x95\xb6\xd3\xe3"
2929                                 "\x01\x75\x85\x86\x28\x1d\xcd\x26",
2930         }, {
2931                 .plaintext = "a",
2932                 .psize  = 1,
2933                 .digest = "\x69\x7f\x2d\x85\x61\x72\xcb\x83"
2934                                 "\x09\xd6\xb8\xb9\x7d\xac\x4d\xe3"
2935                                 "\x44\xb5\x49\xd4\xde\xe6\x1e\xdf"
2936                                 "\xb4\x96\x2d\x86\x98\xb7\xfa\x80"
2937                                 "\x3f\x4f\x93\xff\x24\x39\x35\x86"
2938                                 "\xe2\x8b\x5b\x95\x7a\xc3\xd1\xd3"
2939                                 "\x69\x42\x0c\xe5\x33\x32\x71\x2f"
2940                                 "\x99\x7b\xd3\x36\xd0\x9a\xb0\x2a",
2941         }, {
2942                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
2943                              "jklmklmnlmnomnopnopq",
2944                 .psize  = 56,
2945                 .digest = "\x04\xa3\x71\xe8\x4e\xcf\xb5\xb8"
2946                                 "\xb7\x7c\xb4\x86\x10\xfc\xa8\x18"
2947                                 "\x2d\xd4\x57\xce\x6f\x32\x6a\x0f"
2948                                 "\xd3\xd7\xec\x2f\x1e\x91\x63\x6d"
2949                                 "\xee\x69\x1f\xbe\x0c\x98\x53\x02"
2950                                 "\xba\x1b\x0d\x8d\xc7\x8c\x08\x63"
2951                                 "\x46\xb5\x33\xb4\x9c\x03\x0d\x99"
2952                                 "\xa2\x7d\xaf\x11\x39\xd6\xe7\x5e",
2953         }, {
2954                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2955                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2956                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2957                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2958                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2959                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2960                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2961                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2962                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2963                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2964                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2965                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2966                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2967                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2968                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2969                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2970                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2971                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2972                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2973                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2974                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2975                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2976                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2977                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2978                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2979                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2980                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2981                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2982                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2983                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2984                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2985                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2986                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2987                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2988                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2989                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2990                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2991                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2992                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2993                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2994                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2995                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2996                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2997                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2998                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2999                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
3000                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
3001                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
3002                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
3003                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
3004                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
3005                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
3006                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
3007                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
3008                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
3009                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
3010                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
3011                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
3012                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
3013                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
3014                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
3015                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
3016                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
3017                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
3018                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
3019                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
3020                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
3021                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
3022                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
3023                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
3024                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
3025                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
3026                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
3027                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
3028                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
3029                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
3030                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
3031                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
3032                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
3033                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
3034                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
3035                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
3036                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
3037                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
3038                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
3039                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
3040                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
3041                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
3042                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
3043                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
3044                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
3045                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
3046                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
3047                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
3048                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
3049                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
3050                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
3051                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
3052                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
3053                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
3054                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
3055                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
3056                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
3057                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
3058                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
3059                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
3060                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
3061                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
3062                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
3063                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
3064                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
3065                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
3066                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
3067                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
3068                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
3069                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
3070                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
3071                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
3072                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
3073                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
3074                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
3075                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
3076                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
3077                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
3078                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
3079                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
3080                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
3081                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
3082                 .psize     = 1023,
3083                 .digest    = "\x59\xda\x30\xe3\x90\xe4\x3d\xde"
3084                              "\xf0\xc6\x42\x17\xd7\xb2\x26\x47"
3085                              "\x90\x28\xa6\x84\xe8\x49\x7a\x86"
3086                              "\xd6\xb8\x9e\xf8\x07\x59\x21\x03"
3087                              "\xad\xd2\xed\x48\xa3\xb9\xa5\xf0"
3088                              "\xb3\xae\x02\x2b\xb8\xaf\xc3\x3b"
3089                              "\xd6\xb0\x8f\xcb\x76\x8b\xa7\x41"
3090                              "\x32\xc2\x8e\x50\x91\x86\x90\xfb",
3091         },
3092 };
3093 
3094 
3095 /*
3096  * MD5 test vectors from RFC1321
3097  */
3098 static const struct hash_testvec md5_tv_template[] = {
3099         {
3100                 .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
3101                           "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
3102         }, {
3103                 .plaintext = "a",
3104                 .psize  = 1,
3105                 .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
3106                           "\x31\xc3\x99\xe2\x69\x77\x26\x61",
3107         }, {
3108                 .plaintext = "abc",
3109                 .psize  = 3,
3110                 .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
3111                           "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
3112         }, {
3113                 .plaintext = "message digest",
3114                 .psize  = 14,
3115                 .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
3116                           "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
3117         }, {
3118                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3119                 .psize  = 26,
3120                 .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
3121                           "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
3122         }, {
3123                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
3124                 .psize  = 62,
3125                 .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
3126                           "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
3127         }, {
3128                 .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
3129                            "345678901234567890",
3130                 .psize  = 80,
3131                 .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
3132                           "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
3133         }
3134 
3135 };
3136 
3137 /*
3138  * RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
3139  */
3140 static const struct hash_testvec rmd128_tv_template[] = {
3141         {
3142                 .digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
3143                           "\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
3144         }, {
3145                 .plaintext = "a",
3146                 .psize  = 1,
3147                 .digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
3148                           "\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
3149         }, {
3150                 .plaintext = "abc",
3151                 .psize  = 3,
3152                 .digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
3153                           "\x84\x63\x6b\x0f\x69\x14\x4c\x77",
3154         }, {
3155                 .plaintext = "message digest",
3156                 .psize  = 14,
3157                 .digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
3158                           "\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
3159         }, {
3160                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3161                 .psize  = 26,
3162                 .digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
3163                           "\x10\x71\x49\x22\xb3\x71\x83\x4e",
3164         }, {
3165                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
3166                              "fghijklmnopqrstuvwxyz0123456789",
3167                 .psize  = 62,
3168                 .digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
3169                           "\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
3170         }, {
3171                 .plaintext = "1234567890123456789012345678901234567890"
3172                              "1234567890123456789012345678901234567890",
3173                 .psize  = 80,
3174                 .digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
3175                           "\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
3176         }, {
3177                 .plaintext = "abcdbcdecdefdefgefghfghighij"
3178                              "hijkijkljklmklmnlmnomnopnopq",
3179                 .psize  = 56,
3180                 .digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
3181                           "\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
3182         }, {
3183                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
3184                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
3185                              "lmnopqrsmnopqrstnopqrstu",
3186                 .psize  = 112,
3187                 .digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
3188                           "\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
3189         }, {
3190                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
3191                 .psize  = 32,
3192                 .digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
3193                           "\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
3194         }
3195 };
3196 
3197 /*
3198  * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
3199  */
3200 static const struct hash_testvec rmd160_tv_template[] = {
3201         {
3202                 .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
3203                           "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
3204         }, {
3205                 .plaintext = "a",
3206                 .psize  = 1,
3207                 .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
3208                           "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
3209         }, {
3210                 .plaintext = "abc",
3211                 .psize  = 3,
3212                 .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
3213                           "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
3214         }, {
3215                 .plaintext = "message digest",
3216                 .psize  = 14,
3217                 .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
3218                           "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
3219         }, {
3220                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3221                 .psize  = 26,
3222                 .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
3223                           "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
3224         }, {
3225                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
3226                              "fghijklmnopqrstuvwxyz0123456789",
3227                 .psize  = 62,
3228                 .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
3229                           "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
3230         }, {
3231                 .plaintext = "1234567890123456789012345678901234567890"
3232                              "1234567890123456789012345678901234567890",
3233                 .psize  = 80,
3234                 .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
3235                           "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
3236         }, {
3237                 .plaintext = "abcdbcdecdefdefgefghfghighij"
3238                              "hijkijkljklmklmnlmnomnopnopq",
3239                 .psize  = 56,
3240                 .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
3241                           "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
3242         }, {
3243                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
3244                              "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
3245                              "lmnopqrsmnopqrstnopqrstu",
3246                 .psize  = 112,
3247                 .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
3248                           "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
3249         }, {
3250                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
3251                 .psize  = 32,
3252                 .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
3253                           "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
3254         }
3255 };
3256 
3257 /*
3258  * RIPEMD-256 test vectors
3259  */
3260 static const struct hash_testvec rmd256_tv_template[] = {
3261         {
3262                 .digest = "\x02\xba\x4c\x4e\x5f\x8e\xcd\x18"
3263                           "\x77\xfc\x52\xd6\x4d\x30\xe3\x7a"
3264                           "\x2d\x97\x74\xfb\x1e\x5d\x02\x63"
3265                           "\x80\xae\x01\x68\xe3\xc5\x52\x2d",
3266         }, {
3267                 .plaintext = "a",
3268                 .psize  = 1,
3269                 .digest = "\xf9\x33\x3e\x45\xd8\x57\xf5\xd9"
3270                           "\x0a\x91\xba\xb7\x0a\x1e\xba\x0c"
3271                           "\xfb\x1b\xe4\xb0\x78\x3c\x9a\xcf"
3272                           "\xcd\x88\x3a\x91\x34\x69\x29\x25",
3273         }, {
3274                 .plaintext = "abc",
3275                 .psize  = 3,
3276                 .digest = "\xaf\xbd\x6e\x22\x8b\x9d\x8c\xbb"
3277                           "\xce\xf5\xca\x2d\x03\xe6\xdb\xa1"
3278                           "\x0a\xc0\xbc\x7d\xcb\xe4\x68\x0e"
3279                           "\x1e\x42\xd2\xe9\x75\x45\x9b\x65",
3280         }, {
3281                 .plaintext = "message digest",
3282                 .psize  = 14,
3283                 .digest = "\x87\xe9\x71\x75\x9a\x1c\xe4\x7a"
3284                           "\x51\x4d\x5c\x91\x4c\x39\x2c\x90"
3285                           "\x18\xc7\xc4\x6b\xc1\x44\x65\x55"
3286                           "\x4a\xfc\xdf\x54\xa5\x07\x0c\x0e",
3287         }, {
3288                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3289                 .psize  = 26,
3290                 .digest = "\x64\x9d\x30\x34\x75\x1e\xa2\x16"
3291                           "\x77\x6b\xf9\xa1\x8a\xcc\x81\xbc"
3292                           "\x78\x96\x11\x8a\x51\x97\x96\x87"
3293                           "\x82\xdd\x1f\xd9\x7d\x8d\x51\x33",
3294         }, {
3295                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
3296                              "fghijklmnopqrstuvwxyz0123456789",
3297                 .psize  = 62,
3298                 .digest = "\x57\x40\xa4\x08\xac\x16\xb7\x20"
3299                           "\xb8\x44\x24\xae\x93\x1c\xbb\x1f"
3300                           "\xe3\x63\xd1\xd0\xbf\x40\x17\xf1"
3301                           "\xa8\x9f\x7e\xa6\xde\x77\xa0\xb8",
3302         }, {
3303                 .plaintext = "1234567890123456789012345678901234567890"
3304                              "1234567890123456789012345678901234567890",
3305                 .psize  = 80,
3306                 .digest = "\x06\xfd\xcc\x7a\x40\x95\x48\xaa"
3307                           "\xf9\x13\x68\xc0\x6a\x62\x75\xb5"
3308                           "\x53\xe3\xf0\x99\xbf\x0e\xa4\xed"
3309                           "\xfd\x67\x78\xdf\x89\xa8\x90\xdd",
3310         }, {
3311                 .plaintext = "abcdbcdecdefdefgefghfghighij"
3312                              "hijkijkljklmklmnlmnomnopnopq",
3313                 .psize  = 56,
3314                 .digest = "\x38\x43\x04\x55\x83\xaa\xc6\xc8"
3315                           "\xc8\xd9\x12\x85\x73\xe7\xa9\x80"
3316                           "\x9a\xfb\x2a\x0f\x34\xcc\xc3\x6e"
3317                           "\xa9\xe7\x2f\x16\xf6\x36\x8e\x3f",
3318         }
3319 };
3320 
3321 /*
3322  * RIPEMD-320 test vectors
3323  */
3324 static const struct hash_testvec rmd320_tv_template[] = {
3325         {
3326                 .digest = "\x22\xd6\x5d\x56\x61\x53\x6c\xdc\x75\xc1"
3327                           "\xfd\xf5\xc6\xde\x7b\x41\xb9\xf2\x73\x25"
3328                           "\xeb\xc6\x1e\x85\x57\x17\x7d\x70\x5a\x0e"
3329                           "\xc8\x80\x15\x1c\x3a\x32\xa0\x08\x99\xb8",
3330         }, {
3331                 .plaintext = "a",
3332                 .psize  = 1,
3333                 .digest = "\xce\x78\x85\x06\x38\xf9\x26\x58\xa5\xa5"
3334                           "\x85\x09\x75\x79\x92\x6d\xda\x66\x7a\x57"
3335                           "\x16\x56\x2c\xfc\xf6\xfb\xe7\x7f\x63\x54"
3336                           "\x2f\x99\xb0\x47\x05\xd6\x97\x0d\xff\x5d",
3337         }, {
3338                 .plaintext = "abc",
3339                 .psize  = 3,
3340                 .digest = "\xde\x4c\x01\xb3\x05\x4f\x89\x30\xa7\x9d"
3341                           "\x09\xae\x73\x8e\x92\x30\x1e\x5a\x17\x08"
3342                           "\x5b\xef\xfd\xc1\xb8\xd1\x16\x71\x3e\x74"
3343                           "\xf8\x2f\xa9\x42\xd6\x4c\xdb\xc4\x68\x2d",
3344         }, {
3345                 .plaintext = "message digest",
3346                 .psize  = 14,
3347                 .digest = "\x3a\x8e\x28\x50\x2e\xd4\x5d\x42\x2f\x68"
3348                           "\x84\x4f\x9d\xd3\x16\xe7\xb9\x85\x33\xfa"
3349                           "\x3f\x2a\x91\xd2\x9f\x84\xd4\x25\xc8\x8d"
3350                           "\x6b\x4e\xff\x72\x7d\xf6\x6a\x7c\x01\x97",
3351         }, {
3352                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3353                 .psize  = 26,
3354                 .digest = "\xca\xbd\xb1\x81\x0b\x92\x47\x0a\x20\x93"
3355                           "\xaa\x6b\xce\x05\x95\x2c\x28\x34\x8c\xf4"
3356                           "\x3f\xf6\x08\x41\x97\x51\x66\xbb\x40\xed"
3357                           "\x23\x40\x04\xb8\x82\x44\x63\xe6\xb0\x09",
3358         }, {
3359                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
3360                              "fghijklmnopqrstuvwxyz0123456789",
3361                 .psize  = 62,
3362                 .digest = "\xed\x54\x49\x40\xc8\x6d\x67\xf2\x50\xd2"
3363                           "\x32\xc3\x0b\x7b\x3e\x57\x70\xe0\xc6\x0c"
3364                           "\x8c\xb9\xa4\xca\xfe\x3b\x11\x38\x8a\xf9"
3365                           "\x92\x0e\x1b\x99\x23\x0b\x84\x3c\x86\xa4",
3366         }, {
3367                 .plaintext = "1234567890123456789012345678901234567890"
3368                              "1234567890123456789012345678901234567890",
3369                 .psize  = 80,
3370                 .digest = "\x55\x78\x88\xaf\x5f\x6d\x8e\xd6\x2a\xb6"
3371                           "\x69\x45\xc6\xd2\xa0\xa4\x7e\xcd\x53\x41"
3372                           "\xe9\x15\xeb\x8f\xea\x1d\x05\x24\x95\x5f"
3373                           "\x82\x5d\xc7\x17\xe4\xa0\x08\xab\x2d\x42",
3374         }, {
3375                 .plaintext = "abcdbcdecdefdefgefghfghighij"
3376                              "hijkijkljklmklmnlmnomnopnopq",
3377                 .psize  = 56,
3378                 .digest = "\xd0\x34\xa7\x95\x0c\xf7\x22\x02\x1b\xa4"
3379                           "\xb8\x4d\xf7\x69\xa5\xde\x20\x60\xe2\x59"
3380                           "\xdf\x4c\x9b\xb4\xa4\x26\x8c\x0e\x93\x5b"
3381                           "\xbc\x74\x70\xa9\x69\xc9\xd0\x72\xa1\xac",
3382         }
3383 };
3384 
3385 static const struct hash_testvec crct10dif_tv_template[] = {
3386         {
3387                 .plaintext      = "abc",
3388                 .psize          = 3,
3389                 .digest         = (u8 *)(u16 []){ 0x443b },
3390         }, {
3391                 .plaintext      = "1234567890123456789012345678901234567890"
3392                                   "123456789012345678901234567890123456789",
3393                 .psize          = 79,
3394                 .digest         = (u8 *)(u16 []){ 0x4b70 },
3395         }, {
3396                 .plaintext      = "abcdddddddddddddddddddddddddddddddddddddddd"
3397                                   "ddddddddddddd",
3398                 .psize          = 56,
3399                 .digest         = (u8 *)(u16 []){ 0x9ce3 },
3400         }, {
3401                 .plaintext      = "1234567890123456789012345678901234567890"
3402                                   "1234567890123456789012345678901234567890"
3403                                   "1234567890123456789012345678901234567890"
3404                                   "1234567890123456789012345678901234567890"
3405                                   "1234567890123456789012345678901234567890"
3406                                   "1234567890123456789012345678901234567890"
3407                                   "1234567890123456789012345678901234567890"
3408                                   "123456789012345678901234567890123456789",
3409                 .psize          = 319,
3410                 .digest         = (u8 *)(u16 []){ 0x44c6 },
3411         }, {
3412                 .plaintext =    "\x6e\x05\x79\x10\xa7\x1b\xb2\x49"
3413                                 "\xe0\x54\xeb\x82\x19\x8d\x24\xbb"
3414                                 "\x2f\xc6\x5d\xf4\x68\xff\x96\x0a"
3415                                 "\xa1\x38\xcf\x43\xda\x71\x08\x7c"
3416                                 "\x13\xaa\x1e\xb5\x4c\xe3\x57\xee"
3417                                 "\x85\x1c\x90\x27\xbe\x32\xc9\x60"
3418                                 "\xf7\x6b\x02\x99\x0d\xa4\x3b\xd2"
3419                                 "\x46\xdd\x74\x0b\x7f\x16\xad\x21"
3420                                 "\xb8\x4f\xe6\x5a\xf1\x88\x1f\x93"
3421                                 "\x2a\xc1\x35\xcc\x63\xfa\x6e\x05"
3422                                 "\x9c\x10\xa7\x3e\xd5\x49\xe0\x77"
3423                                 "\x0e\x82\x19\xb0\x24\xbb\x52\xe9"
3424                                 "\x5d\xf4\x8b\x22\x96\x2d\xc4\x38"
3425                                 "\xcf\x66\xfd\x71\x08\x9f\x13\xaa"
3426                                 "\x41\xd8\x4c\xe3\x7a\x11\x85\x1c"
3427                                 "\xb3\x27\xbe\x55\xec\x60\xf7\x8e"
3428                                 "\x02\x99\x30\xc7\x3b\xd2\x69\x00"
3429                                 "\x74\x0b\xa2\x16\xad\x44\xdb\x4f"
3430                                 "\xe6\x7d\x14\x88\x1f\xb6\x2a\xc1"
3431                                 "\x58\xef\x63\xfa\x91\x05\x9c\x33"
3432                                 "\xca\x3e\xd5\x6c\x03\x77\x0e\xa5"
3433                                 "\x19\xb0\x47\xde\x52\xe9\x80\x17"
3434                                 "\x8b\x22\xb9\x2d\xc4\x5b\xf2\x66"
3435                                 "\xfd\x94\x08\x9f\x36\xcd\x41\xd8"
3436                                 "\x6f\x06\x7a\x11\xa8\x1c\xb3\x4a"
3437                                 "\xe1\x55\xec\x83\x1a\x8e\x25\xbc"
3438                                 "\x30\xc7\x5e\xf5\x69\x00\x97\x0b"
3439                                 "\xa2\x39\xd0\x44\xdb\x72\x09\x7d"
3440                                 "\x14\xab\x1f\xb6\x4d\xe4\x58\xef"
3441                                 "\x86\x1d\x91\x28\xbf\x33\xca\x61"
3442                                 "\xf8\x6c\x03\x9a\x0e\xa5\x3c\xd3"
3443                                 "\x47\xde\x75\x0c\x80\x17\xae\x22"
3444                                 "\xb9\x50\xe7\x5b\xf2\x89\x20\x94"
3445                                 "\x2b\xc2\x36\xcd\x64\xfb\x6f\x06"
3446                                 "\x9d\x11\xa8\x3f\xd6\x4a\xe1\x78"
3447                                 "\x0f\x83\x1a\xb1\x25\xbc\x53\xea"
3448                                 "\x5e\xf5\x8c\x00\x97\x2e\xc5\x39"
3449                                 "\xd0\x67\xfe\x72\x09\xa0\x14\xab"
3450                                 "\x42\xd9\x4d\xe4\x7b\x12\x86\x1d"
3451                                 "\xb4\x28\xbf\x56\xed\x61\xf8\x8f"
3452                                 "\x03\x9a\x31\xc8\x3c\xd3\x6a\x01"
3453                                 "\x75\x0c\xa3\x17\xae\x45\xdc\x50"
3454                                 "\xe7\x7e\x15\x89\x20\xb7\x2b\xc2"
3455                                 "\x59\xf0\x64\xfb\x92\x06\x9d\x34"
3456                                 "\xcb\x3f\xd6\x6d\x04\x78\x0f\xa6"
3457                                 "\x1a\xb1\x48\xdf\x53\xea\x81\x18"
3458                                 "\x8c\x23\xba\x2e\xc5\x5c\xf3\x67"
3459                                 "\xfe\x95\x09\xa0\x37\xce\x42\xd9"
3460                                 "\x70\x07\x7b\x12\xa9\x1d\xb4\x4b"
3461                                 "\xe2\x56\xed\x84\x1b\x8f\x26\xbd"
3462                                 "\x31\xc8\x5f\xf6\x6a\x01\x98\x0c"
3463                                 "\xa3\x3a\xd1\x45\xdc\x73\x0a\x7e"
3464                                 "\x15\xac\x20\xb7\x4e\xe5\x59\xf0"
3465                                 "\x87\x1e\x92\x29\xc0\x34\xcb\x62"
3466                                 "\xf9\x6d\x04\x9b\x0f\xa6\x3d\xd4"
3467                                 "\x48\xdf\x76\x0d\x81\x18\xaf\x23"
3468                                 "\xba\x51\xe8\x5c\xf3\x8a\x21\x95"
3469                                 "\x2c\xc3\x37\xce\x65\xfc\x70\x07"
3470                                 "\x9e\x12\xa9\x40\xd7\x4b\xe2\x79"
3471                                 "\x10\x84\x1b\xb2\x26\xbd\x54\xeb"
3472                                 "\x5f\xf6\x8d\x01\x98\x2f\xc6\x3a"
3473                                 "\xd1\x68\xff\x73\x0a\xa1\x15\xac"
3474                                 "\x43\xda\x4e\xe5\x7c\x13\x87\x1e"
3475                                 "\xb5\x29\xc0\x57\xee\x62\xf9\x90"
3476                                 "\x04\x9b\x32\xc9\x3d\xd4\x6b\x02"
3477                                 "\x76\x0d\xa4\x18\xaf\x46\xdd\x51"
3478                                 "\xe8\x7f\x16\x8a\x21\xb8\x2c\xc3"
3479                                 "\x5a\xf1\x65\xfc\x93\x07\x9e\x35"
3480                                 "\xcc\x40\xd7\x6e\x05\x79\x10\xa7"
3481                                 "\x1b\xb2\x49\xe0\x54\xeb\x82\x19"
3482                                 "\x8d\x24\xbb\x2f\xc6\x5d\xf4\x68"
3483                                 "\xff\x96\x0a\xa1\x38\xcf\x43\xda"
3484                                 "\x71\x08\x7c\x13\xaa\x1e\xb5\x4c"
3485                                 "\xe3\x57\xee\x85\x1c\x90\x27\xbe"
3486                                 "\x32\xc9\x60\xf7\x6b\x02\x99\x0d"
3487                                 "\xa4\x3b\xd2\x46\xdd\x74\x0b\x7f"
3488                                 "\x16\xad\x21\xb8\x4f\xe6\x5a\xf1"
3489                                 "\x88\x1f\x93\x2a\xc1\x35\xcc\x63"
3490                                 "\xfa\x6e\x05\x9c\x10\xa7\x3e\xd5"
3491                                 "\x49\xe0\x77\x0e\x82\x19\xb0\x24"
3492                                 "\xbb\x52\xe9\x5d\xf4\x8b\x22\x96"
3493                                 "\x2d\xc4\x38\xcf\x66\xfd\x71\x08"
3494                                 "\x9f\x13\xaa\x41\xd8\x4c\xe3\x7a"
3495                                 "\x11\x85\x1c\xb3\x27\xbe\x55\xec"
3496                                 "\x60\xf7\x8e\x02\x99\x30\xc7\x3b"
3497                                 "\xd2\x69\x00\x74\x0b\xa2\x16\xad"
3498                                 "\x44\xdb\x4f\xe6\x7d\x14\x88\x1f"
3499                                 "\xb6\x2a\xc1\x58\xef\x63\xfa\x91"
3500                                 "\x05\x9c\x33\xca\x3e\xd5\x6c\x03"
3501                                 "\x77\x0e\xa5\x19\xb0\x47\xde\x52"
3502                                 "\xe9\x80\x17\x8b\x22\xb9\x2d\xc4"
3503                                 "\x5b\xf2\x66\xfd\x94\x08\x9f\x36"
3504                                 "\xcd\x41\xd8\x6f\x06\x7a\x11\xa8"
3505                                 "\x1c\xb3\x4a\xe1\x55\xec\x83\x1a"
3506                                 "\x8e\x25\xbc\x30\xc7\x5e\xf5\x69"
3507                                 "\x00\x97\x0b\xa2\x39\xd0\x44\xdb"
3508                                 "\x72\x09\x7d\x14\xab\x1f\xb6\x4d"
3509                                 "\xe4\x58\xef\x86\x1d\x91\x28\xbf"
3510                                 "\x33\xca\x61\xf8\x6c\x03\x9a\x0e"
3511                                 "\xa5\x3c\xd3\x47\xde\x75\x0c\x80"
3512                                 "\x17\xae\x22\xb9\x50\xe7\x5b\xf2"
3513                                 "\x89\x20\x94\x2b\xc2\x36\xcd\x64"
3514                                 "\xfb\x6f\x06\x9d\x11\xa8\x3f\xd6"
3515                                 "\x4a\xe1\x78\x0f\x83\x1a\xb1\x25"
3516                                 "\xbc\x53\xea\x5e\xf5\x8c\x00\x97"
3517                                 "\x2e\xc5\x39\xd0\x67\xfe\x72\x09"
3518                                 "\xa0\x14\xab\x42\xd9\x4d\xe4\x7b"
3519                                 "\x12\x86\x1d\xb4\x28\xbf\x56\xed"
3520                                 "\x61\xf8\x8f\x03\x9a\x31\xc8\x3c"
3521                                 "\xd3\x6a\x01\x75\x0c\xa3\x17\xae"
3522                                 "\x45\xdc\x50\xe7\x7e\x15\x89\x20"
3523                                 "\xb7\x2b\xc2\x59\xf0\x64\xfb\x92"
3524                                 "\x06\x9d\x34\xcb\x3f\xd6\x6d\x04"
3525                                 "\x78\x0f\xa6\x1a\xb1\x48\xdf\x53"
3526                                 "\xea\x81\x18\x8c\x23\xba\x2e\xc5"
3527                                 "\x5c\xf3\x67\xfe\x95\x09\xa0\x37"
3528                                 "\xce\x42\xd9\x70\x07\x7b\x12\xa9"
3529                                 "\x1d\xb4\x4b\xe2\x56\xed\x84\x1b"
3530                                 "\x8f\x26\xbd\x31\xc8\x5f\xf6\x6a"
3531                                 "\x01\x98\x0c\xa3\x3a\xd1\x45\xdc"
3532                                 "\x73\x0a\x7e\x15\xac\x20\xb7\x4e"
3533                                 "\xe5\x59\xf0\x87\x1e\x92\x29\xc0"
3534                                 "\x34\xcb\x62\xf9\x6d\x04\x9b\x0f"
3535                                 "\xa6\x3d\xd4\x48\xdf\x76\x0d\x81"
3536                                 "\x18\xaf\x23\xba\x51\xe8\x5c\xf3"
3537                                 "\x8a\x21\x95\x2c\xc3\x37\xce\x65"
3538                                 "\xfc\x70\x07\x9e\x12\xa9\x40\xd7"
3539                                 "\x4b\xe2\x79\x10\x84\x1b\xb2\x26"
3540                                 "\xbd\x54\xeb\x5f\xf6\x8d\x01\x98"
3541                                 "\x2f\xc6\x3a\xd1\x68\xff\x73\x0a"
3542                                 "\xa1\x15\xac\x43\xda\x4e\xe5\x7c"
3543                                 "\x13\x87\x1e\xb5\x29\xc0\x57\xee"
3544                                 "\x62\xf9\x90\x04\x9b\x32\xc9\x3d"
3545                                 "\xd4\x6b\x02\x76\x0d\xa4\x18\xaf"
3546                                 "\x46\xdd\x51\xe8\x7f\x16\x8a\x21"
3547                                 "\xb8\x2c\xc3\x5a\xf1\x65\xfc\x93"
3548                                 "\x07\x9e\x35\xcc\x40\xd7\x6e\x05"
3549                                 "\x79\x10\xa7\x1b\xb2\x49\xe0\x54"
3550                                 "\xeb\x82\x19\x8d\x24\xbb\x2f\xc6"
3551                                 "\x5d\xf4\x68\xff\x96\x0a\xa1\x38"
3552                                 "\xcf\x43\xda\x71\x08\x7c\x13\xaa"
3553                                 "\x1e\xb5\x4c\xe3\x57\xee\x85\x1c"
3554                                 "\x90\x27\xbe\x32\xc9\x60\xf7\x6b"
3555                                 "\x02\x99\x0d\xa4\x3b\xd2\x46\xdd"
3556                                 "\x74\x0b\x7f\x16\xad\x21\xb8\x4f"
3557                                 "\xe6\x5a\xf1\x88\x1f\x93\x2a\xc1"
3558                                 "\x35\xcc\x63\xfa\x6e\x05\x9c\x10"
3559                                 "\xa7\x3e\xd5\x49\xe0\x77\x0e\x82"
3560                                 "\x19\xb0\x24\xbb\x52\xe9\x5d\xf4"
3561                                 "\x8b\x22\x96\x2d\xc4\x38\xcf\x66"
3562                                 "\xfd\x71\x08\x9f\x13\xaa\x41\xd8"
3563                                 "\x4c\xe3\x7a\x11\x85\x1c\xb3\x27"
3564                                 "\xbe\x55\xec\x60\xf7\x8e\x02\x99"
3565                                 "\x30\xc7\x3b\xd2\x69\x00\x74\x0b"
3566                                 "\xa2\x16\xad\x44\xdb\x4f\xe6\x7d"
3567                                 "\x14\x88\x1f\xb6\x2a\xc1\x58\xef"
3568                                 "\x63\xfa\x91\x05\x9c\x33\xca\x3e"
3569                                 "\xd5\x6c\x03\x77\x0e\xa5\x19\xb0"
3570                                 "\x47\xde\x52\xe9\x80\x17\x8b\x22"
3571                                 "\xb9\x2d\xc4\x5b\xf2\x66\xfd\x94"
3572                                 "\x08\x9f\x36\xcd\x41\xd8\x6f\x06"
3573                                 "\x7a\x11\xa8\x1c\xb3\x4a\xe1\x55"
3574                                 "\xec\x83\x1a\x8e\x25\xbc\x30\xc7"
3575                                 "\x5e\xf5\x69\x00\x97\x0b\xa2\x39"
3576                                 "\xd0\x44\xdb\x72\x09\x7d\x14\xab"
3577                                 "\x1f\xb6\x4d\xe4\x58\xef\x86\x1d"
3578                                 "\x91\x28\xbf\x33\xca\x61\xf8\x6c"
3579                                 "\x03\x9a\x0e\xa5\x3c\xd3\x47\xde"
3580                                 "\x75\x0c\x80\x17\xae\x22\xb9\x50"
3581                                 "\xe7\x5b\xf2\x89\x20\x94\x2b\xc2"
3582                                 "\x36\xcd\x64\xfb\x6f\x06\x9d\x11"
3583                                 "\xa8\x3f\xd6\x4a\xe1\x78\x0f\x83"
3584                                 "\x1a\xb1\x25\xbc\x53\xea\x5e\xf5"
3585                                 "\x8c\x00\x97\x2e\xc5\x39\xd0\x67"
3586                                 "\xfe\x72\x09\xa0\x14\xab\x42\xd9"
3587                                 "\x4d\xe4\x7b\x12\x86\x1d\xb4\x28"
3588                                 "\xbf\x56\xed\x61\xf8\x8f\x03\x9a"
3589                                 "\x31\xc8\x3c\xd3\x6a\x01\x75\x0c"
3590                                 "\xa3\x17\xae\x45\xdc\x50\xe7\x7e"
3591                                 "\x15\x89\x20\xb7\x2b\xc2\x59\xf0"
3592                                 "\x64\xfb\x92\x06\x9d\x34\xcb\x3f"
3593                                 "\xd6\x6d\x04\x78\x0f\xa6\x1a\xb1"
3594                                 "\x48\xdf\x53\xea\x81\x18\x8c\x23"
3595                                 "\xba\x2e\xc5\x5c\xf3\x67\xfe\x95"
3596                                 "\x09\xa0\x37\xce\x42\xd9\x70\x07"
3597                                 "\x7b\x12\xa9\x1d\xb4\x4b\xe2\x56"
3598                                 "\xed\x84\x1b\x8f\x26\xbd\x31\xc8"
3599                                 "\x5f\xf6\x6a\x01\x98\x0c\xa3\x3a"
3600                                 "\xd1\x45\xdc\x73\x0a\x7e\x15\xac"
3601                                 "\x20\xb7\x4e\xe5\x59\xf0\x87\x1e"
3602                                 "\x92\x29\xc0\x34\xcb\x62\xf9\x6d"
3603                                 "\x04\x9b\x0f\xa6\x3d\xd4\x48\xdf"
3604                                 "\x76\x0d\x81\x18\xaf\x23\xba\x51"
3605                                 "\xe8\x5c\xf3\x8a\x21\x95\x2c\xc3"
3606                                 "\x37\xce\x65\xfc\x70\x07\x9e\x12"
3607                                 "\xa9\x40\xd7\x4b\xe2\x79\x10\x84"
3608                                 "\x1b\xb2\x26\xbd\x54\xeb\x5f\xf6"
3609                                 "\x8d\x01\x98\x2f\xc6\x3a\xd1\x68"
3610                                 "\xff\x73\x0a\xa1\x15\xac\x43\xda"
3611                                 "\x4e\xe5\x7c\x13\x87\x1e\xb5\x29"
3612                                 "\xc0\x57\xee\x62\xf9\x90\x04\x9b"
3613                                 "\x32\xc9\x3d\xd4\x6b\x02\x76\x0d"
3614                                 "\xa4\x18\xaf\x46\xdd\x51\xe8\x7f"
3615                                 "\x16\x8a\x21\xb8\x2c\xc3\x5a\xf1"
3616                                 "\x65\xfc\x93\x07\x9e\x35\xcc\x40"
3617                                 "\xd7\x6e\x05\x79\x10\xa7\x1b\xb2"
3618                                 "\x49\xe0\x54\xeb\x82\x19\x8d\x24"
3619                                 "\xbb\x2f\xc6\x5d\xf4\x68\xff\x96"
3620                                 "\x0a\xa1\x38\xcf\x43\xda\x71\x08"
3621                                 "\x7c\x13\xaa\x1e\xb5\x4c\xe3\x57"
3622                                 "\xee\x85\x1c\x90\x27\xbe\x32\xc9"
3623                                 "\x60\xf7\x6b\x02\x99\x0d\xa4\x3b"
3624                                 "\xd2\x46\xdd\x74\x0b\x7f\x16\xad"
3625                                 "\x21\xb8\x4f\xe6\x5a\xf1\x88\x1f"
3626                                 "\x93\x2a\xc1\x35\xcc\x63\xfa\x6e"
3627                                 "\x05\x9c\x10\xa7\x3e\xd5\x49\xe0"
3628                                 "\x77\x0e\x82\x19\xb0\x24\xbb\x52"
3629                                 "\xe9\x5d\xf4\x8b\x22\x96\x2d\xc4"
3630                                 "\x38\xcf\x66\xfd\x71\x08\x9f\x13"
3631                                 "\xaa\x41\xd8\x4c\xe3\x7a\x11\x85"
3632                                 "\x1c\xb3\x27\xbe\x55\xec\x60\xf7"
3633                                 "\x8e\x02\x99\x30\xc7\x3b\xd2\x69"
3634                                 "\x00\x74\x0b\xa2\x16\xad\x44\xdb"
3635                                 "\x4f\xe6\x7d\x14\x88\x1f\xb6\x2a"
3636                                 "\xc1\x58\xef\x63\xfa\x91\x05\x9c"
3637                                 "\x33\xca\x3e\xd5\x6c\x03\x77\x0e"
3638                                 "\xa5\x19\xb0\x47\xde\x52\xe9\x80"
3639                                 "\x17\x8b\x22\xb9\x2d\xc4\x5b\xf2"
3640                                 "\x66\xfd\x94\x08\x9f\x36\xcd\x41"
3641                                 "\xd8\x6f\x06\x7a\x11\xa8\x1c\xb3"
3642                                 "\x4a\xe1\x55\xec\x83\x1a\x8e\x25"
3643                                 "\xbc\x30\xc7\x5e\xf5\x69\x00\x97"
3644                                 "\x0b\xa2\x39\xd0\x44\xdb\x72\x09"
3645                                 "\x7d\x14\xab\x1f\xb6\x4d\xe4\x58"
3646                                 "\xef\x86\x1d\x91\x28\xbf\x33\xca"
3647                                 "\x61\xf8\x6c\x03\x9a\x0e\xa5\x3c"
3648                                 "\xd3\x47\xde\x75\x0c\x80\x17\xae"
3649                                 "\x22\xb9\x50\xe7\x5b\xf2\x89\x20"
3650                                 "\x94\x2b\xc2\x36\xcd\x64\xfb\x6f"
3651                                 "\x06\x9d\x11\xa8\x3f\xd6\x4a\xe1"
3652                                 "\x78\x0f\x83\x1a\xb1\x25\xbc\x53"
3653                                 "\xea\x5e\xf5\x8c\x00\x97\x2e\xc5"
3654                                 "\x39\xd0\x67\xfe\x72\x09\xa0\x14"
3655                                 "\xab\x42\xd9\x4d\xe4\x7b\x12\x86"
3656                                 "\x1d\xb4\x28\xbf\x56\xed\x61\xf8"
3657                                 "\x8f\x03\x9a\x31\xc8\x3c\xd3\x6a"
3658                                 "\x01\x75\x0c\xa3\x17\xae\x45\xdc"
3659                                 "\x50\xe7\x7e\x15\x89\x20\xb7\x2b"
3660                                 "\xc2\x59\xf0\x64\xfb\x92\x06\x9d"
3661                                 "\x34\xcb\x3f\xd6\x6d\x04\x78\x0f"
3662                                 "\xa6\x1a\xb1\x48\xdf\x53\xea\x81"
3663                                 "\x18\x8c\x23\xba\x2e\xc5\x5c\xf3"
3664                                 "\x67\xfe\x95\x09\xa0\x37\xce\x42"
3665                                 "\xd9\x70\x07\x7b\x12\xa9\x1d\xb4"
3666                                 "\x4b\xe2\x56\xed\x84\x1b\x8f\x26"
3667                                 "\xbd\x31\xc8\x5f\xf6\x6a\x01\x98",
3668                 .psize = 2048,
3669                 .digest         = (u8 *)(u16 []){ 0x23ca },
3670         }
3671 };
3672 
3673 /*
3674  * Streebog test vectors from RFC 6986 and GOST R 34.11-2012
3675  */
3676 static const struct hash_testvec streebog256_tv_template[] = {
3677         { /* M1 */
3678                 .plaintext = "012345678901234567890123456789012345678901234567890123456789012",
3679                 .psize = 63,
3680                 .digest =
3681                         "\x9d\x15\x1e\xef\xd8\x59\x0b\x89"
3682                         "\xda\xa6\xba\x6c\xb7\x4a\xf9\x27"
3683                         "\x5d\xd0\x51\x02\x6b\xb1\x49\xa4"
3684                         "\x52\xfd\x84\xe5\xe5\x7b\x55\x00",
3685         },
3686         { /* M2 */
3687                 .plaintext =
3688                         "\xd1\xe5\x20\xe2\xe5\xf2\xf0\xe8"
3689                         "\x2c\x20\xd1\xf2\xf0\xe8\xe1\xee"
3690                         "\xe6\xe8\x20\xe2\xed\xf3\xf6\xe8"
3691                         "\x2c\x20\xe2\xe5\xfe\xf2\xfa\x20"
3692                         "\xf1\x20\xec\xee\xf0\xff\x20\xf1"
3693                         "\xf2\xf0\xe5\xeb\xe0\xec\xe8\x20"
3694                         "\xed\xe0\x20\xf5\xf0\xe0\xe1\xf0"
3695                         "\xfb\xff\x20\xef\xeb\xfa\xea\xfb"
3696                         "\x20\xc8\xe3\xee\xf0\xe5\xe2\xfb",
3697                 .psize = 72,
3698                 .digest =
3699                         "\x9d\xd2\xfe\x4e\x90\x40\x9e\x5d"
3700                         "\xa8\x7f\x53\x97\x6d\x74\x05\xb0"
3701                         "\xc0\xca\xc6\x28\xfc\x66\x9a\x74"
3702                         "\x1d\x50\x06\x3c\x55\x7e\x8f\x50",
3703         },
3704 };
3705 
3706 static const struct hash_testvec streebog512_tv_template[] = {
3707         { /* M1 */
3708                 .plaintext = "012345678901234567890123456789012345678901234567890123456789012",
3709                 .psize = 63,
3710                 .digest =
3711                         "\x1b\x54\xd0\x1a\x4a\xf5\xb9\xd5"
3712                         "\xcc\x3d\x86\xd6\x8d\x28\x54\x62"
3713                         "\xb1\x9a\xbc\x24\x75\x22\x2f\x35"
3714                         "\xc0\x85\x12\x2b\xe4\xba\x1f\xfa"
3715                         "\x00\xad\x30\xf8\x76\x7b\x3a\x82"
3716                         "\x38\x4c\x65\x74\xf0\x24\xc3\x11"
3717                         "\xe2\xa4\x81\x33\x2b\x08\xef\x7f"
3718                         "\x41\x79\x78\x91\xc1\x64\x6f\x48",
3719         },
3720         { /* M2 */
3721                 .plaintext =
3722                         "\xd1\xe5\x20\xe2\xe5\xf2\xf0\xe8"
3723                         "\x2c\x20\xd1\xf2\xf0\xe8\xe1\xee"
3724                         "\xe6\xe8\x20\xe2\xed\xf3\xf6\xe8"
3725                         "\x2c\x20\xe2\xe5\xfe\xf2\xfa\x20"
3726                         "\xf1\x20\xec\xee\xf0\xff\x20\xf1"
3727                         "\xf2\xf0\xe5\xeb\xe0\xec\xe8\x20"
3728                         "\xed\xe0\x20\xf5\xf0\xe0\xe1\xf0"
3729                         "\xfb\xff\x20\xef\xeb\xfa\xea\xfb"
3730                         "\x20\xc8\xe3\xee\xf0\xe5\xe2\xfb",
3731                 .psize = 72,
3732                 .digest =
3733                         "\x1e\x88\xe6\x22\x26\xbf\xca\x6f"
3734                         "\x99\x94\xf1\xf2\xd5\x15\x69\xe0"
3735                         "\xda\xf8\x47\x5a\x3b\x0f\xe6\x1a"
3736                         "\x53\x00\xee\xe4\x6d\x96\x13\x76"
3737                         "\x03\x5f\xe8\x35\x49\xad\xa2\xb8"
3738                         "\x62\x0f\xcd\x7c\x49\x6c\xe5\xb3"
3739                         "\x3f\x0c\xb9\xdd\xdc\x2b\x64\x60"
3740                         "\x14\x3b\x03\xda\xba\xc9\xfb\x28",
3741         },
3742 };
3743 
3744 /*
3745  * Two HMAC-Streebog test vectors from RFC 7836 and R 50.1.113-2016 A
3746  */
3747 static const struct hash_testvec hmac_streebog256_tv_template[] = {
3748         {
3749                 .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
3750                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3751                         "\x10\x11\x12\x13\x14\x15\x16\x17"
3752                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3753                 .ksize  = 32,
3754                 .plaintext =
3755                         "\x01\x26\xbd\xb8\x78\x00\xaf\x21"
3756                         "\x43\x41\x45\x65\x63\x78\x01\x00",
3757                 .psize  = 16,
3758                 .digest =
3759                         "\xa1\xaa\x5f\x7d\xe4\x02\xd7\xb3"
3760                         "\xd3\x23\xf2\x99\x1c\x8d\x45\x34"
3761                         "\x01\x31\x37\x01\x0a\x83\x75\x4f"
3762                         "\xd0\xaf\x6d\x7c\xd4\x92\x2e\xd9",
3763         },
3764 };
3765 
3766 static const struct hash_testvec hmac_streebog512_tv_template[] = {
3767         {
3768                 .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
3769                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3770                         "\x10\x11\x12\x13\x14\x15\x16\x17"
3771                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3772                 .ksize  = 32,
3773                 .plaintext =
3774                         "\x01\x26\xbd\xb8\x78\x00\xaf\x21"
3775                         "\x43\x41\x45\x65\x63\x78\x01\x00",
3776                 .psize  = 16,
3777                 .digest =
3778                         "\xa5\x9b\xab\x22\xec\xae\x19\xc6"
3779                         "\x5f\xbd\xe6\xe5\xf4\xe9\xf5\xd8"
3780                         "\x54\x9d\x31\xf0\x37\xf9\xdf\x9b"
3781                         "\x90\x55\x00\xe1\x71\x92\x3a\x77"
3782                         "\x3d\x5f\x15\x30\xf2\xed\x7e\x96"
3783                         "\x4c\xb2\xee\xdc\x29\xe9\xad\x2f"
3784                         "\x3a\xfe\x93\xb2\x81\x4f\x79\xf5"
3785                         "\x00\x0f\xfc\x03\x66\xc2\x51\xe6",
3786         },
3787 };
3788 
3789 /* Example vectors below taken from
3790  * http://www.oscca.gov.cn/UpFile/20101222141857786.pdf
3791  *
3792  * The rest taken from
3793  * https://github.com/adamws/oscca-sm3
3794  */
3795 static const struct hash_testvec sm3_tv_template[] = {
3796         {
3797                 .plaintext = "",
3798                 .psize = 0,
3799                 .digest = (u8 *)(u8 []) {
3800                         0x1A, 0xB2, 0x1D, 0x83, 0x55, 0xCF, 0xA1, 0x7F,
3801                         0x8e, 0x61, 0x19, 0x48, 0x31, 0xE8, 0x1A, 0x8F,
3802                         0x22, 0xBE, 0xC8, 0xC7, 0x28, 0xFE, 0xFB, 0x74,
3803                         0x7E, 0xD0, 0x35, 0xEB, 0x50, 0x82, 0xAA, 0x2B }
3804         }, {
3805                 .plaintext = "a",
3806                 .psize = 1,
3807                 .digest = (u8 *)(u8 []) {
3808                         0x62, 0x34, 0x76, 0xAC, 0x18, 0xF6, 0x5A, 0x29,
3809                         0x09, 0xE4, 0x3C, 0x7F, 0xEC, 0x61, 0xB4, 0x9C,
3810                         0x7E, 0x76, 0x4A, 0x91, 0xA1, 0x8C, 0xCB, 0x82,
3811                         0xF1, 0x91, 0x7A, 0x29, 0xC8, 0x6C, 0x5E, 0x88 }
3812         }, {
3813                 /* A.1. Example 1 */
3814                 .plaintext = "abc",
3815                 .psize = 3,
3816                 .digest = (u8 *)(u8 []) {
3817                         0x66, 0xC7, 0xF0, 0xF4, 0x62, 0xEE, 0xED, 0xD9,
3818                         0xD1, 0xF2, 0xD4, 0x6B, 0xDC, 0x10, 0xE4, 0xE2,
3819                         0x41, 0x67, 0xC4, 0x87, 0x5C, 0xF2, 0xF7, 0xA2,
3820                         0x29, 0x7D, 0xA0, 0x2B, 0x8F, 0x4B, 0xA8, 0xE0 }
3821         }, {
3822                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
3823                 .psize = 26,
3824                 .digest = (u8 *)(u8 []) {
3825                         0xB8, 0x0F, 0xE9, 0x7A, 0x4D, 0xA2, 0x4A, 0xFC,
3826                         0x27, 0x75, 0x64, 0xF6, 0x6A, 0x35, 0x9E, 0xF4,
3827                         0x40, 0x46, 0x2A, 0xD2, 0x8D, 0xCC, 0x6D, 0x63,
3828                         0xAD, 0xB2, 0x4D, 0x5C, 0x20, 0xA6, 0x15, 0x95 }
3829         }, {
3830                 /* A.1. Example 2 */
3831                 .plaintext = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdab"
3832                              "cdabcdabcdabcdabcd",
3833                 .psize = 64,
3834                 .digest = (u8 *)(u8 []) {
3835                         0xDE, 0xBE, 0x9F, 0xF9, 0x22, 0x75, 0xB8, 0xA1,
3836                         0x38, 0x60, 0x48, 0x89, 0xC1, 0x8E, 0x5A, 0x4D,
3837                         0x6F, 0xDB, 0x70, 0xE5, 0x38, 0x7E, 0x57, 0x65,
3838                         0x29, 0x3D, 0xCB, 0xA3, 0x9C, 0x0C, 0x57, 0x32 }
3839         }, {
3840                 .plaintext = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3841                              "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3842                              "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3843                              "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3844                              "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3845                              "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
3846                              "abcdabcdabcdabcdabcdabcdabcdabcd",
3847                 .psize = 256,
3848                 .digest = (u8 *)(u8 []) {
3849                         0xB9, 0x65, 0x76, 0x4C, 0x8B, 0xEB, 0xB0, 0x91,
3850                         0xC7, 0x60, 0x2B, 0x74, 0xAF, 0xD3, 0x4E, 0xEF,
3851                         0xB5, 0x31, 0xDC, 0xCB, 0x4E, 0x00, 0x76, 0xD9,
3852                         0xB7, 0xCD, 0x81, 0x31, 0x99, 0xB4, 0x59, 0x71 }
3853         }
3854 };
3855 
3856 /* Example vectors below taken from
3857  * GM/T 0042-2015 Appendix D.3
3858  */
3859 static const struct hash_testvec hmac_sm3_tv_template[] = {
3860         {
3861                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3862                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3863                           "\x11\x12\x13\x14\x15\x16\x17\x18"
3864                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
3865                 .ksize  = 32,
3866                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
3867                              "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
3868                 .psize  = 112,
3869                 .digest = "\xca\x05\xe1\x44\xed\x05\xd1\x85"
3870                           "\x78\x40\xd1\xf3\x18\xa4\xa8\x66"
3871                           "\x9e\x55\x9f\xc8\x39\x1f\x41\x44"
3872                           "\x85\xbf\xdf\x7b\xb4\x08\x96\x3a",
3873         }, {
3874                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3875                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3876                           "\x11\x12\x13\x14\x15\x16\x17\x18"
3877                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
3878                           "\x21\x22\x23\x24\x25",
3879                 .ksize  = 37,
3880                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3881                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3882                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3883                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
3884                 .psize  = 50,
3885                 .digest = "\x22\x0b\xf5\x79\xde\xd5\x55\x39"
3886                           "\x3f\x01\x59\xf6\x6c\x99\x87\x78"
3887                           "\x22\xa3\xec\xf6\x10\xd1\x55\x21"
3888                           "\x54\xb4\x1d\x44\xb9\x4d\xb3\xae",
3889         }, {
3890                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3891                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3892                          "\x0b\x0b\x0b\x0b\x0b\x0b",
3893                 .ksize  = 32,
3894                 .plaintext = "Hi There",
3895                 .psize  = 8,
3896                 .digest = "\xc0\xba\x18\xc6\x8b\x90\xc8\x8b"
3897                           "\xc0\x7d\xe7\x94\xbf\xc7\xd2\xc8"
3898                           "\xd1\x9e\xc3\x1e\xd8\x77\x3b\xc2"
3899                           "\xb3\x90\xc9\x60\x4e\x0b\xe1\x1e",
3900         }, {
3901                 .key    = "Jefe",
3902                 .ksize  = 4,
3903                 .plaintext = "what do ya want for nothing?",
3904                 .psize  = 28,
3905                 .digest = "\x2e\x87\xf1\xd1\x68\x62\xe6\xd9"
3906                           "\x64\xb5\x0a\x52\x00\xbf\x2b\x10"
3907                           "\xb7\x64\xfa\xa9\x68\x0a\x29\x6a"
3908                           "\x24\x05\xf2\x4b\xec\x39\xf8\x82",
3909         },
3910 };
3911 
3912 /*
3913  * SHA1 test vectors  from from FIPS PUB 180-1
3914  * Long vector from CAVS 5.0
3915  */
3916 static const struct hash_testvec sha1_tv_template[] = {
3917         {
3918                 .plaintext = "",
3919                 .psize  = 0,
3920                 .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55"
3921                           "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09",
3922         }, {
3923                 .plaintext = "abc",
3924                 .psize  = 3,
3925                 .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
3926                           "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
3927         }, {
3928                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
3929                 .psize  = 56,
3930                 .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
3931                           "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
3932         }, {
3933                 .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
3934                              "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
3935                              "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
3936                              "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
3937                              "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
3938                              "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
3939                              "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
3940                              "\x72\x28\x26\xc0\x66\x86\x9e\xda"
3941                              "\xcd\x73\xb2\x54\x80\x35\x18\x58"
3942                              "\x13\xe2\x26\x34\xa9\xda\x44\x00"
3943                              "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
3944                              "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
3945                              "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
3946                              "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
3947                              "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
3948                              "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
3949                              "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
3950                              "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
3951                              "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
3952                              "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
3953                              "\x5a\x90\x11",
3954                 .psize  = 163,
3955                 .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
3956                           "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
3957         }, {
3958                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
3959                 .psize  = 64,
3960                 .digest = "\xc8\x71\xf6\x9a\x63\xcc\xa9\x84\x84\x82"
3961                           "\x64\xe7\x79\x95\x5d\xd7\x19\x41\x7c\x91",
3962         }, {
3963                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
3964                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
3965                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
3966                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
3967                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
3968                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
3969                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
3970                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
3971                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
3972                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
3973                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
3974                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
3975                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
3976                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
3977                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
3978                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
3979                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
3980                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
3981                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
3982                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
3983                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
3984                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
3985                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
3986                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
3987                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
3988                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
3989                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
3990                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
3991                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
3992                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
3993                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
3994                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
3995                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
3996                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
3997                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
3998                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
3999                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4000                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4001                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4002                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4003                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4004                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4005                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4006                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4007                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4008                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4009                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4010                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4011                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4012                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4013                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4014                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4015                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4016                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4017                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4018                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4019                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4020                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4021                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4022                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4023                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4024                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4025                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4026                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4027                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4028                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4029                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4030                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4031                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4032                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4033                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4034                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4035                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4036                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4037                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4038                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4039                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4040                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4041                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4042                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4043                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4044                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4045                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4046                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4047                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4048                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4049                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4050                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4051                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4052                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4053                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4054                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4055                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4056                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4057                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4058                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4059                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4060                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4061                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4062                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4063                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4064                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4065                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4066                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4067                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4068                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4069                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4070                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4071                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4072                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4073                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4074                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4075                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4076                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4077                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4078                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4079                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4080                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4081                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4082                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4083                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4084                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4085                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4086                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4087                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4088                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4089                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4090                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4091                 .psize     = 1023,
4092                 .digest    = "\xb8\xe3\x54\xed\xc5\xfc\xef\xa4"
4093                              "\x55\x73\x4a\x81\x99\xe4\x47\x2a"
4094                              "\x30\xd6\xc9\x85",
4095         }
4096 };
4097 
4098 
4099 /*
4100  * SHA224 test vectors from from FIPS PUB 180-2
4101  */
4102 static const struct hash_testvec sha224_tv_template[] = {
4103         {
4104                 .plaintext = "",
4105                 .psize  = 0,
4106                 .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9"
4107                           "\x47\x61\x02\xbb\x28\x82\x34\xc4"
4108                           "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a"
4109                           "\xc5\xb3\xe4\x2f",
4110         }, {
4111                 .plaintext = "abc",
4112                 .psize  = 3,
4113                 .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
4114                           "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
4115                           "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
4116                           "\xE3\x6C\x9D\xA7",
4117         }, {
4118                 .plaintext =
4119                 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4120                 .psize  = 56,
4121                 .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
4122                           "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
4123                           "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
4124                           "\x52\x52\x25\x25",
4125         }, {
4126                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
4127                 .psize  = 64,
4128                 .digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01"
4129                           "\x42\xfd\x10\x92\xaa\x4e\x04\x08"
4130                           "\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c"
4131                           "\xef\x3b\xcb\x0e",
4132         }, {
4133                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4134                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4135                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4136                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4137                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4138                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4139                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4140                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4141                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4142                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4143                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4144                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4145                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4146                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4147                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4148                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4149                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4150                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4151                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4152                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4153                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4154                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4155                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4156                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4157                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4158                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4159                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4160                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4161                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4162                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4163                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4164                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4165                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4166                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4167                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4168                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4169                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4170                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4171                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4172                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4173                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4174                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4175                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4176                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4177                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4178                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4179                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4180                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4181                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4182                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4183                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4184                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4185                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4186                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4187                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4188                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4189                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4190                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4191                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4192                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4193                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4194                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4195                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4196                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4197                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4198                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4199                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4200                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4201                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4202                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4203                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4204                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4205                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4206                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4207                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4208                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4209                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4210                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4211                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4212                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4213                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4214                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4215                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4216                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4217                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4218                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4219                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4220                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4221                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4222                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4223                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4224                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4225                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4226                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4227                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4228                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4229                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4230                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4231                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4232                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4233                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4234                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4235                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4236                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4237                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4238                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4239                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4240                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4241                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4242                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4243                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4244                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4245                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4246                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4247                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4248                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4249                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4250                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4251                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4252                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4253                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4254                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4255                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4256                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4257                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4258                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4259                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4260                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4261                 .psize     = 1023,
4262                 .digest    = "\x98\x43\x07\x63\x75\xe0\xa7\x1c"
4263                              "\x78\xb1\x8b\xfd\x04\xf5\x2d\x91"
4264                              "\x20\x48\xa4\x28\xff\x55\xb1\xd3"
4265                              "\xe6\xf9\x4f\xcc",
4266         }
4267 };
4268 
4269 /*
4270  * SHA256 test vectors from from NIST
4271  */
4272 static const struct hash_testvec sha256_tv_template[] = {
4273         {
4274                 .plaintext = "",
4275                 .psize  = 0,
4276                 .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14"
4277                           "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
4278                           "\x27\xae\x41\xe4\x64\x9b\x93\x4c"
4279                           "\xa4\x95\x99\x1b\x78\x52\xb8\x55",
4280         }, {
4281                 .plaintext = "abc",
4282                 .psize  = 3,
4283                 .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
4284                           "\x41\x41\x40\xde\x5d\xae\x22\x23"
4285                           "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
4286                           "\xb4\x10\xff\x61\xf2\x00\x15\xad",
4287         }, {
4288                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4289                 .psize  = 56,
4290                 .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
4291                           "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
4292                           "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
4293                           "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
4294         }, {
4295                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
4296                 .psize  = 64,
4297                 .digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4"
4298                           "\x2c\x32\x29\x32\x19\xbb\xfb\xfa"
4299                           "\xd6\xff\x94\xa3\x72\x91\x85\x66"
4300                           "\x3b\xa7\x87\x77\x58\xa3\x40\x3a",
4301         }, {
4302                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4303                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4304                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4305                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4306                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4307                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4308                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4309                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4310                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4311                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4312                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4313                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4314                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4315                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4316                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4317                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4318                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4319                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4320                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4321                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4322                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4323                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4324                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4325                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4326                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4327                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4328                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4329                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4330                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4331                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4332                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4333                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4334                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4335                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4336                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4337                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4338                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4339                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4340                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4341                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4342                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4343                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4344                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4345                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4346                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4347                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4348                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4349                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4350                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4351                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4352                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4353                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4354                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4355                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4356                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4357                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4358                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4359                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4360                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4361                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4362                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4363                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4364                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4365                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4366                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4367                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4368                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4369                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4370                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4371                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4372                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4373                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4374                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4375                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4376                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4377                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4378                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4379                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4380                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4381                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4382                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4383                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4384                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4385                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4386                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4387                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4388                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4389                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4390                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4391                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4392                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4393                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4394                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4395                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4396                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4397                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4398                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4399                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4400                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4401                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4402                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4403                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4404                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4405                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4406                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4407                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4408                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4409                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4410                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4411                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4412                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4413                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4414                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4415                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4416                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4417                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4418                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4419                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4420                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4421                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4422                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4423                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4424                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4425                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4426                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4427                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4428                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4429                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4430                 .psize     = 1023,
4431                 .digest    = "\xc5\xce\x0c\xca\x01\x4f\x53\x3a"
4432                              "\x32\x32\x17\xcc\xd4\x6a\x71\xa9"
4433                              "\xf3\xed\x50\x10\x64\x8e\x06\xbe"
4434                              "\x9b\x4a\xa6\xbb\x05\x89\x59\x51",
4435         }
4436 };
4437 
4438 /*
4439  * SHA384 test vectors from from NIST and kerneli
4440  */
4441 static const struct hash_testvec sha384_tv_template[] = {
4442         {
4443                 .plaintext = "",
4444                 .psize  = 0,
4445                 .digest = "\x38\xb0\x60\xa7\x51\xac\x96\x38"
4446                           "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a"
4447                           "\x21\xfd\xb7\x11\x14\xbe\x07\x43"
4448                           "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda"
4449                           "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb"
4450                           "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b",
4451         }, {
4452                 .plaintext= "abc",
4453                 .psize  = 3,
4454                 .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
4455                           "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
4456                           "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
4457                           "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
4458                           "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
4459                           "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
4460         }, {
4461                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4462                 .psize  = 56,
4463                 .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
4464                           "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
4465                           "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
4466                           "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
4467                           "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
4468                           "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
4469         }, {
4470                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
4471                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
4472                 .psize  = 112,
4473                 .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
4474                           "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
4475                           "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
4476                           "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
4477                           "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
4478                           "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
4479         }, {
4480                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
4481                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
4482                 .psize  = 104,
4483                 .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
4484                           "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
4485                           "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
4486                           "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
4487                           "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
4488                           "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
4489         }, {
4490                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4491                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4492                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4493                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4494                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4495                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4496                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4497                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4498                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4499                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4500                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4501                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4502                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4503                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4504                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4505                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4506                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4507                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4508                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4509                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4510                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4511                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4512                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4513                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4514                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4515                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4516                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4517                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4518                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4519                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4520                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4521                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4522                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4523                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4524                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4525                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4526                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4527                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4528                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4529                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4530                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4531                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4532                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4533                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4534                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4535                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4536                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4537                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4538                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4539                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4540                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4541                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4542                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4543                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4544                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4545                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4546                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4547                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4548                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4549                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4550                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4551                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4552                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4553                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4554                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4555                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4556                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4557                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4558                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4559                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4560                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4561                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4562                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4563                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4564                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4565                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4566                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4567                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4568                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4569                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4570                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4571                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4572                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4573                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4574                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4575                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4576                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4577                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4578                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4579                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4580                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4581                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4582                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4583                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4584                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4585                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4586                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4587                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4588                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4589                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4590                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4591                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4592                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4593                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4594                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4595                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4596                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4597                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4598                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4599                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4600                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4601                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4602                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4603                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4604                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4605                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4606                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4607                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4608                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4609                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4610                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4611                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4612                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4613                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4614                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4615                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4616                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4617                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4618                 .psize     = 1023,
4619                 .digest    = "\x4d\x97\x23\xc8\xea\x7a\x7c\x15"
4620                              "\xb8\xff\x97\x9c\xf5\x13\x4f\x31"
4621                              "\xde\x67\xf7\x24\x73\xcd\x70\x1c"
4622                              "\x03\x4a\xba\x8a\x87\x49\xfe\xdc"
4623                              "\x75\x29\x62\x83\xae\x3f\x17\xab"
4624                              "\xfd\x10\x4d\x8e\x17\x1c\x1f\xca",
4625         }
4626 };
4627 
4628 /*
4629  * SHA512 test vectors from from NIST and kerneli
4630  */
4631 static const struct hash_testvec sha512_tv_template[] = {
4632         {
4633                 .plaintext = "",
4634                 .psize  = 0,
4635                 .digest = "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd"
4636                           "\xf1\x54\x28\x50\xd6\x6d\x80\x07"
4637                           "\xd6\x20\xe4\x05\x0b\x57\x15\xdc"
4638                           "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
4639                           "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0"
4640                           "\xff\x83\x18\xd2\x87\x7e\xec\x2f"
4641                           "\x63\xb9\x31\xbd\x47\x41\x7a\x81"
4642                           "\xa5\x38\x32\x7a\xf9\x27\xda\x3e",
4643         }, {
4644                 .plaintext = "abc",
4645                 .psize  = 3,
4646                 .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
4647                           "\xcc\x41\x73\x49\xae\x20\x41\x31"
4648                           "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
4649                           "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
4650                           "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
4651                           "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
4652                           "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
4653                           "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
4654         }, {
4655                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4656                 .psize  = 56,
4657                 .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
4658                           "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
4659                           "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
4660                           "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
4661                           "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
4662                           "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
4663                           "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
4664                           "\x54\xec\x63\x12\x38\xca\x34\x45",
4665         }, {
4666                 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
4667                            "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
4668                 .psize  = 112,
4669                 .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
4670                           "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
4671                           "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
4672                           "\x72\x99\xae\xad\xb6\x88\x90\x18"
4673                           "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
4674                           "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
4675                           "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
4676                           "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
4677         }, {
4678                 .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
4679                            "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
4680                 .psize  = 104,
4681                 .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
4682                           "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
4683                           "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
4684                           "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
4685                           "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
4686                           "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
4687                           "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
4688                           "\xed\xb4\x19\x87\x23\x28\x50\xc9",
4689         }, {
4690                 .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4691                              "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4692                              "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4693                              "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4694                              "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4695                              "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4696                              "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4697                              "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4698                              "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4699                              "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4700                              "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4701                              "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4702                              "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4703                              "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4704                              "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4705                              "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4706                              "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4707                              "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4708                              "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4709                              "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4710                              "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4711                              "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4712                              "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4713                              "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4714                              "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4715                              "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4716                              "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4717                              "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4718                              "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4719                              "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4720                              "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4721                              "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4722                              "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4723                              "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4724                              "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4725                              "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4726                              "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4727                              "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4728                              "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4729                              "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4730                              "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4731                              "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4732                              "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4733                              "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4734                              "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4735                              "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4736                              "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4737                              "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4738                              "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4739                              "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4740                              "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4741                              "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4742                              "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4743                              "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4744                              "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4745                              "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4746                              "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4747                              "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4748                              "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4749                              "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4750                              "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4751                              "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4752                              "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4753                              "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4754                              "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4755                              "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4756                              "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4757                              "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4758                              "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4759                              "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4760                              "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4761                              "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4762                              "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4763                              "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4764                              "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4765                              "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4766                              "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4767                              "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4768                              "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4769                              "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4770                              "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4771                              "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4772                              "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4773                              "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4774                              "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4775                              "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4776                              "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4777                              "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4778                              "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4779                              "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4780                              "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4781                              "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4782                              "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4783                              "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4784                              "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4785                              "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4786                              "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4787                              "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4788                              "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4789                              "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4790                              "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4791                              "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4792                              "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4793                              "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4794                              "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4795                              "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4796                              "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4797                              "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4798                              "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4799                              "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4800                              "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4801                              "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4802                              "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4803                              "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4804                              "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4805                              "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4806                              "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4807                              "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4808                              "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4809                              "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4810                              "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4811                              "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4812                              "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4813                              "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4814                              "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4815                              "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4816                              "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4817                              "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4818                 .psize     = 1023,
4819                 .digest    = "\x76\xc9\xd4\x91\x7a\x5f\x0f\xaa"
4820                              "\x13\x39\xf3\x01\x7a\xfa\xe5\x41"
4821                              "\x5f\x0b\xf8\xeb\x32\xfc\xbf\xb0"
4822                              "\xfa\x8c\xcd\x17\x83\xe2\xfa\xeb"
4823                              "\x1c\x19\xde\xe2\x75\xdc\x34\x64"
4824                              "\x5f\x35\x9c\x61\x2f\x10\xf9\xec"
4825                              "\x59\xca\x9d\xcc\x25\x0c\x43\xba"
4826                              "\x85\xa8\xf8\xfe\xb5\x24\xb2\xee",
4827         }
4828 };
4829 
4830 
4831 /*
4832  * WHIRLPOOL test vectors from Whirlpool package
4833  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
4834  * submission
4835  */
4836 static const struct hash_testvec wp512_tv_template[] = {
4837         {
4838                 .plaintext = "",
4839                 .psize  = 0,
4840                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
4841                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
4842                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
4843                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
4844                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
4845                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
4846                           "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
4847                           "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
4848 
4849 
4850         }, {
4851                 .plaintext = "a",
4852                 .psize  = 1,
4853                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
4854                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
4855                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
4856                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
4857                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
4858                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
4859                           "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
4860                           "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
4861         }, {
4862                 .plaintext = "abc",
4863                 .psize  = 3,
4864                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
4865                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
4866                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
4867                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
4868                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
4869                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
4870                           "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
4871                           "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
4872         }, {
4873                 .plaintext = "message digest",
4874                 .psize  = 14,
4875                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
4876                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
4877                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
4878                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
4879                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
4880                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
4881                           "\x92\xED\x92\x00\x52\x83\x8F\x33"
4882                           "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
4883         }, {
4884                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
4885                 .psize  = 26,
4886                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
4887                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
4888                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
4889                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
4890                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
4891                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
4892                           "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
4893                           "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
4894         }, {
4895                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
4896                            "abcdefghijklmnopqrstuvwxyz0123456789",
4897                 .psize  = 62,
4898                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
4899                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
4900                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
4901                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
4902                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
4903                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
4904                           "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
4905                           "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
4906         }, {
4907                 .plaintext = "1234567890123456789012345678901234567890"
4908                            "1234567890123456789012345678901234567890",
4909                 .psize  = 80,
4910                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
4911                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
4912                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
4913                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
4914                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
4915                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
4916                           "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
4917                           "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
4918         }, {
4919                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
4920                 .psize  = 32,
4921                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
4922                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
4923                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
4924                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
4925                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
4926                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
4927                           "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
4928                           "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
4929         },
4930 };
4931 
4932 static const struct hash_testvec wp384_tv_template[] = {
4933         {
4934                 .plaintext = "",
4935                 .psize  = 0,
4936                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
4937                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
4938                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
4939                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
4940                           "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
4941                           "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
4942 
4943 
4944         }, {
4945                 .plaintext = "a",
4946                 .psize  = 1,
4947                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
4948                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
4949                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
4950                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
4951                           "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
4952                           "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
4953         }, {
4954                 .plaintext = "abc",
4955                 .psize  = 3,
4956                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
4957                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
4958                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
4959                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
4960                           "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
4961                           "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
4962         }, {
4963                 .plaintext = "message digest",
4964                 .psize  = 14,
4965                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
4966                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
4967                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
4968                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
4969                           "\x84\x21\x55\x76\x59\xEF\x55\xC1"
4970                           "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
4971         }, {
4972                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
4973                 .psize  = 26,
4974                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
4975                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
4976                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
4977                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
4978                           "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
4979                           "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
4980         }, {
4981                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
4982                            "abcdefghijklmnopqrstuvwxyz0123456789",
4983                 .psize  = 62,
4984                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
4985                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
4986                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
4987                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
4988                           "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
4989                           "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
4990         }, {
4991                 .plaintext = "1234567890123456789012345678901234567890"
4992                            "1234567890123456789012345678901234567890",
4993                 .psize  = 80,
4994                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
4995                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
4996                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
4997                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
4998                           "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
4999                           "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
5000         }, {
5001                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
5002                 .psize  = 32,
5003                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
5004                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
5005                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
5006                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
5007                           "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
5008                           "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
5009         },
5010 };
5011 
5012 static const struct hash_testvec wp256_tv_template[] = {
5013         {
5014                 .plaintext = "",
5015                 .psize  = 0,
5016                 .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
5017                           "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
5018                           "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
5019                           "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
5020 
5021 
5022         }, {
5023                 .plaintext = "a",
5024                 .psize  = 1,
5025                 .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
5026                           "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
5027                           "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
5028                           "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
5029         }, {
5030                 .plaintext = "abc",
5031                 .psize  = 3,
5032                 .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
5033                           "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
5034                           "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
5035                           "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
5036         }, {
5037                 .plaintext = "message digest",
5038                 .psize  = 14,
5039                 .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
5040                           "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
5041                           "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
5042                           "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
5043         }, {
5044                 .plaintext = "abcdefghijklmnopqrstuvwxyz",
5045                 .psize  = 26,
5046                 .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
5047                           "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
5048                           "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
5049                           "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
5050         }, {
5051                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5052                            "abcdefghijklmnopqrstuvwxyz0123456789",
5053                 .psize  = 62,
5054                 .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
5055                           "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
5056                           "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
5057                           "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
5058         }, {
5059                 .plaintext = "1234567890123456789012345678901234567890"
5060                            "1234567890123456789012345678901234567890",
5061                 .psize  = 80,
5062                 .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
5063                           "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
5064                           "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
5065                           "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
5066         }, {
5067                 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
5068                 .psize  = 32,
5069                 .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
5070                           "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
5071                           "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
5072                           "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
5073         },
5074 };
5075 
5076 /*
5077  * TIGER test vectors from Tiger website
5078  */
5079 static const struct hash_testvec tgr192_tv_template[] = {
5080         {
5081                 .plaintext = "",
5082                 .psize  = 0,
5083                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
5084                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
5085                           "\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
5086         }, {
5087                 .plaintext = "abc",
5088                 .psize  = 3,
5089                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
5090                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
5091                           "\x93\x5f\x7b\x95\x1c\x13\x29\x51",
5092         }, {
5093                 .plaintext = "Tiger",
5094                 .psize  = 5,
5095                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
5096                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
5097                           "\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
5098         }, {
5099                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
5100                 .psize  = 64,
5101                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
5102                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
5103                           "\xb5\x86\x44\x50\x34\xa5\xa3\x86",
5104         }, {
5105                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
5106                 .psize  = 64,
5107                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
5108                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
5109                           "\x57\x89\x65\x65\x97\x5f\x91\x97",
5110         }, {
5111                 .plaintext = "Tiger - A Fast New Hash Function, "
5112                            "by Ross Anderson and Eli Biham, "
5113                            "proceedings of Fast Software Encryption 3, "
5114                            "Cambridge, 1996.",
5115                 .psize  = 125,
5116                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
5117                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
5118                           "\xdd\x68\x15\x1d\x50\x39\x74\xfc",
5119         },
5120 };
5121 
5122 static const struct hash_testvec tgr160_tv_template[] = {
5123         {
5124                 .plaintext = "",
5125                 .psize  = 0,
5126                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
5127                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
5128                           "\xf3\x73\xde\x2d",
5129         }, {
5130                 .plaintext = "abc",
5131                 .psize  = 3,
5132                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
5133                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
5134                           "\x93\x5f\x7b\x95",
5135         }, {
5136                 .plaintext = "Tiger",
5137                 .psize  = 5,
5138                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
5139                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
5140                           "\x37\x79\x0c\x11",
5141         }, {
5142                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
5143                 .psize  = 64,
5144                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
5145                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
5146                           "\xb5\x86\x44\x50",
5147         }, {
5148                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
5149                 .psize  = 64,
5150                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
5151                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
5152                           "\x57\x89\x65\x65",
5153         }, {
5154                 .plaintext = "Tiger - A Fast New Hash Function, "
5155                            "by Ross Anderson and Eli Biham, "
5156                            "proceedings of Fast Software Encryption 3, "
5157                            "Cambridge, 1996.",
5158                 .psize  = 125,
5159                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
5160                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
5161                           "\xdd\x68\x15\x1d",
5162         },
5163 };
5164 
5165 static const struct hash_testvec tgr128_tv_template[] = {
5166         {
5167                 .plaintext = "",
5168                 .psize  = 0,
5169                 .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
5170                           "\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
5171         }, {
5172                 .plaintext = "abc",
5173                 .psize  = 3,
5174                 .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
5175                           "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
5176         }, {
5177                 .plaintext = "Tiger",
5178                 .psize  = 5,
5179                 .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
5180                           "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
5181         }, {
5182                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
5183                 .psize  = 64,
5184                 .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
5185                           "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
5186         }, {
5187                 .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
5188                 .psize  = 64,
5189                 .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
5190                           "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
5191         }, {
5192                 .plaintext = "Tiger - A Fast New Hash Function, "
5193                            "by Ross Anderson and Eli Biham, "
5194                            "proceedings of Fast Software Encryption 3, "
5195                            "Cambridge, 1996.",
5196                 .psize  = 125,
5197                 .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
5198                           "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
5199         },
5200 };
5201 
5202 static const struct hash_testvec ghash_tv_template[] =
5203 {
5204         {
5205                 .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03"
5206                           "\xff\xca\xff\x95\xf8\x30\xf0\x61",
5207                 .ksize  = 16,
5208                 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
5209                              "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
5210                 .psize  = 16,
5211                 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
5212                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
5213         }, {
5214                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5215                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5216                 .ksize  = 16,
5217                 .plaintext = "what do ya want for nothing?",
5218                 .psize  = 28,
5219                 .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce"
5220                           "\x0d\x61\x06\x27\x66\x51\xd5\xe2",
5221         }, {
5222                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5223                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5224                 .ksize  = 16,
5225                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5226                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5227                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5228                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5229                 .psize  = 50,
5230                 .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96"
5231                           "\xe1\x96\xe1\x96\xe1\x96\xe1\x96",
5232         }, {
5233                 .key    = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
5234                           "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
5235                 .ksize  = 16,
5236                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5237                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5238                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5239                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5240                 .psize  = 50,
5241                 .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2"
5242                           "\x49\xed\x6e\x32\x7a\xa9\xbe\x08",
5243         }, {
5244                 .key    = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
5245                           "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
5246                 .ksize  = 16,
5247                 .plaintext = "Test With Truncation",
5248                 .psize  = 20,
5249                 .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28"
5250                           "\x23\xf7\x93\xf7\x19\xf5\x96\xd9",
5251         }, {
5252                 .key    = "\x0a\x1b\x2c\x3d\x4e\x5f\x64\x71"
5253                         "\x82\x93\xa4\xb5\xc6\xd7\xe8\xf9",
5254                 .ksize  = 16,
5255                 .plaintext = "\x56\x6f\x72\x20\x6c\x61\x75\x74"
5256                         "\x65\x72\x20\x4c\x61\x75\x73\x63"
5257                         "\x68\x65\x6e\x20\x75\x6e\x64\x20"
5258                         "\x53\x74\x61\x75\x6e\x65\x6e\x20"
5259                         "\x73\x65\x69\x20\x73\x74\x69\x6c"
5260                         "\x6c\x2c\x0a\x64\x75\x20\x6d\x65"
5261                         "\x69\x6e\x20\x74\x69\x65\x66\x74"
5262                         "\x69\x65\x66\x65\x73\x20\x4c\x65"
5263                         "\x62\x65\x6e\x3b\x0a\x64\x61\x73"
5264                         "\x73\x20\x64\x75\x20\x77\x65\x69"
5265                         "\xc3\x9f\x74\x20\x77\x61\x73\x20"
5266                         "\x64\x65\x72\x20\x57\x69\x6e\x64"
5267                         "\x20\x64\x69\x72\x20\x77\x69\x6c"
5268                         "\x6c\x2c\x0a\x65\x68\x20\x6e\x6f"
5269                         "\x63\x68\x20\x64\x69\x65\x20\x42"
5270                         "\x69\x72\x6b\x65\x6e\x20\x62\x65"
5271                         "\x62\x65\x6e\x2e\x0a\x0a\x55\x6e"
5272                         "\x64\x20\x77\x65\x6e\x6e\x20\x64"
5273                         "\x69\x72\x20\x65\x69\x6e\x6d\x61"
5274                         "\x6c\x20\x64\x61\x73\x20\x53\x63"
5275                         "\x68\x77\x65\x69\x67\x65\x6e\x20"
5276                         "\x73\x70\x72\x61\x63\x68\x2c\x0a"
5277                         "\x6c\x61\x73\x73\x20\x64\x65\x69"
5278                         "\x6e\x65\x20\x53\x69\x6e\x6e\x65"
5279                         "\x20\x62\x65\x73\x69\x65\x67\x65"
5280                         "\x6e\x2e\x0a\x4a\x65\x64\x65\x6d"
5281                         "\x20\x48\x61\x75\x63\x68\x65\x20"
5282                         "\x67\x69\x62\x74\x20\x64\x69\x63"
5283                         "\x68\x2c\x20\x67\x69\x62\x20\x6e"
5284                         "\x61\x63\x68\x2c\x0a\x65\x72\x20"
5285                         "\x77\x69\x72\x64\x20\x64\x69\x63"
5286                         "\x68\x20\x6c\x69\x65\x62\x65\x6e"
5287                         "\x20\x75\x6e\x64\x20\x77\x69\x65"
5288                         "\x67\x65\x6e\x2e\x0a\x0a\x55\x6e"
5289                         "\x64\x20\x64\x61\x6e\x6e\x20\x6d"
5290                         "\x65\x69\x6e\x65\x20\x53\x65\x65"
5291                         "\x6c\x65\x20\x73\x65\x69\x74\x20"
5292                         "\x77\x65\x69\x74\x2c\x20\x73\x65"
5293                         "\x69\x20\x77\x65\x69\x74\x2c\x0a"
5294                         "\x64\x61\x73\x73\x20\x64\x69\x72"
5295                         "\x20\x64\x61\x73\x20\x4c\x65\x62"
5296                         "\x65\x6e\x20\x67\x65\x6c\x69\x6e"
5297                         "\x67\x65\x2c\x0a\x62\x72\x65\x69"
5298                         "\x74\x65\x20\x64\x69\x63\x68\x20"
5299                         "\x77\x69\x65\x20\x65\x69\x6e\x20"
5300                         "\x46\x65\x69\x65\x72\x6b\x6c\x65"
5301                         "\x69\x64\x0a\xc3\xbc\x62\x65\x72"
5302                         "\x20\x64\x69\x65\x20\x73\x69\x6e"
5303                         "\x6e\x65\x6e\x64\x65\x6e\x20\x44"
5304                         "\x69\x6e\x67\x65\x2e\x2e\x2e\x0a",
5305                 .psize  = 400,
5306                 .digest = "\xad\xb1\xc1\xe9\x56\x70\x31\x1d"
5307                         "\xbb\x5b\xdf\x5e\x70\x72\x1a\x57",
5308         },
5309 };
5310 
5311 /*
5312  * HMAC-MD5 test vectors from RFC2202
5313  * (These need to be fixed to not use strlen).
5314  */
5315 static const struct hash_testvec hmac_md5_tv_template[] =
5316 {
5317         {
5318                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5319                 .ksize  = 16,
5320                 .plaintext = "Hi There",
5321                 .psize  = 8,
5322                 .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
5323                           "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
5324         }, {
5325                 .key    = "Jefe",
5326                 .ksize  = 4,
5327                 .plaintext = "what do ya want for nothing?",
5328                 .psize  = 28,
5329                 .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
5330                           "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
5331         }, {
5332                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5333                 .ksize  = 16,
5334                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5335                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5336                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5337                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5338                 .psize  = 50,
5339                 .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
5340                           "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
5341         }, {
5342                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5343                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5344                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5345                 .ksize  = 25,
5346                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5347                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5348                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5349                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5350                 .psize  = 50,
5351                 .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
5352                           "\x3a\x75\x16\x47\x46\xff\xaa\x79",
5353         }, {
5354                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5355                 .ksize  = 16,
5356                 .plaintext = "Test With Truncation",
5357                 .psize  = 20,
5358                 .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
5359                           "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
5360         }, {
5361                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5362                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5363                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5364                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5365                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5366                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5367                         "\xaa\xaa",
5368                 .ksize  = 80,
5369                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5370                 .psize  = 54,
5371                 .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
5372                           "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
5373         }, {
5374                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5375                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5376                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5377                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5378                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5379                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5380                         "\xaa\xaa",
5381                 .ksize  = 80,
5382                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5383                            "Block-Size Data",
5384                 .psize  = 73,
5385                 .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
5386                           "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
5387         },
5388 };
5389 
5390 /*
5391  * HMAC-RIPEMD128 test vectors from RFC2286
5392  */
5393 static const struct hash_testvec hmac_rmd128_tv_template[] = {
5394         {
5395                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5396                 .ksize  = 16,
5397                 .plaintext = "Hi There",
5398                 .psize  = 8,
5399                 .digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
5400                           "\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
5401         }, {
5402                 .key    = "Jefe",
5403                 .ksize  = 4,
5404                 .plaintext = "what do ya want for nothing?",
5405                 .psize  = 28,
5406                 .digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
5407                           "\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
5408         }, {
5409                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5410                 .ksize  = 16,
5411                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5412                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5413                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5414                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5415                 .psize  = 50,
5416                 .digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
5417                           "\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
5418         }, {
5419                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5420                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5421                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5422                 .ksize  = 25,
5423                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5424                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5425                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5426                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5427                 .psize  = 50,
5428                 .digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
5429                           "\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
5430         }, {
5431                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5432                 .ksize  = 16,
5433                 .plaintext = "Test With Truncation",
5434                 .psize  = 20,
5435                 .digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
5436                           "\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
5437         }, {
5438                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5439                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5440                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5441                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5442                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5443                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5444                         "\xaa\xaa",
5445                 .ksize  = 80,
5446                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5447                 .psize  = 54,
5448                 .digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
5449                           "\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
5450         }, {
5451                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5452                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5453                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5454                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5455                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5456                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5457                         "\xaa\xaa",
5458                 .ksize  = 80,
5459                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5460                            "Block-Size Data",
5461                 .psize  = 73,
5462                 .digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
5463                           "\x06\x90\xc2\x37\x63\x5f\x30\xc5",
5464         },
5465 };
5466 
5467 /*
5468  * HMAC-RIPEMD160 test vectors from RFC2286
5469  */
5470 static const struct hash_testvec hmac_rmd160_tv_template[] = {
5471         {
5472                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5473                 .ksize  = 20,
5474                 .plaintext = "Hi There",
5475                 .psize  = 8,
5476                 .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
5477                           "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
5478         }, {
5479                 .key    = "Jefe",
5480                 .ksize  = 4,
5481                 .plaintext = "what do ya want for nothing?",
5482                 .psize  = 28,
5483                 .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
5484                           "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
5485         }, {
5486                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5487                 .ksize  = 20,
5488                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5489                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5490                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5491                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5492                 .psize  = 50,
5493                 .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
5494                           "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
5495         }, {
5496                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5497                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5498                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5499                 .ksize  = 25,
5500                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5501                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5502                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5503                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5504                 .psize  = 50,
5505                 .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
5506                           "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
5507         }, {
5508                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5509                 .ksize  = 20,
5510                 .plaintext = "Test With Truncation",
5511                 .psize  = 20,
5512                 .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
5513                           "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
5514         }, {
5515                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5516                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5517                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5518                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5519                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5520                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5521                         "\xaa\xaa",
5522                 .ksize  = 80,
5523                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5524                 .psize  = 54,
5525                 .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
5526                           "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
5527         }, {
5528                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5529                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5530                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5531                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5532                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5533                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5534                         "\xaa\xaa",
5535                 .ksize  = 80,
5536                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5537                            "Block-Size Data",
5538                 .psize  = 73,
5539                 .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
5540                           "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
5541         },
5542 };
5543 
5544 /*
5545  * HMAC-SHA1 test vectors from RFC2202
5546  */
5547 static const struct hash_testvec hmac_sha1_tv_template[] = {
5548         {
5549                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5550                 .ksize  = 20,
5551                 .plaintext = "Hi There",
5552                 .psize  = 8,
5553                 .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
5554                           "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
5555                           "\x46\xbe",
5556         }, {
5557                 .key    = "Jefe",
5558                 .ksize  = 4,
5559                 .plaintext = "what do ya want for nothing?",
5560                 .psize  = 28,
5561                 .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
5562                           "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
5563         }, {
5564                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5565                 .ksize  = 20,
5566                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5567                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5568                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5569                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5570                 .psize  = 50,
5571                 .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
5572                           "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
5573         }, {
5574                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5575                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5576                           "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5577                 .ksize  = 25,
5578                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5579                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5580                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5581                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5582                 .psize  = 50,
5583                 .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
5584                           "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
5585         }, {
5586                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5587                 .ksize  = 20,
5588                 .plaintext = "Test With Truncation",
5589                 .psize  = 20,
5590                 .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
5591                           "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
5592         }, {
5593                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5594                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5595                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5596                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5597                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5598                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5599                         "\xaa\xaa",
5600                 .ksize  = 80,
5601                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5602                 .psize  = 54,
5603                 .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
5604                           "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
5605         }, {
5606                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5607                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5608                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5609                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5610                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5611                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5612                         "\xaa\xaa",
5613                 .ksize  = 80,
5614                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5615                            "Block-Size Data",
5616                 .psize  = 73,
5617                 .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
5618                           "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
5619         },
5620 };
5621 
5622 
5623 /*
5624  * SHA224 HMAC test vectors from RFC4231
5625  */
5626 static const struct hash_testvec hmac_sha224_tv_template[] = {
5627         {
5628                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5629                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5630                         "\x0b\x0b\x0b\x0b",
5631                 .ksize  = 20,
5632                 /*  ("Hi There") */
5633                 .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
5634                 .psize  = 8,
5635                 .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
5636                         "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
5637                         "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
5638                         "\x53\x68\x4b\x22",
5639         }, {
5640                 .key    = "Jefe",
5641                 .ksize  = 4,
5642                 /* ("what do ya want for nothing?") */
5643                 .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
5644                         "\x79\x61\x20\x77\x61\x6e\x74\x20"
5645                         "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
5646                         "\x69\x6e\x67\x3f",
5647                 .psize  = 28,
5648                 .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
5649                         "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
5650                         "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
5651                         "\x8f\xd0\x5e\x44",
5652         }, {
5653                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5654                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5655                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5656                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5657                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5658                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5659                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5660                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5661                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5662                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5663                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5664                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5665                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5666                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5667                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5668                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5669                         "\xaa\xaa\xaa",
5670                 .ksize  = 131,
5671                 /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
5672                 .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
5673                         "\x6e\x67\x20\x4c\x61\x72\x67\x65"
5674                         "\x72\x20\x54\x68\x61\x6e\x20\x42"
5675                         "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
5676                         "\x65\x20\x4b\x65\x79\x20\x2d\x20"
5677                         "\x48\x61\x73\x68\x20\x4b\x65\x79"
5678                         "\x20\x46\x69\x72\x73\x74",
5679                 .psize  = 54,
5680                 .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
5681                         "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
5682                         "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
5683                         "\x3f\xa6\x87\x0e",
5684         }, {
5685                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5686                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5687                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5688                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5689                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5690                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5691                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5692                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5693                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5694                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5695                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5696                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5697                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5698                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5699                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5700                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5701                         "\xaa\xaa\xaa",
5702                 .ksize  = 131,
5703                 /* ("This is a test using a larger than block-size key and a")
5704                 (" larger than block-size data. The key needs to be")
5705                         (" hashed before being used by the HMAC algorithm.") */
5706                 .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
5707                         "\x61\x20\x74\x65\x73\x74\x20\x75"
5708                         "\x73\x69\x6e\x67\x20\x61\x20\x6c"
5709                         "\x61\x72\x67\x65\x72\x20\x74\x68"
5710                         "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
5711                         "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
5712                         "\x79\x20\x61\x6e\x64\x20\x61\x20"
5713                         "\x6c\x61\x72\x67\x65\x72\x20\x74"
5714                         "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
5715                         "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
5716                         "\x61\x74\x61\x2e\x20\x54\x68\x65"
5717                         "\x20\x6b\x65\x79\x20\x6e\x65\x65"
5718                         "\x64\x73\x20\x74\x6f\x20\x62\x65"
5719                         "\x20\x68\x61\x73\x68\x65\x64\x20"
5720                         "\x62\x65\x66\x6f\x72\x65\x20\x62"
5721                         "\x65\x69\x6e\x67\x20\x75\x73\x65"
5722                         "\x64\x20\x62\x79\x20\x74\x68\x65"
5723                         "\x20\x48\x4d\x41\x43\x20\x61\x6c"
5724                         "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
5725                 .psize  = 152,
5726                 .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
5727                         "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
5728                         "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
5729                         "\xf6\xf5\x65\xd1",
5730         },
5731 };
5732 
5733 /*
5734  * HMAC-SHA256 test vectors from
5735  * draft-ietf-ipsec-ciph-sha-256-01.txt
5736  */
5737 static const struct hash_testvec hmac_sha256_tv_template[] = {
5738         {
5739                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5740                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5741                           "\x11\x12\x13\x14\x15\x16\x17\x18"
5742                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5743                 .ksize  = 32,
5744                 .plaintext = "abc",
5745                 .psize  = 3,
5746                 .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
5747                           "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
5748                           "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
5749                           "\x92\x75\x90\x21\xcf\xab\x81\x81",
5750         }, {
5751                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5752                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5753                           "\x11\x12\x13\x14\x15\x16\x17\x18"
5754                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5755                 .ksize  = 32,
5756                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
5757                 .psize  = 56,
5758                 .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
5759                           "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
5760                           "\xe6\x98\xe3\x61\x19\x42\x11\x49"
5761                           "\xea\x8c\x71\x24\x56\x69\x7d\x30",
5762         }, {
5763                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5764                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5765                           "\x11\x12\x13\x14\x15\x16\x17\x18"
5766                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5767                 .ksize  = 32,
5768                 .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
5769                            "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
5770                 .psize  = 112,
5771                 .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
5772                           "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
5773                           "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
5774                           "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
5775         }, {
5776                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5777                         "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5778                         "\x0b\x0b\x0b\x0b\x0b\x0b",
5779                 .ksize  = 32,
5780                 .plaintext = "Hi There",
5781                 .psize  = 8,
5782                 .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
5783                           "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
5784                           "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
5785                           "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
5786         }, {
5787                 .key    = "Jefe",
5788                 .ksize  = 4,
5789                 .plaintext = "what do ya want for nothing?",
5790                 .psize  = 28,
5791                 .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
5792                           "\x6a\x04\x24\x26\x08\x95\x75\xc7"
5793                           "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
5794                           "\x9d\xec\x58\xb9\x64\xec\x38\x43",
5795         }, {
5796                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5797                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5798                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5799                 .ksize  = 32,
5800                 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5801                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5802                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5803                         "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5804                 .psize  = 50,
5805                 .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
5806                           "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
5807                           "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
5808                           "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
5809         }, {
5810                 .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5811                           "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5812                           "\x11\x12\x13\x14\x15\x16\x17\x18"
5813                           "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
5814                           "\x21\x22\x23\x24\x25",
5815                 .ksize  = 37,
5816                 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5817                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5818                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5819                         "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5820                 .psize  = 50,
5821                 .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
5822                           "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
5823                           "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
5824                           "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
5825         }, {
5826                 .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
5827                         "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
5828                         "\x0c\x0c\x0c\x0c\x0c\x0c",
5829                 .ksize  = 32,
5830                 .plaintext = "Test With Truncation",
5831                 .psize  = 20,
5832                 .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
5833                           "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
5834                           "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
5835                           "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
5836         }, {
5837                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5838                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5839                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5840                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5841                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5842                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5843                         "\xaa\xaa",
5844                 .ksize  = 80,
5845                 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5846                 .psize  = 54,
5847                 .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
5848                           "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
5849                           "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
5850                           "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
5851         }, {
5852                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5853                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5854                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5855                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5856                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5857                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5858                         "\xaa\xaa",
5859                 .ksize  = 80,
5860                 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
5861                            "One Block-Size Data",
5862                 .psize  = 73,
5863                 .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
5864                           "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
5865                           "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
5866                           "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
5867         },
5868 };
5869 
5870 static const struct hash_testvec aes_cmac128_tv_template[] = {
5871         { /* From NIST Special Publication 800-38B, AES-128 */
5872                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5873                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5874                 .plaintext      = zeroed_string,
5875                 .digest         = "\xbb\x1d\x69\x29\xe9\x59\x37\x28"
5876                                   "\x7f\xa3\x7d\x12\x9b\x75\x67\x46",
5877                 .psize          = 0,
5878                 .ksize          = 16,
5879         }, {
5880                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5881                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5882                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5883                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
5884                 .digest         = "\x07\x0a\x16\xb4\x6b\x4d\x41\x44"
5885                                   "\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c",
5886                 .psize          = 16,
5887                 .ksize          = 16,
5888         }, {
5889                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5890                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5891                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5892                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5893                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5894                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5895                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11",
5896                 .digest         = "\xdf\xa6\x67\x47\xde\x9a\xe6\x30"
5897                                   "\x30\xca\x32\x61\x14\x97\xc8\x27",
5898                 .psize          = 40,
5899                 .ksize          = 16,
5900         }, {
5901                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5902                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5903                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5904                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5905                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5906                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5907                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
5908                                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
5909                                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
5910                                   "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
5911                 .digest         = "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92"
5912                                   "\xfc\x49\x74\x17\x79\x36\x3c\xfe",
5913                 .psize          = 64,
5914                 .ksize          = 16,
5915         }, { /* From NIST Special Publication 800-38B, AES-256 */
5916                 .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
5917                                   "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
5918                                   "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
5919                                   "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
5920                 .plaintext      = zeroed_string,
5921                 .digest         = "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e"
5922                                   "\xfc\x6b\x55\x1f\x46\x67\xd9\x83",
5923                 .psize          = 0,
5924                 .ksize          = 32,
5925         }, {
5926                 .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
5927                                   "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
5928                                   "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
5929                                   "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
5930                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5931                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5932                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5933                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5934                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
5935                                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
5936                                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
5937                                   "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
5938                 .digest         = "\xe1\x99\x21\x90\x54\x9f\x6e\xd5"
5939                                   "\x69\x6a\x2c\x05\x6c\x31\x54\x10",
5940                 .psize          = 64,
5941                 .ksize          = 32,
5942         }
5943 };
5944 
5945 static const struct hash_testvec aes_cbcmac_tv_template[] = {
5946         {
5947                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5948                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5949                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5950                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
5951                 .digest         = "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60"
5952                                   "\xa8\x9e\xca\xf3\x24\x66\xef\x97",
5953                 .psize          = 16,
5954                 .ksize          = 16,
5955         }, {
5956                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5957                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5958                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5959                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5960                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5961                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5962                                   "\x30",
5963                 .digest         = "\x9d\x0d\xd0\x63\xfb\xcb\x24\x43"
5964                                   "\xf8\xf2\x76\x03\xac\x39\xb0\x9d",
5965                 .psize          = 33,
5966                 .ksize          = 16,
5967         }, {
5968                 .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
5969                                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
5970                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5971                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5972                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5973                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5974                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
5975                                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
5976                                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
5977                                   "\xad\x2b\x41\x7b\xe6\x6c\x37",
5978                 .digest         = "\xc0\x71\x73\xb8\xa0\x2c\x11\x7c"
5979                                   "\xaf\xdc\xb2\xf8\x89\x32\xa3\x3a",
5980                 .psize          = 63,
5981                 .ksize          = 16,
5982         }, {
5983                 .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
5984                                   "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
5985                                   "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
5986                                   "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
5987                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
5988                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
5989                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
5990                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
5991                                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
5992                                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
5993                                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
5994                                   "\xad\x2b\x41\x7b\xe6\x6c\x37\x10"
5995                                   "\x1c",
5996                 .digest         = "\x6a\x4e\xdb\x21\x47\x51\xdf\x4f"
5997                                   "\xa8\x4d\x4c\x10\x3b\x72\x7d\xd6",
5998                 .psize          = 65,
5999                 .ksize          = 32,
6000         }
6001 };
6002 
6003 static const struct hash_testvec des3_ede_cmac64_tv_template[] = {
6004 /*
6005  * From NIST Special Publication 800-38B, Three Key TDEA
6006  * Corrected test vectors from:
6007  *  http://csrc.nist.gov/publications/nistpubs/800-38B/Updated_CMAC_Examples.pdf
6008  */
6009         {
6010                 .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
6011                                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
6012                                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
6013                 .plaintext      = zeroed_string,
6014                 .digest         = "\xb7\xa6\x88\xe1\x22\xff\xaf\x95",
6015                 .psize          = 0,
6016                 .ksize          = 24,
6017         }, {
6018                 .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
6019                                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
6020                                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
6021                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96",
6022                 .digest         = "\x8e\x8f\x29\x31\x36\x28\x37\x97",
6023                 .psize          = 8,
6024                 .ksize          = 24,
6025         }, {
6026                 .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
6027                                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
6028                                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
6029                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6030                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6031                                   "\xae\x2d\x8a\x57",
6032                 .digest         = "\x74\x3d\xdb\xe0\xce\x2d\xc2\xed",
6033                 .psize          = 20,
6034                 .ksize          = 24,
6035         }, {
6036                 .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
6037                                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
6038                                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
6039                 .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6040                                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6041                                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6042                                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51",
6043                 .digest         = "\x33\xe6\xb1\x09\x24\x00\xea\xe5",
6044                 .psize          = 32,
6045                 .ksize          = 24,
6046         }
6047 };
6048 
6049 static const struct hash_testvec aes_xcbc128_tv_template[] = {
6050         {
6051                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6052                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6053                 .plaintext = zeroed_string,
6054                 .digest = "\x75\xf0\x25\x1d\x52\x8a\xc0\x1c"
6055                           "\x45\x73\xdf\xd5\x84\xd7\x9f\x29",
6056                 .psize  = 0,
6057                 .ksize  = 16,
6058         }, {
6059                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6060                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6061                 .plaintext = "\x00\x01\x02",
6062                 .digest = "\x5b\x37\x65\x80\xae\x2f\x19\xaf"
6063                           "\xe7\x21\x9c\xee\xf1\x72\x75\x6f",
6064                 .psize  = 3,
6065                 .ksize  = 16,
6066         } , {
6067                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6068                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6069                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
6070                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6071                 .digest = "\xd2\xa2\x46\xfa\x34\x9b\x68\xa7"
6072                           "\x99\x98\xa4\x39\x4f\xf7\xa2\x63",
6073                 .psize  = 16,
6074                 .ksize  = 16,
6075         }, {
6076                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6077                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6078                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
6079                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6080                              "\x10\x11\x12\x13",
6081                 .digest = "\x47\xf5\x1b\x45\x64\x96\x62\x15"
6082                           "\xb8\x98\x5c\x63\x05\x5e\xd3\x08",
6083                 .psize  = 20,
6084                 .ksize  = 16,
6085         }, {
6086                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6087                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6088                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
6089                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6090                              "\x10\x11\x12\x13\x14\x15\x16\x17"
6091                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
6092                 .digest = "\xf5\x4f\x0e\xc8\xd2\xb9\xf3\xd3"
6093                           "\x68\x07\x73\x4b\xd5\x28\x3f\xd4",
6094                 .psize  = 32,
6095                 .ksize  = 16,
6096         }, {
6097                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6098                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6099                 .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
6100                              "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
6101                              "\x10\x11\x12\x13\x14\x15\x16\x17"
6102                              "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
6103                              "\x20\x21",
6104                 .digest = "\xbe\xcb\xb3\xbc\xcd\xb5\x18\xa3"
6105                           "\x06\x77\xd5\x48\x1f\xb6\xb4\xd8",
6106                 .psize  = 34,
6107                 .ksize  = 16,
6108         }
6109 };
6110 
6111 static const char vmac64_string1[144] = {
6112         '\0',     '\0',   '\0',   '\0',   '\0',   '\0',   '\0',   '\0',
6113         '\0',     '\0',   '\0',   '\0',   '\0',   '\0',   '\0',   '\0',
6114         '\x01', '\x01', '\x01', '\x01', '\x02', '\x03', '\x02', '\x02',
6115         '\x02', '\x04', '\x01', '\x07', '\x04', '\x01', '\x04', '\x03',
6116 };
6117 
6118 static const char vmac64_string2[144] = {
6119         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6120         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6121          'a',  'b',  'c',
6122 };
6123 
6124 static const char vmac64_string3[144] = {
6125         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6126         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6127          'a',  'b',  'c',  'a',  'b',  'c',  'a',  'b',
6128          'c',  'a',  'b',  'c',  'a',  'b',  'c',  'a',
6129          'b',  'c',  'a',  'b',  'c',  'a',  'b',  'c',
6130          'a',  'b',  'c',  'a',  'b',  'c',  'a',  'b',
6131          'c',  'a',  'b',  'c',  'a',  'b',  'c',  'a',
6132          'b',  'c',  'a',  'b',  'c',  'a',  'b',  'c',
6133 };
6134 
6135 static const char vmac64_string4[33] = {
6136         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6137         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6138         'b',   'c',  'e',  'f',  'i',  'j',  'l',  'm',
6139         'o',   'p',  'r',  's',  't',  'u',  'w',  'x',
6140         'z',
6141 };
6142 
6143 static const char vmac64_string5[143] = {
6144         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6145         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6146          'r',  'm',  'b',  't',  'c',  'o',  'l',  'k',
6147          ']',  '%',  '9',  '2',  '7',  '!',  'A',
6148 };
6149 
6150 static const char vmac64_string6[145] = {
6151         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6152         '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
6153          'p',  't',  '*',  '7',  'l',  'i',  '!',  '#',
6154          'w',  '',  'z',  '/',  '4',  'A',  'n',
6155 };
6156 
6157 static const struct hash_testvec vmac64_aes_tv_template[] = {
6158         { /* draft-krovetz-vmac-01 test vector 1 */
6159                 .key    = "abcdefghijklmnop",
6160                 .ksize  = 16,
6161                 .plaintext = "\0\0\0\0\0\0\0\0bcdefghi",
6162                 .psize  = 16,
6163                 .digest = "\x25\x76\xbe\x1c\x56\xd8\xb8\x1b",
6164         }, { /* draft-krovetz-vmac-01 test vector 2 */
6165                 .key    = "abcdefghijklmnop",
6166                 .ksize  = 16,
6167                 .plaintext = "\0\0\0\0\0\0\0\0bcdefghiabc",
6168                 .psize  = 19,
6169                 .digest = "\x2d\x37\x6c\xf5\xb1\x81\x3c\xe5",
6170         }, { /* draft-krovetz-vmac-01 test vector 3 */
6171                 .key    = "abcdefghijklmnop",
6172                 .ksize  = 16,
6173                 .plaintext = "\0\0\0\0\0\0\0\0bcdefghi"
6174                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc",
6175                 .psize  = 64,
6176                 .digest = "\xe8\x42\x1f\x61\xd5\x73\xd2\x98",
6177         }, { /* draft-krovetz-vmac-01 test vector 4 */
6178                 .key    = "abcdefghijklmnop",
6179                 .ksize  = 16,
6180                 .plaintext = "\0\0\0\0\0\0\0\0bcdefghi"
6181                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"
6182                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"
6183                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"
6184                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"
6185                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"
6186                           "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabc",
6187                 .psize  = 316,
6188                 .digest = "\x44\x92\xdf\x6c\x5c\xac\x1b\xbe",
6189         }, {
6190                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6191                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6192                 .ksize  = 16,
6193                 .plaintext = "\x00\x00\x00\x00\x00\x00\x00\x00"
6194                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6195                 .psize  = 16,
6196                 .digest = "\x54\x7b\xa4\x77\x35\x80\x58\x07",
6197         }, {
6198                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6199                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6200                 .ksize  = 16,
6201                 .plaintext = vmac64_string1,
6202                 .psize  = sizeof(vmac64_string1),
6203                 .digest = "\xa1\x8c\x68\xae\xd3\x3c\xf5\xce",
6204         }, {
6205                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6206                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6207                 .ksize  = 16,
6208                 .plaintext = vmac64_string2,
6209                 .psize  = sizeof(vmac64_string2),
6210                 .digest = "\x2d\x14\xbd\x81\x73\xb0\x27\xc9",
6211         }, {
6212                 .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
6213                           "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
6214                 .ksize  = 16,
6215                 .plaintext = vmac64_string3,
6216                 .psize  = sizeof(vmac64_string3),
6217                 .digest = "\x19\x0b\x47\x98\x8c\x95\x1a\x8d",
6218         }, {
6219                 .key    = "abcdefghijklmnop",
6220                 .ksize  = 16,
6221                 .plaintext = "\x00\x00\x00\x00\x00\x00\x00\x00"
6222                           "\x00\x00\x00\x00\x00\x00\x00\x00",
6223                 .psize  = 16,
6224                 .digest = "\x84\x8f\x55\x9e\x26\xa1\x89\x3b",
6225         }, {
6226                 .key    = "abcdefghijklmnop",
6227                 .ksize  = 16,
6228                 .plaintext = vmac64_string1,
6229                 .psize  = sizeof(vmac64_string1),
6230                 .digest = "\xc2\x74\x8d\xf6\xb0\xab\x5e\xab",
6231         }, {
6232                 .key    = "abcdefghijklmnop",
6233                 .ksize  = 16,
6234                 .plaintext = vmac64_string2,
6235                 .psize  = sizeof(vmac64_string2),
6236                 .digest = "\xdf\x09\x7b\x3d\x42\x68\x15\x11",
6237         }, {
6238                 .key    = "abcdefghijklmnop",
6239                 .ksize  = 16,
6240                 .plaintext = vmac64_string3,
6241                 .psize  = sizeof(vmac64_string3),
6242                 .digest = "\xd4\xfa\x8f\xed\xe1\x8f\x32\x8b",
6243         }, {
6244                 .key    = "a09b5cd!f#07K\x00\x00\x00",
6245                 .ksize  = 16,
6246                 .plaintext = vmac64_string4,
6247                 .psize  = sizeof(vmac64_string4),
6248                 .digest = "\x5f\xa1\x4e\x42\xea\x0f\xa5\xab",
6249         }, {
6250                 .key    = "a09b5cd!f#07K\x00\x00\x00",
6251                 .ksize  = 16,
6252                 .plaintext = vmac64_string5,
6253                 .psize  = sizeof(vmac64_string5),
6254                 .digest = "\x60\x67\xe8\x1d\xbc\x98\x31\x25",
6255         }, {
6256                 .key    = "a09b5cd!f#07K\x00\x00\x00",
6257                 .ksize  = 16,
6258                 .plaintext = vmac64_string6,
6259                 .psize  = sizeof(vmac64_string6),
6260                 .digest = "\x41\xeb\x65\x95\x47\x9b\xae\xc4",
6261         },
6262 };
6263 
6264 /*
6265  * SHA384 HMAC test vectors from RFC4231
6266  */
6267 
6268 static const struct hash_testvec hmac_sha384_tv_template[] = {
6269         {
6270                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6271                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6272                           "\x0b\x0b\x0b\x0b",
6273                 .ksize  = 20,
6274                 .plaintext = "Hi There",
6275                 .psize  = 8,
6276                 .digest = "\xaf\xd0\x39\x44\xd8\x48\x95\x62"
6277                           "\x6b\x08\x25\xf4\xab\x46\x90\x7f"
6278                           "\x15\xf9\xda\xdb\xe4\x10\x1e\xc6"
6279                           "\x82\xaa\x03\x4c\x7c\xeb\xc5\x9c"
6280                           "\xfa\xea\x9e\xa9\x07\x6e\xde\x7f"
6281                           "\x4a\xf1\x52\xe8\xb2\xfa\x9c\xb6",
6282         }, {
6283                 .key    = "Jefe",
6284                 .ksize  = 4,
6285                 .plaintext = "what do ya want for nothing?",
6286                 .psize  = 28,
6287                 .digest = "\xaf\x45\xd2\xe3\x76\x48\x40\x31"
6288                           "\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
6289                           "\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47"
6290                           "\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
6291                           "\x8e\x22\x40\xca\x5e\x69\xe2\xc7"
6292                           "\x8b\x32\x39\xec\xfa\xb2\x16\x49",
6293         }, {
6294                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6295                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6296                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6297                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6298                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6299                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6300                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6301                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6302                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6303                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6304                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6305                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6306                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6307                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6308                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6309                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6310                           "\xaa\xaa\xaa",
6311                 .ksize  = 131,
6312                 .plaintext = "Test Using Larger Than Block-Siz"
6313                            "e Key - Hash Key First",
6314                 .psize  = 54,
6315                 .digest = "\x4e\xce\x08\x44\x85\x81\x3e\x90"
6316                           "\x88\xd2\xc6\x3a\x04\x1b\xc5\xb4"
6317                           "\x4f\x9e\xf1\x01\x2a\x2b\x58\x8f"
6318                           "\x3c\xd1\x1f\x05\x03\x3a\xc4\xc6"
6319                           "\x0c\x2e\xf6\xab\x40\x30\xfe\x82"
6320                           "\x96\x24\x8d\xf1\x63\xf4\x49\x52",
6321         }, {
6322                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6323                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6324                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6325                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6326                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6327                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6328                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6329                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6330                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6331                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6332                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6333                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6334                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6335                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6336                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6337                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6338                           "\xaa\xaa\xaa",
6339                 .ksize  = 131,
6340                 .plaintext = "This is a test u"
6341                            "sing a larger th"
6342                            "an block-size ke"
6343                            "y and a larger t"
6344                            "han block-size d"
6345                            "ata. The key nee"
6346                            "ds to be hashed "
6347                            "before being use"
6348                            "d by the HMAC al"
6349                            "gorithm.",
6350                 .psize  = 152,
6351                 .digest = "\x66\x17\x17\x8e\x94\x1f\x02\x0d"
6352                           "\x35\x1e\x2f\x25\x4e\x8f\xd3\x2c"
6353                           "\x60\x24\x20\xfe\xb0\xb8\xfb\x9a"
6354                           "\xdc\xce\xbb\x82\x46\x1e\x99\xc5"
6355                           "\xa6\x78\xcc\x31\xe7\x99\x17\x6d"
6356                           "\x38\x60\xe6\x11\x0c\x46\x52\x3e",
6357         },
6358 };
6359 
6360 /*
6361  * SHA512 HMAC test vectors from RFC4231
6362  */
6363 
6364 static const struct hash_testvec hmac_sha512_tv_template[] = {
6365         {
6366                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6367                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6368                           "\x0b\x0b\x0b\x0b",
6369                 .ksize  = 20,
6370                 .plaintext = "Hi There",
6371                 .psize  = 8,
6372                 .digest = "\x87\xaa\x7c\xde\xa5\xef\x61\x9d"
6373                           "\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0"
6374                           "\x23\x79\xf4\xe2\xce\x4e\xc2\x78"
6375                           "\x7a\xd0\xb3\x05\x45\xe1\x7c\xde"
6376                           "\xda\xa8\x33\xb7\xd6\xb8\xa7\x02"
6377                           "\x03\x8b\x27\x4e\xae\xa3\xf4\xe4"
6378                           "\xbe\x9d\x91\x4e\xeb\x61\xf1\x70"
6379                           "\x2e\x69\x6c\x20\x3a\x12\x68\x54",
6380         }, {
6381                 .key    = "Jefe",
6382                 .ksize  = 4,
6383                 .plaintext = "what do ya want for nothing?",
6384                 .psize  = 28,
6385                 .digest = "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2"
6386                           "\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
6387                           "\x87\xbd\x64\x22\x2e\x83\x1f\xd6"
6388                           "\x10\x27\x0c\xd7\xea\x25\x05\x54"
6389                           "\x97\x58\xbf\x75\xc0\x5a\x99\x4a"
6390                           "\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd"
6391                           "\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b"
6392                           "\x63\x6e\x07\x0a\x38\xbc\xe7\x37",
6393         }, {
6394                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6395                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6396                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6397                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6398                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6399                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6400                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6401                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6402                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6403                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6404                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6405                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6406                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6407                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6408                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6409                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6410                           "\xaa\xaa\xaa",
6411                 .ksize  = 131,
6412                 .plaintext = "Test Using Large"
6413                            "r Than Block-Siz"
6414                            "e Key - Hash Key"
6415                            " First",
6416                 .psize  = 54,
6417                 .digest = "\x80\xb2\x42\x63\xc7\xc1\xa3\xeb"
6418                         "\xb7\x14\x93\xc1\xdd\x7b\xe8\xb4"
6419                         "\x9b\x46\xd1\xf4\x1b\x4a\xee\xc1"
6420                         "\x12\x1b\x01\x37\x83\xf8\xf3\x52"
6421                         "\x6b\x56\xd0\x37\xe0\x5f\x25\x98"
6422                         "\xbd\x0f\xd2\x21\x5d\x6a\x1e\x52"
6423                         "\x95\xe6\x4f\x73\xf6\x3f\x0a\xec"
6424                         "\x8b\x91\x5a\x98\x5d\x78\x65\x98",
6425         }, {
6426                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6427                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6428                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6429                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6430                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6431                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6432                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6433                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6434                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6435                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6436                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6437                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6438                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6439                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6440                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6441                         "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6442                         "\xaa\xaa\xaa",
6443                 .ksize  = 131,
6444                 .plaintext =
6445                           "This is a test u"
6446                           "sing a larger th"
6447                           "an block-size ke"
6448                           "y and a larger t"
6449                           "han block-size d"
6450                           "ata. The key nee"
6451                           "ds to be hashed "
6452                           "before being use"
6453                           "d by the HMAC al"
6454                           "gorithm.",
6455                 .psize  = 152,
6456                 .digest = "\xe3\x7b\x6a\x77\x5d\xc8\x7d\xba"
6457                         "\xa4\xdf\xa9\xf9\x6e\x5e\x3f\xfd"
6458                         "\xde\xbd\x71\xf8\x86\x72\x89\x86"
6459                         "\x5d\xf5\xa3\x2d\x20\xcd\xc9\x44"
6460                         "\xb6\x02\x2c\xac\x3c\x49\x82\xb1"
6461                         "\x0d\x5e\xeb\x55\xc3\xe4\xde\x15"
6462                         "\x13\x46\x76\xfb\x6d\xe0\x44\x60"
6463                         "\x65\xc9\x74\x40\xfa\x8c\x6a\x58",
6464         },
6465 };
6466 
6467 static const struct hash_testvec hmac_sha3_224_tv_template[] = {
6468         {
6469                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6470                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6471                           "\x0b\x0b\x0b\x0b",
6472                 .ksize  = 20,
6473                 .plaintext = "Hi There",
6474                 .psize  = 8,
6475                 .digest = "\x3b\x16\x54\x6b\xbc\x7b\xe2\x70"
6476                           "\x6a\x03\x1d\xca\xfd\x56\x37\x3d"
6477                           "\x98\x84\x36\x76\x41\xd8\xc5\x9a"
6478                           "\xf3\xc8\x60\xf7",
6479         }, {
6480                 .key    = "Jefe",
6481                 .ksize  = 4,
6482                 .plaintext = "what do ya want for nothing?",
6483                 .psize  = 28,
6484                 .digest = "\x7f\xdb\x8d\xd8\x8b\xd2\xf6\x0d"
6485                           "\x1b\x79\x86\x34\xad\x38\x68\x11"
6486                           "\xc2\xcf\xc8\x5b\xfa\xf5\xd5\x2b"
6487                           "\xba\xce\x5e\x66",
6488         }, {
6489                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6490                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6491                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6492                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6493                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6494                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6495                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6496                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6497                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6498                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6499                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6500                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6501                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6502                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6503                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6504                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6505                           "\xaa\xaa\xaa",
6506                 .ksize  = 131,
6507                 .plaintext = "Test Using Large"
6508                            "r Than Block-Siz"
6509                            "e Key - Hash Key"
6510                            " First",
6511                 .psize  = 54,
6512                 .digest = "\xb4\xa1\xf0\x4c\x00\x28\x7a\x9b"
6513                           "\x7f\x60\x75\xb3\x13\xd2\x79\xb8"
6514                           "\x33\xbc\x8f\x75\x12\x43\x52\xd0"
6515                           "\x5f\xb9\x99\x5f",
6516         }, {
6517                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6518                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6519                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6520                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6521                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6522                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6523                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6524                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6525                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6526                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6527                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6528                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6529                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6530                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6531                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6532                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6533                           "\xaa\xaa\xaa",
6534                 .ksize  = 131,
6535                 .plaintext =
6536                           "This is a test u"
6537                           "sing a larger th"
6538                           "an block-size ke"
6539                           "y and a larger t"
6540                           "han block-size d"
6541                           "ata. The key nee"
6542                           "ds to be hashed "
6543                           "before being use"
6544                           "d by the HMAC al"
6545                           "gorithm.",
6546                 .psize  = 152,
6547                 .digest = "\x05\xd8\xcd\x6d\x00\xfa\xea\x8d"
6548                           "\x1e\xb6\x8a\xde\x28\x73\x0b\xbd"
6549                           "\x3c\xba\xb6\x92\x9f\x0a\x08\x6b"
6550                           "\x29\xcd\x62\xa0",
6551         },
6552 };
6553 
6554 static const struct hash_testvec hmac_sha3_256_tv_template[] = {
6555         {
6556                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6557                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6558                           "\x0b\x0b\x0b\x0b",
6559                 .ksize  = 20,
6560                 .plaintext = "Hi There",
6561                 .psize  = 8,
6562                 .digest = "\xba\x85\x19\x23\x10\xdf\xfa\x96"
6563                           "\xe2\xa3\xa4\x0e\x69\x77\x43\x51"
6564                           "\x14\x0b\xb7\x18\x5e\x12\x02\xcd"
6565                           "\xcc\x91\x75\x89\xf9\x5e\x16\xbb",
6566         }, {
6567                 .key    = "Jefe",
6568                 .ksize  = 4,
6569                 .plaintext = "what do ya want for nothing?",
6570                 .psize  = 28,
6571                 .digest = "\xc7\xd4\x07\x2e\x78\x88\x77\xae"
6572                           "\x35\x96\xbb\xb0\xda\x73\xb8\x87"
6573                           "\xc9\x17\x1f\x93\x09\x5b\x29\x4a"
6574                           "\xe8\x57\xfb\xe2\x64\x5e\x1b\xa5",
6575         }, {
6576                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6577                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6578                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6579                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6580                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6581                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6582                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6583                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6584                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6585                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6586                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6587                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6588                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6589                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6590                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6591                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6592                           "\xaa\xaa\xaa",
6593                 .ksize  = 131,
6594                 .plaintext = "Test Using Large"
6595                            "r Than Block-Siz"
6596                            "e Key - Hash Key"
6597                            " First",
6598                 .psize  = 54,
6599                 .digest = "\xed\x73\xa3\x74\xb9\x6c\x00\x52"
6600                           "\x35\xf9\x48\x03\x2f\x09\x67\x4a"
6601                           "\x58\xc0\xce\x55\x5c\xfc\x1f\x22"
6602                           "\x3b\x02\x35\x65\x60\x31\x2c\x3b",
6603         }, {
6604                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6605                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6606                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6607                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6608                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6609                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6610                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6611                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6612                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6613                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6614                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6615                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6616                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6617                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6618                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6619                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6620                           "\xaa\xaa\xaa",
6621                 .ksize  = 131,
6622                 .plaintext =
6623                           "This is a test u"
6624                           "sing a larger th"
6625                           "an block-size ke"
6626                           "y and a larger t"
6627                           "han block-size d"
6628                           "ata. The key nee"
6629                           "ds to be hashed "
6630                           "before being use"
6631                           "d by the HMAC al"
6632                           "gorithm.",
6633                 .psize  = 152,
6634                 .digest = "\x65\xc5\xb0\x6d\x4c\x3d\xe3\x2a"
6635                           "\x7a\xef\x87\x63\x26\x1e\x49\xad"
6636                           "\xb6\xe2\x29\x3e\xc8\xe7\xc6\x1e"
6637                           "\x8d\xe6\x17\x01\xfc\x63\xe1\x23",
6638         },
6639 };
6640 
6641 static const struct hash_testvec hmac_sha3_384_tv_template[] = {
6642         {
6643                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6644                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6645                           "\x0b\x0b\x0b\x0b",
6646                 .ksize  = 20,
6647                 .plaintext = "Hi There",
6648                 .psize  = 8,
6649                 .digest = "\x68\xd2\xdc\xf7\xfd\x4d\xdd\x0a"
6650                           "\x22\x40\xc8\xa4\x37\x30\x5f\x61"
6651                           "\xfb\x73\x34\xcf\xb5\xd0\x22\x6e"
6652                           "\x1b\xc2\x7d\xc1\x0a\x2e\x72\x3a"
6653                           "\x20\xd3\x70\xb4\x77\x43\x13\x0e"
6654                           "\x26\xac\x7e\x3d\x53\x28\x86\xbd",
6655         }, {
6656                 .key    = "Jefe",
6657                 .ksize  = 4,
6658                 .plaintext = "what do ya want for nothing?",
6659                 .psize  = 28,
6660                 .digest = "\xf1\x10\x1f\x8c\xbf\x97\x66\xfd"
6661                           "\x67\x64\xd2\xed\x61\x90\x3f\x21"
6662                           "\xca\x9b\x18\xf5\x7c\xf3\xe1\xa2"
6663                           "\x3c\xa1\x35\x08\xa9\x32\x43\xce"
6664                           "\x48\xc0\x45\xdc\x00\x7f\x26\xa2"
6665                           "\x1b\x3f\x5e\x0e\x9d\xf4\xc2\x0a",
6666         }, {
6667                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6668                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6669                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6670                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6671                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6672                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6673                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6674                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6675                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6676                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6677                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6678                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6679                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6680                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6681                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6682                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6683                           "\xaa\xaa\xaa",
6684                 .ksize  = 131,
6685                 .plaintext = "Test Using Large"
6686                            "r Than Block-Siz"
6687                            "e Key - Hash Key"
6688                            " First",
6689                 .psize  = 54,
6690                 .digest = "\x0f\xc1\x95\x13\xbf\x6b\xd8\x78"
6691                           "\x03\x70\x16\x70\x6a\x0e\x57\xbc"
6692                           "\x52\x81\x39\x83\x6b\x9a\x42\xc3"
6693                           "\xd4\x19\xe4\x98\xe0\xe1\xfb\x96"
6694                           "\x16\xfd\x66\x91\x38\xd3\x3a\x11"
6695                           "\x05\xe0\x7c\x72\xb6\x95\x3b\xcc",
6696         }, {
6697                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6698                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6699                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6700                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6701                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6702                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6703                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6704                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6705                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6706                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6707                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6708                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6709                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6710                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6711                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6712                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6713                           "\xaa\xaa\xaa",
6714                 .ksize  = 131,
6715                 .plaintext =
6716                           "This is a test u"
6717                           "sing a larger th"
6718                           "an block-size ke"
6719                           "y and a larger t"
6720                           "han block-size d"
6721                           "ata. The key nee"
6722                           "ds to be hashed "
6723                           "before being use"
6724                           "d by the HMAC al"
6725                           "gorithm.",
6726                 .psize  = 152,
6727                 .digest = "\x02\x6f\xdf\x6b\x50\x74\x1e\x37"
6728                           "\x38\x99\xc9\xf7\xd5\x40\x6d\x4e"
6729                           "\xb0\x9f\xc6\x66\x56\x36\xfc\x1a"
6730                           "\x53\x00\x29\xdd\xf5\xcf\x3c\xa5"
6731                           "\xa9\x00\xed\xce\x01\xf5\xf6\x1e"
6732                           "\x2f\x40\x8c\xdf\x2f\xd3\xe7\xe8",
6733         },
6734 };
6735 
6736 static const struct hash_testvec hmac_sha3_512_tv_template[] = {
6737         {
6738                 .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6739                           "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
6740                           "\x0b\x0b\x0b\x0b",
6741                 .ksize  = 20,
6742                 .plaintext = "Hi There",
6743                 .psize  = 8,
6744                 .digest = "\xeb\x3f\xbd\x4b\x2e\xaa\xb8\xf5"
6745                           "\xc5\x04\xbd\x3a\x41\x46\x5a\xac"
6746                           "\xec\x15\x77\x0a\x7c\xab\xac\x53"
6747                           "\x1e\x48\x2f\x86\x0b\x5e\xc7\xba"
6748                           "\x47\xcc\xb2\xc6\xf2\xaf\xce\x8f"
6749                           "\x88\xd2\x2b\x6d\xc6\x13\x80\xf2"
6750                           "\x3a\x66\x8f\xd3\x88\x8b\xb8\x05"
6751                           "\x37\xc0\xa0\xb8\x64\x07\x68\x9e",
6752         }, {
6753                 .key    = "Jefe",
6754                 .ksize  = 4,
6755                 .plaintext = "what do ya want for nothing?",
6756                 .psize  = 28,
6757                 .digest = "\x5a\x4b\xfe\xab\x61\x66\x42\x7c"
6758                           "\x7a\x36\x47\xb7\x47\x29\x2b\x83"
6759                           "\x84\x53\x7c\xdb\x89\xaf\xb3\xbf"
6760                           "\x56\x65\xe4\xc5\xe7\x09\x35\x0b"
6761                           "\x28\x7b\xae\xc9\x21\xfd\x7c\xa0"
6762                           "\xee\x7a\x0c\x31\xd0\x22\xa9\x5e"
6763                           "\x1f\xc9\x2b\xa9\xd7\x7d\xf8\x83"
6764                           "\x96\x02\x75\xbe\xb4\xe6\x20\x24",
6765         }, {
6766                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6767                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6768                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6769                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6770                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6771                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6772                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6773                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6774                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6775                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6776                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6777                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6778                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6779                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6780                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6781                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6782                           "\xaa\xaa\xaa",
6783                 .ksize  = 131,
6784                 .plaintext = "Test Using Large"
6785                            "r Than Block-Siz"
6786                            "e Key - Hash Key"
6787                            " First",
6788                 .psize  = 54,
6789                 .digest = "\x00\xf7\x51\xa9\xe5\x06\x95\xb0"
6790                           "\x90\xed\x69\x11\xa4\xb6\x55\x24"
6791                           "\x95\x1c\xdc\x15\xa7\x3a\x5d\x58"
6792                           "\xbb\x55\x21\x5e\xa2\xcd\x83\x9a"
6793                           "\xc7\x9d\x2b\x44\xa3\x9b\xaf\xab"
6794                           "\x27\xe8\x3f\xde\x9e\x11\xf6\x34"
6795                           "\x0b\x11\xd9\x91\xb1\xb9\x1b\xf2"
6796                           "\xee\xe7\xfc\x87\x24\x26\xc3\xa4",
6797         }, {
6798                 .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6799                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6800                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6801                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6802                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6803                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6804                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6805                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6806                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6807                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6808                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6809                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6810                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6811                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6812                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6813                           "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6814                           "\xaa\xaa\xaa",
6815                 .ksize  = 131,
6816                 .plaintext =
6817                           "This is a test u"
6818                           "sing a larger th"
6819                           "an block-size ke"
6820                           "y and a larger t"
6821                           "han block-size d"
6822                           "ata. The key nee"
6823                           "ds to be hashed "
6824                           "before being use"
6825                           "d by the HMAC al"
6826                           "gorithm.",
6827                 .psize  = 152,
6828                 .digest = "\x38\xa4\x56\xa0\x04\xbd\x10\xd3"
6829                           "\x2c\x9a\xb8\x33\x66\x84\x11\x28"
6830                           "\x62\xc3\xdb\x61\xad\xcc\xa3\x18"
6831                           "\x29\x35\x5e\xaf\x46\xfd\x5c\x73"
6832                           "\xd0\x6a\x1f\x0d\x13\xfe\xc9\xa6"
6833                           "\x52\xfb\x38\x11\xb5\x77\xb1\xb1"
6834                           "\xd1\xb9\x78\x9f\x97\xae\x5b\x83"
6835                           "\xc6\xf4\x4d\xfc\xf1\xd6\x7e\xba",
6836         },
6837 };
6838 
6839 /*
6840  * Poly1305 test vectors from RFC7539 A.3.
6841  */
6842 
6843 static const struct hash_testvec poly1305_tv_template[] = {
6844         { /* Test Vector #1 */
6845                 .plaintext      = "\x00\x00\x00\x00\x00\x00\x00\x00"
6846                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6847                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6848                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6849                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6850                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6851                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6852                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6853                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6854                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6855                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6856                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
6857                 .psize          = 96,
6858                 .digest         = "\x00\x00\x00\x00\x00\x00\x00\x00"
6859                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
6860         }, { /* Test Vector #2 */
6861                 .plaintext      = "\x00\x00\x00\x00\x00\x00\x00\x00"
6862                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6863                                   "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
6864                                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e"
6865                                   "\x41\x6e\x79\x20\x73\x75\x62\x6d"
6866                                   "\x69\x73\x73\x69\x6f\x6e\x20\x74"
6867                                   "\x6f\x20\x74\x68\x65\x20\x49\x45"
6868                                   "\x54\x46\x20\x69\x6e\x74\x65\x6e"
6869                                   "\x64\x65\x64\x20\x62\x79\x20\x74"
6870                                   "\x68\x65\x20\x43\x6f\x6e\x74\x72"
6871                                   "\x69\x62\x75\x74\x6f\x72\x20\x66"
6872                                   "\x6f\x72\x20\x70\x75\x62\x6c\x69"
6873                                   "\x63\x61\x74\x69\x6f\x6e\x20\x61"
6874                                   "\x73\x20\x61\x6c\x6c\x20\x6f\x72"
6875                                   "\x20\x70\x61\x72\x74\x20\x6f\x66"
6876                                   "\x20\x61\x6e\x20\x49\x45\x54\x46"
6877                                   "\x20\x49\x6e\x74\x65\x72\x6e\x65"
6878                                   "\x74\x2d\x44\x72\x61\x66\x74\x20"
6879                                   "\x6f\x72\x20\x52\x46\x43\x20\x61"
6880                                   "\x6e\x64\x20\x61\x6e\x79\x20\x73"
6881                                   "\x74\x61\x74\x65\x6d\x65\x6e\x74"
6882                                   "\x20\x6d\x61\x64\x65\x20\x77\x69"
6883                                   "\x74\x68\x69\x6e\x20\x74\x68\x65"
6884                                   "\x20\x63\x6f\x6e\x74\x65\x78\x74"
6885                                   "\x20\x6f\x66\x20\x61\x6e\x20\x49"
6886                                   "\x45\x54\x46\x20\x61\x63\x74\x69"
6887                                   "\x76\x69\x74\x79\x20\x69\x73\x20"
6888                                   "\x63\x6f\x6e\x73\x69\x64\x65\x72"
6889                                   "\x65\x64\x20\x61\x6e\x20\x22\x49"
6890                                   "\x45\x54\x46\x20\x43\x6f\x6e\x74"
6891                                   "\x72\x69\x62\x75\x74\x69\x6f\x6e"
6892                                   "\x22\x2e\x20\x53\x75\x63\x68\x20"
6893                                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
6894                                   "\x74\x73\x20\x69\x6e\x63\x6c\x75"
6895                                   "\x64\x65\x20\x6f\x72\x61\x6c\x20"
6896                                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
6897                                   "\x74\x73\x20\x69\x6e\x20\x49\x45"
6898                                   "\x54\x46\x20\x73\x65\x73\x73\x69"
6899                                   "\x6f\x6e\x73\x2c\x20\x61\x73\x20"
6900                                   "\x77\x65\x6c\x6c\x20\x61\x73\x20"
6901                                   "\x77\x72\x69\x74\x74\x65\x6e\x20"
6902                                   "\x61\x6e\x64\x20\x65\x6c\x65\x63"
6903                                   "\x74\x72\x6f\x6e\x69\x63\x20\x63"
6904                                   "\x6f\x6d\x6d\x75\x6e\x69\x63\x61"
6905                                   "\x74\x69\x6f\x6e\x73\x20\x6d\x61"
6906                                   "\x64\x65\x20\x61\x74\x20\x61\x6e"
6907                                   "\x79\x20\x74\x69\x6d\x65\x20\x6f"
6908                                   "\x72\x20\x70\x6c\x61\x63\x65\x2c"
6909                                   "\x20\x77\x68\x69\x63\x68\x20\x61"
6910                                   "\x72\x65\x20\x61\x64\x64\x72\x65"
6911                                   "\x73\x73\x65\x64\x20\x74\x6f",
6912                 .psize          = 407,
6913                 .digest         = "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
6914                                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e",
6915         }, { /* Test Vector #3 */
6916                 .plaintext      = "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
6917                                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e"
6918                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6919                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6920                                   "\x41\x6e\x79\x20\x73\x75\x62\x6d"
6921                                   "\x69\x73\x73\x69\x6f\x6e\x20\x74"
6922                                   "\x6f\x20\x74\x68\x65\x20\x49\x45"
6923                                   "\x54\x46\x20\x69\x6e\x74\x65\x6e"
6924                                   "\x64\x65\x64\x20\x62\x79\x20\x74"
6925                                   "\x68\x65\x20\x43\x6f\x6e\x74\x72"
6926                                   "\x69\x62\x75\x74\x6f\x72\x20\x66"
6927                                   "\x6f\x72\x20\x70\x75\x62\x6c\x69"
6928                                   "\x63\x61\x74\x69\x6f\x6e\x20\x61"
6929                                   "\x73\x20\x61\x6c\x6c\x20\x6f\x72"
6930                                   "\x20\x70\x61\x72\x74\x20\x6f\x66"
6931                                   "\x20\x61\x6e\x20\x49\x45\x54\x46"
6932                                   "\x20\x49\x6e\x74\x65\x72\x6e\x65"
6933                                   "\x74\x2d\x44\x72\x61\x66\x74\x20"
6934                                   "\x6f\x72\x20\x52\x46\x43\x20\x61"
6935                                   "\x6e\x64\x20\x61\x6e\x79\x20\x73"
6936                                   "\x74\x61\x74\x65\x6d\x65\x6e\x74"
6937                                   "\x20\x6d\x61\x64\x65\x20\x77\x69"
6938                                   "\x74\x68\x69\x6e\x20\x74\x68\x65"
6939                                   "\x20\x63\x6f\x6e\x74\x65\x78\x74"
6940                                   "\x20\x6f\x66\x20\x61\x6e\x20\x49"
6941                                   "\x45\x54\x46\x20\x61\x63\x74\x69"
6942                                   "\x76\x69\x74\x79\x20\x69\x73\x20"
6943                                   "\x63\x6f\x6e\x73\x69\x64\x65\x72"
6944                                   "\x65\x64\x20\x61\x6e\x20\x22\x49"
6945                                   "\x45\x54\x46\x20\x43\x6f\x6e\x74"
6946                                   "\x72\x69\x62\x75\x74\x69\x6f\x6e"
6947                                   "\x22\x2e\x20\x53\x75\x63\x68\x20"
6948                                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
6949                                   "\x74\x73\x20\x69\x6e\x63\x6c\x75"
6950                                   "\x64\x65\x20\x6f\x72\x61\x6c\x20"
6951                                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
6952                                   "\x74\x73\x20\x69\x6e\x20\x49\x45"
6953                                   "\x54\x46\x20\x73\x65\x73\x73\x69"
6954                                   "\x6f\x6e\x73\x2c\x20\x61\x73\x20"
6955                                   "\x77\x65\x6c\x6c\x20\x61\x73\x20"
6956                                   "\x77\x72\x69\x74\x74\x65\x6e\x20"
6957                                   "\x61\x6e\x64\x20\x65\x6c\x65\x63"
6958                                   "\x74\x72\x6f\x6e\x69\x63\x20\x63"
6959                                   "\x6f\x6d\x6d\x75\x6e\x69\x63\x61"
6960                                   "\x74\x69\x6f\x6e\x73\x20\x6d\x61"
6961                                   "\x64\x65\x20\x61\x74\x20\x61\x6e"
6962                                   "\x79\x20\x74\x69\x6d\x65\x20\x6f"
6963                                   "\x72\x20\x70\x6c\x61\x63\x65\x2c"
6964                                   "\x20\x77\x68\x69\x63\x68\x20\x61"
6965                                   "\x72\x65\x20\x61\x64\x64\x72\x65"
6966                                   "\x73\x73\x65\x64\x20\x74\x6f",
6967                 .psize          = 407,
6968                 .digest         = "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf"
6969                                   "\x89\xa6\xb8\x79\x4c\x31\x0c\xf0",
6970         }, { /* Test Vector #4 */
6971                 .plaintext      = "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a"
6972                                   "\xf3\x33\x88\x86\x04\xf6\xb5\xf0"
6973                                   "\x47\x39\x17\xc1\x40\x2b\x80\x09"
6974                                   "\x9d\xca\x5c\xbc\x20\x70\x75\xc0"
6975                                   "\x27\x54\x77\x61\x73\x20\x62\x72"
6976                                   "\x69\x6c\x6c\x69\x67\x2c\x20\x61"
6977                                   "\x6e\x64\x20\x74\x68\x65\x20\x73"
6978                                   "\x6c\x69\x74\x68\x79\x20\x74\x6f"
6979                                   "\x76\x65\x73\x0a\x44\x69\x64\x20"
6980                                   "\x67\x79\x72\x65\x20\x61\x6e\x64"
6981                                   "\x20\x67\x69\x6d\x62\x6c\x65\x20"
6982                                   "\x69\x6e\x20\x74\x68\x65\x20\x77"
6983                                   "\x61\x62\x65\x3a\x0a\x41\x6c\x6c"
6984                                   "\x20\x6d\x69\x6d\x73\x79\x20\x77"
6985                                   "\x65\x72\x65\x20\x74\x68\x65\x20"
6986                                   "\x62\x6f\x72\x6f\x67\x6f\x76\x65"
6987                                   "\x73\x2c\x0a\x41\x6e\x64\x20\x74"
6988                                   "\x68\x65\x20\x6d\x6f\x6d\x65\x20"
6989                                   "\x72\x61\x74\x68\x73\x20\x6f\x75"
6990                                   "\x74\x67\x72\x61\x62\x65\x2e",
6991                 .psize          = 159,
6992                 .digest         = "\x45\x41\x66\x9a\x7e\xaa\xee\x61"
6993                                   "\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62",
6994         }, { /* Test Vector #5 */
6995                 .plaintext      = "\x02\x00\x00\x00\x00\x00\x00\x00"
6996                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6997                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6998                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
6999                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7000                                   "\xff\xff\xff\xff\xff\xff\xff\xff",
7001                 .psize          = 48,
7002                 .digest         = "\x03\x00\x00\x00\x00\x00\x00\x00"
7003                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7004         }, { /* Test Vector #6 */
7005                 .plaintext      = "\x02\x00\x00\x00\x00\x00\x00\x00"
7006                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7007                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7008                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7009                                   "\x02\x00\x00\x00\x00\x00\x00\x00"
7010                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7011                 .psize          = 48,
7012                 .digest         = "\x03\x00\x00\x00\x00\x00\x00\x00"
7013                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7014         }, { /* Test Vector #7 */
7015                 .plaintext      = "\x01\x00\x00\x00\x00\x00\x00\x00"
7016                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7017                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7018                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7019                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7020                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7021                                   "\xf0\xff\xff\xff\xff\xff\xff\xff"
7022                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7023                                   "\x11\x00\x00\x00\x00\x00\x00\x00"
7024                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7025                 .psize          = 80,
7026                 .digest         = "\x05\x00\x00\x00\x00\x00\x00\x00"
7027                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7028         }, { /* Test Vector #8 */
7029                 .plaintext      = "\x01\x00\x00\x00\x00\x00\x00\x00"
7030                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7031                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7032                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7033                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7034                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7035                                   "\xfb\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
7036                                   "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
7037                                   "\x01\x01\x01\x01\x01\x01\x01\x01"
7038                                   "\x01\x01\x01\x01\x01\x01\x01\x01",
7039                 .psize          = 80,
7040                 .digest         = "\x00\x00\x00\x00\x00\x00\x00\x00"
7041                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7042         }, { /* Test Vector #9 */
7043                 .plaintext      = "\x02\x00\x00\x00\x00\x00\x00\x00"
7044                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7045                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7046                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7047                                   "\xfd\xff\xff\xff\xff\xff\xff\xff"
7048                                   "\xff\xff\xff\xff\xff\xff\xff\xff",
7049                 .psize          = 48,
7050                 .digest         = "\xfa\xff\xff\xff\xff\xff\xff\xff"
7051                                   "\xff\xff\xff\xff\xff\xff\xff\xff",
7052         }, { /* Test Vector #10 */
7053                 .plaintext      = "\x01\x00\x00\x00\x00\x00\x00\x00"
7054                                   "\x04\x00\x00\x00\x00\x00\x00\x00"
7055                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7056                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7057                                   "\xe3\x35\x94\xd7\x50\x5e\x43\xb9"
7058                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7059                                   "\x33\x94\xd7\x50\x5e\x43\x79\xcd"
7060                                   "\x01\x00\x00\x00\x00\x00\x00\x00"
7061                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7062                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7063                                   "\x01\x00\x00\x00\x00\x00\x00\x00"
7064                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7065                 .psize          = 96,
7066                 .digest         = "\x14\x00\x00\x00\x00\x00\x00\x00"
7067                                   "\x55\x00\x00\x00\x00\x00\x00\x00",
7068         }, { /* Test Vector #11 */
7069                 .plaintext      = "\x01\x00\x00\x00\x00\x00\x00\x00"
7070                                   "\x04\x00\x00\x00\x00\x00\x00\x00"
7071                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7072                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7073                                   "\xe3\x35\x94\xd7\x50\x5e\x43\xb9"
7074                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7075                                   "\x33\x94\xd7\x50\x5e\x43\x79\xcd"
7076                                   "\x01\x00\x00\x00\x00\x00\x00\x00"
7077                                   "\x00\x00\x00\x00\x00\x00\x00\x00"
7078                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7079                 .psize          = 80,
7080                 .digest         = "\x13\x00\x00\x00\x00\x00\x00\x00"
7081                                   "\x00\x00\x00\x00\x00\x00\x00\x00",
7082         }, { /* Regression test for overflow in AVX2 implementation */
7083                 .plaintext      = "\xff\xff\xff\xff\xff\xff\xff\xff"
7084                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7085                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7086                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7087                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7088                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7089                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7090                                   "\xff\xff\xff\xff\xff\xff\xff\xff"
7091                                   "\x