Back to home page

LXR

 
 

    


0001 /*
0002  * Algorithm testing framework and tests.
0003  *
0004  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
0005  * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
0006  * Copyright (c) 2007 Nokia Siemens Networks
0007  * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
0008  *
0009  * Updated RFC4106 AES-GCM testing. Some test vectors were taken from
0010  * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
0011  * gcm/gcm-test-vectors.tar.gz
0012  *     Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
0013  *              Adrian Hoban <adrian.hoban@intel.com>
0014  *              Gabriele Paoloni <gabriele.paoloni@intel.com>
0015  *              Tadeusz Struk (tadeusz.struk@intel.com)
0016  *     Copyright (c) 2010, Intel Corporation.
0017  *
0018  * This program is free software; you can redistribute it and/or modify it
0019  * under the terms of the GNU General Public License as published by the Free
0020  * Software Foundation; either version 2 of the License, or (at your option)
0021  * any later version.
0022  *
0023  */
0024 #ifndef _CRYPTO_TESTMGR_H
0025 #define _CRYPTO_TESTMGR_H
0026 
0027 #include <linux/netlink.h>
0028 
0029 #define MAX_DIGEST_SIZE     64
0030 #define MAX_TAP         8
0031 
0032 #define MAX_KEYLEN      160
0033 #define MAX_IVLEN       32
0034 
0035 struct hash_testvec {
0036     /* only used with keyed hash algorithms */
0037     char *key;
0038     char *plaintext;
0039     char *digest;
0040     unsigned char tap[MAX_TAP];
0041     unsigned short psize;
0042     unsigned char np;
0043     unsigned char ksize;
0044 };
0045 
0046 /*
0047  * cipher_testvec:  structure to describe a cipher test
0048  * @key:    A pointer to a key used by the test
0049  * @klen:   The length of @key
0050  * @iv:     A pointer to the IV used by the test
0051  * @input:  A pointer to data used as input
0052  * @ilen    The length of data in @input
0053  * @result: A pointer to what the test need to produce
0054  * @rlen:   The length of data in @result
0055  * @fail:   If set to one, the test need to fail
0056  * @wk:     Does the test need CRYPTO_TFM_REQ_WEAK_KEY
0057  *      ( e.g. test needs to fail due to a weak key )
0058  * @np:     numbers of SG to distribute data in (from 1 to MAX_TAP)
0059  * @tap:    How to distribute data in @np SGs
0060  * @also_non_np:    if set to 1, the test will be also done without
0061  *          splitting data in @np SGs
0062  * @fips_skip:  Skip the test vector in FIPS mode
0063  */
0064 
0065 struct cipher_testvec {
0066     char *key;
0067     char *iv;
0068     char *iv_out;
0069     char *input;
0070     char *result;
0071     unsigned short tap[MAX_TAP];
0072     int np;
0073     unsigned char also_non_np;
0074     bool fail;
0075     unsigned char wk; /* weak key flag */
0076     unsigned char klen;
0077     unsigned short ilen;
0078     unsigned short rlen;
0079     bool fips_skip;
0080 };
0081 
0082 struct aead_testvec {
0083     char *key;
0084     char *iv;
0085     char *input;
0086     char *assoc;
0087     char *result;
0088     unsigned char tap[MAX_TAP];
0089     unsigned char atap[MAX_TAP];
0090     int np;
0091     int anp;
0092     bool fail;
0093     unsigned char novrfy;   /* ccm dec verification failure expected */
0094     unsigned char wk; /* weak key flag */
0095     unsigned char klen;
0096     unsigned short ilen;
0097     unsigned short alen;
0098     unsigned short rlen;
0099 };
0100 
0101 struct cprng_testvec {
0102     char *key;
0103     char *dt;
0104     char *v;
0105     char *result;
0106     unsigned char klen;
0107     unsigned short dtlen;
0108     unsigned short vlen;
0109     unsigned short rlen;
0110     unsigned short loops;
0111 };
0112 
0113 struct drbg_testvec {
0114     unsigned char *entropy;
0115     size_t entropylen;
0116     unsigned char *entpra;
0117     unsigned char *entprb;
0118     size_t entprlen;
0119     unsigned char *addtla;
0120     unsigned char *addtlb;
0121     size_t addtllen;
0122     unsigned char *pers;
0123     size_t perslen;
0124     unsigned char *expected;
0125     size_t expectedlen;
0126 };
0127 
0128 struct akcipher_testvec {
0129     unsigned char *key;
0130     unsigned char *m;
0131     unsigned char *c;
0132     unsigned int key_len;
0133     unsigned int m_size;
0134     unsigned int c_size;
0135     bool public_key_vec;
0136 };
0137 
0138 struct kpp_testvec {
0139     unsigned char *secret;
0140     unsigned char *b_public;
0141     unsigned char *expected_a_public;
0142     unsigned char *expected_ss;
0143     unsigned short secret_size;
0144     unsigned short b_public_size;
0145     unsigned short expected_a_public_size;
0146     unsigned short expected_ss_size;
0147 };
0148 
0149 static char zeroed_string[48];
0150 
0151 /*
0152  * RSA test vectors. Borrowed from openSSL.
0153  */
0154 #ifdef CONFIG_CRYPTO_FIPS
0155 #define RSA_TEST_VECTORS    2
0156 #else
0157 #define RSA_TEST_VECTORS    5
0158 #endif
0159 static struct akcipher_testvec rsa_tv_template[] = {
0160     {
0161 #ifndef CONFIG_CRYPTO_FIPS
0162     .key =
0163     "\x30\x81\x9A" /* sequence of 154 bytes */
0164     "\x02\x01\x01" /* version - integer of 1 byte */
0165     "\x02\x41" /* modulus - integer of 65 bytes */
0166     "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
0167     "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
0168     "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
0169     "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
0170     "\xF5"
0171     "\x02\x01\x11" /* public key - integer of 1 byte */
0172     "\x02\x40" /* private key - integer of 64 bytes */
0173     "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
0174     "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
0175     "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
0176     "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"
0177     "\x02\x01\x00" /* prime1 - integer of 1 byte */
0178     "\x02\x01\x00" /* prime2 - integer of 1 byte */
0179     "\x02\x01\x00" /* exponent1 - integer of 1 byte */
0180     "\x02\x01\x00" /* exponent2 - integer of 1 byte */
0181     "\x02\x01\x00", /* coefficient - integer of 1 byte */
0182     .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
0183     .c =
0184     "\x63\x1c\xcd\x7b\xe1\x7e\xe4\xde\xc9\xa8\x89\xa1\x74\xcb\x3c\x63"
0185     "\x7d\x24\xec\x83\xc3\x15\xe4\x7f\x73\x05\x34\xd1\xec\x22\xbb\x8a"
0186     "\x5e\x32\x39\x6d\xc1\x1d\x7d\x50\x3b\x9f\x7a\xad\xf0\x2e\x25\x53"
0187     "\x9f\x6e\xbd\x4c\x55\x84\x0c\x9b\xcf\x1a\x4b\x51\x1e\x9e\x0c\x06",
0188     .key_len = 157,
0189     .m_size = 8,
0190     .c_size = 64,
0191     }, {
0192     .key =
0193     "\x30\x82\x01\x1D" /* sequence of 285 bytes */
0194     "\x02\x01\x01" /* version - integer of 1 byte */
0195     "\x02\x81\x81" /* modulus - integer of 129 bytes */
0196     "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
0197     "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
0198     "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
0199     "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80"
0200     "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25"
0201     "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39"
0202     "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68"
0203     "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
0204     "\xCB"
0205     "\x02\x01\x11" /* public key - integer of 1 byte */
0206     "\x02\x81\x81"  /* private key - integer of 129 bytes */
0207     "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD"
0208     "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41"
0209     "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69"
0210     "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA"
0211     "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94"
0212     "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A"
0213     "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94"
0214     "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3"
0215     "\xC1"
0216     "\x02\x01\x00" /* prime1 - integer of 1 byte */
0217     "\x02\x01\x00" /* prime2 - integer of 1 byte */
0218     "\x02\x01\x00" /* exponent1 - integer of 1 byte */
0219     "\x02\x01\x00" /* exponent2 - integer of 1 byte */
0220     "\x02\x01\x00", /* coefficient - integer of 1 byte */
0221     .key_len = 289,
0222     .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
0223     .c =
0224     "\x74\x1b\x55\xac\x47\xb5\x08\x0a\x6e\x2b\x2d\xf7\x94\xb8\x8a\x95"
0225     "\xed\xa3\x6b\xc9\x29\xee\xb2\x2c\x80\xc3\x39\x3b\x8c\x62\x45\x72"
0226     "\xc2\x7f\x74\x81\x91\x68\x44\x48\x5a\xdc\xa0\x7e\xa7\x0b\x05\x7f"
0227     "\x0e\xa0\x6c\xe5\x8f\x19\x4d\xce\x98\x47\x5f\xbd\x5f\xfe\xe5\x34"
0228     "\x59\x89\xaf\xf0\xba\x44\xd7\xf1\x1a\x50\x72\xef\x5e\x4a\xb6\xb7"
0229     "\x54\x34\xd1\xc4\x83\x09\xdf\x0f\x91\x5f\x7d\x91\x70\x2f\xd4\x13"
0230     "\xcc\x5e\xa4\x6c\xc3\x4d\x28\xef\xda\xaf\xec\x14\x92\xfc\xa3\x75"
0231     "\x13\xb4\xc1\xa1\x11\xfc\x40\x2f\x4c\x9d\xdf\x16\x76\x11\x20\x6b",
0232     .m_size = 8,
0233     .c_size = 128,
0234     }, {
0235 #endif
0236     .key =
0237     "\x30\x82\x02\x1F" /* sequence of 543 bytes */
0238     "\x02\x01\x01" /* version - integer of 1 byte */
0239     "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
0240     "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
0241     "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
0242     "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
0243     "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
0244     "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
0245     "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
0246     "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
0247     "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
0248     "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
0249     "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
0250     "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
0251     "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
0252     "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
0253     "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
0254     "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
0255     "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
0256     "\x02\x03\x01\x00\x01" /* public key - integer of 3 bytes */
0257     "\x02\x82\x01\x00" /* private key - integer of 256 bytes */
0258     "\x52\x41\xF4\xDA\x7B\xB7\x59\x55\xCA\xD4\x2F\x0F\x3A\xCB\xA4\x0D"
0259     "\x93\x6C\xCC\x9D\xC1\xB2\xFB\xFD\xAE\x40\x31\xAC\x69\x52\x21\x92"
0260     "\xB3\x27\xDF\xEA\xEE\x2C\x82\xBB\xF7\x40\x32\xD5\x14\xC4\x94\x12"
0261     "\xEC\xB8\x1F\xCA\x59\xE3\xC1\x78\xF3\x85\xD8\x47\xA5\xD7\x02\x1A"
0262     "\x65\x79\x97\x0D\x24\xF4\xF0\x67\x6E\x75\x2D\xBF\x10\x3D\xA8\x7D"
0263     "\xEF\x7F\x60\xE4\xE6\x05\x82\x89\x5D\xDF\xC6\xD2\x6C\x07\x91\x33"
0264     "\x98\x42\xF0\x02\x00\x25\x38\xC5\x85\x69\x8A\x7D\x2F\x95\x6C\x43"
0265     "\x9A\xB8\x81\xE2\xD0\x07\x35\xAA\x05\x41\xC9\x1E\xAF\xE4\x04\x3B"
0266     "\x19\xB8\x73\xA2\xAC\x4B\x1E\x66\x48\xD8\x72\x1F\xAC\xF6\xCB\xBC"
0267     "\x90\x09\xCA\xEC\x0C\xDC\xF9\x2C\xD7\xEB\xAE\xA3\xA4\x47\xD7\x33"
0268     "\x2F\x8A\xCA\xBC\x5E\xF0\x77\xE4\x97\x98\x97\xC7\x10\x91\x7D\x2A"
0269     "\xA6\xFF\x46\x83\x97\xDE\xE9\xE2\x17\x03\x06\x14\xE2\xD7\xB1\x1D"
0270     "\x77\xAF\x51\x27\x5B\x5E\x69\xB8\x81\xE6\x11\xC5\x43\x23\x81\x04"
0271     "\x62\xFF\xE9\x46\xB8\xD8\x44\xDB\xA5\xCC\x31\x54\x34\xCE\x3E\x82"
0272     "\xD6\xBF\x7A\x0B\x64\x21\x6D\x88\x7E\x5B\x45\x12\x1E\x63\x8D\x49"
0273     "\xA7\x1D\xD9\x1E\x06\xCD\xE8\xBA\x2C\x8C\x69\x32\xEA\xBE\x60\x71"
0274     "\x02\x01\x00" /* prime1 - integer of 1 byte */
0275     "\x02\x01\x00" /* prime2 - integer of 1 byte */
0276     "\x02\x01\x00" /* exponent1 - integer of 1 byte */
0277     "\x02\x01\x00" /* exponent2 - integer of 1 byte */
0278     "\x02\x01\x00", /* coefficient - integer of 1 byte */
0279     .key_len = 547,
0280     .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
0281     .c =
0282     "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
0283     "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
0284     "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
0285     "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
0286     "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
0287     "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
0288     "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
0289     "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
0290     "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
0291     "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
0292     "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
0293     "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
0294     "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
0295     "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
0296     "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
0297     "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
0298     .m_size = 8,
0299     .c_size = 256,
0300     }, {
0301     .key =
0302     "\x30\x82\x01\x09" /* sequence of 265 bytes */
0303     "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
0304     "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
0305     "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
0306     "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
0307     "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
0308     "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
0309     "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
0310     "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
0311     "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
0312     "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
0313     "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
0314     "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
0315     "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
0316     "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
0317     "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
0318     "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
0319     "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
0320     "\x02\x03\x01\x00\x01", /* public key - integer of 3 bytes */
0321     .key_len = 269,
0322     .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
0323     .c =
0324     "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
0325     "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
0326     "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
0327     "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
0328     "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
0329     "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
0330     "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
0331     "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
0332     "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
0333     "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
0334     "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
0335     "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
0336     "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
0337     "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
0338     "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
0339     "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
0340     .m_size = 8,
0341     .c_size = 256,
0342     .public_key_vec = true,
0343     }, {
0344     .key =
0345     "\x30\x82\x09\x29" /* sequence of 2345 bytes */
0346     "\x02\x01\x00" /* version integer of 1 byte */
0347     "\x02\x82\x02\x01" /* modulus - integer of 513 bytes */
0348     "\x00\xC3\x8B\x55\x7B\x73\x4D\xFF\xE9\x9B\xC6\xDC\x67\x3C\xB4\x8E"
0349     "\xA0\x86\xED\xF2\xB9\x50\x5C\x54\x5C\xBA\xE4\xA1\xB2\xA7\xAE\x2F"
0350     "\x1B\x7D\xF1\xFB\xAC\x79\xC5\xDF\x1A\x00\xC9\xB2\xC1\x61\x25\x33"
0351     "\xE6\x9C\xE9\xCF\xD6\x27\xC4\x4E\x44\x30\x44\x5E\x08\xA1\x87\x52"
0352     "\xCC\x6B\x97\x70\x8C\xBC\xA5\x06\x31\x0C\xD4\x2F\xD5\x7D\x26\x24"
0353     "\xA2\xE2\xAC\x78\xF4\x53\x14\xCE\xF7\x19\x2E\xD7\xF7\xE6\x0C\xB9"
0354     "\x56\x7F\x0B\xF1\xB1\xE2\x43\x70\xBD\x86\x1D\xA1\xCC\x2B\x19\x08"
0355     "\x76\xEF\x91\xAC\xBF\x20\x24\x0D\x38\xC0\x89\xB8\x9A\x70\xB3\x64"
0356     "\xD9\x8F\x80\x41\x10\x5B\x9F\xB1\xCB\x76\x43\x00\x21\x25\x36\xD4"
0357     "\x19\xFC\x55\x95\x10\xE4\x26\x74\x98\x2C\xD9\xBD\x0B\x2B\x04\xC2"
0358     "\xAC\x82\x38\xB4\xDD\x4C\x04\x7E\x51\x36\x40\x1E\x0B\xC4\x7C\x25"
0359     "\xDD\x4B\xB2\xE7\x20\x0A\x57\xF9\xB4\x94\xC3\x08\x33\x22\x6F\x8B"
0360     "\x48\xDB\x03\x68\x5A\x5B\xBA\xAE\xF3\xAD\xCF\xC3\x6D\xBA\xF1\x28"
0361     "\x67\x7E\x6C\x79\x07\xDE\xFC\xED\xE7\x96\xE3\x6C\xE0\x2C\x87\xF8"
0362     "\x02\x01\x28\x38\x43\x21\x53\x84\x69\x75\x78\x15\x7E\xEE\xD2\x1B"
0363     "\xB9\x23\x40\xA8\x86\x1E\x38\x83\xB2\x73\x1D\x53\xFB\x9E\x2A\x8A"
0364     "\xB2\x75\x35\x01\xC3\xC3\xC4\x94\xE8\x84\x86\x64\x81\xF4\x42\xAA"
0365     "\x3C\x0E\xD6\x4F\xBC\x0A\x09\x2D\xE7\x1B\xD4\x10\xA8\x54\xEA\x89"
0366     "\x84\x8A\xCB\xF7\x5A\x3C\xCA\x76\x08\x29\x62\xB4\x6A\x22\xDF\x14"
0367     "\x95\x71\xFD\xB6\x86\x39\xB8\x8B\xF8\x91\x7F\x38\xAA\x14\xCD\xE5"
0368     "\xF5\x1D\xC2\x6D\x53\x69\x52\x84\x7F\xA3\x1A\x5E\x26\x04\x83\x06"
0369     "\x73\x52\x56\xCF\x76\x26\xC9\xDD\x75\xD7\xFC\xF4\x69\xD8\x7B\x55"
0370     "\xB7\x68\x13\x53\xB9\xE7\x89\xC3\xE8\xD6\x6E\xA7\x6D\xEA\x81\xFD"
0371     "\xC4\xB7\x05\x5A\xB7\x41\x0A\x23\x8E\x03\x8A\x1C\xAE\xD3\x1E\xCE"
0372     "\xE3\x5E\xFC\x19\x4A\xEE\x61\x9B\x8E\xE5\xE5\xDD\x85\xF9\x41\xEC"
0373     "\x14\x53\x92\xF7\xDD\x06\x85\x02\x91\xE3\xEB\x6C\x43\x03\xB1\x36"
0374     "\x7B\x89\x5A\xA8\xEB\xFC\xD5\xA8\x35\xDC\x81\xD9\x5C\xBD\xCA\xDC"
0375     "\x9B\x98\x0B\x06\x5D\x0C\x5B\xEE\xF3\xD5\xCC\x57\xC9\x71\x2F\x90"
0376     "\x3B\x3C\xF0\x8E\x4E\x35\x48\xAE\x63\x74\xA9\xFC\x72\x75\x8E\x34"
0377     "\xA8\xF2\x1F\xEA\xDF\x3A\x37\x2D\xE5\x39\x39\xF8\x57\x58\x3C\x04"
0378     "\xFE\x87\x06\x98\xBC\x7B\xD3\x21\x36\x60\x25\x54\xA7\x3D\xFA\x91"
0379     "\xCC\xA8\x0B\x92\x8E\xB4\xF7\x06\xFF\x1E\x95\xCB\x07\x76\x97\x3B"
0380     "\x9D"
0381     "\x02\x03\x01\x00\x01" /* public key integer of 3 bytes */
0382     "\x02\x82\x02\x00" /* private key integer of 512 bytes */
0383     "\x74\xA9\xE0\x6A\x32\xB4\xCA\x85\xD9\x86\x9F\x60\x88\x7B\x40\xCC"
0384     "\xCD\x33\x91\xA8\xB6\x25\x1F\xBF\xE3\x51\x1C\x97\xB6\x2A\xD9\xB8"
0385     "\x11\x40\x19\xE3\x21\x13\xC8\xB3\x7E\xDC\xD7\x65\x40\x4C\x2D\xD6"
0386     "\xDC\xAF\x32\x6C\x96\x75\x2C\x2C\xCA\x8F\x3F\x7A\xEE\xC4\x09\xC6"
0387     "\x24\x3A\xC9\xCF\x6D\x8D\x17\x50\x94\x52\xD3\xE7\x0F\x2F\x7E\x94"
0388     "\x1F\xA0\xBE\xD9\x25\xE8\x38\x42\x7C\x27\xD2\x79\xF8\x2A\x87\x38"
0389     "\xEF\xBB\x74\x8B\xA8\x6E\x8C\x08\xC6\xC7\x4F\x0C\xBC\x79\xC6\xEF"
0390     "\x0E\xA7\x5E\xE4\xF8\x8C\x09\xC7\x5E\x37\xCC\x87\x77\xCD\xCF\xD1"
0391     "\x6D\x28\x1B\xA9\x62\xC0\xB8\x16\xA7\x8B\xF9\xBB\xCC\xB4\x15\x7F"
0392     "\x1B\x69\x03\xF2\x7B\xEB\xE5\x8C\x14\xD6\x23\x4F\x52\x6F\x18\xA6"
0393     "\x4B\x5B\x01\xAD\x35\xF9\x48\x53\xB3\x86\x35\x66\xD7\xE7\x29\xC0"
0394     "\x09\xB5\xC6\xE6\xFA\xC4\xDA\x19\xBE\xD7\x4D\x41\x14\xBE\x6F\xDF"
0395     "\x1B\xAB\xC0\xCA\x88\x07\xAC\xF1\x7D\x35\x83\x67\x28\x2D\x50\xE9"
0396     "\xCE\x27\x71\x5E\x1C\xCF\xD2\x30\x65\x79\x72\x2F\x9C\xE1\xD2\x39"
0397     "\x7F\xEF\x3B\x01\xF2\x14\x1D\xDF\xBD\x51\xD3\xA1\x53\x62\xCF\x5F"
0398     "\x79\x84\xCE\x06\x96\x69\x29\x49\x82\x1C\x71\x4A\xA1\x66\xC8\x2F"
0399     "\xFD\x7B\x96\x7B\xFC\xC4\x26\x58\xC4\xFC\x7C\xAF\xB5\xE8\x95\x83"
0400     "\x87\xCB\x46\xDE\x97\xA7\xB3\xA2\x54\x5B\xD7\xAF\xAB\xEB\xC8\xF3"
0401     "\x55\x9D\x48\x2B\x30\x9C\xDC\x26\x4B\xC2\x89\x45\x13\xB2\x01\x9A"
0402     "\xA4\x65\xC3\xEC\x24\x2D\x26\x97\xEB\x80\x8A\x9D\x03\xBC\x59\x66"
0403     "\x9E\xE2\xBB\xBB\x63\x19\x64\x93\x11\x7B\x25\x65\x30\xCD\x5B\x4B"
0404     "\x2C\xFF\xDC\x2D\x30\x87\x1F\x3C\x88\x07\xD0\xFC\x48\xCC\x05\x8A"
0405     "\xA2\xC8\x39\x3E\xD5\x51\xBC\x0A\xBE\x6D\xA8\xA0\xF6\x88\x06\x79"
0406     "\x13\xFF\x1B\x45\xDA\x54\xC9\x24\x25\x8A\x75\x0A\x26\xD1\x69\x81"
0407     "\x14\x14\xD1\x79\x7D\x8E\x76\xF2\xE0\xEB\xDD\x0F\xDE\xC2\xEC\x80"
0408     "\xD7\xDC\x16\x99\x92\xBE\xCB\x40\x0C\xCE\x7C\x3B\x46\xA2\x5B\x5D"
0409     "\x0C\x45\xEB\xE1\x00\xDE\x72\x50\xB1\xA6\x0B\x76\xC5\x8D\xFC\x82"
0410     "\x38\x6D\x99\x14\x1D\x1A\x4A\xD3\x7C\x53\xB8\x12\x46\xA2\x30\x38"
0411     "\x82\xF4\x96\x6E\x8C\xCE\x47\x0D\xAF\x0A\x3B\x45\xB7\x43\x95\x43"
0412     "\x9E\x02\x2C\x44\x07\x6D\x1F\x3C\x66\x89\x09\xB6\x1F\x06\x30\xCC"
0413     "\xAD\xCE\x7D\x9A\xDE\x3E\xFB\x6C\xE4\x58\x43\xD2\x4F\xA5\x9E\x5E"
0414     "\xA7\x7B\xAE\x3A\xF6\x7E\xD9\xDB\xD3\xF5\xC5\x41\xAF\xE6\x9C\x91"
0415     "\x02\x82\x01\x01" /* prime1 - integer of 257 bytes */
0416     "\x00\xE0\xA6\x6C\xF0\xA2\xF8\x81\x85\x36\x43\xD0\x13\x0B\x33\x8B"
0417     "\x8F\x78\x3D\xAC\xC7\x5E\x46\x6A\x7F\x05\xAE\x3E\x26\x0A\xA6\xD0"
0418     "\x51\xF3\xC8\x61\xF5\x77\x22\x48\x10\x87\x4C\xD5\xA4\xD5\xAE\x2D"
0419     "\x4E\x7A\xFE\x1C\x31\xE7\x6B\xFF\xA4\x69\x20\xF9\x2A\x0B\x99\xBE"
0420     "\x7C\x32\x68\xAD\xB0\xC6\x94\x81\x41\x75\xDC\x06\x78\x0A\xB4\xCF"
0421     "\xCD\x1B\x2D\x31\xE4\x7B\xEA\xA8\x35\x99\x75\x57\xC6\x0E\xF6\x78"
0422     "\x4F\xA0\x92\x4A\x00\x1B\xE7\x96\xF2\x5B\xFD\x2C\x0A\x0A\x13\x81"
0423     "\xAF\xCB\x59\x87\x31\xD9\x83\x65\xF2\x22\x48\xD0\x03\x67\x39\xF6"
0424     "\xFF\xA8\x36\x07\x3A\x68\xE3\x7B\xA9\x64\xFD\x9C\xF7\xB1\x3D\xBF"
0425     "\x26\x5C\xCC\x7A\xFC\xA2\x8F\x51\xD1\xE1\xE2\x3C\xEC\x06\x75\x7C"
0426     "\x34\xF9\xA9\x33\x70\x11\xAD\x5A\xDC\x5F\xCF\x50\xF6\x23\x2F\x39"
0427     "\xAC\x92\x48\x53\x4D\x01\x96\x3C\xD8\xDC\x1F\x23\x23\x78\x80\x34"
0428     "\x54\x14\x76\x8B\xB6\xBB\xFB\x88\x78\x31\x59\x28\xD2\xB1\x75\x17"
0429     "\x88\x04\x4A\x78\x62\x18\x2E\xF5\xFB\x9B\xEF\x15\xD8\x16\x47\xC6"
0430     "\x42\xB1\x02\xDA\x9E\xE3\x84\x90\xB4\x2D\xC3\xCE\x13\xC9\x12\x7D"
0431     "\x3E\xCD\x39\x39\xC9\xAD\xA1\x1A\xE6\xD5\xAD\x5A\x09\x4D\x1B\x0C"
0432     "\xAB"
0433     "\x02\x82\x01\x01" /* prime 2 - integer of 257 bytes */
0434     "\x00\xDE\xD5\x1B\xF6\xCD\x83\xB1\xC6\x47\x7E\xB9\xC0\x6B\xA9\xB8"
0435     "\x02\xF3\xAE\x40\x5D\xFC\xD3\xE5\x4E\xF1\xE3\x39\x04\x52\x84\x89"
0436     "\x40\x37\xBB\xC2\xCD\x7F\x71\x77\x17\xDF\x6A\x4C\x31\x24\x7F\xB9"
0437     "\x7E\x7F\xC8\x43\x4A\x3C\xEB\x8D\x1B\x7F\x21\x51\x67\x45\x8F\xA0"
0438     "\x36\x29\x3A\x18\x45\xA5\x32\xEC\x74\x88\x3C\x98\x5D\x67\x3B\xD7"
0439     "\x51\x1F\xE9\xAE\x09\x01\xDE\xDE\x7C\xFB\x60\xD1\xA5\x6C\xE9\x6A"
0440     "\x93\x04\x02\x3A\xBB\x67\x02\xB9\xFD\x23\xF0\x02\x2B\x49\x85\xC9"
0441     "\x5B\xE7\x4B\xDF\xA3\xF4\xEE\x59\x4C\x45\xEF\x8B\xC1\x6B\xDE\xDE"
0442     "\xBC\x1A\xFC\xD2\x76\x3F\x33\x74\xA9\x8E\xA3\x7E\x0C\xC6\xCE\x70"
0443     "\xA1\x5B\xA6\x77\xEA\x76\xEB\x18\xCE\xB9\xD7\x78\x8D\xAE\x06\xBB"
0444     "\xD3\x1F\x16\x0D\x05\xAB\x4F\xC6\x52\xC8\x6B\x36\x51\x7D\x1D\x27"
0445     "\xAF\x88\x9A\x6F\xCC\x25\x2E\x74\x06\x72\xCE\x9E\xDB\xE0\x9D\x30"
0446     "\xEF\x55\xA5\x58\x21\xA7\x42\x12\x2C\x2C\x23\x87\xC1\x0F\xE8\x51"
0447     "\xDA\x53\xDA\xFC\x05\x36\xDF\x08\x0E\x08\x36\xBE\x5C\x86\x9E\xCA"
0448     "\x68\x90\x33\x12\x0B\x14\x82\xAB\x90\x1A\xD4\x49\x32\x9C\xBD\xAA"
0449     "\xAB\x4E\x38\xF1\xEE\xED\x3D\x3F\xE8\xBD\x48\x56\xA6\x64\xEE\xC8"
0450     "\xD7"
0451     "\x02\x82\x01\x01" /* exponent 1 - integer of 257 bytes */
0452     "\x00\x96\x5E\x6F\x8F\x06\xD6\xE6\x03\x1F\x96\x76\x81\x38\xBF\x30"
0453     "\xCC\x40\x84\xAF\xD0\xE7\x06\xA5\x24\x0E\xCE\x59\xA5\x26\xFE\x0F"
0454     "\x74\xBB\x83\xC6\x26\x02\xAF\x3C\xA3\x6B\x9C\xFF\x68\x0C\xEB\x40"
0455     "\x42\x46\xCB\x2E\x5E\x2C\xF4\x3A\x32\x77\x77\xED\xAF\xBA\x02\x17"
0456     "\xE1\x93\xF0\x43\x4A\x8F\x31\x39\xEF\x72\x0F\x6B\x79\x10\x59\x84"
0457     "\xBA\x5A\x55\x7F\x0E\xDB\xEE\xEE\xD6\xA9\xB8\x44\x9F\x3A\xC6\xB9"
0458     "\x33\x3B\x5C\x90\x11\xD0\x9B\xCC\x8A\xBF\x0E\x10\x5B\x4B\xF1\x50"
0459     "\x9E\x35\xB3\xE0\x6D\x7A\x95\x9C\x38\x5D\xC0\x75\x13\xC2\x15\xA7"
0460     "\x81\xEA\xBA\xF7\x4D\x9E\x85\x9D\xF1\x7D\xBA\xD0\x45\x6F\x2A\xD0"
0461     "\x76\xC2\x28\xD0\xAD\xA7\xB5\xDC\xE3\x6A\x99\xFF\x83\x50\xB3\x75"
0462     "\x07\x14\x91\xAF\xEF\x74\xB5\x9F\x9A\xE0\xBA\xA9\x0B\x87\xF3\x85"
0463     "\x5C\x40\xB2\x0E\xA7\xFD\xC6\xED\x45\x8E\xD9\x7C\xB0\xB2\x68\xC6"
0464     "\x1D\xFD\x70\x78\x06\x41\x7F\x95\x12\x36\x9D\xE2\x58\x5D\x15\xEE"
0465     "\x41\x49\xF5\xFA\xEC\x56\x19\xA0\xE6\xE0\xB2\x40\xE1\xD9\xD0\x03"
0466     "\x22\x02\xCF\xD1\x3C\x07\x38\x65\x8F\x65\x0E\xAA\x32\xCE\x25\x05"
0467     "\x16\x73\x51\xB9\x9F\x88\x0B\xCD\x30\xF3\x97\xCC\x2B\x6B\xA4\x0E"
0468     "\x6F"
0469     "\x02\x82\x01\x00" /* exponent 2 - integer of 256 bytes */
0470     "\x2A\x5F\x3F\xB8\x08\x90\x58\x47\xA9\xE4\xB1\x11\xA3\xE7\x5B\xF4"
0471     "\x43\xBE\x08\xC3\x56\x86\x3C\x7E\x6C\x84\x96\x9C\xF9\xCB\xF6\x05"
0472     "\x5E\x13\xB8\x11\x37\x80\xAD\xF2\xBE\x2B\x0A\x5D\xF5\xE0\xCB\xB7"
0473     "\x00\x39\x66\x82\x41\x5F\x51\x2F\xBF\x56\xE8\x91\xC8\xAA\x6C\xFE"
0474     "\x9F\x8C\x4A\x7D\x43\xD2\x91\x1F\xFF\x9F\xF6\x21\x1C\xB6\x46\x55"
0475     "\x48\xCA\x38\xAB\xC1\xCD\x4D\x65\x5A\xAF\xA8\x6D\xDA\x6D\xF0\x34"
0476     "\x10\x79\x14\x0D\xFA\xA2\x8C\x17\x54\xB4\x18\xD5\x7E\x5F\x90\x50"
0477     "\x87\x84\xE7\xFB\xD7\x61\x53\x5D\xAB\x96\xC7\x6E\x7A\x42\xA0\xFC"
0478     "\x07\xED\xB7\x5F\x80\xD9\x19\xFF\xFB\xFD\x9E\xC4\x73\x31\x62\x3D"
0479     "\x6C\x9E\x15\x03\x62\xA5\x85\xCC\x19\x8E\x9D\x7F\xE3\x6D\xA8\x5D"
0480     "\x96\xF5\xAC\x78\x3D\x81\x27\xE7\x29\xF1\x29\x1D\x09\xBB\x77\x86"
0481     "\x6B\x65\x62\x88\xE1\x31\x1A\x22\xF7\xC5\xCE\x73\x65\x1C\xBE\xE7"
0482     "\x63\xD3\xD3\x14\x63\x27\xAF\x28\xF3\x23\xB6\x76\xC1\xBD\x9D\x82"
0483     "\xF4\x9B\x19\x7D\x2C\x57\xF0\xC2\x2A\x51\xAE\x95\x0D\x8C\x38\x54"
0484     "\xF5\xC6\xA0\x51\xB7\x0E\xB9\xEC\xE7\x0D\x22\xF6\x1A\xD3\xFE\x16"
0485     "\x21\x03\xB7\x0D\x85\xD3\x35\xC9\xDD\xE4\x59\x85\xBE\x7F\xA1\x75"
0486     "\x02\x82\x01\x01" /* coefficient - integer of 257 bytes */
0487     "\x00\xB9\x48\xD2\x54\x2F\x19\x54\x64\xAE\x62\x80\x61\x89\x80\xB4"
0488     "\x48\x0B\x8D\x7E\x1B\x0F\x50\x08\x82\x3F\xED\x75\x84\xB7\x13\xE4"
0489     "\xF8\x8D\xA8\xBB\x54\x21\x4C\x5A\x54\x07\x16\x4B\xB4\xA4\x9E\x30"
0490     "\xBF\x7A\x30\x1B\x39\x60\xA3\x21\x53\xFB\xB0\xDC\x0F\x7C\x2C\xFB"
0491     "\xAA\x95\x7D\x51\x39\x28\x33\x1F\x25\x31\x53\xF5\xD2\x64\x2B\xF2"
0492     "\x1E\xB3\xC0\x6A\x0B\xC9\xA4\x42\x64\x5C\xFB\x15\xA3\xE8\x4C\x3A"
0493     "\x9C\x3C\xBE\xA3\x39\x83\x23\xE3\x6D\x18\xCC\xC2\xDC\x63\x8D\xBA"
0494     "\x98\xE0\xE0\x31\x4A\x2B\x37\x9C\x4D\x6B\xF3\x9F\x51\xE4\x43\x5C"
0495     "\x83\x5F\xBF\x5C\xFE\x92\x45\x01\xAF\xF5\xC2\xF4\xB7\x56\x93\xA5"
0496     "\xF4\xAA\x67\x3C\x48\x37\xBD\x9A\x3C\xFE\xA5\x9A\xB0\xD1\x6B\x85"
0497     "\xDD\x81\xD4\xFA\xAD\x31\x83\xA8\x22\x9B\xFD\xB4\x61\xDC\x7A\x51"
0498     "\x59\x62\x10\x1B\x7E\x44\xA3\xFE\x90\x51\x5A\x3E\x02\x87\xAD\xFA"
0499     "\xDD\x0B\x1F\x3D\x35\xAF\xEE\x13\x85\x51\xA7\x42\xC0\xEE\x9E\x20"
0500     "\xE9\xD0\x29\xB2\xE4\x21\xE4\x6D\x62\xB9\xF4\x48\x4A\xD8\x46\x8E"
0501     "\x61\xA6\x2C\x5D\xDF\x8F\x97\x2B\x3A\x75\x1D\x83\x17\x6F\xC6\xB0"
0502     "\xDE\xFC\x14\x25\x06\x5A\x60\xBB\xB8\x21\x89\xD1\xEF\x57\xF1\x71"
0503     "\x3D",
0504     .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
0505     .c =
0506     "\x5c\xce\x9c\xd7\x9a\x9e\xa1\xfe\x7a\x82\x3c\x68\x27\x98\xe3\x5d"
0507     "\xd5\xd7\x07\x29\xf5\xfb\xc3\x1a\x7f\x63\x1e\x62\x31\x3b\x19\x87"
0508     "\x79\x4f\xec\x7b\xf3\xcb\xea\x9b\x95\x52\x3a\x40\xe5\x87\x7b\x72"
0509     "\xd1\x72\xc9\xfb\x54\x63\xd8\xc9\xd7\x2c\xfc\x7b\xc3\x14\x1e\xbc"
0510     "\x18\xb4\x34\xa1\xbf\x14\xb1\x37\x31\x6e\xf0\x1b\x35\x19\x54\x07"
0511     "\xf7\x99\xec\x3e\x63\xe2\xcd\x61\x28\x65\xc3\xcd\xb1\x38\x36\xa5"
0512     "\xb2\xd7\xb0\xdc\x1f\xf5\xef\x19\xc7\x53\x32\x2d\x1c\x26\xda\xe4"
0513     "\x0d\xd6\x90\x7e\x28\xd8\xdc\xe4\x61\x05\xd2\x25\x90\x01\xd3\x96"
0514     "\x6d\xa6\xcf\x58\x20\xbb\x03\xf4\x01\xbc\x79\xb9\x18\xd8\xb8\xba"
0515     "\xbd\x93\xfc\xf2\x62\x5d\x8c\x66\x1e\x0e\x84\x59\x93\xdd\xe2\x93"
0516     "\xa2\x62\x7d\x08\x82\x7a\xdd\xfc\xb8\xbc\xc5\x4f\x9c\x4e\xbf\xb4"
0517     "\xfc\xf4\xc5\x01\xe8\x00\x70\x4d\x28\x26\xcc\x2e\xfe\x0e\x58\x41"
0518     "\x8b\xec\xaf\x7c\x4b\x54\xd0\xa0\x64\xf9\x32\xf4\x2e\x47\x65\x0a"
0519     "\x67\x88\x39\x3a\xdb\xb2\xdb\x7b\xb5\xf6\x17\xa8\xd9\xc6\x5e\x28"
0520     "\x13\x82\x8a\x99\xdb\x60\x08\xa5\x23\x37\xfa\x88\x90\x31\xc8\x9d"
0521     "\x8f\xec\xfb\x85\x9f\xb1\xce\xa6\x24\x50\x46\x44\x47\xcb\x65\xd1"
0522     "\xdf\xc0\xb1\x6c\x90\x1f\x99\x8e\x4d\xd5\x9e\x31\x07\x66\x87\xdf"
0523     "\x01\xaa\x56\x3c\x71\xe0\x2b\x6f\x67\x3b\x23\xed\xc2\xbd\x03\x30"
0524     "\x79\x76\x02\x10\x10\x98\x85\x8a\xff\xfd\x0b\xda\xa5\xd9\x32\x48"
0525     "\x02\xa0\x0b\xb9\x2a\x8a\x18\xca\xc6\x8f\x3f\xbb\x16\xb2\xaa\x98"
0526     "\x27\xe3\x60\x43\xed\x15\x70\xd4\x57\x15\xfe\x19\xd4\x9b\x13\x78"
0527     "\x8a\xf7\x21\xf1\xa2\xa2\x2d\xb3\x09\xcf\x44\x91\x6e\x08\x3a\x30"
0528     "\x81\x3e\x90\x93\x8a\x67\x33\x00\x59\x54\x9a\x25\xd3\x49\x8e\x9f"
0529     "\xc1\x4b\xe5\x86\xf3\x50\x4c\xbc\xc5\xd3\xf5\x3a\x54\xe1\x36\x3f"
0530     "\xe2\x5a\xb4\x37\xc0\xeb\x70\x35\xec\xf6\xb7\xe8\x44\x3b\x7b\xf3"
0531     "\xf1\xf2\x1e\xdb\x60\x7d\xd5\xbe\xf0\x71\x34\x90\x4c\xcb\xd4\x35"
0532     "\x51\xc7\xdd\xd8\xc9\x81\xf5\x5d\x57\x46\x2c\xb1\x7b\x9b\xaa\xcb"
0533     "\xd1\x22\x25\x49\x44\xa3\xd4\x6b\x29\x7b\xd8\xb2\x07\x93\xbf\x3d"
0534     "\x52\x49\x84\x79\xef\xb8\xe5\xc4\xad\xca\xa8\xc6\xf6\xa6\x76\x70"
0535     "\x5b\x0b\xe5\x83\xc6\x0e\xef\x55\xf2\xe7\xff\x04\xea\xe6\x13\xbe"
0536     "\x40\xe1\x40\x45\x48\x66\x75\x31\xae\x35\x64\x91\x11\x6f\xda\xee"
0537     "\x26\x86\x45\x6f\x0b\xd5\x9f\x03\xb1\x65\x5b\xdb\xa4\xe4\xf9\x45",
0538     .key_len = 2349,
0539     .m_size = 8,
0540     .c_size = 512,
0541     }
0542 };
0543 
0544 #define DH_TEST_VECTORS 2
0545 
0546 struct kpp_testvec dh_tv_template[] = {
0547     {
0548     .secret =
0549 #ifdef __LITTLE_ENDIAN
0550     "\x01\x00" /* type */
0551     "\x11\x02" /* len */
0552     "\x00\x01\x00\x00" /* key_size */
0553     "\x00\x01\x00\x00" /* p_size */
0554     "\x01\x00\x00\x00" /* g_size */
0555 #else
0556     "\x00\x01" /* type */
0557     "\x02\x11" /* len */
0558     "\x00\x00\x01\x00" /* key_size */
0559     "\x00\x00\x01\x00" /* p_size */
0560     "\x00\x00\x00\x01" /* g_size */
0561 #endif
0562     /* xa */
0563     "\x44\xc1\x48\x36\xa7\x2b\x6f\x4e\x43\x03\x68\xad\x31\x00\xda\xf3"
0564     "\x2a\x01\xa8\x32\x63\x5f\x89\x32\x1f\xdf\x4c\xa1\x6a\xbc\x10\x15"
0565     "\x90\x35\xc9\x26\x41\xdf\x7b\xaa\x56\x56\x3d\x85\x44\xb5\xc0\x8e"
0566     "\x37\x83\x06\x50\xb3\x5f\x0e\x28\x2c\xd5\x46\x15\xe3\xda\x7d\x74"
0567     "\x87\x13\x91\x4f\xd4\x2d\xf6\xc7\x5e\x14\x2c\x11\xc2\x26\xb4\x3a"
0568     "\xe3\xb2\x36\x20\x11\x3b\x22\xf2\x06\x65\x66\xe2\x57\x58\xf8\x22"
0569     "\x1a\x94\xbd\x2b\x0e\x8c\x55\xad\x61\x23\x45\x2b\x19\x1e\x63\x3a"
0570     "\x13\x61\xe3\xa0\x79\x70\x3e\x6d\x98\x32\xbc\x7f\x82\xc3\x11\xd8"
0571     "\xeb\x53\xb5\xfc\xb5\xd5\x3c\x4a\xea\x92\x3e\x01\xce\x15\x65\xd4"
0572     "\xaa\x85\xc1\x11\x90\x83\x31\x6e\xfe\xe7\x7f\x7d\xed\xab\xf9\x29"
0573     "\xf8\xc7\xf1\x68\xc6\xb7\xe4\x1f\x2f\x28\xa0\xc9\x1a\x50\x64\x29"
0574     "\x4b\x01\x6d\x1a\xda\x46\x63\x21\x07\x40\x8c\x8e\x4c\x6f\xb5\xe5"
0575     "\x12\xf3\xc2\x1b\x48\x27\x5e\x27\x01\xb1\xaa\xed\x68\x9b\x83\x18"
0576     "\x8f\xb1\xeb\x1f\x04\xd1\x3c\x79\xed\x4b\xf7\x0a\x33\xdc\xe0\xc6"
0577     "\xd8\x02\x51\x59\x00\x74\x30\x07\x4c\x2d\xac\xe4\x13\xf1\x80\xf0"
0578     "\xce\xfa\xff\xa9\xce\x29\x46\xdd\x9d\xad\xd1\xc3\xc6\x58\x1a\x63"
0579     /* p */
0580     "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
0581     "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
0582     "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
0583     "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
0584     "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
0585     "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
0586     "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
0587     "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
0588     "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
0589     "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
0590     "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
0591     "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
0592     "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
0593     "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
0594     "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
0595     "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
0596     /* g */
0597     "\x02",
0598     .b_public =
0599     "\x2a\x67\x5c\xfd\x63\x5d\xc0\x97\x0a\x8b\xa2\x1f\xf8\x8a\xcb\x54"
0600     "\xca\x2f\xd3\x49\x3f\x01\x8e\x87\xfe\xcc\x94\xa0\x3e\xd4\x26\x79"
0601     "\x9a\x94\x3c\x11\x81\x58\x5c\x60\x3d\xf5\x98\x90\x89\x64\x62\x1f"
0602     "\xbd\x05\x6d\x2b\xcd\x84\x40\x9b\x4a\x1f\xe0\x19\xf1\xca\x20\xb3"
0603     "\x4e\xa0\x4f\x15\xcc\xa5\xfe\xa5\xb4\xf5\x0b\x18\x7a\x5a\x37\xaa"
0604     "\x58\x00\x19\x7f\xe2\xa3\xd9\x1c\x44\x57\xcc\xde\x2e\xc1\x38\xea"
0605     "\xeb\xe3\x90\x40\xc4\x6c\xf7\xcd\xe9\x22\x50\x71\xf5\x7c\xdb\x37"
0606     "\x0e\x80\xc3\xed\x7e\xb1\x2b\x2f\xbe\x71\xa6\x11\xa5\x9d\xf5\x39"
0607     "\xf1\xa2\xe5\x85\xbc\x25\x91\x4e\x84\x8d\x26\x9f\x4f\xe6\x0f\xa6"
0608     "\x2b\x6b\xf9\x0d\xaf\x6f\xbb\xfa\x2d\x79\x15\x31\x57\xae\x19\x60"
0609     "\x22\x0a\xf5\xfd\x98\x0e\xbf\x5d\x49\x75\x58\x37\xbc\x7f\xf5\x21"
0610     "\x56\x1e\xd5\xb3\x50\x0b\xca\x96\xf3\xd1\x3f\xb3\x70\xa8\x6d\x63"
0611     "\x48\xfb\x3d\xd7\x29\x91\x45\xb5\x48\xcd\xb6\x78\x30\xf2\x3f\x1e"
0612     "\xd6\x22\xd6\x35\x9b\xf9\x1f\x85\xae\xab\x4b\xd7\xe0\xc7\x86\x67"
0613     "\x3f\x05\x7f\xa6\x0d\x2f\x0d\xbf\x53\x5f\x4d\x2c\x6d\x5e\x57\x40"
0614     "\x30\x3a\x23\x98\xf9\xb4\x32\xf5\x32\x83\xdd\x0b\xae\x33\x97\x2f",
0615     .expected_a_public =
0616     "\x5c\x24\xdf\xeb\x5b\x4b\xf8\xc5\xef\x39\x48\x82\xe0\x1e\x62\xee"
0617     "\x8a\xae\xdf\x93\x6c\x2b\x16\x95\x92\x16\x3f\x16\x7b\x75\x03\x85"
0618     "\xd9\xf1\x69\xc2\x14\x87\x45\xfc\xa4\x19\xf6\xf0\xa4\xf3\xec\xd4"
0619     "\x6c\x5c\x03\x3b\x94\xc2\x2f\x92\xe4\xce\xb3\xe4\x72\xe8\x17\xe6"
0620     "\x23\x7e\x00\x01\x09\x59\x13\xbf\xc1\x2f\x99\xa9\x07\xaa\x02\x23"
0621     "\x4a\xca\x39\x4f\xbc\xec\x0f\x27\x4f\x19\x93\x6c\xb9\x30\x52\xfd"
0622     "\x2b\x9d\x86\xf1\x06\x1e\xb6\x56\x27\x4a\xc9\x8a\xa7\x8a\x48\x5e"
0623     "\xb5\x60\xcb\xdf\xff\x03\x26\x10\xbf\x90\x8f\x46\x60\xeb\x9b\x9a"
0624     "\xd6\x6f\x44\x91\x03\x92\x18\x2c\x96\x5e\x40\x19\xfb\xf4\x4f\x3a"
0625     "\x02\x7b\xaf\xcc\x22\x20\x79\xb9\xf8\x9f\x8f\x85\x6b\xec\x44\xbb"
0626     "\xe6\xa8\x8e\xb1\xe8\x2c\xee\x64\xee\xf8\xbd\x00\xf3\xe2\x2b\x93"
0627     "\xcd\xe7\xc4\xdf\xc9\x19\x46\xfe\xb6\x07\x73\xc1\x8a\x64\x79\x26"
0628     "\xe7\x30\xad\x2a\xdf\xe6\x8f\x59\xf5\x81\xbf\x4a\x29\x91\xe7\xb7"
0629     "\xcf\x48\x13\x27\x75\x79\x40\xd9\xd6\x32\x52\x4e\x6a\x86\xae\x6f"
0630     "\xc2\xbf\xec\x1f\xc2\x69\xb2\xb6\x59\xe5\xa5\x17\xa4\x77\xb7\x62"
0631     "\x46\xde\xe8\xd2\x89\x78\x9a\xef\xa3\xb5\x8f\x26\xec\x80\xda\x39",
0632     .expected_ss =
0633     "\x8f\xf3\xac\xa2\xea\x22\x11\x5c\x45\x65\x1a\x77\x75\x2e\xcf\x46"
0634     "\x23\x14\x1e\x67\x53\x4d\x35\xb0\x38\x1d\x4e\xb9\x41\x9a\x21\x24"
0635     "\x6e\x9f\x40\xfe\x90\x51\xb1\x06\xa4\x7b\x87\x17\x2f\xe7\x5e\x22"
0636     "\xf0\x7b\x54\x84\x0a\xac\x0a\x90\xd2\xd7\xe8\x7f\xe7\xe3\x30\x75"
0637     "\x01\x1f\x24\x75\x56\xbe\xcc\x8d\x1e\x68\x0c\x41\x72\xd3\xfa\xbb"
0638     "\xe5\x9c\x60\xc7\x28\x77\x0c\xbe\x89\xab\x08\xd6\x21\xe7\x2e\x1a"
0639     "\x58\x7a\xca\x4f\x22\xf3\x2b\x30\xfd\xf4\x98\xc1\xa3\xf8\xf6\xcc"
0640     "\xa9\xe4\xdb\x5b\xee\xd5\x5c\x6f\x62\x4c\xd1\x1a\x02\x2a\x23\xe4"
0641     "\xb5\x57\xf3\xf9\xec\x04\x83\x54\xfe\x08\x5e\x35\xac\xfb\xa8\x09"
0642     "\x82\x32\x60\x11\xb2\x16\x62\x6b\xdf\xda\xde\x9c\xcb\x63\x44\x6c"
0643     "\x59\x26\x6a\x8f\xb0\x24\xcb\xa6\x72\x48\x1e\xeb\xe0\xe1\x09\x44"
0644     "\xdd\xee\x66\x6d\x84\xcf\xa5\xc1\xb8\x36\x74\xd3\x15\x96\xc3\xe4"
0645     "\xc6\x5a\x4d\x23\x97\x0c\x5c\xcb\xa9\xf5\x29\xc2\x0e\xff\x93\x82"
0646     "\xd3\x34\x49\xad\x64\xa6\xb1\xc0\x59\x28\x75\x60\xa7\x8a\xb0\x11"
0647     "\x56\x89\x42\x74\x11\xf5\xf6\x5e\x6f\x16\x54\x6a\xb1\x76\x4d\x50"
0648     "\x8a\x68\xc1\x5b\x82\xb9\x0d\x00\x32\x50\xed\x88\x87\x48\x92\x17",
0649     .secret_size = 529,
0650     .b_public_size = 256,
0651     .expected_a_public_size = 256,
0652     .expected_ss_size = 256,
0653     },
0654     {
0655     .secret =
0656 #ifdef __LITTLE_ENDIAN
0657     "\x01\x00" /* type */
0658     "\x11\x02" /* len */
0659     "\x00\x01\x00\x00" /* key_size */
0660     "\x00\x01\x00\x00" /* p_size */
0661     "\x01\x00\x00\x00" /* g_size */
0662 #else
0663     "\x00\x01" /* type */
0664     "\x02\x11" /* len */
0665     "\x00\x00\x01\x00" /* key_size */
0666     "\x00\x00\x01\x00" /* p_size */
0667     "\x00\x00\x00\x01" /* g_size */
0668 #endif
0669     /* xa */
0670     "\x4d\x75\xa8\x6e\xba\x23\x3a\x0c\x63\x56\xc8\xc9\x5a\xa7\xd6\x0e"
0671     "\xed\xae\x40\x78\x87\x47\x5f\xe0\xa7\x7b\xba\x84\x88\x67\x4e\xe5"
0672     "\x3c\xcc\x5c\x6a\xe7\x4a\x20\xec\xbe\xcb\xf5\x52\x62\x9f\x37\x80"
0673     "\x0c\x72\x7b\x83\x66\xa4\xf6\x7f\x95\x97\x1c\x6a\x5c\x7e\xf1\x67"
0674     "\x37\xb3\x93\x39\x3d\x0b\x55\x35\xd9\xe5\x22\x04\x9f\xf8\xc1\x04"
0675     "\xce\x13\xa5\xac\xe1\x75\x05\xd1\x2b\x53\xa2\x84\xef\xb1\x18\xf4"
0676     "\x66\xdd\xea\xe6\x24\x69\x5a\x49\xe0\x7a\xd8\xdf\x1b\xb7\xf1\x6d"
0677     "\x9b\x50\x2c\xc8\x1c\x1c\xa3\xb4\x37\xfb\x66\x3f\x67\x71\x73\xa9"
0678     "\xff\x5f\xd9\xa2\x25\x6e\x25\x1b\x26\x54\xbf\x0c\xc6\xdb\xea\x0a"
0679     "\x52\x6c\x16\x7c\x27\x68\x15\x71\x58\x73\x9d\xe6\xc2\x80\xaa\x97"
0680     "\x31\x66\xfb\xa6\xfb\xfd\xd0\x9c\x1d\xbe\x81\x48\xf5\x9a\x32\xf1"
0681     "\x69\x62\x18\x78\xae\x72\x36\xe6\x94\x27\xd1\xff\x18\x4f\x28\x6a"
0682     "\x16\xbd\x6a\x60\xee\xe5\xf9\x6d\x16\xe4\xb8\xa6\x41\x9b\x23\x7e"
0683     "\xf7\x9d\xd1\x1d\x03\x15\x66\x3a\xcf\xb6\x2c\x13\x96\x2c\x52\x21"
0684     "\xe4\x2d\x48\x7a\x8a\x5d\xb2\x88\xed\x98\x61\x79\x8b\x6a\x1e\x5f"
0685     "\xd0\x8a\x2d\x99\x5a\x2b\x0f\xbc\xef\x53\x8f\x32\xc1\xa2\x99\x26"
0686     /* p */
0687     "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
0688     "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
0689     "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
0690     "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
0691     "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
0692     "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
0693     "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
0694     "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
0695     "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
0696     "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
0697     "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
0698     "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
0699     "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
0700     "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
0701     "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
0702     "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
0703     /* g */
0704     "\x02",
0705     .b_public =
0706     "\x99\x4d\xd9\x01\x84\x8e\x4a\x5b\xb8\xa5\x64\x8c\x6c\x00\x5c\x0e"
0707     "\x1e\x1b\xee\x5d\x9f\x53\xe3\x16\x70\x01\xed\xbf\x4f\x14\x36\x6e"
0708     "\xe4\x43\x45\x43\x49\xcc\xb1\xb0\x2a\xc0\x6f\x22\x55\x42\x17\x94"
0709     "\x18\x83\xd7\x2a\x5c\x51\x54\xf8\x4e\x7c\x10\xda\x76\x68\x57\x77"
0710     "\x1e\x62\x03\x30\x04\x7b\x4c\x39\x9c\x54\x01\x54\xec\xef\xb3\x55"
0711     "\xa4\xc0\x24\x6d\x3d\xbd\xcc\x46\x5b\x00\x96\xc7\xea\x93\xd1\x3f"
0712     "\xf2\x6a\x72\xe3\xf2\xc1\x92\x24\x5b\xda\x48\x70\x2c\xa9\x59\x97"
0713     "\x19\xb1\xd6\x54\xb3\x9c\x2e\xb0\x63\x07\x9b\x5e\xac\xb5\xf2\xb1"
0714     "\x5b\xf8\xf3\xd7\x2d\x37\x9b\x68\x6c\xf8\x90\x07\xbc\x37\x9a\xa5"
0715     "\xe2\x91\x12\x25\x47\x77\xe3\x3d\xb2\x95\x69\x44\x0b\x91\x1e\xaf"
0716     "\x7c\x8c\x7c\x34\x41\x6a\xab\x60\x6e\xc6\x52\xec\x7e\x94\x0a\x37"
0717     "\xec\x98\x90\xdf\x3f\x02\xbd\x23\x52\xdd\xd9\xe5\x31\x80\x74\x25"
0718     "\xb6\xd2\xd3\xcc\xd5\xcc\x6d\xf9\x7e\x4d\x78\xab\x77\x51\xfa\x77"
0719     "\x19\x94\x49\x8c\x05\xd4\x75\xed\xd2\xb3\x64\x57\xe0\x52\x99\xc0"
0720     "\x83\xe3\xbb\x5e\x2b\xf1\xd2\xc0\xb1\x37\x36\x0b\x7c\xb5\x63\x96"
0721     "\x8e\xde\x04\x23\x11\x95\x62\x11\x9a\xce\x6f\x63\xc8\xd5\xd1\x8f",
0722     .expected_a_public =
0723     "\x90\x89\xe4\x82\xd6\x0a\xcf\x1a\xae\xce\x1b\x66\xa7\x19\x71\x18"
0724     "\x8f\x95\x4b\x5b\x80\x45\x4a\x5a\x43\x99\x4d\x37\xcf\xa3\xa7\x28"
0725     "\x9c\xc7\x73\xf1\xb2\x17\xf6\x99\xe3\x6b\x56\xcb\x3e\x35\x60\x7d"
0726     "\x65\xc7\x84\x6b\x3e\x60\xee\xcd\xd2\x70\xe7\xc9\x32\x1c\xf0\xb4"
0727     "\xf9\x52\xd9\x88\x75\xfd\x40\x2c\xa7\xbe\x19\x1c\x0a\xae\x93\xe1"
0728     "\x71\xc7\xcd\x4f\x33\x5c\x10\x7d\x39\x56\xfc\x73\x84\xb2\x67\xc3"
0729     "\x77\x26\x20\x97\x2b\xf8\x13\x43\x93\x9c\x9a\xa4\x08\xc7\x34\x83"
0730     "\xe6\x98\x61\xe7\x16\x30\x2c\xb1\xdb\x2a\xb2\xcc\xc3\x02\xa5\x3c"
0731     "\x71\x50\x14\x83\xc7\xbb\xa4\xbe\x98\x1b\xfe\xcb\x43\xe9\x97\x62"
0732     "\xd6\xf0\x8c\xcb\x1c\xba\x1e\xa8\xa6\xa6\x50\xfc\x85\x7d\x47\xbf"
0733     "\xf4\x3e\x23\xd3\x5f\xb2\x71\x3e\x40\x94\xaa\x87\x83\x2c\x6c\x8e"
0734     "\x60\xfd\xdd\xf7\xf4\x76\x03\xd3\x1d\xec\x18\x51\xa3\xf2\x44\x1a"
0735     "\x3f\xb4\x7c\x18\x0d\x68\x65\x92\x54\x0d\x2d\x81\x16\xf1\x84\x66"
0736     "\x89\x92\xd0\x1a\x5e\x1f\x42\x46\x5b\xe5\x83\x86\x80\xd9\xcd\x3a"
0737     "\x5a\x2f\xb9\x59\x9b\xe4\x43\x84\x64\xf3\x09\x1a\x0a\xa2\x64\x0f"
0738     "\x77\x4e\x8d\x8b\xe6\x88\xd1\xfc\xaf\x8f\xdf\x1d\xbc\x31\xb3\xbd",
0739     .expected_ss =
0740     "\x34\xc3\x35\x14\x88\x46\x26\x23\x97\xbb\xdd\x28\x5c\x94\xf6\x47"
0741     "\xca\xb3\x19\xaf\xca\x44\x9b\xc2\x7d\x89\xfd\x96\x14\xfd\x6d\x58"
0742     "\xd8\xc4\x6b\x61\x2a\x0d\xf2\x36\x45\xc8\xe4\xa4\xed\x81\x53\x81"
0743     "\x66\x1e\xe0\x5a\xb1\x78\x2d\x0b\x5c\xb4\xd1\xfc\x90\xc6\x9c\xdb"
0744     "\x5a\x30\x0b\x14\x7d\xbe\xb3\x7d\xb1\xb2\x76\x3c\x6c\xef\x74\x6b"
0745     "\xe7\x1f\x64\x0c\xab\x65\xe1\x76\x5c\x3d\x83\xb5\x8a\xfb\xaf\x0f"
0746     "\xf2\x06\x14\x8f\xa0\xf6\xc1\x89\x78\xf2\xba\x72\x73\x3c\xf7\x76"
0747     "\x21\x67\xbc\x24\x31\xb8\x09\x65\x0f\x0c\x02\x32\x4a\x98\x14\xfc"
0748     "\x72\x2c\x25\x60\x68\x5f\x2f\x30\x1e\x5b\xf0\x3b\xd1\xa2\x87\xa0"
0749     "\x54\xdf\xdb\xc0\xee\x0a\x0f\x47\xc9\x90\x20\x2c\xf9\xe3\x52\xad"
0750     "\x27\x65\x8d\x54\x8d\xa8\xa1\xf3\xed\x15\xd4\x94\x28\x90\x31\x93"
0751     "\x1b\xc0\x51\xbb\x43\x5d\x76\x3b\x1d\x2a\x71\x50\xea\x5d\x48\x94"
0752     "\x7f\x6f\xf1\x48\xdb\x30\xe5\xae\x64\x79\xd9\x7a\xdb\xc6\xff\xd8"
0753     "\x5e\x5a\x64\xbd\xf6\x85\x04\xe8\x28\x6a\xac\xef\xce\x19\x8e\x9a"
0754     "\xfe\x75\xc0\x27\x69\xe3\xb3\x7b\x21\xa7\xb1\x16\xa4\x85\x23\xee"
0755     "\xb0\x1b\x04\x6e\xbd\xab\x16\xde\xfd\x86\x6b\xa9\x95\xd7\x0b\xfd",
0756     .secret_size = 529,
0757     .b_public_size = 256,
0758     .expected_a_public_size = 256,
0759     .expected_ss_size = 256,
0760     }
0761 };
0762 
0763 #ifdef CONFIG_CRYPTO_FIPS
0764 #define ECDH_TEST_VECTORS 1
0765 #else
0766 #define ECDH_TEST_VECTORS 2
0767 #endif
0768 struct kpp_testvec ecdh_tv_template[] = {
0769     {
0770 #ifndef CONFIG_CRYPTO_FIPS
0771     .secret =
0772 #ifdef __LITTLE_ENDIAN
0773     "\x02\x00" /* type */
0774     "\x20\x00" /* len */
0775     "\x01\x00" /* curve_id */
0776     "\x18\x00" /* key_size */
0777 #else
0778     "\x00\x02" /* type */
0779     "\x00\x20" /* len */
0780     "\x00\x01" /* curve_id */
0781     "\x00\x18" /* key_size */
0782 #endif
0783     "\xb5\x05\xb1\x71\x1e\xbf\x8c\xda"
0784     "\x4e\x19\x1e\x62\x1f\x23\x23\x31"
0785     "\x36\x1e\xd3\x84\x2f\xcc\x21\x72",
0786     .b_public =
0787     "\xc3\xba\x67\x4b\x71\xec\xd0\x76"
0788     "\x7a\x99\x75\x64\x36\x13\x9a\x94"
0789     "\x5d\x8b\xdc\x60\x90\x91\xfd\x3f"
0790     "\xb0\x1f\x8a\x0a\x68\xc6\x88\x6e"
0791     "\x83\x87\xdd\x67\x09\xf8\x8d\x96"
0792     "\x07\xd6\xbd\x1c\xe6\x8d\x9d\x67",
0793     .expected_a_public =
0794     "\x1a\x04\xdb\xa5\xe1\xdd\x4e\x79"
0795     "\xa3\xe6\xef\x0e\x5c\x80\x49\x85"
0796     "\xfa\x78\xb4\xef\x49\xbd\x4c\x7c"
0797     "\x22\x90\x21\x02\xf9\x1b\x81\x5d"
0798     "\x0c\x8a\xa8\x98\xd6\x27\x69\x88"
0799     "\x5e\xbc\x94\xd8\x15\x9e\x21\xce",
0800     .expected_ss =
0801     "\xf4\x57\xcc\x4f\x1f\x4e\x31\xcc"
0802     "\xe3\x40\x60\xc8\x06\x93\xc6\x2e"
0803     "\x99\x80\x81\x28\xaf\xc5\x51\x74",
0804     .secret_size = 32,
0805     .b_public_size = 48,
0806     .expected_a_public_size = 48,
0807     .expected_ss_size = 24
0808     }, {
0809 #endif
0810     .secret =
0811 #ifdef __LITTLE_ENDIAN
0812     "\x02\x00" /* type */
0813     "\x28\x00" /* len */
0814     "\x02\x00" /* curve_id */
0815     "\x20\x00" /* key_size */
0816 #else
0817     "\x00\x02" /* type */
0818     "\x00\x28" /* len */
0819     "\x00\x02" /* curve_id */
0820     "\x00\x20" /* key_size */
0821 #endif
0822     "\x24\xd1\x21\xeb\xe5\xcf\x2d\x83"
0823     "\xf6\x62\x1b\x6e\x43\x84\x3a\xa3"
0824     "\x8b\xe0\x86\xc3\x20\x19\xda\x92"
0825     "\x50\x53\x03\xe1\xc0\xea\xb8\x82",
0826     .expected_a_public =
0827     "\x1a\x7f\xeb\x52\x00\xbd\x3c\x31"
0828     "\x7d\xb6\x70\xc1\x86\xa6\xc7\xc4"
0829     "\x3b\xc5\x5f\x6c\x6f\x58\x3c\xf5"
0830     "\xb6\x63\x82\x77\x33\x24\xa1\x5f"
0831     "\x6a\xca\x43\x6f\xf7\x7e\xff\x02"
0832     "\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
0833     "\x6a\x02\x6e\x41\x87\x68\x38\x77"
0834     "\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
0835     .expected_ss =
0836     "\xea\x17\x6f\x7e\x6e\x57\x26\x38"
0837     "\x8b\xfb\x41\xeb\xba\xc8\x6d\xa5"
0838     "\xa8\x72\xd1\xff\xc9\x47\x3d\xaa"
0839     "\x58\x43\x9f\x34\x0f\x8c\xf3\xc9",
0840     .b_public =
0841     "\xcc\xb4\xda\x74\xb1\x47\x3f\xea"
0842     "\x6c\x70\x9e\x38\x2d\xc7\xaa\xb7"
0843     "\x29\xb2\x47\x03\x19\xab\xdd\x34"
0844     "\xbd\xa8\x2c\x93\xe1\xa4\x74\xd9"
0845     "\x64\x63\xf7\x70\x20\x2f\xa4\xe6"
0846     "\x9f\x4a\x38\xcc\xc0\x2c\x49\x2f"
0847     "\xb1\x32\xbb\xaf\x22\x61\xda\xcb"
0848     "\x6f\xdb\xa9\xaa\xfc\x77\x81\xf3",
0849     .secret_size = 40,
0850     .b_public_size = 64,
0851     .expected_a_public_size = 64,
0852     .expected_ss_size = 32
0853     }
0854 };
0855 
0856 /*
0857  * MD4 test vectors from RFC1320
0858  */
0859 #define MD4_TEST_VECTORS    7
0860 
0861 static struct hash_testvec md4_tv_template [] = {
0862     {
0863         .plaintext = "",
0864         .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
0865               "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
0866     }, {
0867         .plaintext = "a",
0868         .psize  = 1,
0869         .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
0870               "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
0871     }, {
0872         .plaintext = "abc",
0873         .psize  = 3,
0874         .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
0875               "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
0876     }, {
0877         .plaintext = "message digest",
0878         .psize  = 14,
0879         .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
0880             "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
0881     }, {
0882         .plaintext = "abcdefghijklmnopqrstuvwxyz",
0883         .psize  = 26,
0884         .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
0885               "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
0886         .np = 2,
0887         .tap    = { 13, 13 },
0888     }, {
0889         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
0890         .psize  = 62,
0891         .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
0892               "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
0893     }, {
0894         .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
0895                "45678901234567890",
0896         .psize  = 80,
0897         .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
0898               "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
0899     },
0900 };
0901 
0902 #define SHA3_224_TEST_VECTORS   3
0903 static struct hash_testvec sha3_224_tv_template[] = {
0904     {
0905         .plaintext = "",
0906         .digest = "\x6b\x4e\x03\x42\x36\x67\xdb\xb7"
0907                 "\x3b\x6e\x15\x45\x4f\x0e\xb1\xab"
0908                 "\xd4\x59\x7f\x9a\x1b\x07\x8e\x3f"
0909                 "\x5b\x5a\x6b\xc7",
0910     }, {
0911         .plaintext = "a",
0912         .psize  = 1,
0913         .digest = "\x9e\x86\xff\x69\x55\x7c\xa9\x5f"
0914                 "\x40\x5f\x08\x12\x69\x68\x5b\x38"
0915                 "\xe3\xa8\x19\xb3\x09\xee\x94\x2f"
0916                 "\x48\x2b\x6a\x8b",
0917     }, {
0918         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
0919                 "jklmklmnlmnomnopnopq",
0920         .psize  = 56,
0921         .digest = "\x8a\x24\x10\x8b\x15\x4a\xda\x21"
0922                 "\xc9\xfd\x55\x74\x49\x44\x79\xba"
0923                 "\x5c\x7e\x7a\xb7\x6e\xf2\x64\xea"
0924                 "\xd0\xfc\xce\x33",
0925     },
0926 };
0927 
0928 #define SHA3_256_TEST_VECTORS   3
0929 static struct hash_testvec sha3_256_tv_template[] = {
0930     {
0931         .plaintext = "",
0932         .digest = "\xa7\xff\xc6\xf8\xbf\x1e\xd7\x66"
0933                 "\x51\xc1\x47\x56\xa0\x61\xd6\x62"
0934                 "\xf5\x80\xff\x4d\xe4\x3b\x49\xfa"
0935                 "\x82\xd8\x0a\x4b\x80\xf8\x43\x4a",
0936     }, {
0937         .plaintext = "a",
0938         .psize  = 1,
0939         .digest = "\x80\x08\x4b\xf2\xfb\xa0\x24\x75"
0940                 "\x72\x6f\xeb\x2c\xab\x2d\x82\x15"
0941                 "\xea\xb1\x4b\xc6\xbd\xd8\xbf\xb2"
0942                 "\xc8\x15\x12\x57\x03\x2e\xcd\x8b",
0943     }, {
0944         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
0945                  "jklmklmnlmnomnopnopq",
0946         .psize  = 56,
0947         .digest = "\x41\xc0\xdb\xa2\xa9\xd6\x24\x08"
0948                 "\x49\x10\x03\x76\xa8\x23\x5e\x2c"
0949                 "\x82\xe1\xb9\x99\x8a\x99\x9e\x21"
0950                 "\xdb\x32\xdd\x97\x49\x6d\x33\x76",
0951     },
0952 };
0953 
0954 
0955 #define SHA3_384_TEST_VECTORS   3
0956 static struct hash_testvec sha3_384_tv_template[] = {
0957     {
0958         .plaintext = "",
0959         .digest = "\x0c\x63\xa7\x5b\x84\x5e\x4f\x7d"
0960                 "\x01\x10\x7d\x85\x2e\x4c\x24\x85"
0961                 "\xc5\x1a\x50\xaa\xaa\x94\xfc\x61"
0962                 "\x99\x5e\x71\xbb\xee\x98\x3a\x2a"
0963                 "\xc3\x71\x38\x31\x26\x4a\xdb\x47"
0964                 "\xfb\x6b\xd1\xe0\x58\xd5\xf0\x04",
0965     }, {
0966         .plaintext = "a",
0967         .psize  = 1,
0968         .digest = "\x18\x15\xf7\x74\xf3\x20\x49\x1b"
0969                 "\x48\x56\x9e\xfe\xc7\x94\xd2\x49"
0970                 "\xee\xb5\x9a\xae\x46\xd2\x2b\xf7"
0971                 "\x7d\xaf\xe2\x5c\x5e\xdc\x28\xd7"
0972                 "\xea\x44\xf9\x3e\xe1\x23\x4a\xa8"
0973                 "\x8f\x61\xc9\x19\x12\xa4\xcc\xd9",
0974     }, {
0975         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
0976                  "jklmklmnlmnomnopnopq",
0977         .psize  = 56,
0978         .digest = "\x99\x1c\x66\x57\x55\xeb\x3a\x4b"
0979                 "\x6b\xbd\xfb\x75\xc7\x8a\x49\x2e"
0980                 "\x8c\x56\xa2\x2c\x5c\x4d\x7e\x42"
0981                 "\x9b\xfd\xbc\x32\xb9\xd4\xad\x5a"
0982                 "\xa0\x4a\x1f\x07\x6e\x62\xfe\xa1"
0983                 "\x9e\xef\x51\xac\xd0\x65\x7c\x22",
0984     },
0985 };
0986 
0987 
0988 #define SHA3_512_TEST_VECTORS   3
0989 static struct hash_testvec sha3_512_tv_template[] = {
0990     {
0991         .plaintext = "",
0992         .digest = "\xa6\x9f\x73\xcc\xa2\x3a\x9a\xc5"
0993                 "\xc8\xb5\x67\xdc\x18\x5a\x75\x6e"
0994                 "\x97\xc9\x82\x16\x4f\xe2\x58\x59"
0995                 "\xe0\xd1\xdc\xc1\x47\x5c\x80\xa6"
0996                 "\x15\xb2\x12\x3a\xf1\xf5\xf9\x4c"
0997                 "\x11\xe3\xe9\x40\x2c\x3a\xc5\x58"
0998                 "\xf5\x00\x19\x9d\x95\xb6\xd3\xe3"
0999                 "\x01\x75\x85\x86\x28\x1d\xcd\x26",
1000     }, {
1001         .plaintext = "a",
1002         .psize  = 1,
1003         .digest = "\x69\x7f\x2d\x85\x61\x72\xcb\x83"
1004                 "\x09\xd6\xb8\xb9\x7d\xac\x4d\xe3"
1005                 "\x44\xb5\x49\xd4\xde\xe6\x1e\xdf"
1006                 "\xb4\x96\x2d\x86\x98\xb7\xfa\x80"
1007                 "\x3f\x4f\x93\xff\x24\x39\x35\x86"
1008                 "\xe2\x8b\x5b\x95\x7a\xc3\xd1\xd3"
1009                 "\x69\x42\x0c\xe5\x33\x32\x71\x2f"
1010                 "\x99\x7b\xd3\x36\xd0\x9a\xb0\x2a",
1011     }, {
1012         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
1013                  "jklmklmnlmnomnopnopq",
1014         .psize  = 56,
1015         .digest = "\x04\xa3\x71\xe8\x4e\xcf\xb5\xb8"
1016                 "\xb7\x7c\xb4\x86\x10\xfc\xa8\x18"
1017                 "\x2d\xd4\x57\xce\x6f\x32\x6a\x0f"
1018                 "\xd3\xd7\xec\x2f\x1e\x91\x63\x6d"
1019                 "\xee\x69\x1f\xbe\x0c\x98\x53\x02"
1020                 "\xba\x1b\x0d\x8d\xc7\x8c\x08\x63"
1021                 "\x46\xb5\x33\xb4\x9c\x03\x0d\x99"
1022                 "\xa2\x7d\xaf\x11\x39\xd6\xe7\x5e",
1023     },
1024 };
1025 
1026 
1027 /*
1028  * MD5 test vectors from RFC1321
1029  */
1030 #define MD5_TEST_VECTORS    7
1031 
1032 static struct hash_testvec md5_tv_template[] = {
1033     {
1034         .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
1035               "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
1036     }, {
1037         .plaintext = "a",
1038         .psize  = 1,
1039         .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
1040               "\x31\xc3\x99\xe2\x69\x77\x26\x61",
1041     }, {
1042         .plaintext = "abc",
1043         .psize  = 3,
1044         .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
1045               "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
1046     }, {
1047         .plaintext = "message digest",
1048         .psize  = 14,
1049         .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
1050               "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
1051     }, {
1052         .plaintext = "abcdefghijklmnopqrstuvwxyz",
1053         .psize  = 26,
1054         .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
1055               "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
1056         .np = 2,
1057         .tap    = {13, 13}
1058     }, {
1059         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
1060         .psize  = 62,
1061         .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
1062               "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
1063     }, {
1064         .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
1065                "345678901234567890",
1066         .psize  = 80,
1067         .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
1068               "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
1069     }
1070 
1071 };
1072 
1073 /*
1074  * RIPEMD-128 test vectors from ISO/IEC 10118-3:2004(E)
1075  */
1076 #define RMD128_TEST_VECTORS     10
1077 
1078 static struct hash_testvec rmd128_tv_template[] = {
1079     {
1080         .digest = "\xcd\xf2\x62\x13\xa1\x50\xdc\x3e"
1081               "\xcb\x61\x0f\x18\xf6\xb3\x8b\x46",
1082     }, {
1083         .plaintext = "a",
1084         .psize  = 1,
1085         .digest = "\x86\xbe\x7a\xfa\x33\x9d\x0f\xc7"
1086               "\xcf\xc7\x85\xe7\x2f\x57\x8d\x33",
1087     }, {
1088         .plaintext = "abc",
1089         .psize  = 3,
1090         .digest = "\xc1\x4a\x12\x19\x9c\x66\xe4\xba"
1091               "\x84\x63\x6b\x0f\x69\x14\x4c\x77",
1092     }, {
1093         .plaintext = "message digest",
1094         .psize  = 14,
1095         .digest = "\x9e\x32\x7b\x3d\x6e\x52\x30\x62"
1096               "\xaf\xc1\x13\x2d\x7d\xf9\xd1\xb8",
1097     }, {
1098         .plaintext = "abcdefghijklmnopqrstuvwxyz",
1099         .psize  = 26,
1100         .digest = "\xfd\x2a\xa6\x07\xf7\x1d\xc8\xf5"
1101               "\x10\x71\x49\x22\xb3\x71\x83\x4e",
1102     }, {
1103         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
1104                  "fghijklmnopqrstuvwxyz0123456789",
1105         .psize  = 62,
1106         .digest = "\xd1\xe9\x59\xeb\x17\x9c\x91\x1f"
1107               "\xae\xa4\x62\x4c\x60\xc5\xc7\x02",
1108     }, {
1109         .plaintext = "1234567890123456789012345678901234567890"
1110                  "1234567890123456789012345678901234567890",
1111         .psize  = 80,
1112         .digest = "\x3f\x45\xef\x19\x47\x32\xc2\xdb"
1113               "\xb2\xc4\xa2\xc7\x69\x79\x5f\xa3",
1114     }, {
1115         .plaintext = "abcdbcdecdefdefgefghfghighij"
1116                  "hijkijkljklmklmnlmnomnopnopq",
1117         .psize  = 56,
1118         .digest = "\xa1\xaa\x06\x89\xd0\xfa\xfa\x2d"
1119               "\xdc\x22\xe8\x8b\x49\x13\x3a\x06",
1120         .np = 2,
1121         .tap    = { 28, 28 },
1122     }, {
1123         .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
1124                  "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
1125                  "lmnopqrsmnopqrstnopqrstu",
1126         .psize  = 112,
1127         .digest = "\xd4\xec\xc9\x13\xe1\xdf\x77\x6b"
1128               "\xf4\x8d\xe9\xd5\x5b\x1f\x25\x46",
1129     }, {
1130         .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
1131         .psize  = 32,
1132         .digest = "\x13\xfc\x13\xe8\xef\xff\x34\x7d"
1133               "\xe1\x93\xff\x46\xdb\xac\xcf\xd4",
1134     }
1135 };
1136 
1137 /*
1138  * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
1139  */
1140 #define RMD160_TEST_VECTORS     10
1141 
1142 static struct hash_testvec rmd160_tv_template[] = {
1143     {
1144         .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
1145               "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
1146     }, {
1147         .plaintext = "a",
1148         .psize  = 1,
1149         .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
1150               "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
1151     }, {
1152         .plaintext = "abc",
1153         .psize  = 3,
1154         .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
1155               "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
1156     }, {
1157         .plaintext = "message digest",
1158         .psize  = 14,
1159         .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
1160               "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
1161     }, {
1162         .plaintext = "abcdefghijklmnopqrstuvwxyz",
1163         .psize  = 26,
1164         .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
1165               "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
1166     }, {
1167         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
1168                  "fghijklmnopqrstuvwxyz0123456789",
1169         .psize  = 62,
1170         .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
1171               "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
1172     }, {
1173         .plaintext = "1234567890123456789012345678901234567890"
1174                  "1234567890123456789012345678901234567890",
1175         .psize  = 80,
1176         .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
1177               "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
1178     }, {
1179         .plaintext = "abcdbcdecdefdefgefghfghighij"
1180                  "hijkijkljklmklmnlmnomnopnopq",
1181         .psize  = 56,
1182         .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
1183               "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
1184         .np = 2,
1185         .tap    = { 28, 28 },
1186     }, {
1187         .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
1188                  "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
1189                  "lmnopqrsmnopqrstnopqrstu",
1190         .psize  = 112,
1191         .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
1192               "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
1193     }, {
1194         .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
1195         .psize  = 32,
1196         .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
1197               "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
1198     }
1199 };
1200 
1201 /*
1202  * RIPEMD-256 test vectors
1203  */
1204 #define RMD256_TEST_VECTORS     8
1205 
1206 static struct hash_testvec rmd256_tv_template[] = {
1207     {
1208         .digest = "\x02\xba\x4c\x4e\x5f\x8e\xcd\x18"
1209               "\x77\xfc\x52\xd6\x4d\x30\xe3\x7a"
1210               "\x2d\x97\x74\xfb\x1e\x5d\x02\x63"
1211               "\x80\xae\x01\x68\xe3\xc5\x52\x2d",
1212     }, {
1213         .plaintext = "a",
1214         .psize  = 1,
1215         .digest = "\xf9\x33\x3e\x45\xd8\x57\xf5\xd9"
1216               "\x0a\x91\xba\xb7\x0a\x1e\xba\x0c"
1217               "\xfb\x1b\xe4\xb0\x78\x3c\x9a\xcf"
1218               "\xcd\x88\x3a\x91\x34\x69\x29\x25",
1219     }, {
1220         .plaintext = "abc",
1221         .psize  = 3,
1222         .digest = "\xaf\xbd\x6e\x22\x8b\x9d\x8c\xbb"
1223               "\xce\xf5\xca\x2d\x03\xe6\xdb\xa1"
1224               "\x0a\xc0\xbc\x7d\xcb\xe4\x68\x0e"
1225               "\x1e\x42\xd2\xe9\x75\x45\x9b\x65",
1226     }, {
1227         .plaintext = "message digest",
1228         .psize  = 14,
1229         .digest = "\x87\xe9\x71\x75\x9a\x1c\xe4\x7a"
1230               "\x51\x4d\x5c\x91\x4c\x39\x2c\x90"
1231               "\x18\xc7\xc4\x6b\xc1\x44\x65\x55"
1232               "\x4a\xfc\xdf\x54\xa5\x07\x0c\x0e",
1233     }, {
1234         .plaintext = "abcdefghijklmnopqrstuvwxyz",
1235         .psize  = 26,
1236         .digest = "\x64\x9d\x30\x34\x75\x1e\xa2\x16"
1237               "\x77\x6b\xf9\xa1\x8a\xcc\x81\xbc"
1238               "\x78\x96\x11\x8a\x51\x97\x96\x87"
1239               "\x82\xdd\x1f\xd9\x7d\x8d\x51\x33",
1240     }, {
1241         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
1242                  "fghijklmnopqrstuvwxyz0123456789",
1243         .psize  = 62,
1244         .digest = "\x57\x40\xa4\x08\xac\x16\xb7\x20"
1245               "\xb8\x44\x24\xae\x93\x1c\xbb\x1f"
1246               "\xe3\x63\xd1\xd0\xbf\x40\x17\xf1"
1247               "\xa8\x9f\x7e\xa6\xde\x77\xa0\xb8",
1248     }, {
1249         .plaintext = "1234567890123456789012345678901234567890"
1250                  "1234567890123456789012345678901234567890",
1251         .psize  = 80,
1252         .digest = "\x06\xfd\xcc\x7a\x40\x95\x48\xaa"
1253               "\xf9\x13\x68\xc0\x6a\x62\x75\xb5"
1254               "\x53\xe3\xf0\x99\xbf\x0e\xa4\xed"
1255               "\xfd\x67\x78\xdf\x89\xa8\x90\xdd",
1256     }, {
1257         .plaintext = "abcdbcdecdefdefgefghfghighij"
1258                  "hijkijkljklmklmnlmnomnopnopq",
1259         .psize  = 56,
1260         .digest = "\x38\x43\x04\x55\x83\xaa\xc6\xc8"
1261               "\xc8\xd9\x12\x85\x73\xe7\xa9\x80"
1262               "\x9a\xfb\x2a\x0f\x34\xcc\xc3\x6e"
1263               "\xa9\xe7\x2f\x16\xf6\x36\x8e\x3f",
1264         .np = 2,
1265         .tap    = { 28, 28 },
1266     }
1267 };
1268 
1269 /*
1270  * RIPEMD-320 test vectors
1271  */
1272 #define RMD320_TEST_VECTORS     8
1273 
1274 static struct hash_testvec rmd320_tv_template[] = {
1275     {
1276         .digest = "\x22\xd6\x5d\x56\x61\x53\x6c\xdc\x75\xc1"
1277               "\xfd\xf5\xc6\xde\x7b\x41\xb9\xf2\x73\x25"
1278               "\xeb\xc6\x1e\x85\x57\x17\x7d\x70\x5a\x0e"
1279               "\xc8\x80\x15\x1c\x3a\x32\xa0\x08\x99\xb8",
1280     }, {
1281         .plaintext = "a",
1282         .psize  = 1,
1283         .digest = "\xce\x78\x85\x06\x38\xf9\x26\x58\xa5\xa5"
1284               "\x85\x09\x75\x79\x92\x6d\xda\x66\x7a\x57"
1285               "\x16\x56\x2c\xfc\xf6\xfb\xe7\x7f\x63\x54"
1286               "\x2f\x99\xb0\x47\x05\xd6\x97\x0d\xff\x5d",
1287     }, {
1288         .plaintext = "abc",
1289         .psize  = 3,
1290         .digest = "\xde\x4c\x01\xb3\x05\x4f\x89\x30\xa7\x9d"
1291               "\x09\xae\x73\x8e\x92\x30\x1e\x5a\x17\x08"
1292               "\x5b\xef\xfd\xc1\xb8\xd1\x16\x71\x3e\x74"
1293               "\xf8\x2f\xa9\x42\xd6\x4c\xdb\xc4\x68\x2d",
1294     }, {
1295         .plaintext = "message digest",
1296         .psize  = 14,
1297         .digest = "\x3a\x8e\x28\x50\x2e\xd4\x5d\x42\x2f\x68"
1298               "\x84\x4f\x9d\xd3\x16\xe7\xb9\x85\x33\xfa"
1299               "\x3f\x2a\x91\xd2\x9f\x84\xd4\x25\xc8\x8d"
1300               "\x6b\x4e\xff\x72\x7d\xf6\x6a\x7c\x01\x97",
1301     }, {
1302         .plaintext = "abcdefghijklmnopqrstuvwxyz",
1303         .psize  = 26,
1304         .digest = "\xca\xbd\xb1\x81\x0b\x92\x47\x0a\x20\x93"
1305               "\xaa\x6b\xce\x05\x95\x2c\x28\x34\x8c\xf4"
1306               "\x3f\xf6\x08\x41\x97\x51\x66\xbb\x40\xed"
1307               "\x23\x40\x04\xb8\x82\x44\x63\xe6\xb0\x09",
1308     }, {
1309         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
1310                  "fghijklmnopqrstuvwxyz0123456789",
1311         .psize  = 62,
1312         .digest = "\xed\x54\x49\x40\xc8\x6d\x67\xf2\x50\xd2"
1313               "\x32\xc3\x0b\x7b\x3e\x57\x70\xe0\xc6\x0c"
1314               "\x8c\xb9\xa4\xca\xfe\x3b\x11\x38\x8a\xf9"
1315               "\x92\x0e\x1b\x99\x23\x0b\x84\x3c\x86\xa4",
1316     }, {
1317         .plaintext = "1234567890123456789012345678901234567890"
1318                  "1234567890123456789012345678901234567890",
1319         .psize  = 80,
1320         .digest = "\x55\x78\x88\xaf\x5f\x6d\x8e\xd6\x2a\xb6"
1321               "\x69\x45\xc6\xd2\xa0\xa4\x7e\xcd\x53\x41"
1322               "\xe9\x15\xeb\x8f\xea\x1d\x05\x24\x95\x5f"
1323               "\x82\x5d\xc7\x17\xe4\xa0\x08\xab\x2d\x42",
1324     }, {
1325         .plaintext = "abcdbcdecdefdefgefghfghighij"
1326                  "hijkijkljklmklmnlmnomnopnopq",
1327         .psize  = 56,
1328         .digest = "\xd0\x34\xa7\x95\x0c\xf7\x22\x02\x1b\xa4"
1329               "\xb8\x4d\xf7\x69\xa5\xde\x20\x60\xe2\x59"
1330               "\xdf\x4c\x9b\xb4\xa4\x26\x8c\x0e\x93\x5b"
1331               "\xbc\x74\x70\xa9\x69\xc9\xd0\x72\xa1\xac",
1332         .np = 2,
1333         .tap    = { 28, 28 },
1334     }
1335 };
1336 
1337 #define CRCT10DIF_TEST_VECTORS  ARRAY_SIZE(crct10dif_tv_template)
1338 static struct hash_testvec crct10dif_tv_template[] = {
1339     {
1340         .plaintext  = "abc",
1341         .psize      = 3,
1342         .digest     = (u8 *)(u16 []){ 0x443b },
1343     }, {
1344         .plaintext  = "1234567890123456789012345678901234567890"
1345                   "123456789012345678901234567890123456789",
1346         .psize      = 79,
1347         .digest     = (u8 *)(u16 []){ 0x4b70 },
1348         .np     = 2,
1349         .tap        = { 63, 16 },
1350     }, {
1351         .plaintext  = "abcdddddddddddddddddddddddddddddddddddddddd"
1352                   "ddddddddddddd",
1353         .psize      = 56,
1354         .digest     = (u8 *)(u16 []){ 0x9ce3 },
1355         .np     = 8,
1356         .tap        = { 1, 2, 28, 7, 6, 5, 4, 3 },
1357     }, {
1358         .plaintext  = "1234567890123456789012345678901234567890"
1359                   "1234567890123456789012345678901234567890"
1360                   "1234567890123456789012345678901234567890"
1361                   "1234567890123456789012345678901234567890"
1362                   "1234567890123456789012345678901234567890"
1363                   "1234567890123456789012345678901234567890"
1364                   "1234567890123456789012345678901234567890"
1365                   "123456789012345678901234567890123456789",
1366         .psize      = 319,
1367         .digest     = (u8 *)(u16 []){ 0x44c6 },
1368     }, {
1369         .plaintext  = "1234567890123456789012345678901234567890"
1370                   "1234567890123456789012345678901234567890"
1371                   "1234567890123456789012345678901234567890"
1372                   "1234567890123456789012345678901234567890"
1373                   "1234567890123456789012345678901234567890"
1374                   "1234567890123456789012345678901234567890"
1375                   "1234567890123456789012345678901234567890"
1376                   "123456789012345678901234567890123456789",
1377         .psize      = 319,
1378         .digest     = (u8 *)(u16 []){ 0x44c6 },
1379         .np     = 4,
1380         .tap        = { 1, 255, 57, 6 },
1381     }
1382 };
1383 
1384 /*
1385  * SHA1 test vectors  from from FIPS PUB 180-1
1386  * Long vector from CAVS 5.0
1387  */
1388 #define SHA1_TEST_VECTORS   6
1389 
1390 static struct hash_testvec sha1_tv_template[] = {
1391     {
1392         .plaintext = "",
1393         .psize  = 0,
1394         .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55"
1395               "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09",
1396     }, {
1397         .plaintext = "abc",
1398         .psize  = 3,
1399         .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
1400               "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
1401     }, {
1402         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1403         .psize  = 56,
1404         .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
1405               "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
1406         .np = 2,
1407         .tap    = { 28, 28 }
1408     }, {
1409         .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
1410                  "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
1411                  "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
1412                  "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
1413                  "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
1414                  "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
1415                  "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
1416                  "\x72\x28\x26\xc0\x66\x86\x9e\xda"
1417                  "\xcd\x73\xb2\x54\x80\x35\x18\x58"
1418                  "\x13\xe2\x26\x34\xa9\xda\x44\x00"
1419                  "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
1420                  "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
1421                  "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
1422                  "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
1423                  "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
1424                  "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
1425                  "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
1426                  "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
1427                  "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
1428                  "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
1429                  "\x5a\x90\x11",
1430         .psize  = 163,
1431         .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
1432               "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
1433         .np = 4,
1434         .tap    = { 63, 64, 31, 5 }
1435     }, {
1436         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1437         .psize  = 64,
1438         .digest = "\xc8\x71\xf6\x9a\x63\xcc\xa9\x84\x84\x82"
1439               "\x64\xe7\x79\x95\x5d\xd7\x19\x41\x7c\x91",
1440     }, {
1441         .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1442                  "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1443                  "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1444                  "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1445                  "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1446                  "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1447                  "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1448                  "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1449                  "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1450                  "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1451                  "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1452                  "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1453                  "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1454                  "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1455                  "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1456                  "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1457                  "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1458                  "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1459                  "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1460                  "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1461                  "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1462                  "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1463                  "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1464                  "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1465                  "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1466                  "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1467                  "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1468                  "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1469                  "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1470                  "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1471                  "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1472                  "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1473                  "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1474                  "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1475                  "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1476                  "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1477                  "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1478                  "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1479                  "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1480                  "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1481                  "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1482                  "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1483                  "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1484                  "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1485                  "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1486                  "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1487                  "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1488                  "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1489                  "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1490                  "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1491                  "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1492                  "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1493                  "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1494                  "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1495                  "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1496                  "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1497                  "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1498                  "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1499                  "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1500                  "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1501                  "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1502                  "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1503                  "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1504                  "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1505                  "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1506                  "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1507                  "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1508                  "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1509                  "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1510                  "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1511                  "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1512                  "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1513                  "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1514                  "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1515                  "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1516                  "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1517                  "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1518                  "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1519                  "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1520                  "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1521                  "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1522                  "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1523                  "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1524                  "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1525                  "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1526                  "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1527                  "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1528                  "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1529                  "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1530                  "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1531                  "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1532                  "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1533                  "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1534                  "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1535                  "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1536                  "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1537                  "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1538                  "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1539                  "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1540                  "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1541                  "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1542                  "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1543                  "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1544                  "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1545                  "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1546                  "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1547                  "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1548                  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1549                  "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1550                  "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1551                  "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1552                  "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1553                  "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1554                  "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1555                  "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1556                  "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1557                  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1558                  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1559                  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1560                  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1561                  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1562                  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1563                  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1564                  "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1565                  "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1566                  "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1567                  "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1568                  "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1569         .psize     = 1023,
1570         .digest    = "\xb8\xe3\x54\xed\xc5\xfc\xef\xa4"
1571                  "\x55\x73\x4a\x81\x99\xe4\x47\x2a"
1572                  "\x30\xd6\xc9\x85",
1573     }
1574 };
1575 
1576 
1577 /*
1578  * SHA224 test vectors from from FIPS PUB 180-2
1579  */
1580 #define SHA224_TEST_VECTORS     5
1581 
1582 static struct hash_testvec sha224_tv_template[] = {
1583     {
1584         .plaintext = "",
1585         .psize  = 0,
1586         .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9"
1587               "\x47\x61\x02\xbb\x28\x82\x34\xc4"
1588               "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a"
1589               "\xc5\xb3\xe4\x2f",
1590     }, {
1591         .plaintext = "abc",
1592         .psize  = 3,
1593         .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
1594               "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
1595               "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
1596               "\xE3\x6C\x9D\xA7",
1597     }, {
1598         .plaintext =
1599         "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1600         .psize  = 56,
1601         .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
1602               "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
1603               "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
1604               "\x52\x52\x25\x25",
1605         .np     = 2,
1606         .tap    = { 28, 28 }
1607     }, {
1608         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1609         .psize  = 64,
1610         .digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01"
1611               "\x42\xfd\x10\x92\xaa\x4e\x04\x08"
1612               "\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c"
1613               "\xef\x3b\xcb\x0e",
1614     }, {
1615         .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1616                  "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1617                  "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1618                  "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1619                  "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1620                  "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1621                  "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1622                  "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1623                  "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1624                  "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1625                  "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1626                  "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1627                  "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1628                  "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1629                  "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1630                  "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1631                  "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1632                  "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1633                  "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1634                  "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1635                  "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1636                  "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1637                  "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1638                  "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1639                  "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1640                  "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1641                  "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1642                  "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1643                  "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1644                  "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1645                  "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1646                  "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1647                  "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1648                  "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1649                  "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1650                  "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1651                  "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1652                  "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1653                  "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1654                  "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1655                  "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1656                  "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1657                  "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1658                  "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1659                  "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1660                  "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1661                  "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1662                  "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1663                  "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1664                  "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1665                  "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1666                  "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1667                  "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1668                  "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1669                  "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1670                  "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1671                  "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1672                  "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1673                  "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1674                  "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1675                  "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1676                  "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1677                  "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1678                  "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1679                  "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1680                  "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1681                  "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1682                  "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1683                  "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1684                  "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1685                  "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1686                  "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1687                  "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1688                  "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1689                  "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1690                  "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1691                  "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1692                  "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1693                  "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1694                  "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1695                  "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1696                  "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1697                  "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1698                  "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1699                  "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1700                  "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1701                  "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1702                  "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1703                  "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1704                  "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1705                  "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1706                  "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1707                  "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1708                  "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1709                  "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1710                  "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1711                  "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1712                  "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1713                  "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1714                  "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1715                  "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1716                  "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1717                  "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1718                  "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1719                  "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1720                  "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1721                  "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1722                  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1723                  "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1724                  "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1725                  "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1726                  "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1727                  "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1728                  "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1729                  "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1730                  "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1731                  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1732                  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1733                  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1734                  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1735                  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1736                  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1737                  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1738                  "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1739                  "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1740                  "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1741                  "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1742                  "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1743         .psize     = 1023,
1744         .digest    = "\x98\x43\x07\x63\x75\xe0\xa7\x1c"
1745                  "\x78\xb1\x8b\xfd\x04\xf5\x2d\x91"
1746                  "\x20\x48\xa4\x28\xff\x55\xb1\xd3"
1747                  "\xe6\xf9\x4f\xcc",
1748     }
1749 };
1750 
1751 /*
1752  * SHA256 test vectors from from NIST
1753  */
1754 #define SHA256_TEST_VECTORS 5
1755 
1756 static struct hash_testvec sha256_tv_template[] = {
1757     {
1758         .plaintext = "",
1759         .psize  = 0,
1760         .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14"
1761               "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
1762               "\x27\xae\x41\xe4\x64\x9b\x93\x4c"
1763               "\xa4\x95\x99\x1b\x78\x52\xb8\x55",
1764     }, {
1765         .plaintext = "abc",
1766         .psize  = 3,
1767         .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
1768               "\x41\x41\x40\xde\x5d\xae\x22\x23"
1769               "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
1770               "\xb4\x10\xff\x61\xf2\x00\x15\xad",
1771     }, {
1772         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1773         .psize  = 56,
1774         .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
1775               "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
1776               "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
1777               "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
1778         .np = 2,
1779         .tap    = { 28, 28 }
1780     }, {
1781         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
1782         .psize  = 64,
1783         .digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4"
1784               "\x2c\x32\x29\x32\x19\xbb\xfb\xfa"
1785               "\xd6\xff\x94\xa3\x72\x91\x85\x66"
1786               "\x3b\xa7\x87\x77\x58\xa3\x40\x3a",
1787     }, {
1788         .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1789                  "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1790                  "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1791                  "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1792                  "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1793                  "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1794                  "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1795                  "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1796                  "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1797                  "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1798                  "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1799                  "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1800                  "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1801                  "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1802                  "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1803                  "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1804                  "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1805                  "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1806                  "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1807                  "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
1808                  "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
1809                  "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
1810                  "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
1811                  "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
1812                  "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
1813                  "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
1814                  "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
1815                  "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
1816                  "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
1817                  "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
1818                  "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
1819                  "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
1820                  "\x53\xea\x81\x18\x8c\x23\xba\x2e"
1821                  "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
1822                  "\x37\xce\x42\xd9\x70\x07\x7b\x12"
1823                  "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
1824                  "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
1825                  "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
1826                  "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
1827                  "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
1828                  "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
1829                  "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
1830                  "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
1831                  "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
1832                  "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
1833                  "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
1834                  "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
1835                  "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
1836                  "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
1837                  "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
1838                  "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
1839                  "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
1840                  "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
1841                  "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
1842                  "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
1843                  "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
1844                  "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
1845                  "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
1846                  "\x38\xcf\x43\xda\x71\x08\x7c\x13"
1847                  "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
1848                  "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
1849                  "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
1850                  "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
1851                  "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
1852                  "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
1853                  "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
1854                  "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
1855                  "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
1856                  "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
1857                  "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
1858                  "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
1859                  "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
1860                  "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
1861                  "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
1862                  "\xef\x63\xfa\x91\x05\x9c\x33\xca"
1863                  "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
1864                  "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
1865                  "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
1866                  "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
1867                  "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
1868                  "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
1869                  "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
1870                  "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
1871                  "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
1872                  "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
1873                  "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
1874                  "\xde\x75\x0c\x80\x17\xae\x22\xb9"
1875                  "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
1876                  "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
1877                  "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
1878                  "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
1879                  "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
1880                  "\x67\xfe\x72\x09\xa0\x14\xab\x42"
1881                  "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
1882                  "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
1883                  "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
1884                  "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
1885                  "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
1886                  "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
1887                  "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
1888                  "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
1889                  "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
1890                  "\x95\x09\xa0\x37\xce\x42\xd9\x70"
1891                  "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
1892                  "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
1893                  "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
1894                  "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
1895                  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
1896                  "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
1897                  "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
1898                  "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
1899                  "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
1900                  "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
1901                  "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
1902                  "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
1903                  "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
1904                  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
1905                  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
1906                  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
1907                  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
1908                  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
1909                  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
1910                  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
1911                  "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
1912                  "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
1913                  "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
1914                  "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
1915                  "\x08\x7c\x13\xaa\x1e\xb5\x4c",
1916         .psize     = 1023,
1917         .digest    = "\xc5\xce\x0c\xca\x01\x4f\x53\x3a"
1918                  "\x32\x32\x17\xcc\xd4\x6a\x71\xa9"
1919                  "\xf3\xed\x50\x10\x64\x8e\x06\xbe"
1920                  "\x9b\x4a\xa6\xbb\x05\x89\x59\x51",
1921     }
1922 };
1923 
1924 /*
1925  * SHA384 test vectors from from NIST and kerneli
1926  */
1927 #define SHA384_TEST_VECTORS 6
1928 
1929 static struct hash_testvec sha384_tv_template[] = {
1930     {
1931         .plaintext = "",
1932         .psize  = 0,
1933         .digest = "\x38\xb0\x60\xa7\x51\xac\x96\x38"
1934               "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a"
1935               "\x21\xfd\xb7\x11\x14\xbe\x07\x43"
1936               "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda"
1937               "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb"
1938               "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b",
1939     }, {
1940         .plaintext= "abc",
1941         .psize  = 3,
1942         .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
1943               "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
1944               "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
1945               "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
1946               "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
1947               "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
1948     }, {
1949         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1950         .psize  = 56,
1951         .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
1952               "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
1953               "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
1954               "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
1955               "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
1956               "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
1957     }, {
1958         .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
1959                "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
1960         .psize  = 112,
1961         .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
1962               "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
1963               "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
1964               "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
1965               "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
1966               "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
1967     }, {
1968         .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
1969                "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
1970         .psize  = 104,
1971         .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
1972               "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
1973               "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
1974               "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
1975               "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
1976               "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
1977         .np = 4,
1978         .tap    = { 26, 26, 26, 26 }
1979     }, {
1980         .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
1981                  "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
1982                  "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
1983                  "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
1984                  "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
1985                  "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
1986                  "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
1987                  "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
1988                  "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
1989                  "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
1990                  "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
1991                  "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
1992                  "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
1993                  "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
1994                  "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
1995                  "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
1996                  "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
1997                  "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
1998                  "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
1999                  "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2000                  "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2001                  "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2002                  "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2003                  "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2004                  "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2005                  "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2006                  "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2007                  "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2008                  "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2009                  "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2010                  "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2011                  "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2012                  "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2013                  "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2014                  "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2015                  "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2016                  "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2017                  "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2018                  "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2019                  "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2020                  "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2021                  "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2022                  "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2023                  "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2024                  "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2025                  "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2026                  "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2027                  "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2028                  "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2029                  "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2030                  "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2031                  "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2032                  "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2033                  "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2034                  "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2035                  "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2036                  "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2037                  "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2038                  "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2039                  "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
2040                  "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
2041                  "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
2042                  "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
2043                  "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
2044                  "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
2045                  "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
2046                  "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
2047                  "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
2048                  "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
2049                  "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
2050                  "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
2051                  "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
2052                  "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
2053                  "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
2054                  "\xef\x63\xfa\x91\x05\x9c\x33\xca"
2055                  "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
2056                  "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
2057                  "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
2058                  "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
2059                  "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
2060                  "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
2061                  "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
2062                  "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
2063                  "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
2064                  "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
2065                  "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
2066                  "\xde\x75\x0c\x80\x17\xae\x22\xb9"
2067                  "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
2068                  "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
2069                  "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
2070                  "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
2071                  "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
2072                  "\x67\xfe\x72\x09\xa0\x14\xab\x42"
2073                  "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
2074                  "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
2075                  "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
2076                  "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
2077                  "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
2078                  "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
2079                  "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
2080                  "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
2081                  "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
2082                  "\x95\x09\xa0\x37\xce\x42\xd9\x70"
2083                  "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
2084                  "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
2085                  "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
2086                  "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
2087                  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
2088                  "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
2089                  "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
2090                  "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
2091                  "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
2092                  "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
2093                  "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
2094                  "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
2095                  "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
2096                  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
2097                  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
2098                  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
2099                  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
2100                  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
2101                  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
2102                  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
2103                  "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
2104                  "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
2105                  "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
2106                  "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
2107                  "\x08\x7c\x13\xaa\x1e\xb5\x4c",
2108         .psize     = 1023,
2109         .digest    = "\x4d\x97\x23\xc8\xea\x7a\x7c\x15"
2110                  "\xb8\xff\x97\x9c\xf5\x13\x4f\x31"
2111                  "\xde\x67\xf7\x24\x73\xcd\x70\x1c"
2112                  "\x03\x4a\xba\x8a\x87\x49\xfe\xdc"
2113                  "\x75\x29\x62\x83\xae\x3f\x17\xab"
2114                  "\xfd\x10\x4d\x8e\x17\x1c\x1f\xca",
2115     }
2116 };
2117 
2118 /*
2119  * SHA512 test vectors from from NIST and kerneli
2120  */
2121 #define SHA512_TEST_VECTORS 6
2122 
2123 static struct hash_testvec sha512_tv_template[] = {
2124     {
2125         .plaintext = "",
2126         .psize  = 0,
2127         .digest = "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd"
2128               "\xf1\x54\x28\x50\xd6\x6d\x80\x07"
2129               "\xd6\x20\xe4\x05\x0b\x57\x15\xdc"
2130               "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
2131               "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0"
2132               "\xff\x83\x18\xd2\x87\x7e\xec\x2f"
2133               "\x63\xb9\x31\xbd\x47\x41\x7a\x81"
2134               "\xa5\x38\x32\x7a\xf9\x27\xda\x3e",
2135     }, {
2136         .plaintext = "abc",
2137         .psize  = 3,
2138         .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
2139               "\xcc\x41\x73\x49\xae\x20\x41\x31"
2140               "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
2141               "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
2142               "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
2143               "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
2144               "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
2145               "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
2146     }, {
2147         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
2148         .psize  = 56,
2149         .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
2150               "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
2151               "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
2152               "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
2153               "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
2154               "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
2155               "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
2156               "\x54\xec\x63\x12\x38\xca\x34\x45",
2157     }, {
2158         .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
2159                "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
2160         .psize  = 112,
2161         .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
2162               "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
2163               "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
2164               "\x72\x99\xae\xad\xb6\x88\x90\x18"
2165               "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
2166               "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
2167               "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
2168               "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
2169     }, {
2170         .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
2171                "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
2172         .psize  = 104,
2173         .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
2174               "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
2175               "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
2176               "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
2177               "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
2178               "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
2179               "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
2180               "\xed\xb4\x19\x87\x23\x28\x50\xc9",
2181         .np = 4,
2182         .tap    = { 26, 26, 26, 26 }
2183     }, {
2184         .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2185                  "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2186                  "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2187                  "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2188                  "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2189                  "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2190                  "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2191                  "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2192                  "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2193                  "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2194                  "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2195                  "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2196                  "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2197                  "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2198                  "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2199                  "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2200                  "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2201                  "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2202                  "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2203                  "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2204                  "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2205                  "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2206                  "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2207                  "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2208                  "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2209                  "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2210                  "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2211                  "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2212                  "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2213                  "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2214                  "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2215                  "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2216                  "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2217                  "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2218                  "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2219                  "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2220                  "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2221                  "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2222                  "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2223                  "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2224                  "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2225                  "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2226                  "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2227                  "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2228                  "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2229                  "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2230                  "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2231                  "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2232                  "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2233                  "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2234                  "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2235                  "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2236                  "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2237                  "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2238                  "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2239                  "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2240                  "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2241                  "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2242                  "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2243                  "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
2244                  "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
2245                  "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
2246                  "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
2247                  "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
2248                  "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
2249                  "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
2250                  "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
2251                  "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
2252                  "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
2253                  "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
2254                  "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
2255                  "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
2256                  "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
2257                  "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
2258                  "\xef\x63\xfa\x91\x05\x9c\x33\xca"
2259                  "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
2260                  "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
2261                  "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
2262                  "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
2263                  "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
2264                  "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
2265                  "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
2266                  "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
2267                  "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
2268                  "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
2269                  "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
2270                  "\xde\x75\x0c\x80\x17\xae\x22\xb9"
2271                  "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
2272                  "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
2273                  "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
2274                  "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
2275                  "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
2276                  "\x67\xfe\x72\x09\xa0\x14\xab\x42"
2277                  "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
2278                  "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
2279                  "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
2280                  "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
2281                  "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
2282                  "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
2283                  "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
2284                  "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
2285                  "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
2286                  "\x95\x09\xa0\x37\xce\x42\xd9\x70"
2287                  "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
2288                  "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
2289                  "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
2290                  "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
2291                  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
2292                  "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
2293                  "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
2294                  "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
2295                  "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
2296                  "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
2297                  "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
2298                  "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
2299                  "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
2300                  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
2301                  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
2302                  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
2303                  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
2304                  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
2305                  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
2306                  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
2307                  "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
2308                  "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
2309                  "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
2310                  "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
2311                  "\x08\x7c\x13\xaa\x1e\xb5\x4c",
2312         .psize     = 1023,
2313         .digest    = "\x76\xc9\xd4\x91\x7a\x5f\x0f\xaa"
2314                  "\x13\x39\xf3\x01\x7a\xfa\xe5\x41"
2315                  "\x5f\x0b\xf8\xeb\x32\xfc\xbf\xb0"
2316                  "\xfa\x8c\xcd\x17\x83\xe2\xfa\xeb"
2317                  "\x1c\x19\xde\xe2\x75\xdc\x34\x64"
2318                  "\x5f\x35\x9c\x61\x2f\x10\xf9\xec"
2319                  "\x59\xca\x9d\xcc\x25\x0c\x43\xba"
2320                  "\x85\xa8\xf8\xfe\xb5\x24\xb2\xee",
2321     }
2322 };
2323 
2324 
2325 /*
2326  * WHIRLPOOL test vectors from Whirlpool package
2327  * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
2328  * submission
2329  */
2330 #define WP512_TEST_VECTORS  8
2331 
2332 static struct hash_testvec wp512_tv_template[] = {
2333     {
2334         .plaintext = "",
2335         .psize  = 0,
2336         .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
2337               "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
2338               "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
2339               "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
2340               "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
2341               "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
2342               "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
2343               "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
2344 
2345 
2346     }, {
2347         .plaintext = "a",
2348         .psize  = 1,
2349         .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
2350               "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
2351               "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
2352               "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
2353               "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
2354               "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
2355               "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
2356               "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
2357     }, {
2358         .plaintext = "abc",
2359         .psize  = 3,
2360         .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
2361               "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
2362               "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
2363               "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
2364               "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
2365               "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
2366               "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
2367               "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
2368     }, {
2369         .plaintext = "message digest",
2370         .psize  = 14,
2371         .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
2372               "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
2373               "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
2374               "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
2375               "\x84\x21\x55\x76\x59\xEF\x55\xC1"
2376               "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
2377               "\x92\xED\x92\x00\x52\x83\x8F\x33"
2378               "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
2379     }, {
2380         .plaintext = "abcdefghijklmnopqrstuvwxyz",
2381         .psize  = 26,
2382         .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
2383               "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
2384               "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
2385               "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
2386               "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
2387               "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
2388               "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
2389               "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
2390     }, {
2391         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2392                "abcdefghijklmnopqrstuvwxyz0123456789",
2393         .psize  = 62,
2394         .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
2395               "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
2396               "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
2397               "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
2398               "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
2399               "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
2400               "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
2401               "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
2402     }, {
2403         .plaintext = "1234567890123456789012345678901234567890"
2404                "1234567890123456789012345678901234567890",
2405         .psize  = 80,
2406         .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
2407               "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
2408               "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
2409               "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
2410               "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
2411               "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
2412               "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
2413               "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
2414     }, {
2415         .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
2416         .psize  = 32,
2417         .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
2418               "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
2419               "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
2420               "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
2421               "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
2422               "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
2423               "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
2424               "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
2425     },
2426 };
2427 
2428 #define WP384_TEST_VECTORS  8
2429 
2430 static struct hash_testvec wp384_tv_template[] = {
2431     {
2432         .plaintext = "",
2433         .psize  = 0,
2434         .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
2435               "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
2436               "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
2437               "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
2438               "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
2439               "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
2440 
2441 
2442     }, {
2443         .plaintext = "a",
2444         .psize  = 1,
2445         .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
2446               "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
2447               "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
2448               "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
2449               "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
2450               "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
2451     }, {
2452         .plaintext = "abc",
2453         .psize  = 3,
2454         .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
2455               "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
2456               "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
2457               "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
2458               "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
2459               "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
2460     }, {
2461         .plaintext = "message digest",
2462         .psize  = 14,
2463         .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
2464               "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
2465               "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
2466               "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
2467               "\x84\x21\x55\x76\x59\xEF\x55\xC1"
2468               "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
2469     }, {
2470         .plaintext = "abcdefghijklmnopqrstuvwxyz",
2471         .psize  = 26,
2472         .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
2473               "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
2474               "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
2475               "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
2476               "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
2477               "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
2478     }, {
2479         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2480                "abcdefghijklmnopqrstuvwxyz0123456789",
2481         .psize  = 62,
2482         .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
2483               "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
2484               "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
2485               "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
2486               "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
2487               "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
2488     }, {
2489         .plaintext = "1234567890123456789012345678901234567890"
2490                "1234567890123456789012345678901234567890",
2491         .psize  = 80,
2492         .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
2493               "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
2494               "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
2495               "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
2496               "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
2497               "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
2498     }, {
2499         .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
2500         .psize  = 32,
2501         .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
2502               "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
2503               "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
2504               "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
2505               "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
2506               "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
2507     },
2508 };
2509 
2510 #define WP256_TEST_VECTORS  8
2511 
2512 static struct hash_testvec wp256_tv_template[] = {
2513     {
2514         .plaintext = "",
2515         .psize  = 0,
2516         .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
2517               "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
2518               "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
2519               "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
2520 
2521 
2522     }, {
2523         .plaintext = "a",
2524         .psize  = 1,
2525         .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
2526               "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
2527               "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
2528               "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
2529     }, {
2530         .plaintext = "abc",
2531         .psize  = 3,
2532         .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
2533               "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
2534               "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
2535               "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
2536     }, {
2537         .plaintext = "message digest",
2538         .psize  = 14,
2539         .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
2540               "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
2541               "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
2542               "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
2543     }, {
2544         .plaintext = "abcdefghijklmnopqrstuvwxyz",
2545         .psize  = 26,
2546         .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
2547               "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
2548               "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
2549               "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
2550     }, {
2551         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2552                "abcdefghijklmnopqrstuvwxyz0123456789",
2553         .psize  = 62,
2554         .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
2555               "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
2556               "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
2557               "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
2558     }, {
2559         .plaintext = "1234567890123456789012345678901234567890"
2560                "1234567890123456789012345678901234567890",
2561         .psize  = 80,
2562         .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
2563               "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
2564               "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
2565               "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
2566     }, {
2567         .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
2568         .psize  = 32,
2569         .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
2570               "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
2571               "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
2572               "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
2573     },
2574 };
2575 
2576 /*
2577  * TIGER test vectors from Tiger website
2578  */
2579 #define TGR192_TEST_VECTORS 6
2580 
2581 static struct hash_testvec tgr192_tv_template[] = {
2582     {
2583         .plaintext = "",
2584         .psize  = 0,
2585         .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
2586               "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
2587               "\xf3\x73\xde\x2d\x49\x58\x4e\x7a",
2588     }, {
2589         .plaintext = "abc",
2590         .psize  = 3,
2591         .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
2592               "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
2593               "\x93\x5f\x7b\x95\x1c\x13\x29\x51",
2594     }, {
2595         .plaintext = "Tiger",
2596         .psize  = 5,
2597         .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
2598               "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
2599               "\x37\x79\x0c\x11\x6f\x9d\x2b\xdf",
2600     }, {
2601         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
2602         .psize  = 64,
2603         .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
2604               "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
2605               "\xb5\x86\x44\x50\x34\xa5\xa3\x86",
2606     }, {
2607         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
2608         .psize  = 64,
2609         .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
2610               "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
2611               "\x57\x89\x65\x65\x97\x5f\x91\x97",
2612     }, {
2613         .plaintext = "Tiger - A Fast New Hash Function, "
2614                "by Ross Anderson and Eli Biham, "
2615                "proceedings of Fast Software Encryption 3, "
2616                "Cambridge, 1996.",
2617         .psize  = 125,
2618         .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
2619               "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
2620               "\xdd\x68\x15\x1d\x50\x39\x74\xfc",
2621     },
2622 };
2623 
2624 #define TGR160_TEST_VECTORS 6
2625 
2626 static struct hash_testvec tgr160_tv_template[] = {
2627     {
2628         .plaintext = "",
2629         .psize  = 0,
2630         .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
2631               "\x16\x16\x6e\x76\xb1\xbb\x92\x5f"
2632               "\xf3\x73\xde\x2d",
2633     }, {
2634         .plaintext = "abc",
2635         .psize  = 3,
2636         .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
2637               "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf"
2638               "\x93\x5f\x7b\x95",
2639     }, {
2640         .plaintext = "Tiger",
2641         .psize  = 5,
2642         .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
2643               "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec"
2644               "\x37\x79\x0c\x11",
2645     }, {
2646         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
2647         .psize  = 64,
2648         .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
2649               "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e"
2650               "\xb5\x86\x44\x50",
2651     }, {
2652         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
2653         .psize  = 64,
2654         .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
2655               "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9"
2656               "\x57\x89\x65\x65",
2657     }, {
2658         .plaintext = "Tiger - A Fast New Hash Function, "
2659                "by Ross Anderson and Eli Biham, "
2660                "proceedings of Fast Software Encryption 3, "
2661                "Cambridge, 1996.",
2662         .psize  = 125,
2663         .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
2664               "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24"
2665               "\xdd\x68\x15\x1d",
2666     },
2667 };
2668 
2669 #define TGR128_TEST_VECTORS 6
2670 
2671 static struct hash_testvec tgr128_tv_template[] = {
2672     {
2673         .plaintext = "",
2674         .psize  = 0,
2675         .digest = "\x24\xf0\x13\x0c\x63\xac\x93\x32"
2676               "\x16\x16\x6e\x76\xb1\xbb\x92\x5f",
2677     }, {
2678         .plaintext = "abc",
2679         .psize  = 3,
2680         .digest = "\xf2\x58\xc1\xe8\x84\x14\xab\x2a"
2681               "\x52\x7a\xb5\x41\xff\xc5\xb8\xbf",
2682     }, {
2683         .plaintext = "Tiger",
2684         .psize  = 5,
2685         .digest = "\x9f\x00\xf5\x99\x07\x23\x00\xdd"
2686               "\x27\x6a\xbb\x38\xc8\xeb\x6d\xec",
2687     }, {
2688         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
2689         .psize  = 64,
2690         .digest = "\x87\xfb\x2a\x90\x83\x85\x1c\xf7"
2691               "\x47\x0d\x2c\xf8\x10\xe6\xdf\x9e",
2692     }, {
2693         .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789",
2694         .psize  = 64,
2695         .digest = "\x46\x7d\xb8\x08\x63\xeb\xce\x48"
2696               "\x8d\xf1\xcd\x12\x61\x65\x5d\xe9",
2697     }, {
2698         .plaintext = "Tiger - A Fast New Hash Function, "
2699                "by Ross Anderson and Eli Biham, "
2700                "proceedings of Fast Software Encryption 3, "
2701                "Cambridge, 1996.",
2702         .psize  = 125,
2703         .digest = "\x3d\x9a\xeb\x03\xd1\xbd\x1a\x63"
2704               "\x57\xb2\x77\x4d\xfd\x6d\x5b\x24",
2705     },
2706 };
2707 
2708 #define GHASH_TEST_VECTORS 6
2709 
2710 static struct hash_testvec ghash_tv_template[] =
2711 {
2712     {
2713         .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03"
2714               "\xff\xca\xff\x95\xf8\x30\xf0\x61",
2715         .ksize  = 16,
2716         .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
2717                  "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
2718         .psize  = 16,
2719         .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
2720               "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
2721     }, {
2722         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
2723               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2724         .ksize  = 16,
2725         .plaintext = "what do ya want for nothing?",
2726         .psize  = 28,
2727         .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce"
2728               "\x0d\x61\x06\x27\x66\x51\xd5\xe2",
2729         .np = 2,
2730         .tap    = {14, 14}
2731     }, {
2732         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2733               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2734         .ksize  = 16,
2735         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2736             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2737             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2738             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2739         .psize  = 50,
2740         .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96"
2741               "\xe1\x96\xe1\x96\xe1\x96\xe1\x96",
2742     }, {
2743         .key    = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
2744               "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
2745         .ksize  = 16,
2746         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2747             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2748             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2749             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2750         .psize  = 50,
2751         .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2"
2752               "\x49\xed\x6e\x32\x7a\xa9\xbe\x08",
2753     }, {
2754         .key    = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
2755               "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
2756         .ksize  = 16,
2757         .plaintext = "Test With Truncation",
2758         .psize  = 20,
2759         .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28"
2760               "\x23\xf7\x93\xf7\x19\xf5\x96\xd9",
2761     }, {
2762         .key    = "\x0a\x1b\x2c\x3d\x4e\x5f\x64\x71"
2763             "\x82\x93\xa4\xb5\xc6\xd7\xe8\xf9",
2764         .ksize  = 16,
2765         .plaintext = "\x56\x6f\x72\x20\x6c\x61\x75\x74"
2766             "\x65\x72\x20\x4c\x61\x75\x73\x63"
2767             "\x68\x65\x6e\x20\x75\x6e\x64\x20"
2768             "\x53\x74\x61\x75\x6e\x65\x6e\x20"
2769             "\x73\x65\x69\x20\x73\x74\x69\x6c"
2770             "\x6c\x2c\x0a\x64\x75\x20\x6d\x65"
2771             "\x69\x6e\x20\x74\x69\x65\x66\x74"
2772             "\x69\x65\x66\x65\x73\x20\x4c\x65"
2773             "\x62\x65\x6e\x3b\x0a\x64\x61\x73"
2774             "\x73\x20\x64\x75\x20\x77\x65\x69"
2775             "\xc3\x9f\x74\x20\x77\x61\x73\x20"
2776             "\x64\x65\x72\x20\x57\x69\x6e\x64"
2777             "\x20\x64\x69\x72\x20\x77\x69\x6c"
2778             "\x6c\x2c\x0a\x65\x68\x20\x6e\x6f"
2779             "\x63\x68\x20\x64\x69\x65\x20\x42"
2780             "\x69\x72\x6b\x65\x6e\x20\x62\x65"
2781             "\x62\x65\x6e\x2e\x0a\x0a\x55\x6e"
2782             "\x64\x20\x77\x65\x6e\x6e\x20\x64"
2783             "\x69\x72\x20\x65\x69\x6e\x6d\x61"
2784             "\x6c\x20\x64\x61\x73\x20\x53\x63"
2785             "\x68\x77\x65\x69\x67\x65\x6e\x20"
2786             "\x73\x70\x72\x61\x63\x68\x2c\x0a"
2787             "\x6c\x61\x73\x73\x20\x64\x65\x69"
2788             "\x6e\x65\x20\x53\x69\x6e\x6e\x65"
2789             "\x20\x62\x65\x73\x69\x65\x67\x65"
2790             "\x6e\x2e\x0a\x4a\x65\x64\x65\x6d"
2791             "\x20\x48\x61\x75\x63\x68\x65\x20"
2792             "\x67\x69\x62\x74\x20\x64\x69\x63"
2793             "\x68\x2c\x20\x67\x69\x62\x20\x6e"
2794             "\x61\x63\x68\x2c\x0a\x65\x72\x20"
2795             "\x77\x69\x72\x64\x20\x64\x69\x63"
2796             "\x68\x20\x6c\x69\x65\x62\x65\x6e"
2797             "\x20\x75\x6e\x64\x20\x77\x69\x65"
2798             "\x67\x65\x6e\x2e\x0a\x0a\x55\x6e"
2799             "\x64\x20\x64\x61\x6e\x6e\x20\x6d"
2800             "\x65\x69\x6e\x65\x20\x53\x65\x65"
2801             "\x6c\x65\x20\x73\x65\x69\x74\x20"
2802             "\x77\x65\x69\x74\x2c\x20\x73\x65"
2803             "\x69\x20\x77\x65\x69\x74\x2c\x0a"
2804             "\x64\x61\x73\x73\x20\x64\x69\x72"
2805             "\x20\x64\x61\x73\x20\x4c\x65\x62"
2806             "\x65\x6e\x20\x67\x65\x6c\x69\x6e"
2807             "\x67\x65\x2c\x0a\x62\x72\x65\x69"
2808             "\x74\x65\x20\x64\x69\x63\x68\x20"
2809             "\x77\x69\x65\x20\x65\x69\x6e\x20"
2810             "\x46\x65\x69\x65\x72\x6b\x6c\x65"
2811             "\x69\x64\x0a\xc3\xbc\x62\x65\x72"
2812             "\x20\x64\x69\x65\x20\x73\x69\x6e"
2813             "\x6e\x65\x6e\x64\x65\x6e\x20\x44"
2814             "\x69\x6e\x67\x65\x2e\x2e\x2e\x0a",
2815         .psize  = 400,
2816         .digest = "\xad\xb1\xc1\xe9\x56\x70\x31\x1d"
2817             "\xbb\x5b\xdf\x5e\x70\x72\x1a\x57",
2818     },
2819 };
2820 
2821 /*
2822  * HMAC-MD5 test vectors from RFC2202
2823  * (These need to be fixed to not use strlen).
2824  */
2825 #define HMAC_MD5_TEST_VECTORS   7
2826 
2827 static struct hash_testvec hmac_md5_tv_template[] =
2828 {
2829     {
2830         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2831         .ksize  = 16,
2832         .plaintext = "Hi There",
2833         .psize  = 8,
2834         .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
2835               "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
2836     }, {
2837         .key    = "Jefe",
2838         .ksize  = 4,
2839         .plaintext = "what do ya want for nothing?",
2840         .psize  = 28,
2841         .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
2842               "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
2843         .np = 2,
2844         .tap    = {14, 14}
2845     }, {
2846         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2847         .ksize  = 16,
2848         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2849             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2850             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2851             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2852         .psize  = 50,
2853         .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
2854               "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
2855     }, {
2856         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2857               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2858               "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2859         .ksize  = 25,
2860         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2861             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2862             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2863             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2864         .psize  = 50,
2865         .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
2866               "\x3a\x75\x16\x47\x46\xff\xaa\x79",
2867     }, {
2868         .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2869         .ksize  = 16,
2870         .plaintext = "Test With Truncation",
2871         .psize  = 20,
2872         .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
2873               "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
2874     }, {
2875         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2876             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2877             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2878             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2879             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2880             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2881             "\xaa\xaa",
2882         .ksize  = 80,
2883         .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2884         .psize  = 54,
2885         .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
2886               "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
2887     }, {
2888         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2889             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2890             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2891             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2892             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2893             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2894             "\xaa\xaa",
2895         .ksize  = 80,
2896         .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2897                "Block-Size Data",
2898         .psize  = 73,
2899         .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
2900               "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
2901     },
2902 };
2903 
2904 /*
2905  * HMAC-RIPEMD128 test vectors from RFC2286
2906  */
2907 #define HMAC_RMD128_TEST_VECTORS    7
2908 
2909 static struct hash_testvec hmac_rmd128_tv_template[] = {
2910     {
2911         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2912         .ksize  = 16,
2913         .plaintext = "Hi There",
2914         .psize  = 8,
2915         .digest = "\xfb\xf6\x1f\x94\x92\xaa\x4b\xbf"
2916               "\x81\xc1\x72\xe8\x4e\x07\x34\xdb",
2917     }, {
2918         .key    = "Jefe",
2919         .ksize  = 4,
2920         .plaintext = "what do ya want for nothing?",
2921         .psize  = 28,
2922         .digest = "\x87\x5f\x82\x88\x62\xb6\xb3\x34"
2923               "\xb4\x27\xc5\x5f\x9f\x7f\xf0\x9b",
2924         .np = 2,
2925         .tap    = { 14, 14 },
2926     }, {
2927         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
2928         .ksize  = 16,
2929         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2930             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2931             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
2932             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
2933         .psize  = 50,
2934         .digest = "\x09\xf0\xb2\x84\x6d\x2f\x54\x3d"
2935               "\xa3\x63\xcb\xec\x8d\x62\xa3\x8d",
2936     }, {
2937         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
2938               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
2939               "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
2940         .ksize  = 25,
2941         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2942             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2943             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
2944             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
2945         .psize  = 50,
2946         .digest = "\xbd\xbb\xd7\xcf\x03\xe4\x4b\x5a"
2947               "\xa6\x0a\xf8\x15\xbe\x4d\x22\x94",
2948     }, {
2949         .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
2950         .ksize  = 16,
2951         .plaintext = "Test With Truncation",
2952         .psize  = 20,
2953         .digest = "\xe7\x98\x08\xf2\x4b\x25\xfd\x03"
2954               "\x1c\x15\x5f\x0d\x55\x1d\x9a\x3a",
2955     }, {
2956         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2957             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2958             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2959             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2960             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2961             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2962             "\xaa\xaa",
2963         .ksize  = 80,
2964         .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
2965         .psize  = 54,
2966         .digest = "\xdc\x73\x29\x28\xde\x98\x10\x4a"
2967               "\x1f\x59\xd3\x73\xc1\x50\xac\xbb",
2968     }, {
2969         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2970             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2971             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2972             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2973             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2974             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
2975             "\xaa\xaa",
2976         .ksize  = 80,
2977         .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
2978                "Block-Size Data",
2979         .psize  = 73,
2980         .digest = "\x5c\x6b\xec\x96\x79\x3e\x16\xd4"
2981               "\x06\x90\xc2\x37\x63\x5f\x30\xc5",
2982     },
2983 };
2984 
2985 /*
2986  * HMAC-RIPEMD160 test vectors from RFC2286
2987  */
2988 #define HMAC_RMD160_TEST_VECTORS    7
2989 
2990 static struct hash_testvec hmac_rmd160_tv_template[] = {
2991     {
2992         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
2993         .ksize  = 20,
2994         .plaintext = "Hi There",
2995         .psize  = 8,
2996         .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
2997               "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
2998     }, {
2999         .key    = "Jefe",
3000         .ksize  = 4,
3001         .plaintext = "what do ya want for nothing?",
3002         .psize  = 28,
3003         .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
3004               "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
3005         .np = 2,
3006         .tap    = { 14, 14 },
3007     }, {
3008         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
3009         .ksize  = 20,
3010         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3011             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3012             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3013             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
3014         .psize  = 50,
3015         .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
3016               "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
3017     }, {
3018         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3019               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3020               "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
3021         .ksize  = 25,
3022         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3023             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3024             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3025             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
3026         .psize  = 50,
3027         .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
3028               "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
3029     }, {
3030         .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
3031         .ksize  = 20,
3032         .plaintext = "Test With Truncation",
3033         .psize  = 20,
3034         .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
3035               "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
3036     }, {
3037         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3038             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3039             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3040             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3041             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3042             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3043             "\xaa\xaa",
3044         .ksize  = 80,
3045         .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
3046         .psize  = 54,
3047         .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
3048               "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
3049     }, {
3050         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3051             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3052             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3053             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3054             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3055             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3056             "\xaa\xaa",
3057         .ksize  = 80,
3058         .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
3059                "Block-Size Data",
3060         .psize  = 73,
3061         .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
3062               "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
3063     },
3064 };
3065 
3066 /*
3067  * HMAC-SHA1 test vectors from RFC2202
3068  */
3069 #define HMAC_SHA1_TEST_VECTORS  7
3070 
3071 static struct hash_testvec hmac_sha1_tv_template[] = {
3072     {
3073         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
3074         .ksize  = 20,
3075         .plaintext = "Hi There",
3076         .psize  = 8,
3077         .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
3078               "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
3079               "\x46\xbe",
3080     }, {
3081         .key    = "Jefe",
3082         .ksize  = 4,
3083         .plaintext = "what do ya want for nothing?",
3084         .psize  = 28,
3085         .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
3086               "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
3087         .np = 2,
3088         .tap    = { 14, 14 }
3089     }, {
3090         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
3091         .ksize  = 20,
3092         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3093             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3094             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3095             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
3096         .psize  = 50,
3097         .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
3098               "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
3099     }, {
3100         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3101               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3102               "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
3103         .ksize  = 25,
3104         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3105             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3106             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3107             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
3108         .psize  = 50,
3109         .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
3110               "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
3111     }, {
3112         .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
3113         .ksize  = 20,
3114         .plaintext = "Test With Truncation",
3115         .psize  = 20,
3116         .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
3117               "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
3118     }, {
3119         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3120             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3121             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3122             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3123             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3124             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3125             "\xaa\xaa",
3126         .ksize  = 80,
3127         .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
3128         .psize  = 54,
3129         .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
3130               "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
3131     }, {
3132         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3133             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3134             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3135             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3136             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3137             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3138             "\xaa\xaa",
3139         .ksize  = 80,
3140         .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
3141                "Block-Size Data",
3142         .psize  = 73,
3143         .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
3144               "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
3145     },
3146 };
3147 
3148 
3149 /*
3150  * SHA224 HMAC test vectors from RFC4231
3151  */
3152 #define HMAC_SHA224_TEST_VECTORS    4
3153 
3154 static struct hash_testvec hmac_sha224_tv_template[] = {
3155     {
3156         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3157             "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3158             "\x0b\x0b\x0b\x0b",
3159         .ksize  = 20,
3160         /*  ("Hi There") */
3161         .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
3162         .psize  = 8,
3163         .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
3164             "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
3165             "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
3166             "\x53\x68\x4b\x22",
3167     }, {
3168         .key    = "Jefe",
3169         .ksize  = 4,
3170         /* ("what do ya want for nothing?") */
3171         .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
3172             "\x79\x61\x20\x77\x61\x6e\x74\x20"
3173             "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
3174             "\x69\x6e\x67\x3f",
3175         .psize  = 28,
3176         .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
3177             "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
3178             "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
3179             "\x8f\xd0\x5e\x44",
3180         .np = 4,
3181         .tap    = { 7, 7, 7, 7 }
3182     }, {
3183         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3184             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3185             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3186             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3187             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3188             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3189             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3190             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3191             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3192             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3193             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3194             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3195             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3196             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3197             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3198             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3199             "\xaa\xaa\xaa",
3200         .ksize  = 131,
3201         /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
3202         .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
3203             "\x6e\x67\x20\x4c\x61\x72\x67\x65"
3204             "\x72\x20\x54\x68\x61\x6e\x20\x42"
3205             "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
3206             "\x65\x20\x4b\x65\x79\x20\x2d\x20"
3207             "\x48\x61\x73\x68\x20\x4b\x65\x79"
3208             "\x20\x46\x69\x72\x73\x74",
3209         .psize  = 54,
3210         .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
3211             "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
3212             "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
3213             "\x3f\xa6\x87\x0e",
3214     }, {
3215         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3216             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3217             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3218             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3219             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3220             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3221             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3222             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3223             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3224             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3225             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3226             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3227             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3228             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3229             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3230             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3231             "\xaa\xaa\xaa",
3232         .ksize  = 131,
3233         /* ("This is a test using a larger than block-size key and a")
3234         (" larger than block-size data. The key needs to be")
3235             (" hashed before being used by the HMAC algorithm.") */
3236         .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
3237             "\x61\x20\x74\x65\x73\x74\x20\x75"
3238             "\x73\x69\x6e\x67\x20\x61\x20\x6c"
3239             "\x61\x72\x67\x65\x72\x20\x74\x68"
3240             "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
3241             "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
3242             "\x79\x20\x61\x6e\x64\x20\x61\x20"
3243             "\x6c\x61\x72\x67\x65\x72\x20\x74"
3244             "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
3245             "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
3246             "\x61\x74\x61\x2e\x20\x54\x68\x65"
3247             "\x20\x6b\x65\x79\x20\x6e\x65\x65"
3248             "\x64\x73\x20\x74\x6f\x20\x62\x65"
3249             "\x20\x68\x61\x73\x68\x65\x64\x20"
3250             "\x62\x65\x66\x6f\x72\x65\x20\x62"
3251             "\x65\x69\x6e\x67\x20\x75\x73\x65"
3252             "\x64\x20\x62\x79\x20\x74\x68\x65"
3253             "\x20\x48\x4d\x41\x43\x20\x61\x6c"
3254             "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
3255         .psize  = 152,
3256         .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
3257             "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
3258             "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
3259             "\xf6\xf5\x65\xd1",
3260     },
3261 };
3262 
3263 /*
3264  * HMAC-SHA256 test vectors from
3265  * draft-ietf-ipsec-ciph-sha-256-01.txt
3266  */
3267 #define HMAC_SHA256_TEST_VECTORS    10
3268 
3269 static struct hash_testvec hmac_sha256_tv_template[] = {
3270     {
3271         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3272               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3273               "\x11\x12\x13\x14\x15\x16\x17\x18"
3274               "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
3275         .ksize  = 32,
3276         .plaintext = "abc",
3277         .psize  = 3,
3278         .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
3279               "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
3280               "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
3281               "\x92\x75\x90\x21\xcf\xab\x81\x81",
3282     }, {
3283         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3284               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3285               "\x11\x12\x13\x14\x15\x16\x17\x18"
3286               "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
3287         .ksize  = 32,
3288         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
3289         .psize  = 56,
3290         .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
3291               "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
3292               "\xe6\x98\xe3\x61\x19\x42\x11\x49"
3293               "\xea\x8c\x71\x24\x56\x69\x7d\x30",
3294     }, {
3295         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3296               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3297               "\x11\x12\x13\x14\x15\x16\x17\x18"
3298               "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
3299         .ksize  = 32,
3300         .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
3301                "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
3302         .psize  = 112,
3303         .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
3304               "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
3305               "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
3306               "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
3307     }, {
3308         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3309             "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3310             "\x0b\x0b\x0b\x0b\x0b\x0b",
3311         .ksize  = 32,
3312         .plaintext = "Hi There",
3313         .psize  = 8,
3314         .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
3315               "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
3316               "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
3317               "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
3318     }, {
3319         .key    = "Jefe",
3320         .ksize  = 4,
3321         .plaintext = "what do ya want for nothing?",
3322         .psize  = 28,
3323         .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
3324               "\x6a\x04\x24\x26\x08\x95\x75\xc7"
3325               "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
3326               "\x9d\xec\x58\xb9\x64\xec\x38\x43",
3327         .np = 2,
3328         .tap    = { 14, 14 }
3329     }, {
3330         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3331             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3332             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
3333         .ksize  = 32,
3334         .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3335             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3336             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
3337             "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
3338         .psize  = 50,
3339         .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
3340               "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
3341               "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
3342               "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
3343     }, {
3344         .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
3345               "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
3346               "\x11\x12\x13\x14\x15\x16\x17\x18"
3347               "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
3348               "\x21\x22\x23\x24\x25",
3349         .ksize  = 37,
3350         .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3351             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3352             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
3353             "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
3354         .psize  = 50,
3355         .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
3356               "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
3357               "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
3358               "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
3359     }, {
3360         .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
3361             "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
3362             "\x0c\x0c\x0c\x0c\x0c\x0c",
3363         .ksize  = 32,
3364         .plaintext = "Test With Truncation",
3365         .psize  = 20,
3366         .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
3367               "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
3368               "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
3369               "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
3370     }, {
3371         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3372             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3373             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3374             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3375             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3376             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3377             "\xaa\xaa",
3378         .ksize  = 80,
3379         .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
3380         .psize  = 54,
3381         .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
3382               "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
3383               "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
3384               "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
3385     }, {
3386         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3387             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3388             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3389             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3390             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3391             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3392             "\xaa\xaa",
3393         .ksize  = 80,
3394         .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
3395                "One Block-Size Data",
3396         .psize  = 73,
3397         .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
3398               "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
3399               "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
3400               "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
3401     },
3402 };
3403 
3404 #define CMAC_AES_TEST_VECTORS 6
3405 
3406 static struct hash_testvec aes_cmac128_tv_template[] = {
3407     { /* From NIST Special Publication 800-38B, AES-128 */
3408         .key        = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
3409                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
3410         .plaintext  = zeroed_string,
3411         .digest     = "\xbb\x1d\x69\x29\xe9\x59\x37\x28"
3412                   "\x7f\xa3\x7d\x12\x9b\x75\x67\x46",
3413         .psize      = 0,
3414         .ksize      = 16,
3415     }, {
3416         .key        = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
3417                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
3418         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3419                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
3420         .digest     = "\x07\x0a\x16\xb4\x6b\x4d\x41\x44"
3421                   "\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c",
3422         .psize      = 16,
3423         .ksize      = 16,
3424     }, {
3425         .key        = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
3426                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
3427         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3428                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
3429                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
3430                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
3431                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11",
3432         .digest     = "\xdf\xa6\x67\x47\xde\x9a\xe6\x30"
3433                   "\x30\xca\x32\x61\x14\x97\xc8\x27",
3434         .psize      = 40,
3435         .ksize      = 16,
3436     }, {
3437         .key        = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
3438                   "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
3439         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3440                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
3441                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
3442                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
3443                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
3444                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
3445                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
3446                   "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
3447         .digest     = "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92"
3448                   "\xfc\x49\x74\x17\x79\x36\x3c\xfe",
3449         .psize      = 64,
3450         .ksize      = 16,
3451     }, { /* From NIST Special Publication 800-38B, AES-256 */
3452         .key        = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
3453                   "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
3454                   "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
3455                   "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
3456         .plaintext  = zeroed_string,
3457         .digest     = "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e"
3458                   "\xfc\x6b\x55\x1f\x46\x67\xd9\x83",
3459         .psize      = 0,
3460         .ksize      = 32,
3461     }, {
3462         .key        = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
3463                   "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
3464                   "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
3465                   "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
3466         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3467                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
3468                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
3469                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
3470                   "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
3471                   "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
3472                   "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
3473                   "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
3474         .digest     = "\xe1\x99\x21\x90\x54\x9f\x6e\xd5"
3475                   "\x69\x6a\x2c\x05\x6c\x31\x54\x10",
3476         .psize      = 64,
3477         .ksize      = 32,
3478     }
3479 };
3480 
3481 #define CMAC_DES3_EDE_TEST_VECTORS 4
3482 
3483 static struct hash_testvec des3_ede_cmac64_tv_template[] = {
3484 /*
3485  * From NIST Special Publication 800-38B, Three Key TDEA
3486  * Corrected test vectors from:
3487  *  http://csrc.nist.gov/publications/nistpubs/800-38B/Updated_CMAC_Examples.pdf
3488  */
3489     {
3490         .key        = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
3491                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
3492                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
3493         .plaintext  = zeroed_string,
3494         .digest     = "\xb7\xa6\x88\xe1\x22\xff\xaf\x95",
3495         .psize      = 0,
3496         .ksize      = 24,
3497     }, {
3498         .key        = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
3499                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
3500                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
3501         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96",
3502         .digest     = "\x8e\x8f\x29\x31\x36\x28\x37\x97",
3503         .psize      = 8,
3504         .ksize      = 24,
3505     }, {
3506         .key        = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
3507                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
3508                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
3509         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3510                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
3511                   "\xae\x2d\x8a\x57",
3512         .digest     = "\x74\x3d\xdb\xe0\xce\x2d\xc2\xed",
3513         .psize      = 20,
3514         .ksize      = 24,
3515     }, {
3516         .key        = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
3517                   "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
3518                   "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
3519         .plaintext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
3520                   "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
3521                   "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
3522                   "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51",
3523         .digest     = "\x33\xe6\xb1\x09\x24\x00\xea\xe5",
3524         .psize      = 32,
3525         .ksize      = 24,
3526     }
3527 };
3528 
3529 #define XCBC_AES_TEST_VECTORS 6
3530 
3531 static struct hash_testvec aes_xcbc128_tv_template[] = {
3532     {
3533         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3534               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3535         .plaintext = zeroed_string,
3536         .digest = "\x75\xf0\x25\x1d\x52\x8a\xc0\x1c"
3537               "\x45\x73\xdf\xd5\x84\xd7\x9f\x29",
3538         .psize  = 0,
3539         .ksize  = 16,
3540     }, {
3541         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3542               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3543         .plaintext = "\x00\x01\x02",
3544         .digest = "\x5b\x37\x65\x80\xae\x2f\x19\xaf"
3545               "\xe7\x21\x9c\xee\xf1\x72\x75\x6f",
3546         .psize  = 3,
3547         .ksize  = 16,
3548     } , {
3549         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3550               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3551         .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
3552                  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3553         .digest = "\xd2\xa2\x46\xfa\x34\x9b\x68\xa7"
3554               "\x99\x98\xa4\x39\x4f\xf7\xa2\x63",
3555         .psize  = 16,
3556         .ksize  = 16,
3557     }, {
3558         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3559               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3560         .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
3561                  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3562                  "\x10\x11\x12\x13",
3563         .digest = "\x47\xf5\x1b\x45\x64\x96\x62\x15"
3564               "\xb8\x98\x5c\x63\x05\x5e\xd3\x08",
3565         .tap    = { 10, 10 },
3566         .psize  = 20,
3567         .np = 2,
3568         .ksize  = 16,
3569     }, {
3570         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3571               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3572         .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
3573                  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3574                  "\x10\x11\x12\x13\x14\x15\x16\x17"
3575                  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
3576         .digest = "\xf5\x4f\x0e\xc8\xd2\xb9\xf3\xd3"
3577               "\x68\x07\x73\x4b\xd5\x28\x3f\xd4",
3578         .psize  = 32,
3579         .ksize  = 16,
3580     }, {
3581         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3582               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3583         .plaintext = "\x00\x01\x02\x03\x04\x05\x06\x07"
3584                  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
3585                  "\x10\x11\x12\x13\x14\x15\x16\x17"
3586                  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
3587                  "\x20\x21",
3588         .digest = "\xbe\xcb\xb3\xbc\xcd\xb5\x18\xa3"
3589               "\x06\x77\xd5\x48\x1f\xb6\xb4\xd8",
3590         .tap    = { 17, 17 },
3591         .psize  = 34,
3592         .np = 2,
3593         .ksize  = 16,
3594     }
3595 };
3596 
3597 #define VMAC_AES_TEST_VECTORS   11
3598 static char vmac_string1[128] = {'\x01', '\x01', '\x01', '\x01',
3599                 '\x02', '\x03', '\x02', '\x02',
3600                 '\x02', '\x04', '\x01', '\x07',
3601                 '\x04', '\x01', '\x04', '\x03',};
3602 static char vmac_string2[128] = {'a', 'b', 'c',};
3603 static char vmac_string3[128] = {'a', 'b', 'c', 'a', 'b', 'c',
3604                 'a', 'b', 'c', 'a', 'b', 'c',
3605                 'a', 'b', 'c', 'a', 'b', 'c',
3606                 'a', 'b', 'c', 'a', 'b', 'c',
3607                 'a', 'b', 'c', 'a', 'b', 'c',
3608                 'a', 'b', 'c', 'a', 'b', 'c',
3609                 'a', 'b', 'c', 'a', 'b', 'c',
3610                 'a', 'b', 'c', 'a', 'b', 'c',
3611                 };
3612 
3613 static char vmac_string4[17] = {'b', 'c', 'e', 'f',
3614                 'i', 'j', 'l', 'm',
3615                 'o', 'p', 'r', 's',
3616                 't', 'u', 'w', 'x', 'z'};
3617 
3618 static char vmac_string5[127] = {'r', 'm', 'b', 't', 'c',
3619                  'o', 'l', 'k', ']', '%',
3620                  '9', '2', '7', '!', 'A'};
3621 
3622 static char vmac_string6[129] = {'p', 't', '*', '7', 'l',
3623                  'i', '!', '#', 'w', '0',
3624                  'z', '/', '4', 'A', 'n'};
3625 
3626 static struct hash_testvec aes_vmac128_tv_template[] = {
3627     {
3628         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3629               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3630         .plaintext = NULL,
3631         .digest = "\x07\x58\x80\x35\x77\xa4\x7b\x54",
3632         .psize  = 0,
3633         .ksize  = 16,
3634     }, {
3635         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3636               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3637         .plaintext = vmac_string1,
3638         .digest = "\xce\xf5\x3c\xd3\xae\x68\x8c\xa1",
3639         .psize  = 128,
3640         .ksize  = 16,
3641     }, {
3642         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3643               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3644         .plaintext = vmac_string2,
3645         .digest = "\xc9\x27\xb0\x73\x81\xbd\x14\x2d",
3646         .psize  = 128,
3647         .ksize  = 16,
3648     }, {
3649         .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
3650               "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
3651         .plaintext = vmac_string3,
3652         .digest = "\x8d\x1a\x95\x8c\x98\x47\x0b\x19",
3653         .psize  = 128,
3654         .ksize  = 16,
3655     }, {
3656         .key    = "abcdefghijklmnop",
3657         .plaintext = NULL,
3658         .digest = "\x3b\x89\xa1\x26\x9e\x55\x8f\x84",
3659         .psize  = 0,
3660         .ksize  = 16,
3661     }, {
3662         .key    = "abcdefghijklmnop",
3663         .plaintext = vmac_string1,
3664         .digest = "\xab\x5e\xab\xb0\xf6\x8d\x74\xc2",
3665         .psize  = 128,
3666         .ksize  = 16,
3667     }, {
3668         .key    = "abcdefghijklmnop",
3669         .plaintext = vmac_string2,
3670         .digest = "\x11\x15\x68\x42\x3d\x7b\x09\xdf",
3671         .psize  = 128,
3672         .ksize  = 16,
3673     }, {
3674         .key    = "abcdefghijklmnop",
3675         .plaintext = vmac_string3,
3676         .digest = "\x8b\x32\x8f\xe1\xed\x8f\xfa\xd4",
3677         .psize  = 128,
3678         .ksize  = 16,
3679     }, {
3680         .key = "a09b5cd!f#07K\x00\x00\x00",
3681         .plaintext = vmac_string4,
3682         .digest = "\xab\xa5\x0f\xea\x42\x4e\xa1\x5f",
3683         .psize = sizeof(vmac_string4),
3684         .ksize = 16,
3685     }, {
3686         .key = "a09b5cd!f#07K\x00\x00\x00",
3687         .plaintext = vmac_string5,
3688         .digest = "\x25\x31\x98\xbc\x1d\xe8\x67\x60",
3689         .psize = sizeof(vmac_string5),
3690         .ksize = 16,
3691     }, {
3692         .key = "a09b5cd!f#07K\x00\x00\x00",
3693         .plaintext = vmac_string6,
3694         .digest = "\xc4\xae\x9b\x47\x95\x65\xeb\x41",
3695         .psize = sizeof(vmac_string6),
3696         .ksize = 16,
3697     },
3698 };
3699 
3700 /*
3701  * SHA384 HMAC test vectors from RFC4231
3702  */
3703 
3704 #define HMAC_SHA384_TEST_VECTORS    4
3705 
3706 static struct hash_testvec hmac_sha384_tv_template[] = {
3707     {
3708         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3709               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3710               "\x0b\x0b\x0b\x0b",
3711         .ksize  = 20,
3712         .plaintext = "Hi There",
3713         .psize  = 8,
3714         .digest = "\xaf\xd0\x39\x44\xd8\x48\x95\x62"
3715               "\x6b\x08\x25\xf4\xab\x46\x90\x7f"
3716               "\x15\xf9\xda\xdb\xe4\x10\x1e\xc6"
3717               "\x82\xaa\x03\x4c\x7c\xeb\xc5\x9c"
3718               "\xfa\xea\x9e\xa9\x07\x6e\xde\x7f"
3719               "\x4a\xf1\x52\xe8\xb2\xfa\x9c\xb6",
3720     }, {
3721         .key    = "Jefe",
3722         .ksize  = 4,
3723         .plaintext = "what do ya want for nothing?",
3724         .psize  = 28,
3725         .digest = "\xaf\x45\xd2\xe3\x76\x48\x40\x31"
3726               "\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
3727               "\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47"
3728               "\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
3729               "\x8e\x22\x40\xca\x5e\x69\xe2\xc7"
3730               "\x8b\x32\x39\xec\xfa\xb2\x16\x49",
3731         .np = 4,
3732         .tap    = { 7, 7, 7, 7 }
3733     }, {
3734         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3735               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3736               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3737               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3738               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3739               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3740               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3741               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3742               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3743               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3744               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3745               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3746               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3747               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3748               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3749               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3750               "\xaa\xaa\xaa",
3751         .ksize  = 131,
3752         .plaintext = "Test Using Larger Than Block-Siz"
3753                "e Key - Hash Key First",
3754         .psize  = 54,
3755         .digest = "\x4e\xce\x08\x44\x85\x81\x3e\x90"
3756               "\x88\xd2\xc6\x3a\x04\x1b\xc5\xb4"
3757               "\x4f\x9e\xf1\x01\x2a\x2b\x58\x8f"
3758               "\x3c\xd1\x1f\x05\x03\x3a\xc4\xc6"
3759               "\x0c\x2e\xf6\xab\x40\x30\xfe\x82"
3760               "\x96\x24\x8d\xf1\x63\xf4\x49\x52",
3761     }, {
3762         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3763               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3764               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3765               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3766               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3767               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3768               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3769               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3770               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3771               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3772               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3773               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3774               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3775               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3776               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3777               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3778               "\xaa\xaa\xaa",
3779         .ksize  = 131,
3780         .plaintext = "This is a test u"
3781                "sing a larger th"
3782                "an block-size ke"
3783                "y and a larger t"
3784                "han block-size d"
3785                "ata. The key nee"
3786                "ds to be hashed "
3787                "before being use"
3788                "d by the HMAC al"
3789                "gorithm.",
3790         .psize  = 152,
3791         .digest = "\x66\x17\x17\x8e\x94\x1f\x02\x0d"
3792               "\x35\x1e\x2f\x25\x4e\x8f\xd3\x2c"
3793               "\x60\x24\x20\xfe\xb0\xb8\xfb\x9a"
3794               "\xdc\xce\xbb\x82\x46\x1e\x99\xc5"
3795               "\xa6\x78\xcc\x31\xe7\x99\x17\x6d"
3796               "\x38\x60\xe6\x11\x0c\x46\x52\x3e",
3797     },
3798 };
3799 
3800 /*
3801  * SHA512 HMAC test vectors from RFC4231
3802  */
3803 
3804 #define HMAC_SHA512_TEST_VECTORS    4
3805 
3806 static struct hash_testvec hmac_sha512_tv_template[] = {
3807     {
3808         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3809               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3810               "\x0b\x0b\x0b\x0b",
3811         .ksize  = 20,
3812         .plaintext = "Hi There",
3813         .psize  = 8,
3814         .digest = "\x87\xaa\x7c\xde\xa5\xef\x61\x9d"
3815               "\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0"
3816               "\x23\x79\xf4\xe2\xce\x4e\xc2\x78"
3817               "\x7a\xd0\xb3\x05\x45\xe1\x7c\xde"
3818               "\xda\xa8\x33\xb7\xd6\xb8\xa7\x02"
3819               "\x03\x8b\x27\x4e\xae\xa3\xf4\xe4"
3820               "\xbe\x9d\x91\x4e\xeb\x61\xf1\x70"
3821               "\x2e\x69\x6c\x20\x3a\x12\x68\x54",
3822     }, {
3823         .key    = "Jefe",
3824         .ksize  = 4,
3825         .plaintext = "what do ya want for nothing?",
3826         .psize  = 28,
3827         .digest = "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2"
3828               "\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
3829               "\x87\xbd\x64\x22\x2e\x83\x1f\xd6"
3830               "\x10\x27\x0c\xd7\xea\x25\x05\x54"
3831               "\x97\x58\xbf\x75\xc0\x5a\x99\x4a"
3832               "\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd"
3833               "\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b"
3834               "\x63\x6e\x07\x0a\x38\xbc\xe7\x37",
3835         .np = 4,
3836         .tap    = { 7, 7, 7, 7 }
3837     }, {
3838         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3839               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3840               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3841               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3842               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3843               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3844               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3845               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3846               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3847               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3848               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3849               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3850               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3851               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3852               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3853               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3854               "\xaa\xaa\xaa",
3855         .ksize  = 131,
3856         .plaintext = "Test Using Large"
3857                "r Than Block-Siz"
3858                "e Key - Hash Key"
3859                " First",
3860         .psize  = 54,
3861         .digest = "\x80\xb2\x42\x63\xc7\xc1\xa3\xeb"
3862             "\xb7\x14\x93\xc1\xdd\x7b\xe8\xb4"
3863             "\x9b\x46\xd1\xf4\x1b\x4a\xee\xc1"
3864             "\x12\x1b\x01\x37\x83\xf8\xf3\x52"
3865             "\x6b\x56\xd0\x37\xe0\x5f\x25\x98"
3866             "\xbd\x0f\xd2\x21\x5d\x6a\x1e\x52"
3867             "\x95\xe6\x4f\x73\xf6\x3f\x0a\xec"
3868             "\x8b\x91\x5a\x98\x5d\x78\x65\x98",
3869     }, {
3870         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3871             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3872             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3873             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3874             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3875             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3876             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3877             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3878             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3879             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3880             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3881             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3882             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3883             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3884             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3885             "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3886             "\xaa\xaa\xaa",
3887         .ksize  = 131,
3888         .plaintext =
3889               "This is a test u"
3890               "sing a larger th"
3891               "an block-size ke"
3892               "y and a larger t"
3893               "han block-size d"
3894               "ata. The key nee"
3895               "ds to be hashed "
3896               "before being use"
3897               "d by the HMAC al"
3898               "gorithm.",
3899         .psize  = 152,
3900         .digest = "\xe3\x7b\x6a\x77\x5d\xc8\x7d\xba"
3901             "\xa4\xdf\xa9\xf9\x6e\x5e\x3f\xfd"
3902             "\xde\xbd\x71\xf8\x86\x72\x89\x86"
3903             "\x5d\xf5\xa3\x2d\x20\xcd\xc9\x44"
3904             "\xb6\x02\x2c\xac\x3c\x49\x82\xb1"
3905             "\x0d\x5e\xeb\x55\xc3\xe4\xde\x15"
3906             "\x13\x46\x76\xfb\x6d\xe0\x44\x60"
3907             "\x65\xc9\x74\x40\xfa\x8c\x6a\x58",
3908     },
3909 };
3910 
3911 #define HMAC_SHA3_224_TEST_VECTORS  4
3912 
3913 static struct hash_testvec hmac_sha3_224_tv_template[] = {
3914     {
3915         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3916               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
3917               "\x0b\x0b\x0b\x0b",
3918         .ksize  = 20,
3919         .plaintext = "Hi There",
3920         .psize  = 8,
3921         .digest = "\x3b\x16\x54\x6b\xbc\x7b\xe2\x70"
3922               "\x6a\x03\x1d\xca\xfd\x56\x37\x3d"
3923               "\x98\x84\x36\x76\x41\xd8\xc5\x9a"
3924               "\xf3\xc8\x60\xf7",
3925     }, {
3926         .key    = "Jefe",
3927         .ksize  = 4,
3928         .plaintext = "what do ya want for nothing?",
3929         .psize  = 28,
3930         .digest = "\x7f\xdb\x8d\xd8\x8b\xd2\xf6\x0d"
3931               "\x1b\x79\x86\x34\xad\x38\x68\x11"
3932               "\xc2\xcf\xc8\x5b\xfa\xf5\xd5\x2b"
3933               "\xba\xce\x5e\x66",
3934         .np = 4,
3935         .tap    = { 7, 7, 7, 7 }
3936     }, {
3937         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3938               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3939               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3940               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3941               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3942               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3943               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3944               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3945               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3946               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3947               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3948               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3949               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3950               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3951               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3952               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3953               "\xaa\xaa\xaa",
3954         .ksize  = 131,
3955         .plaintext = "Test Using Large"
3956                "r Than Block-Siz"
3957                "e Key - Hash Key"
3958                " First",
3959         .psize  = 54,
3960         .digest = "\xb4\xa1\xf0\x4c\x00\x28\x7a\x9b"
3961               "\x7f\x60\x75\xb3\x13\xd2\x79\xb8"
3962               "\x33\xbc\x8f\x75\x12\x43\x52\xd0"
3963               "\x5f\xb9\x99\x5f",
3964     }, {
3965         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3966               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3967               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3968               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3969               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3970               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3971               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3972               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3973               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3974               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3975               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3976               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3977               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3978               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3979               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3980               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
3981               "\xaa\xaa\xaa",
3982         .ksize  = 131,
3983         .plaintext =
3984               "This is a test u"
3985               "sing a larger th"
3986               "an block-size ke"
3987               "y and a larger t"
3988               "han block-size d"
3989               "ata. The key nee"
3990               "ds to be hashed "
3991               "before being use"
3992               "d by the HMAC al"
3993               "gorithm.",
3994         .psize  = 152,
3995         .digest = "\x05\xd8\xcd\x6d\x00\xfa\xea\x8d"
3996               "\x1e\xb6\x8a\xde\x28\x73\x0b\xbd"
3997               "\x3c\xba\xb6\x92\x9f\x0a\x08\x6b"
3998               "\x29\xcd\x62\xa0",
3999     },
4000 };
4001 
4002 #define HMAC_SHA3_256_TEST_VECTORS  4
4003 
4004 static struct hash_testvec hmac_sha3_256_tv_template[] = {
4005     {
4006         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4007               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4008               "\x0b\x0b\x0b\x0b",
4009         .ksize  = 20,
4010         .plaintext = "Hi There",
4011         .psize  = 8,
4012         .digest = "\xba\x85\x19\x23\x10\xdf\xfa\x96"
4013               "\xe2\xa3\xa4\x0e\x69\x77\x43\x51"
4014               "\x14\x0b\xb7\x18\x5e\x12\x02\xcd"
4015               "\xcc\x91\x75\x89\xf9\x5e\x16\xbb",
4016     }, {
4017         .key    = "Jefe",
4018         .ksize  = 4,
4019         .plaintext = "what do ya want for nothing?",
4020         .psize  = 28,
4021         .digest = "\xc7\xd4\x07\x2e\x78\x88\x77\xae"
4022               "\x35\x96\xbb\xb0\xda\x73\xb8\x87"
4023               "\xc9\x17\x1f\x93\x09\x5b\x29\x4a"
4024               "\xe8\x57\xfb\xe2\x64\x5e\x1b\xa5",
4025         .np = 4,
4026         .tap    = { 7, 7, 7, 7 }
4027     }, {
4028         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4029               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4030               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4031               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4032               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4033               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4034               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4035               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4036               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4037               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4038               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4039               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4040               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4041               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4042               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4043               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4044               "\xaa\xaa\xaa",
4045         .ksize  = 131,
4046         .plaintext = "Test Using Large"
4047                "r Than Block-Siz"
4048                "e Key - Hash Key"
4049                " First",
4050         .psize  = 54,
4051         .digest = "\xed\x73\xa3\x74\xb9\x6c\x00\x52"
4052               "\x35\xf9\x48\x03\x2f\x09\x67\x4a"
4053               "\x58\xc0\xce\x55\x5c\xfc\x1f\x22"
4054               "\x3b\x02\x35\x65\x60\x31\x2c\x3b",
4055     }, {
4056         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4057               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4058               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4059               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4060               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4061               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4062               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4063               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4064               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4065               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4066               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4067               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4068               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4069               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4070               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4071               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4072               "\xaa\xaa\xaa",
4073         .ksize  = 131,
4074         .plaintext =
4075               "This is a test u"
4076               "sing a larger th"
4077               "an block-size ke"
4078               "y and a larger t"
4079               "han block-size d"
4080               "ata. The key nee"
4081               "ds to be hashed "
4082               "before being use"
4083               "d by the HMAC al"
4084               "gorithm.",
4085         .psize  = 152,
4086         .digest = "\x65\xc5\xb0\x6d\x4c\x3d\xe3\x2a"
4087               "\x7a\xef\x87\x63\x26\x1e\x49\xad"
4088               "\xb6\xe2\x29\x3e\xc8\xe7\xc6\x1e"
4089               "\x8d\xe6\x17\x01\xfc\x63\xe1\x23",
4090     },
4091 };
4092 
4093 #define HMAC_SHA3_384_TEST_VECTORS  4
4094 
4095 static struct hash_testvec hmac_sha3_384_tv_template[] = {
4096     {
4097         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4098               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4099               "\x0b\x0b\x0b\x0b",
4100         .ksize  = 20,
4101         .plaintext = "Hi There",
4102         .psize  = 8,
4103         .digest = "\x68\xd2\xdc\xf7\xfd\x4d\xdd\x0a"
4104               "\x22\x40\xc8\xa4\x37\x30\x5f\x61"
4105               "\xfb\x73\x34\xcf\xb5\xd0\x22\x6e"
4106               "\x1b\xc2\x7d\xc1\x0a\x2e\x72\x3a"
4107               "\x20\xd3\x70\xb4\x77\x43\x13\x0e"
4108               "\x26\xac\x7e\x3d\x53\x28\x86\xbd",
4109     }, {
4110         .key    = "Jefe",
4111         .ksize  = 4,
4112         .plaintext = "what do ya want for nothing?",
4113         .psize  = 28,
4114         .digest = "\xf1\x10\x1f\x8c\xbf\x97\x66\xfd"
4115               "\x67\x64\xd2\xed\x61\x90\x3f\x21"
4116               "\xca\x9b\x18\xf5\x7c\xf3\xe1\xa2"
4117               "\x3c\xa1\x35\x08\xa9\x32\x43\xce"
4118               "\x48\xc0\x45\xdc\x00\x7f\x26\xa2"
4119               "\x1b\x3f\x5e\x0e\x9d\xf4\xc2\x0a",
4120         .np = 4,
4121         .tap    = { 7, 7, 7, 7 }
4122     }, {
4123         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4124               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4125               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4126               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4127               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4128               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4129               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4130               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4131               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4132               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4133               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4134               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4135               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4136               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4137               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4138               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4139               "\xaa\xaa\xaa",
4140         .ksize  = 131,
4141         .plaintext = "Test Using Large"
4142                "r Than Block-Siz"
4143                "e Key - Hash Key"
4144                " First",
4145         .psize  = 54,
4146         .digest = "\x0f\xc1\x95\x13\xbf\x6b\xd8\x78"
4147               "\x03\x70\x16\x70\x6a\x0e\x57\xbc"
4148               "\x52\x81\x39\x83\x6b\x9a\x42\xc3"
4149               "\xd4\x19\xe4\x98\xe0\xe1\xfb\x96"
4150               "\x16\xfd\x66\x91\x38\xd3\x3a\x11"
4151               "\x05\xe0\x7c\x72\xb6\x95\x3b\xcc",
4152     }, {
4153         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4154               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4155               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4156               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4157               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4158               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4159               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4160               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4161               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4162               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4163               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4164               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4165               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4166               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4167               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4168               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4169               "\xaa\xaa\xaa",
4170         .ksize  = 131,
4171         .plaintext =
4172               "This is a test u"
4173               "sing a larger th"
4174               "an block-size ke"
4175               "y and a larger t"
4176               "han block-size d"
4177               "ata. The key nee"
4178               "ds to be hashed "
4179               "before being use"
4180               "d by the HMAC al"
4181               "gorithm.",
4182         .psize  = 152,
4183         .digest = "\x02\x6f\xdf\x6b\x50\x74\x1e\x37"
4184               "\x38\x99\xc9\xf7\xd5\x40\x6d\x4e"
4185               "\xb0\x9f\xc6\x66\x56\x36\xfc\x1a"
4186               "\x53\x00\x29\xdd\xf5\xcf\x3c\xa5"
4187               "\xa9\x00\xed\xce\x01\xf5\xf6\x1e"
4188               "\x2f\x40\x8c\xdf\x2f\xd3\xe7\xe8",
4189     },
4190 };
4191 
4192 #define HMAC_SHA3_512_TEST_VECTORS  4
4193 
4194 static struct hash_testvec hmac_sha3_512_tv_template[] = {
4195     {
4196         .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4197               "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4198               "\x0b\x0b\x0b\x0b",
4199         .ksize  = 20,
4200         .plaintext = "Hi There",
4201         .psize  = 8,
4202         .digest = "\xeb\x3f\xbd\x4b\x2e\xaa\xb8\xf5"
4203               "\xc5\x04\xbd\x3a\x41\x46\x5a\xac"
4204               "\xec\x15\x77\x0a\x7c\xab\xac\x53"
4205               "\x1e\x48\x2f\x86\x0b\x5e\xc7\xba"
4206               "\x47\xcc\xb2\xc6\xf2\xaf\xce\x8f"
4207               "\x88\xd2\x2b\x6d\xc6\x13\x80\xf2"
4208               "\x3a\x66\x8f\xd3\x88\x8b\xb8\x05"
4209               "\x37\xc0\xa0\xb8\x64\x07\x68\x9e",
4210     }, {
4211         .key    = "Jefe",
4212         .ksize  = 4,
4213         .plaintext = "what do ya want for nothing?",
4214         .psize  = 28,
4215         .digest = "\x5a\x4b\xfe\xab\x61\x66\x42\x7c"
4216               "\x7a\x36\x47\xb7\x47\x29\x2b\x83"
4217               "\x84\x53\x7c\xdb\x89\xaf\xb3\xbf"
4218               "\x56\x65\xe4\xc5\xe7\x09\x35\x0b"
4219               "\x28\x7b\xae\xc9\x21\xfd\x7c\xa0"
4220               "\xee\x7a\x0c\x31\xd0\x22\xa9\x5e"
4221               "\x1f\xc9\x2b\xa9\xd7\x7d\xf8\x83"
4222               "\x96\x02\x75\xbe\xb4\xe6\x20\x24",
4223         .np = 4,
4224         .tap    = { 7, 7, 7, 7 }
4225     }, {
4226         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4227               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4228               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4229               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4230               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4231               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4232               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4233               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4234               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4235               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4236               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4237               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4238               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4239               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4240               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4241               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4242               "\xaa\xaa\xaa",
4243         .ksize  = 131,
4244         .plaintext = "Test Using Large"
4245                "r Than Block-Siz"
4246                "e Key - Hash Key"
4247                " First",
4248         .psize  = 54,
4249         .digest = "\x00\xf7\x51\xa9\xe5\x06\x95\xb0"
4250               "\x90\xed\x69\x11\xa4\xb6\x55\x24"
4251               "\x95\x1c\xdc\x15\xa7\x3a\x5d\x58"
4252               "\xbb\x55\x21\x5e\xa2\xcd\x83\x9a"
4253               "\xc7\x9d\x2b\x44\xa3\x9b\xaf\xab"
4254               "\x27\xe8\x3f\xde\x9e\x11\xf6\x34"
4255               "\x0b\x11\xd9\x91\xb1\xb9\x1b\xf2"
4256               "\xee\xe7\xfc\x87\x24\x26\xc3\xa4",
4257     }, {
4258         .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4259               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4260               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4261               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4262               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4263               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4264               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4265               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4266               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4267               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4268               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4269               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4270               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4271               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4272               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4273               "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
4274               "\xaa\xaa\xaa",
4275         .ksize  = 131,
4276         .plaintext =
4277               "This is a test u"
4278               "sing a larger th"
4279               "an block-size ke"
4280               "y and a larger t"
4281               "han block-size d"
4282               "ata. The key nee"
4283               "ds to be hashed "
4284               "before being use"
4285               "d by the HMAC al"
4286               "gorithm.",
4287         .psize  = 152,
4288         .digest = "\x38\xa4\x56\xa0\x04\xbd\x10\xd3"
4289               "\x2c\x9a\xb8\x33\x66\x84\x11\x28"
4290               "\x62\xc3\xdb\x61\xad\xcc\xa3\x18"
4291               "\x29\x35\x5e\xaf\x46\xfd\x5c\x73"
4292               "\xd0\x6a\x1f\x0d\x13\xfe\xc9\xa6"
4293               "\x52\xfb\x38\x11\xb5\x77\xb1\xb1"
4294               "\xd1\xb9\x78\x9f\x97\xae\x5b\x83"
4295               "\xc6\xf4\x4d\xfc\xf1\xd6\x7e\xba",
4296     },
4297 };
4298 
4299 /*
4300  * Poly1305 test vectors from RFC7539 A.3.
4301  */
4302 
4303 #define POLY1305_TEST_VECTORS   11
4304 
4305 static struct hash_testvec poly1305_tv_template[] = {
4306     { /* Test Vector #1 */
4307         .plaintext  = "\x00\x00\x00\x00\x00\x00\x00\x00"
4308                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4309                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4310                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4311                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4312                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4313                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4314                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4315                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4316                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4317                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4318                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4319         .psize      = 96,
4320         .digest     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4321                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4322     }, { /* Test Vector #2 */
4323         .plaintext  = "\x00\x00\x00\x00\x00\x00\x00\x00"
4324                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4325                   "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
4326                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e"
4327                   "\x41\x6e\x79\x20\x73\x75\x62\x6d"
4328                   "\x69\x73\x73\x69\x6f\x6e\x20\x74"
4329                   "\x6f\x20\x74\x68\x65\x20\x49\x45"
4330                   "\x54\x46\x20\x69\x6e\x74\x65\x6e"
4331                   "\x64\x65\x64\x20\x62\x79\x20\x74"
4332                   "\x68\x65\x20\x43\x6f\x6e\x74\x72"
4333                   "\x69\x62\x75\x74\x6f\x72\x20\x66"
4334                   "\x6f\x72\x20\x70\x75\x62\x6c\x69"
4335                   "\x63\x61\x74\x69\x6f\x6e\x20\x61"
4336                   "\x73\x20\x61\x6c\x6c\x20\x6f\x72"
4337                   "\x20\x70\x61\x72\x74\x20\x6f\x66"
4338                   "\x20\x61\x6e\x20\x49\x45\x54\x46"
4339                   "\x20\x49\x6e\x74\x65\x72\x6e\x65"
4340                   "\x74\x2d\x44\x72\x61\x66\x74\x20"
4341                   "\x6f\x72\x20\x52\x46\x43\x20\x61"
4342                   "\x6e\x64\x20\x61\x6e\x79\x20\x73"
4343                   "\x74\x61\x74\x65\x6d\x65\x6e\x74"
4344                   "\x20\x6d\x61\x64\x65\x20\x77\x69"
4345                   "\x74\x68\x69\x6e\x20\x74\x68\x65"
4346                   "\x20\x63\x6f\x6e\x74\x65\x78\x74"
4347                   "\x20\x6f\x66\x20\x61\x6e\x20\x49"
4348                   "\x45\x54\x46\x20\x61\x63\x74\x69"
4349                   "\x76\x69\x74\x79\x20\x69\x73\x20"
4350                   "\x63\x6f\x6e\x73\x69\x64\x65\x72"
4351                   "\x65\x64\x20\x61\x6e\x20\x22\x49"
4352                   "\x45\x54\x46\x20\x43\x6f\x6e\x74"
4353                   "\x72\x69\x62\x75\x74\x69\x6f\x6e"
4354                   "\x22\x2e\x20\x53\x75\x63\x68\x20"
4355                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
4356                   "\x74\x73\x20\x69\x6e\x63\x6c\x75"
4357                   "\x64\x65\x20\x6f\x72\x61\x6c\x20"
4358                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
4359                   "\x74\x73\x20\x69\x6e\x20\x49\x45"
4360                   "\x54\x46\x20\x73\x65\x73\x73\x69"
4361                   "\x6f\x6e\x73\x2c\x20\x61\x73\x20"
4362                   "\x77\x65\x6c\x6c\x20\x61\x73\x20"
4363                   "\x77\x72\x69\x74\x74\x65\x6e\x20"
4364                   "\x61\x6e\x64\x20\x65\x6c\x65\x63"
4365                   "\x74\x72\x6f\x6e\x69\x63\x20\x63"
4366                   "\x6f\x6d\x6d\x75\x6e\x69\x63\x61"
4367                   "\x74\x69\x6f\x6e\x73\x20\x6d\x61"
4368                   "\x64\x65\x20\x61\x74\x20\x61\x6e"
4369                   "\x79\x20\x74\x69\x6d\x65\x20\x6f"
4370                   "\x72\x20\x70\x6c\x61\x63\x65\x2c"
4371                   "\x20\x77\x68\x69\x63\x68\x20\x61"
4372                   "\x72\x65\x20\x61\x64\x64\x72\x65"
4373                   "\x73\x73\x65\x64\x20\x74\x6f",
4374         .psize      = 407,
4375         .digest     = "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
4376                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e",
4377     }, { /* Test Vector #3 */
4378         .plaintext  = "\x36\xe5\xf6\xb5\xc5\xe0\x60\x70"
4379                   "\xf0\xef\xca\x96\x22\x7a\x86\x3e"
4380                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4381                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4382                   "\x41\x6e\x79\x20\x73\x75\x62\x6d"
4383                   "\x69\x73\x73\x69\x6f\x6e\x20\x74"
4384                   "\x6f\x20\x74\x68\x65\x20\x49\x45"
4385                   "\x54\x46\x20\x69\x6e\x74\x65\x6e"
4386                   "\x64\x65\x64\x20\x62\x79\x20\x74"
4387                   "\x68\x65\x20\x43\x6f\x6e\x74\x72"
4388                   "\x69\x62\x75\x74\x6f\x72\x20\x66"
4389                   "\x6f\x72\x20\x70\x75\x62\x6c\x69"
4390                   "\x63\x61\x74\x69\x6f\x6e\x20\x61"
4391                   "\x73\x20\x61\x6c\x6c\x20\x6f\x72"
4392                   "\x20\x70\x61\x72\x74\x20\x6f\x66"
4393                   "\x20\x61\x6e\x20\x49\x45\x54\x46"
4394                   "\x20\x49\x6e\x74\x65\x72\x6e\x65"
4395                   "\x74\x2d\x44\x72\x61\x66\x74\x20"
4396                   "\x6f\x72\x20\x52\x46\x43\x20\x61"
4397                   "\x6e\x64\x20\x61\x6e\x79\x20\x73"
4398                   "\x74\x61\x74\x65\x6d\x65\x6e\x74"
4399                   "\x20\x6d\x61\x64\x65\x20\x77\x69"
4400                   "\x74\x68\x69\x6e\x20\x74\x68\x65"
4401                   "\x20\x63\x6f\x6e\x74\x65\x78\x74"
4402                   "\x20\x6f\x66\x20\x61\x6e\x20\x49"
4403                   "\x45\x54\x46\x20\x61\x63\x74\x69"
4404                   "\x76\x69\x74\x79\x20\x69\x73\x20"
4405                   "\x63\x6f\x6e\x73\x69\x64\x65\x72"
4406                   "\x65\x64\x20\x61\x6e\x20\x22\x49"
4407                   "\x45\x54\x46\x20\x43\x6f\x6e\x74"
4408                   "\x72\x69\x62\x75\x74\x69\x6f\x6e"
4409                   "\x22\x2e\x20\x53\x75\x63\x68\x20"
4410                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
4411                   "\x74\x73\x20\x69\x6e\x63\x6c\x75"
4412                   "\x64\x65\x20\x6f\x72\x61\x6c\x20"
4413                   "\x73\x74\x61\x74\x65\x6d\x65\x6e"
4414                   "\x74\x73\x20\x69\x6e\x20\x49\x45"
4415                   "\x54\x46\x20\x73\x65\x73\x73\x69"
4416                   "\x6f\x6e\x73\x2c\x20\x61\x73\x20"
4417                   "\x77\x65\x6c\x6c\x20\x61\x73\x20"
4418                   "\x77\x72\x69\x74\x74\x65\x6e\x20"
4419                   "\x61\x6e\x64\x20\x65\x6c\x65\x63"
4420                   "\x74\x72\x6f\x6e\x69\x63\x20\x63"
4421                   "\x6f\x6d\x6d\x75\x6e\x69\x63\x61"
4422                   "\x74\x69\x6f\x6e\x73\x20\x6d\x61"
4423                   "\x64\x65\x20\x61\x74\x20\x61\x6e"
4424                   "\x79\x20\x74\x69\x6d\x65\x20\x6f"
4425                   "\x72\x20\x70\x6c\x61\x63\x65\x2c"
4426                   "\x20\x77\x68\x69\x63\x68\x20\x61"
4427                   "\x72\x65\x20\x61\x64\x64\x72\x65"
4428                   "\x73\x73\x65\x64\x20\x74\x6f",
4429         .psize      = 407,
4430         .digest     = "\xf3\x47\x7e\x7c\xd9\x54\x17\xaf"
4431                   "\x89\xa6\xb8\x79\x4c\x31\x0c\xf0",
4432     }, { /* Test Vector #4 */
4433         .plaintext  = "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a"
4434                   "\xf3\x33\x88\x86\x04\xf6\xb5\xf0"
4435                   "\x47\x39\x17\xc1\x40\x2b\x80\x09"
4436                   "\x9d\xca\x5c\xbc\x20\x70\x75\xc0"
4437                   "\x27\x54\x77\x61\x73\x20\x62\x72"
4438                   "\x69\x6c\x6c\x69\x67\x2c\x20\x61"
4439                   "\x6e\x64\x20\x74\x68\x65\x20\x73"
4440                   "\x6c\x69\x74\x68\x79\x20\x74\x6f"
4441                   "\x76\x65\x73\x0a\x44\x69\x64\x20"
4442                   "\x67\x79\x72\x65\x20\x61\x6e\x64"
4443                   "\x20\x67\x69\x6d\x62\x6c\x65\x20"
4444                   "\x69\x6e\x20\x74\x68\x65\x20\x77"
4445                   "\x61\x62\x65\x3a\x0a\x41\x6c\x6c"
4446                   "\x20\x6d\x69\x6d\x73\x79\x20\x77"
4447                   "\x65\x72\x65\x20\x74\x68\x65\x20"
4448                   "\x62\x6f\x72\x6f\x67\x6f\x76\x65"
4449                   "\x73\x2c\x0a\x41\x6e\x64\x20\x74"
4450                   "\x68\x65\x20\x6d\x6f\x6d\x65\x20"
4451                   "\x72\x61\x74\x68\x73\x20\x6f\x75"
4452                   "\x74\x67\x72\x61\x62\x65\x2e",
4453         .psize      = 159,
4454         .digest     = "\x45\x41\x66\x9a\x7e\xaa\xee\x61"
4455                   "\xe7\x08\xdc\x7c\xbc\xc5\xeb\x62",
4456     }, { /* Test Vector #5 */
4457         .plaintext  = "\x02\x00\x00\x00\x00\x00\x00\x00"
4458                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4459                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4460                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4461                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4462                   "\xff\xff\xff\xff\xff\xff\xff\xff",
4463         .psize      = 48,
4464         .digest     = "\x03\x00\x00\x00\x00\x00\x00\x00"
4465                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4466     }, { /* Test Vector #6 */
4467         .plaintext  = "\x02\x00\x00\x00\x00\x00\x00\x00"
4468                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4469                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4470                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4471                   "\x02\x00\x00\x00\x00\x00\x00\x00"
4472                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4473         .psize      = 48,
4474         .digest     = "\x03\x00\x00\x00\x00\x00\x00\x00"
4475                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4476     }, { /* Test Vector #7 */
4477         .plaintext  = "\x01\x00\x00\x00\x00\x00\x00\x00"
4478                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4479                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4480                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4481                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4482                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4483                   "\xf0\xff\xff\xff\xff\xff\xff\xff"
4484                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4485                   "\x11\x00\x00\x00\x00\x00\x00\x00"
4486                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4487         .psize      = 80,
4488         .digest     = "\x05\x00\x00\x00\x00\x00\x00\x00"
4489                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4490     }, { /* Test Vector #8 */
4491         .plaintext  = "\x01\x00\x00\x00\x00\x00\x00\x00"
4492                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4493                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4494                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4495                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4496                   "\xff\xff\xff\xff\xff\xff\xff\xff"
4497                   "\xfb\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
4498                   "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
4499                   "\x01\x01\x01\x01\x01\x01\x01\x01"
4500                   "\x01\x01\x01\x01\x01\x01\x01\x01",
4501         .psize      = 80,
4502         .digest     = "\x00\x00\x00\x00\x00\x00\x00\x00"
4503                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4504     }, { /* Test Vector #9 */
4505         .plaintext  = "\x02\x00\x00\x00\x00\x00\x00\x00"
4506                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4507                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4508                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4509                   "\xfd\xff\xff\xff\xff\xff\xff\xff"
4510                   "\xff\xff\xff\xff\xff\xff\xff\xff",
4511         .psize      = 48,
4512         .digest     = "\xfa\xff\xff\xff\xff\xff\xff\xff"
4513                   "\xff\xff\xff\xff\xff\xff\xff\xff",
4514     }, { /* Test Vector #10 */
4515         .plaintext  = "\x01\x00\x00\x00\x00\x00\x00\x00"
4516                   "\x04\x00\x00\x00\x00\x00\x00\x00"
4517                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4518                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4519                   "\xe3\x35\x94\xd7\x50\x5e\x43\xb9"
4520                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4521                   "\x33\x94\xd7\x50\x5e\x43\x79\xcd"
4522                   "\x01\x00\x00\x00\x00\x00\x00\x00"
4523                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4524                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4525                   "\x01\x00\x00\x00\x00\x00\x00\x00"
4526                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4527         .psize      = 96,
4528         .digest     = "\x14\x00\x00\x00\x00\x00\x00\x00"
4529                   "\x55\x00\x00\x00\x00\x00\x00\x00",
4530     }, { /* Test Vector #11 */
4531         .plaintext  = "\x01\x00\x00\x00\x00\x00\x00\x00"
4532                   "\x04\x00\x00\x00\x00\x00\x00\x00"
4533                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4534                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4535                   "\xe3\x35\x94\xd7\x50\x5e\x43\xb9"
4536                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4537                   "\x33\x94\xd7\x50\x5e\x43\x79\xcd"
4538                   "\x01\x00\x00\x00\x00\x00\x00\x00"
4539                   "\x00\x00\x00\x00\x00\x00\x00\x00"
4540                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4541         .psize      = 80,
4542         .digest     = "\x13\x00\x00\x00\x00\x00\x00\x00"
4543                   "\x00\x00\x00\x00\x00\x00\x00\x00",
4544     },
4545 };
4546 
4547 /*
4548  * DES test vectors.
4549  */
4550 #define DES_ENC_TEST_VECTORS        11
4551 #define DES_DEC_TEST_VECTORS        5
4552 #define DES_CBC_ENC_TEST_VECTORS    6
4553 #define DES_CBC_DEC_TEST_VECTORS    5
4554 #define DES_CTR_ENC_TEST_VECTORS    2
4555 #define DES_CTR_DEC_TEST_VECTORS    2
4556 #define DES3_EDE_ENC_TEST_VECTORS   4
4557 #define DES3_EDE_DEC_TEST_VECTORS   4
4558 #define DES3_EDE_CBC_ENC_TEST_VECTORS   2
4559 #define DES3_EDE_CBC_DEC_TEST_VECTORS   2
4560 #define DES3_EDE_CTR_ENC_TEST_VECTORS   2
4561 #define DES3_EDE_CTR_DEC_TEST_VECTORS   2
4562 
4563 static struct cipher_testvec des_enc_tv_template[] = {
4564     { /* From Applied Cryptography */
4565         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4566         .klen   = 8,
4567         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
4568         .ilen   = 8,
4569         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
4570         .rlen   = 8,
4571     }, { /* Same key, different plaintext block */
4572         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4573         .klen   = 8,
4574         .input  = "\x22\x33\x44\x55\x66\x77\x88\x99",
4575         .ilen   = 8,
4576         .result = "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
4577         .rlen   = 8,
4578     }, { /* Sbox test from NBS */
4579         .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
4580         .klen   = 8,
4581         .input  = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
4582         .ilen   = 8,
4583         .result = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
4584         .rlen   = 8,
4585     }, { /* Three blocks */
4586         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4587         .klen   = 8,
4588         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4589               "\x22\x33\x44\x55\x66\x77\x88\x99"
4590               "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
4591         .ilen   = 24,
4592         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4593               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
4594               "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
4595         .rlen   = 24,
4596     }, { /* Weak key */
4597         .fail   = true,
4598         .wk = 1,
4599         .key    = "\x01\x01\x01\x01\x01\x01\x01\x01",
4600         .klen   = 8,
4601         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
4602         .ilen   = 8,
4603         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
4604         .rlen   = 8,
4605     }, { /* Two blocks -- for testing encryption across pages */
4606         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4607         .klen   = 8,
4608         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4609               "\x22\x33\x44\x55\x66\x77\x88\x99",
4610         .ilen   = 16,
4611         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4612               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
4613         .rlen   = 16,
4614         .np = 2,
4615         .tap    = { 8, 8 }
4616     }, { /* Four blocks -- for testing encryption with chunking */
4617         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4618         .klen   = 8,
4619         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4620               "\x22\x33\x44\x55\x66\x77\x88\x99"
4621               "\xca\xfe\xba\xbe\xfe\xed\xbe\xef"
4622               "\x22\x33\x44\x55\x66\x77\x88\x99",
4623         .ilen   = 32,
4624         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4625               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
4626               "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90"
4627               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
4628         .rlen   = 32,
4629         .np = 3,
4630         .tap    = { 14, 10, 8 }
4631     }, {
4632         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4633         .klen   = 8,
4634         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4635               "\x22\x33\x44\x55\x66\x77\x88\x99"
4636               "\xca\xfe\xba\xbe\xfe\xed\xbe\xef",
4637         .ilen   = 24,
4638         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4639               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b"
4640               "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90",
4641         .rlen   = 24,
4642         .np = 4,
4643         .tap    = { 2, 1, 3, 18 }
4644     }, {
4645         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4646         .klen   = 8,
4647         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4648               "\x22\x33\x44\x55\x66\x77\x88\x99",
4649         .ilen   = 16,
4650         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4651               "\xf7\x9c\x89\x2a\x33\x8f\x4a\x8b",
4652         .rlen   = 16,
4653         .np = 5,
4654         .tap    = { 2, 2, 2, 2, 8 }
4655     }, {
4656         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4657         .klen   = 8,
4658         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
4659         .ilen   = 8,
4660         .result = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
4661         .rlen   = 8,
4662         .np = 8,
4663         .tap    = { 1, 1, 1, 1, 1, 1, 1, 1 }
4664     }, { /* Generated with Crypto++ */
4665         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
4666         .klen   = 8,
4667         .input  = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
4668               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
4669               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
4670               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
4671               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
4672               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
4673               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
4674               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
4675               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
4676               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
4677               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
4678               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
4679               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
4680               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
4681               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
4682               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
4683               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
4684               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
4685               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
4686               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
4687               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
4688               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
4689               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
4690               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
4691               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
4692               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
4693               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
4694               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
4695               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
4696               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
4697               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
4698         .ilen   = 248,
4699         .result = "\x88\xCB\x1F\xAB\x2F\x2A\x49\x57"
4700               "\x92\xB9\x77\xFF\x2F\x47\x58\xDD"
4701               "\xD7\x8A\x91\x95\x26\x33\x78\xB2"
4702               "\x33\xBA\xB2\x3E\x02\xF5\x1F\xEF"
4703               "\x98\xC5\xA6\xD2\x7D\x79\xEC\xB3"
4704               "\x45\xF3\x4C\x61\xAC\x6C\xC2\x55"
4705               "\xE5\xD3\x06\x58\x8A\x42\x3E\xDD"
4706               "\x3D\x20\x45\xE9\x6F\x0D\x25\xA8"
4707               "\xA5\xC7\x69\xCE\xD5\x3B\x7B\xC9"
4708               "\x9E\x65\xE7\xA3\xF2\xE4\x18\x94"
4709               "\xD2\x81\xE9\x33\x2B\x2D\x49\xC4"
4710               "\xFE\xDA\x7F\xE2\xF2\x8C\x9C\xDC"
4711               "\x73\x58\x11\x1F\x81\xD7\x21\x1A"
4712               "\x80\xD0\x0D\xE8\x45\xD6\xD8\xD5"
4713               "\x2E\x51\x16\xCA\x09\x89\x54\x62"
4714               "\xF7\x04\x3D\x75\xB9\xA3\x84\xF4"
4715               "\x62\xF0\x02\x58\x83\xAF\x30\x87"
4716               "\x85\x3F\x01\xCD\x8E\x58\x42\xC4"
4717               "\x41\x73\xE0\x15\x0A\xE6\x2E\x80"
4718               "\x94\xF8\x5B\x3A\x4E\xDF\x51\xB2"
4719               "\x9D\xE4\xC4\x9D\xF7\x3F\xF8\x8E"
4720               "\x37\x22\x4D\x00\x2A\xEF\xC1\x0F"
4721               "\x14\xA0\x66\xAB\x79\x39\xD0\x8E"
4722               "\xE9\x95\x61\x74\x12\xED\x07\xD7"
4723               "\xDD\x95\xDC\x7B\x57\x25\x27\x9C"
4724               "\x51\x96\x16\xF7\x94\x61\xB8\x87"
4725               "\xF0\x21\x1B\x32\xFB\x07\x0F\x29"
4726               "\x56\xBD\x9D\x22\xA2\x9F\xA2\xB9"
4727               "\x46\x31\x4C\x5E\x2E\x95\x61\xEF"
4728               "\xE1\x58\x39\x09\xB4\x8B\x40\xAC"
4729               "\x5F\x62\xC7\x72\xD9\xFC\xCB\x9A",
4730         .rlen   = 248,
4731         .also_non_np = 1,
4732         .np = 3,
4733         .tap    = { 248 - 10, 2, 8 },
4734     },
4735 };
4736 
4737 static struct cipher_testvec des_dec_tv_template[] = {
4738     { /* From Applied Cryptography */
4739         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4740         .klen   = 8,
4741         .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
4742         .ilen   = 8,
4743         .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
4744         .rlen   = 8,
4745     }, { /* Sbox test from NBS */
4746         .key    = "\x7c\xa1\x10\x45\x4a\x1a\x6e\x57",
4747         .klen   = 8,
4748         .input  = "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
4749         .ilen   = 8,
4750         .result = "\x01\xa1\xd6\xd0\x39\x77\x67\x42",
4751         .rlen   = 8,
4752     }, { /* Two blocks, for chunking test */
4753         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4754         .klen   = 8,
4755         .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4756               "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
4757         .ilen   = 16,
4758         .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4759               "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
4760         .rlen   = 16,
4761         .np = 2,
4762         .tap    = { 8, 8 }
4763     }, {
4764         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4765         .klen   = 8,
4766         .input  = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d"
4767               "\x69\x0f\x5b\x0d\x9a\x26\x93\x9b",
4768         .ilen   = 16,
4769         .result = "\x01\x23\x45\x67\x89\xab\xcd\xe7"
4770               "\xa3\x99\x7b\xca\xaf\x69\xa0\xf5",
4771         .rlen   = 16,
4772         .np = 3,
4773         .tap    = { 3, 12, 1 }
4774     }, { /* Generated with Crypto++ */
4775         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
4776         .klen   = 8,
4777         .input  = "\x88\xCB\x1F\xAB\x2F\x2A\x49\x57"
4778               "\x92\xB9\x77\xFF\x2F\x47\x58\xDD"
4779               "\xD7\x8A\x91\x95\x26\x33\x78\xB2"
4780               "\x33\xBA\xB2\x3E\x02\xF5\x1F\xEF"
4781               "\x98\xC5\xA6\xD2\x7D\x79\xEC\xB3"
4782               "\x45\xF3\x4C\x61\xAC\x6C\xC2\x55"
4783               "\xE5\xD3\x06\x58\x8A\x42\x3E\xDD"
4784               "\x3D\x20\x45\xE9\x6F\x0D\x25\xA8"
4785               "\xA5\xC7\x69\xCE\xD5\x3B\x7B\xC9"
4786               "\x9E\x65\xE7\xA3\xF2\xE4\x18\x94"
4787               "\xD2\x81\xE9\x33\x2B\x2D\x49\xC4"
4788               "\xFE\xDA\x7F\xE2\xF2\x8C\x9C\xDC"
4789               "\x73\x58\x11\x1F\x81\xD7\x21\x1A"
4790               "\x80\xD0\x0D\xE8\x45\xD6\xD8\xD5"
4791               "\x2E\x51\x16\xCA\x09\x89\x54\x62"
4792               "\xF7\x04\x3D\x75\xB9\xA3\x84\xF4"
4793               "\x62\xF0\x02\x58\x83\xAF\x30\x87"
4794               "\x85\x3F\x01\xCD\x8E\x58\x42\xC4"
4795               "\x41\x73\xE0\x15\x0A\xE6\x2E\x80"
4796               "\x94\xF8\x5B\x3A\x4E\xDF\x51\xB2"
4797               "\x9D\xE4\xC4\x9D\xF7\x3F\xF8\x8E"
4798               "\x37\x22\x4D\x00\x2A\xEF\xC1\x0F"
4799               "\x14\xA0\x66\xAB\x79\x39\xD0\x8E"
4800               "\xE9\x95\x61\x74\x12\xED\x07\xD7"
4801               "\xDD\x95\xDC\x7B\x57\x25\x27\x9C"
4802               "\x51\x96\x16\xF7\x94\x61\xB8\x87"
4803               "\xF0\x21\x1B\x32\xFB\x07\x0F\x29"
4804               "\x56\xBD\x9D\x22\xA2\x9F\xA2\xB9"
4805               "\x46\x31\x4C\x5E\x2E\x95\x61\xEF"
4806               "\xE1\x58\x39\x09\xB4\x8B\x40\xAC"
4807               "\x5F\x62\xC7\x72\xD9\xFC\xCB\x9A",
4808         .ilen   = 248,
4809         .result = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
4810               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
4811               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
4812               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
4813               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
4814               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
4815               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
4816               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
4817               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
4818               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
4819               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
4820               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
4821               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
4822               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
4823               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
4824               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
4825               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
4826               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
4827               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
4828               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
4829               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
4830               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
4831               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
4832               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
4833               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
4834               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
4835               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
4836               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
4837               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
4838               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
4839               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
4840         .rlen   = 248,
4841         .also_non_np = 1,
4842         .np = 3,
4843         .tap    = { 248 - 10, 2, 8 },
4844     },
4845 };
4846 
4847 static struct cipher_testvec des_cbc_enc_tv_template[] = {
4848     { /* From OpenSSL */
4849         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4850         .klen   = 8,
4851         .iv = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
4852         .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
4853               "\x4e\x6f\x77\x20\x69\x73\x20\x74"
4854               "\x68\x65\x20\x74\x69\x6d\x65\x20",
4855         .ilen   = 24,
4856         .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
4857               "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
4858               "\x46\x8e\x91\x15\x78\x88\xba\x68",
4859         .rlen   = 24,
4860     }, { /* FIPS Pub 81 */
4861         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4862         .klen   = 8,
4863         .iv = "\x12\x34\x56\x78\x90\xab\xcd\xef",
4864         .input  = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
4865         .ilen   = 8,
4866         .result = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
4867         .rlen   = 8,
4868     }, {
4869         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4870         .klen   = 8,
4871         .iv = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
4872         .input  = "\x68\x65\x20\x74\x69\x6d\x65\x20",
4873         .ilen   = 8,
4874         .result = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
4875         .rlen   = 8,
4876     }, {
4877         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4878         .klen   = 8,
4879         .iv = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
4880         .input  = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
4881         .ilen   = 8,
4882         .result = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
4883         .rlen   = 8,
4884     }, { /* Copy of openssl vector for chunk testing */
4885          /* From OpenSSL */
4886         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4887         .klen   = 8,
4888         .iv = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
4889         .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
4890               "\x4e\x6f\x77\x20\x69\x73\x20\x74"
4891               "\x68\x65\x20\x74\x69\x6d\x65\x20",
4892         .ilen   = 24,
4893         .result = "\xcc\xd1\x73\xff\xab\x20\x39\xf4"
4894               "\xac\xd8\xae\xfd\xdf\xd8\xa1\xeb"
4895               "\x46\x8e\x91\x15\x78\x88\xba\x68",
4896         .rlen   = 24,
4897         .np = 2,
4898         .tap    = { 13, 11 }
4899     }, { /* Generated with Crypto++ */
4900         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
4901         .klen   = 8,
4902         .iv = "\xE7\x82\x1D\xB8\x53\x11\xAC\x47",
4903         .input  = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
4904               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
4905               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
4906               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
4907               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
4908               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
4909               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
4910               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
4911               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
4912               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
4913               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
4914               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
4915               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
4916               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
4917               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
4918               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
4919               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
4920               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
4921               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
4922               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
4923               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
4924               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
4925               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
4926               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
4927               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
4928               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
4929               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
4930               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
4931               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
4932               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
4933               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
4934         .ilen   = 248,
4935         .result = "\x71\xCC\x56\x1C\x87\x2C\x43\x20"
4936               "\x1C\x20\x13\x09\xF9\x2B\x40\x47"
4937               "\x99\x10\xD1\x1B\x65\x33\x33\xBA"
4938               "\x88\x0D\xA2\xD1\x86\xFF\x4D\xF4"
4939               "\x5A\x0C\x12\x96\x32\x57\xAA\x26"
4940               "\xA7\xF4\x32\x8D\xBC\x10\x31\x9E"
4941               "\x81\x72\x74\xDE\x30\x19\x69\x49"
4942               "\x54\x9C\xC3\xEB\x0B\x97\xDD\xD1"
4943               "\xE8\x6D\x0D\x05\x83\xA5\x12\x08"
4944               "\x47\xF8\x88\x03\x86\x51\x3C\xEF"
4945               "\xE7\x11\x73\x4D\x44\x2B\xE2\x16"
4946               "\xE8\xA5\x06\x50\x66\x70\x0E\x14"
4947               "\xBA\x21\x3B\xD5\x23\x5B\xA7\x8F"
4948               "\x56\xB6\xA7\x44\xDB\x86\xAB\x69"
4949               "\x33\x3C\xBE\x64\xC4\x22\xD3\xFE"
4950               "\x49\x90\x88\x6A\x09\x8F\x76\x59"
4951               "\xCB\xB7\xA0\x2D\x79\x75\x92\x8A"
4952               "\x82\x1D\xC2\xFE\x09\x1F\x78\x6B"
4953               "\x2F\xD6\xA4\x87\x1E\xC4\x53\x63"
4954               "\x80\x02\x61\x2F\xE3\x46\xB6\xB5"
4955               "\xAA\x95\xF4\xEE\xA7\x64\x2B\x4F"
4956               "\x20\xCF\xD2\x47\x4E\x39\x65\xB3"
4957               "\x11\x87\xA2\x6C\x49\x7E\x36\xC7"
4958               "\x62\x8B\x48\x0D\x6A\x64\x00\xBD"
4959               "\x71\x91\x8C\xE9\x70\x19\x01\x4F"
4960               "\x4E\x68\x23\xBA\xDA\x24\x2E\x45"
4961               "\x02\x14\x33\x21\xAE\x58\x4B\xCF"
4962               "\x3B\x4B\xE8\xF8\xF6\x4F\x34\x93"
4963               "\xD7\x07\x8A\xD7\x18\x92\x36\x8C"
4964               "\x82\xA9\xBD\x6A\x31\x91\x39\x11"
4965               "\xC6\x4A\xF3\x55\xC7\x29\x2E\x63",
4966         .rlen   = 248,
4967         .also_non_np = 1,
4968         .np = 3,
4969         .tap    = { 248 - 10, 2, 8 },
4970     },
4971 };
4972 
4973 static struct cipher_testvec des_cbc_dec_tv_template[] = {
4974     { /* FIPS Pub 81 */
4975         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4976         .klen   = 8,
4977         .iv = "\x12\x34\x56\x78\x90\xab\xcd\xef",
4978         .input  = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
4979         .ilen   = 8,
4980         .result = "\x4e\x6f\x77\x20\x69\x73\x20\x74",
4981         .rlen   = 8,
4982     }, {
4983         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4984         .klen   = 8,
4985         .iv = "\xe5\xc7\xcd\xde\x87\x2b\xf2\x7c",
4986         .input  = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
4987         .ilen   = 8,
4988         .result = "\x68\x65\x20\x74\x69\x6d\x65\x20",
4989         .rlen   = 8,
4990     }, {
4991         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
4992         .klen   = 8,
4993         .iv = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
4994         .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
4995         .ilen   = 8,
4996         .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
4997         .rlen   = 8,
4998     }, { /* Copy of above, for chunk testing */
4999         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
5000         .klen   = 8,
5001         .iv = "\x43\xe9\x34\x00\x8c\x38\x9c\x0f",
5002         .input  = "\x68\x37\x88\x49\x9a\x7c\x05\xf6",
5003         .ilen   = 8,
5004         .result = "\x66\x6f\x72\x20\x61\x6c\x6c\x20",
5005         .rlen   = 8,
5006         .np = 2,
5007         .tap    = { 4, 4 }
5008     }, { /* Generated with Crypto++ */
5009         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
5010         .klen   = 8,
5011         .iv = "\xE7\x82\x1D\xB8\x53\x11\xAC\x47",
5012         .input  = "\x71\xCC\x56\x1C\x87\x2C\x43\x20"
5013               "\x1C\x20\x13\x09\xF9\x2B\x40\x47"
5014               "\x99\x10\xD1\x1B\x65\x33\x33\xBA"
5015               "\x88\x0D\xA2\xD1\x86\xFF\x4D\xF4"
5016               "\x5A\x0C\x12\x96\x32\x57\xAA\x26"
5017               "\xA7\xF4\x32\x8D\xBC\x10\x31\x9E"
5018               "\x81\x72\x74\xDE\x30\x19\x69\x49"
5019               "\x54\x9C\xC3\xEB\x0B\x97\xDD\xD1"
5020               "\xE8\x6D\x0D\x05\x83\xA5\x12\x08"
5021               "\x47\xF8\x88\x03\x86\x51\x3C\xEF"
5022               "\xE7\x11\x73\x4D\x44\x2B\xE2\x16"
5023               "\xE8\xA5\x06\x50\x66\x70\x0E\x14"
5024               "\xBA\x21\x3B\xD5\x23\x5B\xA7\x8F"
5025               "\x56\xB6\xA7\x44\xDB\x86\xAB\x69"
5026               "\x33\x3C\xBE\x64\xC4\x22\xD3\xFE"
5027               "\x49\x90\x88\x6A\x09\x8F\x76\x59"
5028               "\xCB\xB7\xA0\x2D\x79\x75\x92\x8A"
5029               "\x82\x1D\xC2\xFE\x09\x1F\x78\x6B"
5030               "\x2F\xD6\xA4\x87\x1E\xC4\x53\x63"
5031               "\x80\x02\x61\x2F\xE3\x46\xB6\xB5"
5032               "\xAA\x95\xF4\xEE\xA7\x64\x2B\x4F"
5033               "\x20\xCF\xD2\x47\x4E\x39\x65\xB3"
5034               "\x11\x87\xA2\x6C\x49\x7E\x36\xC7"
5035               "\x62\x8B\x48\x0D\x6A\x64\x00\xBD"
5036               "\x71\x91\x8C\xE9\x70\x19\x01\x4F"
5037               "\x4E\x68\x23\xBA\xDA\x24\x2E\x45"
5038               "\x02\x14\x33\x21\xAE\x58\x4B\xCF"
5039               "\x3B\x4B\xE8\xF8\xF6\x4F\x34\x93"
5040               "\xD7\x07\x8A\xD7\x18\x92\x36\x8C"
5041               "\x82\xA9\xBD\x6A\x31\x91\x39\x11"
5042               "\xC6\x4A\xF3\x55\xC7\x29\x2E\x63",
5043         .ilen   = 248,
5044         .result = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
5045               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
5046               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
5047               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
5048               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
5049               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
5050               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
5051               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
5052               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
5053               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
5054               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
5055               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
5056               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
5057               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
5058               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
5059               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
5060               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
5061               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
5062               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
5063               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
5064               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
5065               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
5066               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
5067               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
5068               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
5069               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
5070               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
5071               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
5072               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
5073               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
5074               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
5075         .rlen   = 248,
5076         .also_non_np = 1,
5077         .np = 3,
5078         .tap    = { 248 - 10, 2, 8 },
5079     },
5080 };
5081 
5082 static struct cipher_testvec des_ctr_enc_tv_template[] = {
5083     { /* Generated with Crypto++ */
5084         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
5085         .klen   = 8,
5086         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
5087         .input  = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
5088               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
5089               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
5090               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
5091               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
5092               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
5093               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
5094               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
5095               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
5096               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
5097               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
5098               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
5099               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
5100               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
5101               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
5102               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
5103               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
5104               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
5105               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
5106               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
5107               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
5108               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
5109               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
5110               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
5111               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
5112               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
5113               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
5114               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
5115               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
5116               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
5117               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
5118         .ilen   = 248,
5119         .result = "\x2F\x96\x06\x0F\x50\xC9\x68\x03"
5120               "\x0F\x31\xD4\x64\xA5\x29\x77\x35"
5121               "\xBC\x7A\x9F\x19\xE7\x0D\x33\x3E"
5122               "\x12\x0B\x8C\xAE\x48\xAE\xD9\x02"
5123               "\x0A\xD4\xB0\xD6\x37\xB2\x65\x1C"
5124               "\x4B\x65\xEB\x24\xB5\x8E\xAD\x47"
5125               "\x0D\xDA\x79\x77\xA0\x29\xA0\x2B"
5126               "\xC8\x0F\x85\xDC\x03\x13\xA9\x04"
5127               "\x19\x40\xBE\xBE\x5C\x49\x4A\x69"
5128               "\xED\xE8\xE1\x9E\x14\x43\x74\xDE"
5129               "\xEC\x6E\x11\x3F\x36\xEF\x7B\xFB"
5130               "\xBE\x4C\x91\x43\x22\x65\x72\x48"
5131               "\xE2\x12\xED\x88\xAC\xA7\xC9\x91"
5132               "\x14\xA2\x36\x1C\x29\xFF\xC8\x4F"
5133               "\x72\x5C\x4B\xB0\x1E\x93\xC2\xFA"
5134               "\x9D\x53\x86\xA0\xAE\xC6\xB7\x3C"
5135               "\x59\x0C\xD0\x8F\xA6\xD8\xA4\x31"
5136               "\xB7\x30\x1C\x21\x38\xFB\x68\x8C"
5137               "\x2E\xF5\x6E\x73\xC3\x16\x5F\x12"
5138               "\x0C\x33\xB9\x1E\x7B\x70\xDE\x86"
5139               "\x32\xB3\xC1\x16\xAB\xD9\x49\x0B"
5140               "\x96\x28\x72\x6B\xF3\x30\xA9\xEB"
5141               "\x69\xE2\x1E\x58\x46\xA2\x8E\xC7"
5142               "\xC0\xEF\x07\xB7\x77\x2C\x00\x05"
5143               "\x46\xBD\xFE\x53\x81\x8B\xA4\x03"
5144               "\x20\x0F\xDB\x78\x0B\x1F\x53\x04"
5145               "\x4C\x60\x4C\xC3\x2A\x86\x86\x7E"
5146               "\x13\xD2\x26\xED\x5D\x3E\x9C\xF2"
5147               "\x5C\xC4\x15\xC9\x9A\x21\xC5\xCD"
5148               "\x19\x7F\x99\x19\x53\xCE\x1D\x14"
5149               "\x69\x74\xA1\x06\x46\x0F\x4E\x75",
5150         .rlen   = 248,
5151         .also_non_np = 1,
5152         .np = 3,
5153         .tap    = { 248 - 10, 2, 8 },
5154     }, { /* Generated with Crypto++ */
5155         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
5156         .klen   = 8,
5157         .iv = "\xE7\x82\x1D\xB8\x53\x11\xAC\x47",
5158         .input  = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
5159               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
5160               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
5161               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
5162               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
5163               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
5164               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
5165               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
5166               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
5167               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
5168               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
5169               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
5170               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
5171               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
5172               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
5173               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
5174               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
5175               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
5176               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
5177               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
5178               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
5179               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
5180               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
5181               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
5182               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
5183               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
5184               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
5185               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
5186               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
5187               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
5188               "\xC6\x2F\xBB\x24\x8D\x19\x82",
5189         .ilen   = 247,
5190         .result = "\x62\xE5\xF4\xDC\x99\xE7\x89\xE3"
5191               "\xF4\x10\xCC\x21\x99\xEB\xDC\x15"
5192               "\x19\x13\x93\x27\x9D\xB6\x6F\x45"
5193               "\x17\x55\x61\x72\xC8\xD3\x7F\xA5"
5194               "\x32\xD0\xD3\x02\x15\xA4\x05\x23"
5195               "\x9C\x23\x61\x60\x77\x7B\x6C\x95"
5196               "\x26\x49\x42\x2E\xF3\xC1\x8C\x6D"
5197               "\xC8\x47\xD5\x94\xE7\x53\xC8\x23"
5198               "\x1B\xA5\x0B\xCB\x12\xD3\x7A\x12"
5199               "\xA4\x42\x15\x34\xF7\x5F\xDC\x58"
5200               "\x5B\x58\x4C\xAD\xD1\x33\x8E\xE6"
5201               "\xE5\xA0\xDA\x4D\x94\x3D\x63\xA8"
5202               "\x02\x82\xBB\x16\xB8\xDC\xB5\x58"
5203               "\xC3\x2D\x79\xE4\x25\x79\x43\xF9"
5204               "\x6D\xD3\xCA\xC0\xE8\x12\xD4\x7E"
5205               "\x04\x25\x79\xFD\x27\xFB\xC4\xEA"
5206               "\x32\x94\x48\x92\xF3\x68\x1A\x7F"
5207               "\x36\x33\x43\x79\xF7\xCA\xC2\x38"
5208               "\xC0\x68\xD4\x53\xA9\xCC\x43\x0C"
5209               "\x40\x57\x3E\xED\x00\x9F\x22\x6E"
5210               "\x80\x99\x0B\xCC\x40\x63\x46\x8A"
5211               "\xE8\xC4\x9B\x6D\x7A\x08\x6E\xA9"
5212               "\x6F\x84\xBC\xB3\xF4\x95\x0B\x2D"
5213               "\x6A\xBA\x37\x50\xC3\xCF\x9F\x7C"
5214               "\x59\x5E\xDE\x0B\x30\xFA\x34\x8A"
5215               "\xF8\xD1\xA2\xF8\x4E\xBD\x5D\x5E"
5216               "\x7D\x71\x99\xE0\xF6\xE5\x7C\xE0"
5217               "\x6D\xEE\x82\x89\x92\xD4\xF5\xD7"
5218               "\xDF\x85\x2D\xE1\xB2\xD6\xAB\x94"
5219               "\xA5\xA6\xE7\xB0\x51\x36\x52\x37"
5220               "\x91\x45\x05\x3E\x58\xBF\x32",
5221         .rlen   = 247,
5222         .also_non_np = 1,
5223         .np = 2,
5224         .tap    = { 247 - 8, 8 },
5225     },
5226 };
5227 
5228 static struct cipher_testvec des_ctr_dec_tv_template[] = {
5229     { /* Generated with Crypto++ */
5230         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
5231         .klen   = 8,
5232         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
5233         .input  = "\x2F\x96\x06\x0F\x50\xC9\x68\x03"
5234               "\x0F\x31\xD4\x64\xA5\x29\x77\x35"
5235               "\xBC\x7A\x9F\x19\xE7\x0D\x33\x3E"
5236               "\x12\x0B\x8C\xAE\x48\xAE\xD9\x02"
5237               "\x0A\xD4\xB0\xD6\x37\xB2\x65\x1C"
5238               "\x4B\x65\xEB\x24\xB5\x8E\xAD\x47"
5239               "\x0D\xDA\x79\x77\xA0\x29\xA0\x2B"
5240               "\xC8\x0F\x85\xDC\x03\x13\xA9\x04"
5241               "\x19\x40\xBE\xBE\x5C\x49\x4A\x69"
5242               "\xED\xE8\xE1\x9E\x14\x43\x74\xDE"
5243               "\xEC\x6E\x11\x3F\x36\xEF\x7B\xFB"
5244               "\xBE\x4C\x91\x43\x22\x65\x72\x48"
5245               "\xE2\x12\xED\x88\xAC\xA7\xC9\x91"
5246               "\x14\xA2\x36\x1C\x29\xFF\xC8\x4F"
5247               "\x72\x5C\x4B\xB0\x1E\x93\xC2\xFA"
5248               "\x9D\x53\x86\xA0\xAE\xC6\xB7\x3C"
5249               "\x59\x0C\xD0\x8F\xA6\xD8\xA4\x31"
5250               "\xB7\x30\x1C\x21\x38\xFB\x68\x8C"
5251               "\x2E\xF5\x6E\x73\xC3\x16\x5F\x12"
5252               "\x0C\x33\xB9\x1E\x7B\x70\xDE\x86"
5253               "\x32\xB3\xC1\x16\xAB\xD9\x49\x0B"
5254               "\x96\x28\x72\x6B\xF3\x30\xA9\xEB"
5255               "\x69\xE2\x1E\x58\x46\xA2\x8E\xC7"
5256               "\xC0\xEF\x07\xB7\x77\x2C\x00\x05"
5257               "\x46\xBD\xFE\x53\x81\x8B\xA4\x03"
5258               "\x20\x0F\xDB\x78\x0B\x1F\x53\x04"
5259               "\x4C\x60\x4C\xC3\x2A\x86\x86\x7E"
5260               "\x13\xD2\x26\xED\x5D\x3E\x9C\xF2"
5261               "\x5C\xC4\x15\xC9\x9A\x21\xC5\xCD"
5262               "\x19\x7F\x99\x19\x53\xCE\x1D\x14"
5263               "\x69\x74\xA1\x06\x46\x0F\x4E\x75",
5264         .ilen   = 248,
5265         .result = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
5266               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
5267               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
5268               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
5269               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
5270               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
5271               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
5272               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
5273               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
5274               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
5275               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
5276               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
5277               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
5278               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
5279               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
5280               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
5281               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
5282               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
5283               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
5284               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
5285               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
5286               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
5287               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
5288               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
5289               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
5290               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
5291               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
5292               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
5293               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
5294               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
5295               "\xC6\x2F\xBB\x24\x8D\x19\x82\xEB",
5296         .rlen   = 248,
5297         .also_non_np = 1,
5298         .np = 3,
5299         .tap    = { 248 - 10, 2, 8 },
5300     }, { /* Generated with Crypto++ */
5301         .key    = "\xC9\x83\xA6\xC9\xEC\x0F\x32\x55",
5302         .klen   = 8,
5303         .iv = "\xE7\x82\x1D\xB8\x53\x11\xAC\x47",
5304         .input  = "\x62\xE5\xF4\xDC\x99\xE7\x89\xE3"
5305               "\xF4\x10\xCC\x21\x99\xEB\xDC\x15"
5306               "\x19\x13\x93\x27\x9D\xB6\x6F\x45"
5307               "\x17\x55\x61\x72\xC8\xD3\x7F\xA5"
5308               "\x32\xD0\xD3\x02\x15\xA4\x05\x23"
5309               "\x9C\x23\x61\x60\x77\x7B\x6C\x95"
5310               "\x26\x49\x42\x2E\xF3\xC1\x8C\x6D"
5311               "\xC8\x47\xD5\x94\xE7\x53\xC8\x23"
5312               "\x1B\xA5\x0B\xCB\x12\xD3\x7A\x12"
5313               "\xA4\x42\x15\x34\xF7\x5F\xDC\x58"
5314               "\x5B\x58\x4C\xAD\xD1\x33\x8E\xE6"
5315               "\xE5\xA0\xDA\x4D\x94\x3D\x63\xA8"
5316               "\x02\x82\xBB\x16\xB8\xDC\xB5\x58"
5317               "\xC3\x2D\x79\xE4\x25\x79\x43\xF9"
5318               "\x6D\xD3\xCA\xC0\xE8\x12\xD4\x7E"
5319               "\x04\x25\x79\xFD\x27\xFB\xC4\xEA"
5320               "\x32\x94\x48\x92\xF3\x68\x1A\x7F"
5321               "\x36\x33\x43\x79\xF7\xCA\xC2\x38"
5322               "\xC0\x68\xD4\x53\xA9\xCC\x43\x0C"
5323               "\x40\x57\x3E\xED\x00\x9F\x22\x6E"
5324               "\x80\x99\x0B\xCC\x40\x63\x46\x8A"
5325               "\xE8\xC4\x9B\x6D\x7A\x08\x6E\xA9"
5326               "\x6F\x84\xBC\xB3\xF4\x95\x0B\x2D"
5327               "\x6A\xBA\x37\x50\xC3\xCF\x9F\x7C"
5328               "\x59\x5E\xDE\x0B\x30\xFA\x34\x8A"
5329               "\xF8\xD1\xA2\xF8\x4E\xBD\x5D\x5E"
5330               "\x7D\x71\x99\xE0\xF6\xE5\x7C\xE0"
5331               "\x6D\xEE\x82\x89\x92\xD4\xF5\xD7"
5332               "\xDF\x85\x2D\xE1\xB2\xD6\xAB\x94"
5333               "\xA5\xA6\xE7\xB0\x51\x36\x52\x37"
5334               "\x91\x45\x05\x3E\x58\xBF\x32",
5335         .ilen   = 247,
5336         .result = "\x50\xB9\x22\xAE\x17\x80\x0C\x75"
5337               "\xDE\x47\xD3\x3C\xA5\x0E\x9A\x03"
5338               "\x6C\xF8\x61\xCA\x33\xBF\x28\x91"
5339               "\x1D\x86\xEF\x58\xE4\x4D\xB6\x1F"
5340               "\xAB\x14\x7D\x09\x72\xDB\x44\xD0"
5341               "\x39\xA2\x0B\x97\x00\x69\xF5\x5E"
5342               "\xC7\x30\xBC\x25\x8E\x1A\x83\xEC"
5343               "\x55\xE1\x4A\xB3\x1C\xA8\x11\x7A"
5344               "\x06\x6F\xD8\x41\xCD\x36\x9F\x08"
5345               "\x94\xFD\x66\xF2\x5B\xC4\x2D\xB9"
5346               "\x22\x8B\x17\x80\xE9\x52\xDE\x47"
5347               "\xB0\x19\xA5\x0E\x77\x03\x6C\xD5"
5348               "\x3E\xCA\x33\x9C\x05\x91\xFA\x63"
5349               "\xEF\x58\xC1\x2A\xB6\x1F\x88\x14"
5350               "\x7D\xE6\x4F\xDB\x44\xAD\x16\xA2"
5351               "\x0B\x74\x00\x69\xD2\x3B\xC7\x30"
5352               "\x99\x02\x8E\xF7\x60\xEC\x55\xBE"
5353               "\x27\xB3\x1C\x85\x11\x7A\xE3\x4C"
5354               "\xD8\x41\xAA\x13\x9F\x08\x71\xFD"
5355               "\x66\xCF\x38\xC4\x2D\x96\x22\x8B"
5356               "\xF4\x5D\xE9\x52\xBB\x24\xB0\x19"
5357               "\x82\x0E\x77\xE0\x49\xD5\x3E\xA7"
5358               "\x10\x9C\x05\x6E\xFA\x63\xCC\x35"
5359               "\xC1\x2A\x93\x1F\x88\xF1\x5A\xE6"
5360               "\x4F\xB8\x21\xAD\x16\x7F\x0B\x74"
5361               "\xDD\x46\xD2\x3B\xA4\x0D\x99\x02"
5362               "\x6B\xF7\x60\xC9\x32\xBE\x27\x90"
5363               "\x1C\x85\xEE\x57\xE3\x4C\xB5\x1E"
5364               "\xAA\x13\x7C\x08\x71\xDA\x43\xCF"
5365               "\x38\xA1\x0A\x96\xFF\x68\xF4\x5D"
5366               "\xC6\x2F\xBB\x24\x8D\x19\x82",
5367         .rlen   = 247,
5368         .also_non_np = 1,
5369         .np = 2,
5370         .tap    = { 247 - 8, 8 },
5371     },
5372 };
5373 
5374 static struct cipher_testvec des3_ede_enc_tv_template[] = {
5375     { /* These are from openssl */
5376         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
5377               "\x55\x55\x55\x55\x55\x55\x55\x55"
5378               "\xfe\xdc\xba\x98\x76\x54\x32\x10",
5379         .klen   = 24,
5380         .input  = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
5381         .ilen   = 8,
5382         .result = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
5383         .rlen   = 8,
5384     }, {
5385         .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
5386               "\x86\x02\x87\x66\x59\x08\x21\x98"
5387               "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
5388         .klen   = 24,
5389         .input  = "\x73\x71\x75\x69\x67\x67\x6c\x65",
5390         .ilen   = 8,
5391         .result = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
5392         .rlen   = 8,
5393     }, {
5394         .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
5395               "\x91\x07\xd0\x15\x89\x19\x01\x01"
5396               "\x19\x07\x92\x10\x98\x1a\x01\x01",
5397         .klen   = 24,
5398         .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
5399         .ilen   = 8,
5400         .result = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
5401         .rlen   = 8,
5402     }, { /* Generated with Crypto++ */
5403         .key    = "\xF3\x9C\xD6\xF3\x9C\xB9\x5A\x67"
5404               "\x00\x5A\x67\x00\x2D\xCE\xEB\x2D"
5405               "\xCE\xEB\xB4\x51\x72\xB4\x51\x72",
5406         .klen   = 24,
5407         .input  = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
5408               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
5409               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
5410               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
5411               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
5412               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
5413               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
5414               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
5415               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
5416               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
5417               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
5418               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
5419               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
5420               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
5421               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
5422               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
5423               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
5424               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
5425               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
5426               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
5427               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
5428               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
5429               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
5430               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
5431               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
5432               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
5433               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
5434               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
5435               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
5436               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
5437               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
5438               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
5439               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
5440               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
5441               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
5442               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
5443               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
5444               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
5445               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
5446               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
5447               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
5448               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
5449               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
5450               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
5451               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
5452               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
5453               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
5454               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
5455               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
5456               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
5457               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
5458               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
5459               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
5460               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
5461               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
5462               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
5463               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
5464               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
5465               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
5466               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
5467               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
5468               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
5469         .ilen   = 496,
5470         .result = "\x4E\x9A\x40\x3D\x61\x7D\x17\xFA"
5471               "\x16\x86\x88\x0B\xD8\xAE\xF8\xE4"
5472               "\x81\x01\x04\x00\x76\xFA\xED\xD3"
5473               "\x44\x7E\x21\x9D\xF0\xFB\x2B\x64"
5474               "\xCA\x4E\x90\xE0\xC0\x63\x28\x92"
5475               "\xF3\x1F\xA4\x53\x2C\x77\xCC\x77"
5476               "\x69\x56\xD0\x19\xAD\x00\x2D\x97"
5477               "\xBC\xDE\x49\x6A\x82\xBC\x16\xE2"
5478               "\x2F\x3E\x72\xEE\xD1\xCE\xFC\x1B"
5479               "\xEA\x32\x56\xE4\x0B\xAF\x27\x36"
5480               "\xAF\x08\xB9\x61\xB7\x48\x23\x27"
5481               "\xEE\x4D\xC8\x79\x56\x06\xEB\xC7"
5482               "\x5B\xCA\x0A\xC6\x5E\x5C\xCB\xB6"
5483               "\x9D\xDA\x04\x59\xE2\x09\x48\x7E"
5484               "\x6B\x37\xC6\xFE\x92\xA9\x1E\x6E"
5485               "\x0D\x19\xFA\x33\x0F\xEE\x36\x68"
5486               "\x11\xBB\xF9\x5A\x73\xAB\x3A\xEA"
5487               "\xAC\x28\xD8\xD5\x27\xE8\x6B\x16"
5488               "\x45\x86\x50\x01\x70\x35\x99\x92"
5489               "\xDF\x0C\x07\x88\x8B\x7F\x9E\x4B"
5490               "\xD2\x04\x84\x90\xC4\x27\xDF\x0A"
5491               "\x49\xA8\xA7\x1A\x6D\x78\x16\xCA"
5492               "\xB3\x18\x5C\xC3\x93\x63\x5A\x68"
5493               "\x77\x02\xBA\xED\x62\x71\xB1\xD9"
5494               "\x5E\xE5\x6F\x1A\xCC\x1D\xBE\x2E"
5495               "\x11\xF3\xA6\x97\xCA\x8E\xBF\xB4"
5496               "\x56\xA1\x36\x6B\xB1\x0A\x3E\x70"
5497               "\xEA\xD7\xCD\x72\x7B\x79\xC8\xAD"
5498               "\x6B\xFE\xFB\xBA\x64\xAE\x19\xC1"
5499               "\x82\xCF\x8A\xA1\x50\x17\x7F\xB2"
5500               "\x6F\x7B\x0F\x52\xC5\x3E\x4A\x52"
5501               "\x3F\xD9\x3F\x01\xA6\x41\x1A\xB3"
5502               "\xB3\x7A\x0E\x8E\x75\xB2\xB1\x5F"
5503               "\xDB\xEA\x84\x13\x26\x6C\x85\x4E"
5504               "\xAE\x6B\xDC\xE7\xE7\xAD\xB0\x06"
5505               "\x5C\xBA\x92\xD0\x30\xBB\x8D\xD2"
5506               "\xAE\x4C\x70\x85\xA0\x07\xE3\x2C"
5507               "\xD1\x27\x9C\xCF\xDB\x13\xB7\xE5"
5508               "\xF9\x6A\x02\xD0\x39\x9D\xB6\xE7"
5509               "\xD1\x17\x25\x08\xF9\xA9\xA6\x67"
5510               "\x38\x80\xD1\x22\xAB\x1A\xD7\x26"
5511               "\xAD\xCA\x19\x1B\xFA\x18\xA7\x57"
5512               "\x31\xEC\xC9\xED\xDB\x79\xC0\x48"
5513               "\xAC\x31\x9F\x03\x8B\x62\x5B\x7E"
5514               "\x0E\xA6\xD0\x64\xEE\xEA\x00\xFC"
5515               "\x58\xC8\xDE\x51\x4E\x17\x15\x11"
5516               "\x66\x58\xB6\x90\xDC\xDF\xA1\x49"
5517               "\xCA\x79\xE9\x31\x31\x42\xDC\x56"
5518               "\x0B\xCD\xB6\x0D\xC7\x64\xF7\x19"
5519               "\xD9\x42\x05\x7F\xBC\x2F\xFC\x90"
5520               "\xAE\x29\x86\xAA\x43\x7A\x4F\x6B"
5521               "\xCE\xEA\xBC\x31\x8D\x65\x9D\x46"
5522               "\xEA\x77\xB4\xF9\x58\xEA\x5D\x84"
5523               "\xE4\xDC\x14\xBB\xBD\x15\x0E\xDA"
5524               "\xD8\xE4\xA4\x5D\x61\xF9\x58\x0F"
5525               "\xE4\x82\x77\xCE\x87\xC0\x09\xF0"
5526               "\xD6\x10\x9E\x34\xE1\x0C\x67\x55"
5527               "\x7B\x6D\xD5\x51\x4B\x00\xEE\xBA"
5528               "\xF2\x7B\xBE\x75\x07\x42\x9D\x99"
5529               "\x12\xE1\x71\x4A\xF9\x2A\xF5\xF6"
5530               "\x93\x03\xD7\x51\x09\xFA\xBE\x68"
5531               "\xD8\x45\xFF\x33\xBA\xBB\x2B\x63",
5532         .rlen   = 496,
5533         .also_non_np = 1,
5534         .np = 3,
5535         .tap    = { 496 - 20, 4, 16 },
5536     },
5537 };
5538 
5539 static struct cipher_testvec des3_ede_dec_tv_template[] = {
5540     { /* These are from openssl */
5541         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
5542               "\x55\x55\x55\x55\x55\x55\x55\x55"
5543               "\xfe\xdc\xba\x98\x76\x54\x32\x10",
5544         .klen   = 24,
5545         .input  = "\x18\xd7\x48\xe5\x63\x62\x05\x72",
5546         .ilen   = 8,
5547         .result = "\x73\x6f\x6d\x65\x64\x61\x74\x61",
5548         .rlen   = 8,
5549     }, {
5550         .key    = "\x03\x52\x02\x07\x67\x20\x82\x17"
5551               "\x86\x02\x87\x66\x59\x08\x21\x98"
5552               "\x64\x05\x6a\xbd\xfe\xa9\x34\x57",
5553         .klen   = 24,
5554         .input  = "\xc0\x7d\x2a\x0f\xa5\x66\xfa\x30",
5555         .ilen   = 8,
5556         .result = "\x73\x71\x75\x69\x67\x67\x6c\x65",
5557         .rlen   = 8,
5558     }, {
5559         .key    = "\x10\x46\x10\x34\x89\x98\x80\x20"
5560               "\x91\x07\xd0\x15\x89\x19\x01\x01"
5561               "\x19\x07\x92\x10\x98\x1a\x01\x01",
5562         .klen   = 24,
5563         .input  = "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
5564         .ilen   = 8,
5565         .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
5566         .rlen   = 8,
5567     }, { /* Generated with Crypto++ */
5568         .key    = "\xF3\x9C\xD6\xF3\x9C\xB9\x5A\x67"
5569               "\x00\x5A\x67\x00\x2D\xCE\xEB\x2D"
5570               "\xCE\xEB\xB4\x51\x72\xB4\x51\x72",
5571         .klen   = 24,
5572         .input  = "\x4E\x9A\x40\x3D\x61\x7D\x17\xFA"
5573               "\x16\x86\x88\x0B\xD8\xAE\xF8\xE4"
5574               "\x81\x01\x04\x00\x76\xFA\xED\xD3"
5575               "\x44\x7E\x21\x9D\xF0\xFB\x2B\x64"
5576               "\xCA\x4E\x90\xE0\xC0\x63\x28\x92"
5577               "\xF3\x1F\xA4\x53\x2C\x77\xCC\x77"
5578               "\x69\x56\xD0\x19\xAD\x00\x2D\x97"
5579               "\xBC\xDE\x49\x6A\x82\xBC\x16\xE2"
5580               "\x2F\x3E\x72\xEE\xD1\xCE\xFC\x1B"
5581               "\xEA\x32\x56\xE4\x0B\xAF\x27\x36"
5582               "\xAF\x08\xB9\x61\xB7\x48\x23\x27"
5583               "\xEE\x4D\xC8\x79\x56\x06\xEB\xC7"
5584               "\x5B\xCA\x0A\xC6\x5E\x5C\xCB\xB6"
5585               "\x9D\xDA\x04\x59\xE2\x09\x48\x7E"
5586               "\x6B\x37\xC6\xFE\x92\xA9\x1E\x6E"
5587               "\x0D\x19\xFA\x33\x0F\xEE\x36\x68"
5588               "\x11\xBB\xF9\x5A\x73\xAB\x3A\xEA"
5589               "\xAC\x28\xD8\xD5\x27\xE8\x6B\x16"
5590               "\x45\x86\x50\x01\x70\x35\x99\x92"
5591               "\xDF\x0C\x07\x88\x8B\x7F\x9E\x4B"
5592               "\xD2\x04\x84\x90\xC4\x27\xDF\x0A"
5593               "\x49\xA8\xA7\x1A\x6D\x78\x16\xCA"
5594               "\xB3\x18\x5C\xC3\x93\x63\x5A\x68"
5595               "\x77\x02\xBA\xED\x62\x71\xB1\xD9"
5596               "\x5E\xE5\x6F\x1A\xCC\x1D\xBE\x2E"
5597               "\x11\xF3\xA6\x97\xCA\x8E\xBF\xB4"
5598               "\x56\xA1\x36\x6B\xB1\x0A\x3E\x70"
5599               "\xEA\xD7\xCD\x72\x7B\x79\xC8\xAD"
5600               "\x6B\xFE\xFB\xBA\x64\xAE\x19\xC1"
5601               "\x82\xCF\x8A\xA1\x50\x17\x7F\xB2"
5602               "\x6F\x7B\x0F\x52\xC5\x3E\x4A\x52"
5603               "\x3F\xD9\x3F\x01\xA6\x41\x1A\xB3"
5604               "\xB3\x7A\x0E\x8E\x75\xB2\xB1\x5F"
5605               "\xDB\xEA\x84\x13\x26\x6C\x85\x4E"
5606               "\xAE\x6B\xDC\xE7\xE7\xAD\xB0\x06"
5607               "\x5C\xBA\x92\xD0\x30\xBB\x8D\xD2"
5608               "\xAE\x4C\x70\x85\xA0\x07\xE3\x2C"
5609               "\xD1\x27\x9C\xCF\xDB\x13\xB7\xE5"
5610               "\xF9\x6A\x02\xD0\x39\x9D\xB6\xE7"
5611               "\xD1\x17\x25\x08\xF9\xA9\xA6\x67"
5612               "\x38\x80\xD1\x22\xAB\x1A\xD7\x26"
5613               "\xAD\xCA\x19\x1B\xFA\x18\xA7\x57"
5614               "\x31\xEC\xC9\xED\xDB\x79\xC0\x48"
5615               "\xAC\x31\x9F\x03\x8B\x62\x5B\x7E"
5616               "\x0E\xA6\xD0\x64\xEE\xEA\x00\xFC"
5617               "\x58\xC8\xDE\x51\x4E\x17\x15\x11"
5618               "\x66\x58\xB6\x90\xDC\xDF\xA1\x49"
5619               "\xCA\x79\xE9\x31\x31\x42\xDC\x56"
5620               "\x0B\xCD\xB6\x0D\xC7\x64\xF7\x19"
5621               "\xD9\x42\x05\x7F\xBC\x2F\xFC\x90"
5622               "\xAE\x29\x86\xAA\x43\x7A\x4F\x6B"
5623               "\xCE\xEA\xBC\x31\x8D\x65\x9D\x46"
5624               "\xEA\x77\xB4\xF9\x58\xEA\x5D\x84"
5625               "\xE4\xDC\x14\xBB\xBD\x15\x0E\xDA"
5626               "\xD8\xE4\xA4\x5D\x61\xF9\x58\x0F"
5627               "\xE4\x82\x77\xCE\x87\xC0\x09\xF0"
5628               "\xD6\x10\x9E\x34\xE1\x0C\x67\x55"
5629               "\x7B\x6D\xD5\x51\x4B\x00\xEE\xBA"
5630               "\xF2\x7B\xBE\x75\x07\x42\x9D\x99"
5631               "\x12\xE1\x71\x4A\xF9\x2A\xF5\xF6"
5632               "\x93\x03\xD7\x51\x09\xFA\xBE\x68"
5633               "\xD8\x45\xFF\x33\xBA\xBB\x2B\x63",
5634         .ilen   = 496,
5635         .result = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
5636               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
5637               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
5638               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
5639               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
5640               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
5641               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
5642               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
5643               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
5644               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
5645               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
5646               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
5647               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
5648               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
5649               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
5650               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
5651               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
5652               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
5653               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
5654               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
5655               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
5656               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
5657               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
5658               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
5659               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
5660               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
5661               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
5662               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
5663               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
5664               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
5665               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
5666               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
5667               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
5668               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
5669               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
5670               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
5671               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
5672               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
5673               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
5674               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
5675               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
5676               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
5677               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
5678               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
5679               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
5680               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
5681               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
5682               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
5683               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
5684               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
5685               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
5686               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
5687               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
5688               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
5689               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
5690               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
5691               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
5692               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
5693               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
5694               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
5695               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
5696               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
5697         .rlen   = 496,
5698         .also_non_np = 1,
5699         .np = 3,
5700         .tap    = { 496 - 20, 4, 16 },
5701     },
5702 };
5703 
5704 static struct cipher_testvec des3_ede_cbc_enc_tv_template[] = {
5705     { /* Generated from openssl */
5706         .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
5707               "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
5708               "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
5709         .klen   = 24,
5710         .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
5711         .input  = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
5712               "\x53\x20\x63\x65\x65\x72\x73\x74"
5713               "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
5714               "\x20\x79\x65\x53\x72\x63\x74\x65"
5715               "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
5716               "\x79\x6e\x53\x20\x63\x65\x65\x72"
5717               "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
5718               "\x6e\x61\x20\x79\x65\x53\x72\x63"
5719               "\x74\x65\x20\x73\x6f\x54\x20\x6f"
5720               "\x61\x4d\x79\x6e\x53\x20\x63\x65"
5721               "\x65\x72\x73\x74\x54\x20\x6f\x6f"
5722               "\x4d\x20\x6e\x61\x20\x79\x65\x53"
5723               "\x72\x63\x74\x65\x20\x73\x6f\x54"
5724               "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
5725               "\x63\x65\x65\x72\x73\x74\x54\x20"
5726               "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
5727         .ilen   = 128,
5728         .result = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
5729               "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
5730               "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
5731               "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
5732               "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
5733               "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
5734               "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
5735               "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
5736               "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
5737               "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
5738               "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
5739               "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
5740               "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
5741               "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
5742               "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
5743               "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
5744         .rlen   = 128,
5745     }, { /* Generated with Crypto++ */
5746         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
5747               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
5748               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
5749         .klen   = 24,
5750         .iv = "\xB2\xD7\x48\xED\x06\x44\xF9\x12"
5751               "\xB7\x28\x4D\x83\x24\x59\xF2\x17",
5752         .input  = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
5753               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
5754               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
5755               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
5756               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
5757               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
5758               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
5759               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
5760               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
5761               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
5762               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
5763               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
5764               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
5765               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
5766               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
5767               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
5768               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
5769               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
5770               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
5771               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
5772               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
5773               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
5774               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
5775               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
5776               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
5777               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
5778               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
5779               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
5780               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
5781               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
5782               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
5783               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
5784               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
5785               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
5786               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
5787               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
5788               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
5789               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
5790               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
5791               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
5792               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
5793               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
5794               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
5795               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
5796               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
5797               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
5798               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
5799               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
5800               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
5801               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
5802               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
5803               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
5804               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
5805               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
5806               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
5807               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
5808               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
5809               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
5810               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
5811               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
5812               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
5813               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
5814         .ilen   = 496,
5815         .result = "\xF8\xF6\xB5\x60\x5C\x5A\x75\x84"
5816               "\x87\x81\x53\xBA\xC9\x6F\xEC\xD5"
5817               "\x1E\x68\x8E\x85\x12\x86\x1D\x38"
5818               "\x1C\x91\x40\xCC\x69\x6A\xD5\x35"
5819               "\x0D\x7C\xB5\x07\x7C\x7B\x2A\xAF"
5820               "\x32\xBC\xA1\xB3\x84\x31\x1B\x3C"
5821               "\x0A\x2B\xFA\xD3\x9F\xB0\x8C\x37"
5822               "\x8F\x9D\xA7\x6D\x6C\xFA\xD7\x90"
5823               "\xE3\x69\x54\xED\x3A\xC4\xF1\x6B"
5824               "\xB1\xCC\xFB\x7D\xD8\x8E\x17\x0B"
5825               "\x9C\xF6\x4C\xD6\xFF\x03\x4E\xD9"
5826               "\xE6\xA5\xAD\x25\xE6\x17\x69\x63"
5827               "\x11\x35\x61\x94\x88\x7B\x1C\x48"
5828               "\xF1\x24\x20\x29\x6B\x93\x1A\x8E"
5829               "\x43\x03\x89\xD8\xB1\xDA\x47\x7B"
5830               "\x79\x3A\x83\x76\xDA\xAE\xC6\xBB"
5831               "\x22\xF8\xE8\x3D\x9A\x65\x54\xD8"
5832               "\x4C\xE9\xE7\xE4\x63\x2F\x5C\x73"
5833               "\x5A\xC3\xAE\x46\xA8\xCD\x57\xE6"
5834               "\x67\x88\xA5\x20\x6F\x5F\x97\xC7"
5835               "\xCC\x15\xA2\x0A\x93\xEA\x33\xE7"
5836               "\x03\x5F\xEC\x64\x30\x6F\xEE\xD7"
5837               "\x7E\xDF\xD6\xE9\x6F\x3F\xD6\x1E"
5838               "\xBE\x67\x6C\x5B\x97\xA0\x09\xE6"
5839               "\xEE\xFE\x55\xA3\x29\x65\xE0\x12"
5840               "\xA1\x6A\x8A\x6F\xF2\xE6\xF1\x96"
5841               "\x87\xFB\x9C\x05\xDD\x80\xEC\xFF"
5842               "\xC5\xED\x50\xFE\xFC\x91\xCD\xCE"
5843               "\x25\x2C\x5F\xD9\xAD\x95\x7D\x99"
5844               "\xF0\x05\xC4\x71\x46\x5F\xF9\x0D"
5845               "\xD2\x63\xDF\x9B\x96\x2E\x2B\xA6"
5846               "\x2B\x1C\xD5\xFB\x96\x24\x60\x60"
5847               "\x54\x40\xB8\x62\xA4\xF8\x46\x95"
5848               "\x73\x28\xA3\xA6\x16\x2B\x17\xE7"
5849               "\x7A\xF8\x62\x54\x3B\x64\x69\xE1"
5850               "\x71\x34\x29\x5B\x4E\x05\x9B\xFA"
5851               "\x5E\xF1\x96\xB7\xCE\x16\x9B\x59"
5852               "\xF1\x1A\x4C\x51\x26\xFD\x79\xE2"
5853               "\x3B\x8E\x71\x69\x6A\x91\xB6\x65"
5854               "\x32\x09\xB8\xE4\x09\x1F\xEA\x39"
5855               "\xCE\x20\x65\x9F\xD6\xD1\xC7\xF0"
5856               "\x73\x50\x08\x56\x20\x9B\x94\x23"
5857               "\x14\x39\xB7\x2B\xB1\x2D\x6D\x6F"
5858               "\x41\x5B\xCC\xE2\x18\xAE\x62\x89"
5859               "\x78\x8E\x67\x23\xD0\xFB\x2B\xE5"
5860               "\x25\xC9\x48\x97\xB5\xD3\x17\xD5"
5861               "\x6A\x9F\xA7\x48\x0C\x2B\x73\x3B"
5862               "\x57\x08\xAE\x91\xF2\xB7\x57\x89"
5863               "\xF4\xD0\xB0\x07\xB0\x42\x6C\xAF"
5864               "\x98\x1A\xE7\xD1\xAC\x1E\xB5\x02"
5865               "\xD4\x56\x42\x79\x79\x7F\x2A\x77"
5866               "\x25\xE9\x7D\xC1\x88\x19\x2B\x49"
5867               "\x6F\x46\x59\xAB\x56\x1F\x61\xE0"
5868               "\x0C\x24\x9C\xC9\x5B\x63\xA9\x12"
5869               "\xCF\x88\x96\xB6\xA8\x24\xC6\xA8"
5870               "\x21\x85\x1A\x62\x7E\x34\xBB\xEB"
5871               "\xBD\x02\x2A\xC7\xD8\x89\x80\xC5"
5872               "\xB1\xBB\x60\xA5\x22\xFC\x6F\x38"
5873               "\x02\x80\xA3\x28\x22\x75\xE1\xE9"
5874               "\x90\xE9\xFA\x4B\x00\x10\xAC\x58"
5875               "\x83\x70\xFF\x86\xE6\xAA\x0F\x1F"
5876               "\x95\x63\x73\xA2\x44\xAC\xF8\xA5",
5877         .rlen   = 496,
5878         .also_non_np = 1,
5879         .np = 3,
5880         .tap    = { 496 - 20, 4, 16 },
5881     },
5882 };
5883 
5884 static struct cipher_testvec des3_ede_cbc_dec_tv_template[] = {
5885     { /* Generated from openssl */
5886         .key    = "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
5887               "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
5888               "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
5889         .klen   = 24,
5890         .iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
5891         .input  = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
5892               "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
5893               "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
5894               "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
5895               "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
5896               "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
5897               "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
5898               "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
5899               "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
5900               "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
5901               "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
5902               "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
5903               "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
5904               "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
5905               "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
5906               "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
5907         .ilen   = 128,
5908         .result = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
5909               "\x53\x20\x63\x65\x65\x72\x73\x74"
5910               "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
5911               "\x20\x79\x65\x53\x72\x63\x74\x65"
5912               "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
5913               "\x79\x6e\x53\x20\x63\x65\x65\x72"
5914               "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
5915               "\x6e\x61\x20\x79\x65\x53\x72\x63"
5916               "\x74\x65\x20\x73\x6f\x54\x20\x6f"
5917               "\x61\x4d\x79\x6e\x53\x20\x63\x65"
5918               "\x65\x72\x73\x74\x54\x20\x6f\x6f"
5919               "\x4d\x20\x6e\x61\x20\x79\x65\x53"
5920               "\x72\x63\x74\x65\x20\x73\x6f\x54"
5921               "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
5922               "\x63\x65\x65\x72\x73\x74\x54\x20"
5923               "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
5924         .rlen   = 128,
5925     }, { /* Generated with Crypto++ */
5926         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
5927               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
5928               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
5929         .klen   = 24,
5930         .iv = "\xB2\xD7\x48\xED\x06\x44\xF9\x12"
5931               "\xB7\x28\x4D\x83\x24\x59\xF2\x17",
5932         .input  = "\xF8\xF6\xB5\x60\x5C\x5A\x75\x84"
5933               "\x87\x81\x53\xBA\xC9\x6F\xEC\xD5"
5934               "\x1E\x68\x8E\x85\x12\x86\x1D\x38"
5935               "\x1C\x91\x40\xCC\x69\x6A\xD5\x35"
5936               "\x0D\x7C\xB5\x07\x7C\x7B\x2A\xAF"
5937               "\x32\xBC\xA1\xB3\x84\x31\x1B\x3C"
5938               "\x0A\x2B\xFA\xD3\x9F\xB0\x8C\x37"
5939               "\x8F\x9D\xA7\x6D\x6C\xFA\xD7\x90"
5940               "\xE3\x69\x54\xED\x3A\xC4\xF1\x6B"
5941               "\xB1\xCC\xFB\x7D\xD8\x8E\x17\x0B"
5942               "\x9C\xF6\x4C\xD6\xFF\x03\x4E\xD9"
5943               "\xE6\xA5\xAD\x25\xE6\x17\x69\x63"
5944               "\x11\x35\x61\x94\x88\x7B\x1C\x48"
5945               "\xF1\x24\x20\x29\x6B\x93\x1A\x8E"
5946               "\x43\x03\x89\xD8\xB1\xDA\x47\x7B"
5947               "\x79\x3A\x83\x76\xDA\xAE\xC6\xBB"
5948               "\x22\xF8\xE8\x3D\x9A\x65\x54\xD8"
5949               "\x4C\xE9\xE7\xE4\x63\x2F\x5C\x73"
5950               "\x5A\xC3\xAE\x46\xA8\xCD\x57\xE6"
5951               "\x67\x88\xA5\x20\x6F\x5F\x97\xC7"
5952               "\xCC\x15\xA2\x0A\x93\xEA\x33\xE7"
5953               "\x03\x5F\xEC\x64\x30\x6F\xEE\xD7"
5954               "\x7E\xDF\xD6\xE9\x6F\x3F\xD6\x1E"
5955               "\xBE\x67\x6C\x5B\x97\xA0\x09\xE6"
5956               "\xEE\xFE\x55\xA3\x29\x65\xE0\x12"
5957               "\xA1\x6A\x8A\x6F\xF2\xE6\xF1\x96"
5958               "\x87\xFB\x9C\x05\xDD\x80\xEC\xFF"
5959               "\xC5\xED\x50\xFE\xFC\x91\xCD\xCE"
5960               "\x25\x2C\x5F\xD9\xAD\x95\x7D\x99"
5961               "\xF0\x05\xC4\x71\x46\x5F\xF9\x0D"
5962               "\xD2\x63\xDF\x9B\x96\x2E\x2B\xA6"
5963               "\x2B\x1C\xD5\xFB\x96\x24\x60\x60"
5964               "\x54\x40\xB8\x62\xA4\xF8\x46\x95"
5965               "\x73\x28\xA3\xA6\x16\x2B\x17\xE7"
5966               "\x7A\xF8\x62\x54\x3B\x64\x69\xE1"
5967               "\x71\x34\x29\x5B\x4E\x05\x9B\xFA"
5968               "\x5E\xF1\x96\xB7\xCE\x16\x9B\x59"
5969               "\xF1\x1A\x4C\x51\x26\xFD\x79\xE2"
5970               "\x3B\x8E\x71\x69\x6A\x91\xB6\x65"
5971               "\x32\x09\xB8\xE4\x09\x1F\xEA\x39"
5972               "\xCE\x20\x65\x9F\xD6\xD1\xC7\xF0"
5973               "\x73\x50\x08\x56\x20\x9B\x94\x23"
5974               "\x14\x39\xB7\x2B\xB1\x2D\x6D\x6F"
5975               "\x41\x5B\xCC\xE2\x18\xAE\x62\x89"
5976               "\x78\x8E\x67\x23\xD0\xFB\x2B\xE5"
5977               "\x25\xC9\x48\x97\xB5\xD3\x17\xD5"
5978               "\x6A\x9F\xA7\x48\x0C\x2B\x73\x3B"
5979               "\x57\x08\xAE\x91\xF2\xB7\x57\x89"
5980               "\xF4\xD0\xB0\x07\xB0\x42\x6C\xAF"
5981               "\x98\x1A\xE7\xD1\xAC\x1E\xB5\x02"
5982               "\xD4\x56\x42\x79\x79\x7F\x2A\x77"
5983               "\x25\xE9\x7D\xC1\x88\x19\x2B\x49"
5984               "\x6F\x46\x59\xAB\x56\x1F\x61\xE0"
5985               "\x0C\x24\x9C\xC9\x5B\x63\xA9\x12"
5986               "\xCF\x88\x96\xB6\xA8\x24\xC6\xA8"
5987               "\x21\x85\x1A\x62\x7E\x34\xBB\xEB"
5988               "\xBD\x02\x2A\xC7\xD8\x89\x80\xC5"
5989               "\xB1\xBB\x60\xA5\x22\xFC\x6F\x38"
5990               "\x02\x80\xA3\x28\x22\x75\xE1\xE9"
5991               "\x90\xE9\xFA\x4B\x00\x10\xAC\x58"
5992               "\x83\x70\xFF\x86\xE6\xAA\x0F\x1F"
5993               "\x95\x63\x73\xA2\x44\xAC\xF8\xA5",
5994         .ilen   = 496,
5995         .result = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
5996               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
5997               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
5998               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
5999               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
6000               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
6001               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
6002               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
6003               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
6004               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
6005               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
6006               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
6007               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
6008               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
6009               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
6010               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
6011               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
6012               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
6013               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
6014               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
6015               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
6016               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
6017               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
6018               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
6019               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
6020               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
6021               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
6022               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
6023               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
6024               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
6025               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
6026               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
6027               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
6028               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
6029               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
6030               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
6031               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
6032               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
6033               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
6034               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
6035               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
6036               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
6037               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
6038               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
6039               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
6040               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
6041               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
6042               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
6043               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
6044               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
6045               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
6046               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
6047               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
6048               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
6049               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
6050               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
6051               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
6052               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
6053               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
6054               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
6055               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
6056               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
6057         .rlen   = 496,
6058         .also_non_np = 1,
6059         .np = 3,
6060         .tap    = { 496 - 20, 4, 16 },
6061     },
6062 };
6063 
6064 static struct cipher_testvec des3_ede_ctr_enc_tv_template[] = {
6065     { /* Generated with Crypto++ */
6066         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
6067               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
6068               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
6069         .klen   = 24,
6070         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
6071               "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
6072         .input  = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
6073               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
6074               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
6075               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
6076               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
6077               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
6078               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
6079               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
6080               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
6081               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
6082               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
6083               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
6084               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
6085               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
6086               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
6087               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
6088               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
6089               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
6090               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
6091               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
6092               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
6093               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
6094               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
6095               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
6096               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
6097               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
6098               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
6099               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
6100               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
6101               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
6102               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
6103               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
6104               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
6105               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
6106               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
6107               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
6108               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
6109               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
6110               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
6111               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
6112               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
6113               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
6114               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
6115               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
6116               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
6117               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
6118               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
6119               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
6120               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
6121               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
6122               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
6123               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
6124               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
6125               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
6126               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
6127               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
6128               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
6129               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
6130               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
6131               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
6132               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
6133               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
6134         .ilen   = 496,
6135         .result = "\x07\xC2\x08\x20\x72\x1F\x49\xEF"
6136               "\x19\xCD\x6F\x32\x53\x05\x22\x15"
6137               "\xA2\x85\x2B\xDB\x85\xD2\xD8\xB9"
6138               "\xDD\x0D\x1B\x45\xCB\x69\x11\xD4"
6139               "\xEA\xBE\xB2\x45\x5D\x0C\xAE\xBE"
6140               "\xA0\xC1\x27\xAC\x65\x9F\x53\x7E"
6141               "\xAF\xC2\x1B\xB5\xB8\x6D\x36\x0C"
6142               "\x25\xC0\xF8\x6D\x0B\x29\x01\xDA"
6143               "\x13\x78\xDC\x89\x12\x12\x43\xFA"
6144               "\xF6\x12\xEF\x8D\x87\x62\x78\x83"
6145               "\xE2\xBE\x41\x20\x4C\x6D\x35\x1B"
6146               "\xD1\x0C\x30\xCF\xE2\xDE\x2B\x03"
6147               "\xBF\x45\x73\xD4\xE5\x59\x95\xD1"
6148               "\xB3\x9B\x27\x62\x97\xBD\xDE\x7F"
6149               "\xA4\xD2\x39\x80\xAA\x50\x23\xF0"
6150               "\x74\x88\x3D\xA8\x6A\x18\x79\x3B"
6151               "\xC4\x96\x6C\x8D\x22\x40\x92\x6E"
6152               "\xD6\xAD\x2A\x1F\xDE\x63\xC0\xE7"
6153               "\x07\xF7\x2D\xF7\xB5\xF3\xF0\xCC"
6154               "\x01\x7C\x2A\x9B\xC2\x10\xCA\xAA"
6155               "\xFD\x2B\x3F\xC5\xF3\xF6\xFC\x9B"
6156               "\x45\xDB\x53\xE4\x5B\xF3\xC9\x7B"
6157               "\x8E\x52\xFF\xC8\x02\xB8\xAC\x9D"
6158               "\xA1\x00\x39\xDA\x3D\x2D\x0E\x01"
6159               "\x09\x7D\x8D\x5E\xBE\x53\xB9\xB0"
6160               "\x8E\xE7\xE2\x96\x6A\xB2\x78\xEA"
6161               "\xDE\x23\x8B\xA5\xFA\x5C\xE3\xDA"
6162               "\xBF\x8E\x31\x6A\x55\xD1\x6A\xB2"
6163               "\xB5\x46\x6F\xA5\xF0\xEE\xBA\x1F"
6164               "\x9F\x98\xB0\x66\x4F\xD0\x3F\xA9"
6165               "\xDF\x5F\x58\xC4\xF4\xFF\x75\x5C"
6166               "\x40\x3A\x09\x7E\x6E\x1C\x97\xD4"
6167               "\xCC\xE7\xE7\x71\xCF\x0B\x15\x08"
6168               "\x71\xFA\x07\x97\xCD\xE6\xCA\x1D"
6169               "\x14\x28\x0C\xCF\x99\x13\x7A\xF1"
6170               "\xEB\xFA\xFA\x92\x07\xDE\x1D\xA1"
6171               "\xD3\x36\x69\xFE\x51\x4D\x9F\x2E"
6172               "\x83\x37\x4F\x1F\x48\x30\xED\x04"
6173               "\x4D\xA4\xEF\x3A\xCA\x76\xF4\x1C"
6174               "\x41\x8F\x63\x37\x78\x2F\x86\xA6"
6175               "\xEF\x41\x7E\xD2\xAF\x88\xAB\x67"
6176               "\x52\x71\xC3\x8E\xF8\x26\x93\x72"
6177               "\xAA\xD6\x0E\xE7\x0B\x46\xB1\x3A"
6178               "\xB4\x08\xA9\xA8\xA0\xCF\x20\x0C"
6179               "\x52\xBC\x8B\x05\x56\xB2\xBC\x31"
6180               "\x9B\x74\xB9\x29\x29\x96\x9A\x50"
6181               "\xDC\x45\xDC\x1A\xEB\x0C\x64\xD4"
6182               "\xD3\x05\x7E\x59\x55\xC3\xF4\x90"
6183               "\xC2\xAB\xF8\x9B\x8A\xDA\xCE\xA1"
6184               "\xC3\xF4\xAD\x77\xDD\x44\xC8\xAC"
6185               "\xA3\xF1\xC9\xD2\x19\x5C\xB0\xCA"
6186               "\xA2\x34\xC1\xF7\x6C\xFD\xAC\x65"
6187               "\x32\xDC\x48\xC4\xF2\x00\x6B\x77"
6188               "\xF1\x7D\x76\xAC\xC0\x31\x63\x2A"
6189               "\xA5\x3A\x62\xC8\x91\xB1\x03\x65"
6190               "\xCB\x43\xD1\x06\xDF\xC3\x67\xBC"
6191               "\xDC\xE0\xCD\x35\xCE\x49\x65\xA0"
6192               "\x52\x7B\xA7\x0D\x07\xA9\x1B\xB0"
6193               "\x40\x77\x72\xC2\xEA\x0E\x3A\x78"
6194               "\x46\xB9\x91\xB6\xE7\x3D\x51\x42"
6195               "\xFD\x51\xB0\xC6\x2C\x63\x13\x78"
6196               "\x5C\xEE\xFC\xCF\xC4\x70\x00\x34",
6197         .rlen   = 496,
6198         .also_non_np = 1,
6199         .np = 3,
6200         .tap    = { 496 - 20, 4, 16 },
6201     }, { /* Generated with Crypto++ */
6202         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
6203               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
6204               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
6205         .klen   = 24,
6206         .iv = "\xB2\xD7\x48\xED\x06\x44\xF9\x12"
6207               "\xB7\x28\x4D\x83\x24\x59\xF2\x17",
6208         .input  = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
6209               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
6210               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
6211               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
6212               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
6213               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
6214               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
6215               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
6216               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
6217               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
6218               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
6219               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
6220               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
6221               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
6222               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
6223               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
6224               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
6225               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
6226               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
6227               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
6228               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
6229               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
6230               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
6231               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
6232               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
6233               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
6234               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
6235               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
6236               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
6237               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
6238               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
6239               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
6240               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
6241               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
6242               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
6243               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
6244               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
6245               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
6246               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
6247               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
6248               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
6249               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
6250               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
6251               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
6252               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
6253               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
6254               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
6255               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
6256               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
6257               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
6258               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
6259               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
6260               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
6261               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
6262               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
6263               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
6264               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
6265               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
6266               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
6267               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
6268               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
6269               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47"
6270               "\x2E\xB1\x18",
6271         .ilen   = 499,
6272         .result = "\x23\xFF\x5C\x99\x75\xBB\x1F\xD4"
6273               "\xBC\x27\x9D\x36\x60\xA9\xC9\xF7"
6274               "\x94\x9D\x1B\xFF\x8E\x95\x57\x89"
6275               "\x8C\x2E\x33\x70\x43\x61\xE6\xD2"
6276               "\x82\x33\x63\xB6\xC4\x34\x5E\xF8"
6277               "\x96\x07\xA7\xD2\x3B\x8E\xC9\xAA"
6278               "\x7C\xA0\x55\x89\x2E\xE1\x85\x25"
6279               "\x14\x04\xDA\x6B\xE0\xEE\x56\xCF"
6280               "\x08\x2E\x69\xD4\x54\xDE\x22\x84"
6281               "\x69\xA6\xA7\xD3\x3A\x9A\xE8\x05"
6282               "\x63\xDB\xBF\x46\x3A\x26\x2E\x0F"
6283               "\x58\x5C\x46\xEA\x07\x40\xDA\xE1"
6284               "\x14\x1D\xCD\x4F\x06\xC0\xCA\x54"
6285               "\x1E\xC9\x45\x85\x67\x7C\xC2\xB5"
6286               "\x97\x5D\x61\x78\x2E\x46\xEC\x6A"
6287               "\x53\xF4\xD0\xAE\xFA\xB4\x86\x29"
6288               "\x9F\x17\x33\x24\xD8\xB9\xB2\x05"
6289               "\x93\x88\xEA\xF7\xA0\x70\x69\x49"
6290               "\x88\x6B\x73\x40\x41\x8D\xD9\xD9"
6291               "\x7E\x78\xE9\xBE\x6C\x14\x22\x7A"
6292               "\x66\xE1\xDA\xED\x10\xFF\x69\x1D"
6293               "\xB9\xAA\xF2\x56\x72\x1B\x23\xE2"
6294               "\x45\x54\x8B\xA3\x70\x23\xB4\x5E"
6295               "\x8E\x96\xC9\x05\x00\xB3\xB6\xC2"
6296               "\x2A\x02\x43\x7A\x62\xD5\xC8\xD2"
6297               "\xC2\xD0\xE4\x78\xA1\x7B\x3E\xE8"
6298               "\x9F\x7F\x7D\x40\x54\x30\x3B\xC0"
6299               "\xA5\x54\xFD\xCA\x25\xEC\x44\x3E"
6300               "\x1A\x54\x7F\x88\xD0\xE1\xFE\x71"
6301               "\xCE\x05\x49\x89\xBA\xD6\x72\xE7"
6302               "\xD6\x5D\x3F\xA2\xD9\xAB\xC5\x02"
6303               "\xD6\x43\x22\xAF\xA2\xE4\x80\x85"
6304               "\xD7\x87\xB9\xEA\x43\xDB\xC8\xEF"
6305               "\x5C\x82\x2E\x98\x0D\x30\x41\x6B"
6306               "\x08\x48\x8D\xF0\xF8\x60\xD7\x9D"
6307               "\xE9\xDE\x40\xAD\x0D\xAD\x0D\x58"
6308               "\x2A\x98\x35\xFE\xF7\xDD\x4B\x40"
6309               "\xDE\xB0\x05\xD9\x7B\x09\x4D\xBC"
6310               "\x42\xC0\xF1\x15\x0B\xFA\x26\x6B"
6311               "\xC6\x12\x13\x4F\xCB\x35\xBA\x35"
6312               "\xDD\x7A\x36\x9C\x12\x57\x55\x83"
6313               "\x78\x58\x09\xD0\xB0\xCF\x7C\x5C"
6314               "\x38\xCF\xBD\x79\x5B\x13\x4D\x97"
6315               "\xC1\x85\x6F\x97\xC9\xE8\xC2\xA4"
6316               "\x98\xE2\xBD\x77\x6B\x53\x39\x1A"
6317               "\x28\x10\xE7\xE0\xE7\xDE\x9D\x69"
6318               "\x78\x6F\x8E\xD2\xD9\x5D\xD2\x15"
6319               "\x9E\xB5\x4D\x8C\xC0\x78\x22\x2F"
6320               "\x17\x11\x2E\x99\xD7\xE3\xA4\x4F"
6321               "\x65\xA5\x6B\x03\x2C\x35\x6F\xDA"
6322               "\x8A\x19\x08\xE1\x08\x48\x59\x51"
6323               "\x53\x4B\xD1\xDF\xDA\x14\x50\x5F"
6324               "\xDF\xB5\x8C\xDF\xC6\xFD\x85\xFA"
6325               "\xD4\xF9\x64\x45\x65\x0D\x7D\xF4"
6326               "\xC8\xCD\x3F\x32\xAF\xDD\x30\xED"
6327               "\x7B\xAA\xAC\xF0\xDA\x7F\xDF\x75"
6328               "\x1C\xA4\xF1\xCB\x5E\x4F\x0B\xB4"
6329               "\x97\x73\x28\xDE\xCF\xAF\x82\xBD"
6330               "\xC4\xBA\xB4\x9C\x0D\x16\x77\x42"
6331               "\x42\x39\x7C\x53\xA4\xD4\xDD\x40"
6332               "\x5C\x60\x1F\x6E\xA7\xE2\xDC\xE7"
6333               "\x32\x0F\x05\x2F\xF2\x4C\x95\x3B"
6334               "\xF2\x79\xD9",
6335         .rlen   = 499,
6336         .also_non_np = 1,
6337         .np = 2,
6338         .tap    = { 499 - 16, 16 },
6339     },
6340 };
6341 
6342 static struct cipher_testvec des3_ede_ctr_dec_tv_template[] = {
6343     { /* Generated with Crypto++ */
6344         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
6345               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
6346               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
6347         .klen   = 24,
6348         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
6349               "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
6350         .input  = "\x07\xC2\x08\x20\x72\x1F\x49\xEF"
6351               "\x19\xCD\x6F\x32\x53\x05\x22\x15"
6352               "\xA2\x85\x2B\xDB\x85\xD2\xD8\xB9"
6353               "\xDD\x0D\x1B\x45\xCB\x69\x11\xD4"
6354               "\xEA\xBE\xB2\x45\x5D\x0C\xAE\xBE"
6355               "\xA0\xC1\x27\xAC\x65\x9F\x53\x7E"
6356               "\xAF\xC2\x1B\xB5\xB8\x6D\x36\x0C"
6357               "\x25\xC0\xF8\x6D\x0B\x29\x01\xDA"
6358               "\x13\x78\xDC\x89\x12\x12\x43\xFA"
6359               "\xF6\x12\xEF\x8D\x87\x62\x78\x83"
6360               "\xE2\xBE\x41\x20\x4C\x6D\x35\x1B"
6361               "\xD1\x0C\x30\xCF\xE2\xDE\x2B\x03"
6362               "\xBF\x45\x73\xD4\xE5\x59\x95\xD1"
6363               "\xB3\x9B\x27\x62\x97\xBD\xDE\x7F"
6364               "\xA4\xD2\x39\x80\xAA\x50\x23\xF0"
6365               "\x74\x88\x3D\xA8\x6A\x18\x79\x3B"
6366               "\xC4\x96\x6C\x8D\x22\x40\x92\x6E"
6367               "\xD6\xAD\x2A\x1F\xDE\x63\xC0\xE7"
6368               "\x07\xF7\x2D\xF7\xB5\xF3\xF0\xCC"
6369               "\x01\x7C\x2A\x9B\xC2\x10\xCA\xAA"
6370               "\xFD\x2B\x3F\xC5\xF3\xF6\xFC\x9B"
6371               "\x45\xDB\x53\xE4\x5B\xF3\xC9\x7B"
6372               "\x8E\x52\xFF\xC8\x02\xB8\xAC\x9D"
6373               "\xA1\x00\x39\xDA\x3D\x2D\x0E\x01"
6374               "\x09\x7D\x8D\x5E\xBE\x53\xB9\xB0"
6375               "\x8E\xE7\xE2\x96\x6A\xB2\x78\xEA"
6376               "\xDE\x23\x8B\xA5\xFA\x5C\xE3\xDA"
6377               "\xBF\x8E\x31\x6A\x55\xD1\x6A\xB2"
6378               "\xB5\x46\x6F\xA5\xF0\xEE\xBA\x1F"
6379               "\x9F\x98\xB0\x66\x4F\xD0\x3F\xA9"
6380               "\xDF\x5F\x58\xC4\xF4\xFF\x75\x5C"
6381               "\x40\x3A\x09\x7E\x6E\x1C\x97\xD4"
6382               "\xCC\xE7\xE7\x71\xCF\x0B\x15\x08"
6383               "\x71\xFA\x07\x97\xCD\xE6\xCA\x1D"
6384               "\x14\x28\x0C\xCF\x99\x13\x7A\xF1"
6385               "\xEB\xFA\xFA\x92\x07\xDE\x1D\xA1"
6386               "\xD3\x36\x69\xFE\x51\x4D\x9F\x2E"
6387               "\x83\x37\x4F\x1F\x48\x30\xED\x04"
6388               "\x4D\xA4\xEF\x3A\xCA\x76\xF4\x1C"
6389               "\x41\x8F\x63\x37\x78\x2F\x86\xA6"
6390               "\xEF\x41\x7E\xD2\xAF\x88\xAB\x67"
6391               "\x52\x71\xC3\x8E\xF8\x26\x93\x72"
6392               "\xAA\xD6\x0E\xE7\x0B\x46\xB1\x3A"
6393               "\xB4\x08\xA9\xA8\xA0\xCF\x20\x0C"
6394               "\x52\xBC\x8B\x05\x56\xB2\xBC\x31"
6395               "\x9B\x74\xB9\x29\x29\x96\x9A\x50"
6396               "\xDC\x45\xDC\x1A\xEB\x0C\x64\xD4"
6397               "\xD3\x05\x7E\x59\x55\xC3\xF4\x90"
6398               "\xC2\xAB\xF8\x9B\x8A\xDA\xCE\xA1"
6399               "\xC3\xF4\xAD\x77\xDD\x44\xC8\xAC"
6400               "\xA3\xF1\xC9\xD2\x19\x5C\xB0\xCA"
6401               "\xA2\x34\xC1\xF7\x6C\xFD\xAC\x65"
6402               "\x32\xDC\x48\xC4\xF2\x00\x6B\x77"
6403               "\xF1\x7D\x76\xAC\xC0\x31\x63\x2A"
6404               "\xA5\x3A\x62\xC8\x91\xB1\x03\x65"
6405               "\xCB\x43\xD1\x06\xDF\xC3\x67\xBC"
6406               "\xDC\xE0\xCD\x35\xCE\x49\x65\xA0"
6407               "\x52\x7B\xA7\x0D\x07\xA9\x1B\xB0"
6408               "\x40\x77\x72\xC2\xEA\x0E\x3A\x78"
6409               "\x46\xB9\x91\xB6\xE7\x3D\x51\x42"
6410               "\xFD\x51\xB0\xC6\x2C\x63\x13\x78"
6411               "\x5C\xEE\xFC\xCF\xC4\x70\x00\x34",
6412         .ilen   = 496,
6413         .result = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
6414               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
6415               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
6416               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
6417               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
6418               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
6419               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
6420               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
6421               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
6422               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
6423               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
6424               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
6425               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
6426               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
6427               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
6428               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
6429               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
6430               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
6431               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
6432               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
6433               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
6434               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
6435               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
6436               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
6437               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
6438               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
6439               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
6440               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
6441               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
6442               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
6443               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
6444               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
6445               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
6446               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
6447               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
6448               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
6449               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
6450               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
6451               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
6452               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
6453               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
6454               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
6455               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
6456               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
6457               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
6458               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
6459               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
6460               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
6461               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
6462               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
6463               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
6464               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
6465               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
6466               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
6467               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
6468               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
6469               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
6470               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
6471               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
6472               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
6473               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
6474               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47",
6475         .rlen   = 496,
6476         .also_non_np = 1,
6477         .np = 3,
6478         .tap    = { 496 - 20, 4, 16 },
6479     }, { /* Generated with Crypto++ */
6480         .key    = "\x9C\xD6\xF3\x9C\xB9\x5A\x67\x00"
6481               "\x5A\x67\x00\x2D\xCE\xEB\x2D\xCE"
6482               "\xEB\xB4\x51\x72\xB4\x51\x72\x1F",
6483         .klen   = 24,
6484         .iv = "\xB2\xD7\x48\xED\x06\x44\xF9\x12"
6485               "\xB7\x28\x4D\x83\x24\x59\xF2\x17",
6486         .input  = "\x23\xFF\x5C\x99\x75\xBB\x1F\xD4"
6487               "\xBC\x27\x9D\x36\x60\xA9\xC9\xF7"
6488               "\x94\x9D\x1B\xFF\x8E\x95\x57\x89"
6489               "\x8C\x2E\x33\x70\x43\x61\xE6\xD2"
6490               "\x82\x33\x63\xB6\xC4\x34\x5E\xF8"
6491               "\x96\x07\xA7\xD2\x3B\x8E\xC9\xAA"
6492               "\x7C\xA0\x55\x89\x2E\xE1\x85\x25"
6493               "\x14\x04\xDA\x6B\xE0\xEE\x56\xCF"
6494               "\x08\x2E\x69\xD4\x54\xDE\x22\x84"
6495               "\x69\xA6\xA7\xD3\x3A\x9A\xE8\x05"
6496               "\x63\xDB\xBF\x46\x3A\x26\x2E\x0F"
6497               "\x58\x5C\x46\xEA\x07\x40\xDA\xE1"
6498               "\x14\x1D\xCD\x4F\x06\xC0\xCA\x54"
6499               "\x1E\xC9\x45\x85\x67\x7C\xC2\xB5"
6500               "\x97\x5D\x61\x78\x2E\x46\xEC\x6A"
6501               "\x53\xF4\xD0\xAE\xFA\xB4\x86\x29"
6502               "\x9F\x17\x33\x24\xD8\xB9\xB2\x05"
6503               "\x93\x88\xEA\xF7\xA0\x70\x69\x49"
6504               "\x88\x6B\x73\x40\x41\x8D\xD9\xD9"
6505               "\x7E\x78\xE9\xBE\x6C\x14\x22\x7A"
6506               "\x66\xE1\xDA\xED\x10\xFF\x69\x1D"
6507               "\xB9\xAA\xF2\x56\x72\x1B\x23\xE2"
6508               "\x45\x54\x8B\xA3\x70\x23\xB4\x5E"
6509               "\x8E\x96\xC9\x05\x00\xB3\xB6\xC2"
6510               "\x2A\x02\x43\x7A\x62\xD5\xC8\xD2"
6511               "\xC2\xD0\xE4\x78\xA1\x7B\x3E\xE8"
6512               "\x9F\x7F\x7D\x40\x54\x30\x3B\xC0"
6513               "\xA5\x54\xFD\xCA\x25\xEC\x44\x3E"
6514               "\x1A\x54\x7F\x88\xD0\xE1\xFE\x71"
6515               "\xCE\x05\x49\x89\xBA\xD6\x72\xE7"
6516               "\xD6\x5D\x3F\xA2\xD9\xAB\xC5\x02"
6517               "\xD6\x43\x22\xAF\xA2\xE4\x80\x85"
6518               "\xD7\x87\xB9\xEA\x43\xDB\xC8\xEF"
6519               "\x5C\x82\x2E\x98\x0D\x30\x41\x6B"
6520               "\x08\x48\x8D\xF0\xF8\x60\xD7\x9D"
6521               "\xE9\xDE\x40\xAD\x0D\xAD\x0D\x58"
6522               "\x2A\x98\x35\xFE\xF7\xDD\x4B\x40"
6523               "\xDE\xB0\x05\xD9\x7B\x09\x4D\xBC"
6524               "\x42\xC0\xF1\x15\x0B\xFA\x26\x6B"
6525               "\xC6\x12\x13\x4F\xCB\x35\xBA\x35"
6526               "\xDD\x7A\x36\x9C\x12\x57\x55\x83"
6527               "\x78\x58\x09\xD0\xB0\xCF\x7C\x5C"
6528               "\x38\xCF\xBD\x79\x5B\x13\x4D\x97"
6529               "\xC1\x85\x6F\x97\xC9\xE8\xC2\xA4"
6530               "\x98\xE2\xBD\x77\x6B\x53\x39\x1A"
6531               "\x28\x10\xE7\xE0\xE7\xDE\x9D\x69"
6532               "\x78\x6F\x8E\xD2\xD9\x5D\xD2\x15"
6533               "\x9E\xB5\x4D\x8C\xC0\x78\x22\x2F"
6534               "\x17\x11\x2E\x99\xD7\xE3\xA4\x4F"
6535               "\x65\xA5\x6B\x03\x2C\x35\x6F\xDA"
6536               "\x8A\x19\x08\xE1\x08\x48\x59\x51"
6537               "\x53\x4B\xD1\xDF\xDA\x14\x50\x5F"
6538               "\xDF\xB5\x8C\xDF\xC6\xFD\x85\xFA"
6539               "\xD4\xF9\x64\x45\x65\x0D\x7D\xF4"
6540               "\xC8\xCD\x3F\x32\xAF\xDD\x30\xED"
6541               "\x7B\xAA\xAC\xF0\xDA\x7F\xDF\x75"
6542               "\x1C\xA4\xF1\xCB\x5E\x4F\x0B\xB4"
6543               "\x97\x73\x28\xDE\xCF\xAF\x82\xBD"
6544               "\xC4\xBA\xB4\x9C\x0D\x16\x77\x42"
6545               "\x42\x39\x7C\x53\xA4\xD4\xDD\x40"
6546               "\x5C\x60\x1F\x6E\xA7\xE2\xDC\xE7"
6547               "\x32\x0F\x05\x2F\xF2\x4C\x95\x3B"
6548               "\xF2\x79\xD9",
6549         .ilen   = 499,
6550         .result = "\x05\xEC\x77\xFB\x42\xD5\x59\x20"
6551               "\x8B\x12\x86\x69\xF0\x5B\xCF\x56"
6552               "\x39\xAD\x34\x9F\x66\xEA\x7D\xC4"
6553               "\x48\xD3\xBA\x0D\xB1\x18\xE3\x4A"
6554               "\xFE\x41\x28\x5C\x27\x8E\x11\x85"
6555               "\x6C\xF7\x5E\xC2\x55\x3C\xA0\x0B"
6556               "\x92\x65\xE9\x70\xDB\x4F\xD6\xB9"
6557               "\x00\xB4\x1F\xE6\x49\xFD\x44\x2F"
6558               "\x53\x3A\x8D\x14\x98\x63\xCA\x5D"
6559               "\xC1\xA8\x33\xA7\x0E\x91\x78\xEC"
6560               "\x77\xDE\x42\xD5\xBC\x07\x8B\x12"
6561               "\xE5\x4C\xF0\x5B\x22\x56\x39\x80"
6562               "\x6B\x9F\x66\xC9\x50\xC4\xAF\x36"
6563               "\xBA\x0D\x94\x7F\xE3\x4A\xDD\x41"
6564               "\x28\xB3\x1A\x8E\x11\xF8\x43\xF7"
6565               "\x5E\x21\x55\x3C\x87\x6E\x92\x65"
6566               "\xCC\x57\xDB\xA2\x35\xB9\x00\xEB"
6567               "\x72\xE6\x49\xD0\x44\x2F\xB6\x19"
6568               "\x8D\x14\xFF\x46\xCA\x5D\x24\xA8"
6569               "\x33\x9A\x6D\x91\x78\xC3\x77\xDE"
6570               "\xA1\x08\xBC\x07\xEE\x71\xE5\x4C"
6571               "\xD7\x5B\x22\xB5\x1C\x80\x6B\xF2"
6572               "\x45\xC9\x50\x3B\xAF\x36\x99\x60"
6573               "\x94\x7F\xC6\x4A\xDD\xA4\x0F\xB3"
6574               "\x1A\xED\x74\xF8\x43\x2A\x5E\x21"
6575               "\x88\x13\x87\x6E\xF1\x58\xCC\x57"
6576               "\x3E\xA2\x35\x9C\x67\xEB\x72\xC5"
6577               "\x49\xD0\xBB\x02\xB6\x19\xE0\x4B"
6578               "\xFF\x46\x29\x5D\x24\x8F\x16\x9A"
6579               "\x6D\xF4\x5F\xC3\xAA\x3D\xA1\x08"
6580               "\x93\x7A\xEE\x71\xD8\x4C\xD7\xBE"
6581               "\x01\xB5\x1C\xE7\x4E\xF2\x45\x2C"
6582               "\x50\x3B\x82\x15\x99\x60\xCB\x52"
6583               "\xC6\xA9\x30\xA4\x0F\x96\x79\xED"
6584               "\x74\xDF\x43\x2A\xBD\x04\x88\x13"
6585               "\xFA\x4D\xF1\x58\x23\x57\x3E\x81"
6586               "\x68\x9C\x67\xCE\x51\xC5\xAC\x37"
6587               "\xBB\x02\x95\x7C\xE0\x4B\xD2\x46"
6588               "\x29\xB0\x1B\x8F\x16\xF9\x40\xF4"
6589               "\x5F\x26\xAA\x3D\x84\x6F\x93\x7A"
6590               "\xCD\x54\xD8\xA3\x0A\xBE\x01\xE8"
6591               "\x73\xE7\x4E\xD1\x45\x2C\xB7\x1E"
6592               "\x82\x15\xFC\x47\xCB\x52\x25\xA9"
6593               "\x30\x9B\x62\x96\x79\xC0\x74\xDF"
6594               "\xA6\x09\xBD\x04\xEF\x76\xFA\x4D"
6595               "\xD4\x58\x23\x8A\x1D\x81\x68\xF3"
6596               "\x5A\xCE\x51\x38\xAC\x37\x9E\x61"
6597               "\x95\x7C\xC7\x4B\xD2\xA5\x0C\xB0"
6598               "\x1B\xE2\x75\xF9\x40\x2B\x5F\x26"
6599               "\x89\x10\x84\x6F\xF6\x59\xCD\x54"
6600               "\x3F\xA3\x0A\x9D\x64\xE8\x73\xDA"
6601               "\x4E\xD1\xB8\x03\xB7\x1E\xE1\x48"
6602               "\xFC\x47\x2E\x52\x25\x8C\x17\x9B"
6603               "\x62\xF5\x5C\xC0\xAB\x32\xA6\x09"
6604               "\x90\x7B\xEF\x76\xD9\x4D\xD4\xBF"
6605               "\x06\x8A\x1D\xE4\x4F\xF3\x5A\x2D"
6606               "\x51\x38\x83\x6A\x9E\x61\xC8\x53"
6607               "\xC7\xAE\x31\xA5\x0C\x97\x7E\xE2"
6608               "\x75\xDC\x40\x2B\xB2\x05\x89\x10"
6609               "\xFB\x42\xF6\x59\x20\x54\x3F\x86"
6610               "\x69\x9D\x64\xCF\x56\xDA\xAD\x34"
6611               "\xB8\x03\xEA\x7D\xE1\x48\xD3\x47"
6612               "\x2E\xB1\x18",
6613         .rlen   = 499,
6614         .also_non_np = 1,
6615         .np = 2,
6616         .tap    = { 499 - 16, 16 },
6617     },
6618 };
6619 
6620 /*
6621  * Blowfish test vectors.
6622  */
6623 #define BF_ENC_TEST_VECTORS 7
6624 #define BF_DEC_TEST_VECTORS 7
6625 #define BF_CBC_ENC_TEST_VECTORS 2
6626 #define BF_CBC_DEC_TEST_VECTORS 2
6627 #define BF_CTR_ENC_TEST_VECTORS 2
6628 #define BF_CTR_DEC_TEST_VECTORS 2
6629 
6630 static struct cipher_testvec bf_enc_tv_template[] = {
6631     { /* DES test vectors from OpenSSL */
6632         .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
6633         .klen   = 8,
6634         .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
6635         .ilen   = 8,
6636         .result = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
6637         .rlen   = 8,
6638     }, {
6639         .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
6640         .klen   = 8,
6641         .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
6642         .ilen   = 8,
6643         .result = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
6644         .rlen   = 8,
6645     }, {
6646         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
6647         .klen   = 8,
6648         .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6649         .ilen   = 8,
6650         .result = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
6651         .rlen   = 8,
6652     }, { /* Vary the keylength... */
6653         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6654               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
6655         .klen   = 16,
6656         .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6657         .ilen   = 8,
6658         .result = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
6659         .rlen   = 8,
6660     }, {
6661         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6662               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
6663               "\x00\x11\x22\x33\x44",
6664         .klen   = 21,
6665         .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6666         .ilen   = 8,
6667         .result = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
6668         .rlen   = 8,
6669     }, { /* Generated with bf488 */
6670         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6671               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
6672               "\x00\x11\x22\x33\x44\x55\x66\x77"
6673               "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
6674               "\x58\x40\x23\x64\x1a\xba\x61\x76"
6675               "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
6676               "\xff\xff\xff\xff\xff\xff\xff\xff",
6677         .klen   = 56,
6678         .input  = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6679         .ilen   = 8,
6680         .result = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
6681         .rlen   = 8,
6682     }, { /* Generated with Crypto++ */
6683         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
6684               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
6685               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
6686               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
6687         .klen   = 32,
6688         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
6689               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
6690               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
6691               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
6692               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
6693               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
6694               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
6695               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
6696               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
6697               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
6698               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
6699               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
6700               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
6701               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
6702               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
6703               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
6704               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
6705               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
6706               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
6707               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
6708               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
6709               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
6710               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
6711               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
6712               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
6713               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
6714               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
6715               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
6716               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
6717               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
6718               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
6719               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
6720               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
6721               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
6722               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
6723               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
6724               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
6725               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
6726               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
6727               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
6728               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
6729               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
6730               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
6731               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
6732               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
6733               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
6734               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
6735               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
6736               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
6737               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
6738               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
6739               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
6740               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
6741               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
6742               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
6743               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
6744               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
6745               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
6746               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
6747               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
6748               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
6749               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
6750               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
6751         .ilen   = 504,
6752         .result = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
6753               "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
6754               "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
6755               "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
6756               "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B"
6757               "\xD3\xB2\xD4\x61\xC7\x9F\x06\xE9"
6758               "\xCD\xF3\x88\x39\x39\x7A\xDF\x19"
6759               "\xE8\x03\x2A\x0B\x9E\xA0\x2B\x86"
6760               "\x31\xF8\x9D\xB1\xEE\x78\x9D\xB5"
6761               "\xCD\x8B\x7C\x2E\xF5\xA2\x2D\x5D"
6762               "\x6E\x66\xAF\x38\x6C\xD3\x13\xED"
6763               "\x14\xEA\x5D\xD0\x17\x77\x0F\x4A"
6764               "\x50\xF2\xD0\x0F\xC8\xF7\x1E\x7B"
6765               "\x9D\x5B\x54\x65\x4F\x16\x8A\x97"
6766               "\xF3\xF6\xD4\xAA\x87\x36\x77\x72"
6767               "\x99\x4A\xB5\x5E\x88\xC3\xCD\x7D"
6768               "\x1D\x97\xF9\x11\xBD\xE0\x1F\x1F"
6769               "\x96\x3E\x4B\x22\xF4\xC0\xE6\xB8"
6770               "\x47\x82\x98\x23\x33\x36\xBC\x1B"
6771               "\x36\xE7\xF6\xCF\x97\x37\x16\xC0"
6772               "\x87\x31\x8B\xB0\xDB\x19\x42\xA5"
6773               "\x1F\x90\x7E\x66\x34\xDD\x5E\xE9"
6774               "\x4F\xB2\x2B\x9A\xDE\xB3\x5D\x71"
6775               "\x4D\x68\xF0\xDC\xA6\xEA\xE3\x9B"
6776               "\x60\x00\x55\x57\x06\x8B\xD5\xB3"
6777               "\x86\x30\x78\xDA\x33\x9A\x9D\xCC"
6778               "\xBA\x0B\x81\x06\x77\x43\xC7\xC9"
6779               "\xDB\x37\x60\x11\x45\x59\x6D\x2D"
6780               "\x90\x3D\x65\x3E\xD0\x13\xC6\x3C"
6781               "\x0E\x78\x7D\x9A\x00\xD6\x2F\x0B"
6782               "\x3B\x53\x19\x1E\xA8\x9B\x11\xD9"
6783               "\x98\xE4\x7F\xC3\x6E\x51\x24\x70"
6784               "\x9F\x04\x9C\xC2\x9E\x44\x84\xE3"
6785               "\xE0\x8A\x44\xA2\x5C\x94\x74\x34"
6786               "\x37\x52\x7C\x03\xE8\x8E\x97\xE1"
6787               "\x5B\x5C\x0E\xB0\x70\xFE\x54\x3F"
6788               "\xD8\x65\xA9\xC5\xCD\xEC\xF4\x45"
6789               "\x55\xC5\xA7\xA3\x19\x80\x28\x51"
6790               "\xBE\x64\x4A\xC1\xD4\xE1\xBE\xEB"
6791               "\x73\x4C\xB6\xF9\x5F\x6D\x82\xBC"
6792               "\x3E\x42\x14\x49\x88\x51\xBF\x68"
6793               "\x45\x75\x27\x1B\x0A\x72\xED\xAF"
6794               "\xDA\xC4\x4D\x67\x0D\xEE\x75\xE3"
6795               "\x34\xDD\x91\x19\x42\x3A\xCB\xDA"
6796               "\x38\xFA\x3C\x93\x62\xF2\xE3\x81"
6797               "\xB3\xE4\xBB\xF6\x0D\x0B\x1D\x09"
6798               "\x9C\x52\x0D\x50\x63\xA4\xB2\xD2"
6799               "\x82\xA0\x23\x3F\x1F\xB6\xED\x6E"
6800               "\xC2\x9C\x1C\xD0\x9A\x40\xB6\xFC"
6801               "\x36\x56\x6E\x85\x73\xD7\x52\xBA"
6802               "\x35\x5E\x32\x89\x5D\x42\xF5\x36"
6803               "\x52\x8D\x46\x7D\xC8\x71\xAD\x33"
6804               "\xE1\xAF\x6A\xA8\xEC\xBA\x1C\xDC"
6805               "\xFE\x88\xE6\x16\xE4\xC8\x13\x00"
6806               "\x3C\xDA\x59\x32\x38\x19\xD5\xEB"
6807               "\xB6\x7F\x78\x45\x1B\x8E\x07\x8C"
6808               "\x66\x52\x75\xFF\xAF\xCE\x2D\x2B"
6809               "\x22\x29\xCA\xB3\x5F\x7F\xE3\x29"
6810               "\xB2\xB8\x9D\xEB\x16\xC8\xC5\x1D"
6811               "\xC9\x0D\x59\x82\x27\x57\x9D\x42"
6812               "\x54\x59\x09\xA5\x3D\xC5\x84\x68"
6813               "\x56\xEB\x36\x77\x3D\xAA\xB8\xF5"
6814               "\xC9\x1A\xFB\x5D\xDE\xBB\x43\xF4",
6815         .rlen   = 504,
6816         .also_non_np = 1,
6817         .np = 3,
6818         .tap    = { 504 - 10, 2, 8 },
6819     },
6820 };
6821 
6822 static struct cipher_testvec bf_dec_tv_template[] = {
6823     { /* DES test vectors from OpenSSL */
6824         .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
6825         .klen   = 8,
6826         .input  = "\x4e\xf9\x97\x45\x61\x98\xdd\x78",
6827         .ilen   = 8,
6828         .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
6829         .rlen   = 8,
6830     }, {
6831         .key    = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
6832         .klen   = 8,
6833         .input  = "\xa7\x90\x79\x51\x08\xea\x3c\xae",
6834         .ilen   = 8,
6835         .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
6836         .rlen   = 8,
6837     }, {
6838         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
6839         .klen   = 8,
6840         .input  = "\xe8\x7a\x24\x4e\x2c\xc8\x5e\x82",
6841         .ilen   = 8,
6842         .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6843         .rlen   = 8,
6844     }, { /* Vary the keylength... */
6845         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6846               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f",
6847         .klen   = 16,
6848         .input  = "\x93\x14\x28\x87\xee\x3b\xe1\x5c",
6849         .ilen   = 8,
6850         .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6851         .rlen   = 8,
6852     }, {
6853         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6854               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
6855               "\x00\x11\x22\x33\x44",
6856         .klen   = 21,
6857         .input  = "\xe6\xf5\x1e\xd7\x9b\x9d\xb2\x1f",
6858         .ilen   = 8,
6859         .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6860         .rlen   = 8,
6861     }, { /* Generated with bf488, using OpenSSL, Libgcrypt and Nettle */
6862         .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87"
6863               "\x78\x69\x5a\x4b\x3c\x2d\x1e\x0f"
6864               "\x00\x11\x22\x33\x44\x55\x66\x77"
6865               "\x04\x68\x91\x04\xc2\xfd\x3b\x2f"
6866               "\x58\x40\x23\x64\x1a\xba\x61\x76"
6867               "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e"
6868               "\xff\xff\xff\xff\xff\xff\xff\xff",
6869         .klen   = 56,
6870         .input  = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
6871         .ilen   = 8,
6872         .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
6873         .rlen   = 8,
6874     }, { /* Generated with Crypto++ */
6875         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
6876               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
6877               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
6878               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
6879         .klen   = 32,
6880         .input  = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
6881               "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
6882               "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
6883               "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
6884               "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B"
6885               "\xD3\xB2\xD4\x61\xC7\x9F\x06\xE9"
6886               "\xCD\xF3\x88\x39\x39\x7A\xDF\x19"
6887               "\xE8\x03\x2A\x0B\x9E\xA0\x2B\x86"
6888               "\x31\xF8\x9D\xB1\xEE\x78\x9D\xB5"
6889               "\xCD\x8B\x7C\x2E\xF5\xA2\x2D\x5D"
6890               "\x6E\x66\xAF\x38\x6C\xD3\x13\xED"
6891               "\x14\xEA\x5D\xD0\x17\x77\x0F\x4A"
6892               "\x50\xF2\xD0\x0F\xC8\xF7\x1E\x7B"
6893               "\x9D\x5B\x54\x65\x4F\x16\x8A\x97"
6894               "\xF3\xF6\xD4\xAA\x87\x36\x77\x72"
6895               "\x99\x4A\xB5\x5E\x88\xC3\xCD\x7D"
6896               "\x1D\x97\xF9\x11\xBD\xE0\x1F\x1F"
6897               "\x96\x3E\x4B\x22\xF4\xC0\xE6\xB8"
6898               "\x47\x82\x98\x23\x33\x36\xBC\x1B"
6899               "\x36\xE7\xF6\xCF\x97\x37\x16\xC0"
6900               "\x87\x31\x8B\xB0\xDB\x19\x42\xA5"
6901               "\x1F\x90\x7E\x66\x34\xDD\x5E\xE9"
6902               "\x4F\xB2\x2B\x9A\xDE\xB3\x5D\x71"
6903               "\x4D\x68\xF0\xDC\xA6\xEA\xE3\x9B"
6904               "\x60\x00\x55\x57\x06\x8B\xD5\xB3"
6905               "\x86\x30\x78\xDA\x33\x9A\x9D\xCC"
6906               "\xBA\x0B\x81\x06\x77\x43\xC7\xC9"
6907               "\xDB\x37\x60\x11\x45\x59\x6D\x2D"
6908               "\x90\x3D\x65\x3E\xD0\x13\xC6\x3C"
6909               "\x0E\x78\x7D\x9A\x00\xD6\x2F\x0B"
6910               "\x3B\x53\x19\x1E\xA8\x9B\x11\xD9"
6911               "\x98\xE4\x7F\xC3\x6E\x51\x24\x70"
6912               "\x9F\x04\x9C\xC2\x9E\x44\x84\xE3"
6913               "\xE0\x8A\x44\xA2\x5C\x94\x74\x34"
6914               "\x37\x52\x7C\x03\xE8\x8E\x97\xE1"
6915               "\x5B\x5C\x0E\xB0\x70\xFE\x54\x3F"
6916               "\xD8\x65\xA9\xC5\xCD\xEC\xF4\x45"
6917               "\x55\xC5\xA7\xA3\x19\x80\x28\x51"
6918               "\xBE\x64\x4A\xC1\xD4\xE1\xBE\xEB"
6919               "\x73\x4C\xB6\xF9\x5F\x6D\x82\xBC"
6920               "\x3E\x42\x14\x49\x88\x51\xBF\x68"
6921               "\x45\x75\x27\x1B\x0A\x72\xED\xAF"
6922               "\xDA\xC4\x4D\x67\x0D\xEE\x75\xE3"
6923               "\x34\xDD\x91\x19\x42\x3A\xCB\xDA"
6924               "\x38\xFA\x3C\x93\x62\xF2\xE3\x81"
6925               "\xB3\xE4\xBB\xF6\x0D\x0B\x1D\x09"
6926               "\x9C\x52\x0D\x50\x63\xA4\xB2\xD2"
6927               "\x82\xA0\x23\x3F\x1F\xB6\xED\x6E"
6928               "\xC2\x9C\x1C\xD0\x9A\x40\xB6\xFC"
6929               "\x36\x56\x6E\x85\x73\xD7\x52\xBA"
6930               "\x35\x5E\x32\x89\x5D\x42\xF5\x36"
6931               "\x52\x8D\x46\x7D\xC8\x71\xAD\x33"
6932               "\xE1\xAF\x6A\xA8\xEC\xBA\x1C\xDC"
6933               "\xFE\x88\xE6\x16\xE4\xC8\x13\x00"
6934               "\x3C\xDA\x59\x32\x38\x19\xD5\xEB"
6935               "\xB6\x7F\x78\x45\x1B\x8E\x07\x8C"
6936               "\x66\x52\x75\xFF\xAF\xCE\x2D\x2B"
6937               "\x22\x29\xCA\xB3\x5F\x7F\xE3\x29"
6938               "\xB2\xB8\x9D\xEB\x16\xC8\xC5\x1D"
6939               "\xC9\x0D\x59\x82\x27\x57\x9D\x42"
6940               "\x54\x59\x09\xA5\x3D\xC5\x84\x68"
6941               "\x56\xEB\x36\x77\x3D\xAA\xB8\xF5"
6942               "\xC9\x1A\xFB\x5D\xDE\xBB\x43\xF4",
6943         .ilen   = 504,
6944         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
6945               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
6946               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
6947               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
6948               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
6949               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
6950               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
6951               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
6952               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
6953               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
6954               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
6955               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
6956               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
6957               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
6958               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
6959               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
6960               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
6961               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
6962               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
6963               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
6964               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
6965               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
6966               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
6967               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
6968               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
6969               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
6970               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
6971               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
6972               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
6973               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
6974               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
6975               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
6976               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
6977               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
6978               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
6979               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
6980               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
6981               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
6982               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
6983               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
6984               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
6985               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
6986               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
6987               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
6988               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
6989               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
6990               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
6991               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
6992               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
6993               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
6994               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
6995               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
6996               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
6997               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
6998               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
6999               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7000               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7001               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7002               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7003               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7004               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7005               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7006               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7007         .rlen   = 504,
7008         .also_non_np = 1,
7009         .np = 3,
7010         .tap    = { 504 - 10, 2, 8 },
7011     },
7012 };
7013 
7014 static struct cipher_testvec bf_cbc_enc_tv_template[] = {
7015     { /* From OpenSSL */
7016         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
7017               "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
7018         .klen   = 16,
7019         .iv = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
7020         .input  = "\x37\x36\x35\x34\x33\x32\x31\x20"
7021               "\x4e\x6f\x77\x20\x69\x73\x20\x74"
7022               "\x68\x65\x20\x74\x69\x6d\x65\x20"
7023               "\x66\x6f\x72\x20\x00\x00\x00\x00",
7024         .ilen   = 32,
7025         .result = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
7026               "\x05\xb1\x56\xe2\x74\x03\x97\x93"
7027               "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
7028               "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
7029         .rlen   = 32,
7030     }, { /* Generated with Crypto++ */
7031         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7032               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7033               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7034               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7035         .klen   = 32,
7036         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7037         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7038               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7039               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7040               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7041               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7042               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7043               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7044               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7045               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7046               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7047               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7048               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7049               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7050               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7051               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7052               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7053               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7054               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7055               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7056               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7057               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7058               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7059               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7060               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7061               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7062               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7063               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7064               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7065               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7066               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7067               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7068               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7069               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7070               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7071               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7072               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7073               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7074               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7075               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7076               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7077               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7078               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7079               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7080               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7081               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7082               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7083               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7084               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7085               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7086               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7087               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7088               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7089               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7090               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7091               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7092               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7093               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7094               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7095               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7096               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7097               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7098               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7099               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7100         .ilen   = 504,
7101         .result = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
7102               "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
7103               "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
7104               "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
7105               "\x01\x9C\x93\x63\x51\x60\x82\xD2"
7106               "\x4D\xE5\xC2\xB7\xAE\x60\xD8\xAD"
7107               "\x9F\xAB\x6C\xFA\x20\x05\xDA\x6F"
7108               "\x1F\xD1\xD8\x36\x0F\xB5\x16\x69"
7109               "\x3C\xAF\xB3\x30\x18\x33\xE6\xB5"
7110               "\x43\x29\x9D\x94\xF4\x2F\x0A\x65"
7111               "\x40\xB2\xB2\xB2\x42\x89\xEE\x8A"
7112               "\x60\xD3\x52\xA8\xED\x91\xDF\xE1"
7113               "\x91\x73\x7C\x28\xA1\x14\xC3\x4C"
7114               "\x82\x72\x4B\x7D\x7D\x32\xD5\x19"
7115               "\xE8\xB8\x6B\x30\x21\x09\x0E\x27"
7116               "\x10\x9D\x2D\x3A\x6A\x4B\x7B\xE6"
7117               "\x8D\x4E\x02\x32\xFF\x7F\x8E\x13"
7118               "\xB0\x96\xF4\xC2\xA1\x60\x8A\x69"
7119               "\xEF\x0F\x86\xD0\x25\x13\x1A\x7C"
7120               "\x6E\xF0\x41\xA3\xFB\xB3\xAB\x40"
7121               "\x7D\x19\xA0\x11\x4F\x3E\x1D\x43"
7122               "\x65\xFE\x15\x40\xD0\x62\x41\x02"
7123               "\xEA\x0C\x7A\xC3\x84\xEE\xB0\xBE"
7124               "\xBE\xC8\x57\x51\xCD\x4F\xAD\x5C"
7125               "\xCC\x79\xBA\x0D\x85\x3A\xED\x6B"
7126               "\xAC\x6B\xA3\x4D\xBC\xE8\x02\x6A"
7127               "\xC2\x6D\xBD\x5E\x89\x95\x86\x43"
7128               "\x2C\x17\x4B\xC6\x40\xA2\xBD\x24"
7129               "\x04\xF0\x86\x08\x78\x18\x42\xE0"
7130               "\x39\x1B\x22\x9E\x89\x4C\x04\x6B"
7131               "\x65\xC5\xB6\x0E\xF6\x63\xFC\xD7"
7132               "\xAE\x9E\x87\x13\xCC\xD3\x1A\xEC"
7133               "\xF0\x51\xCC\x93\x68\xFC\xE9\x19"
7134               "\x7C\x4E\x9B\xCC\x17\xAD\xD2\xFC"
7135               "\x97\x18\x92\xFF\x15\x11\xCE\xED"
7136               "\x04\x41\x05\xA3\x92\xFF\x3B\xE6"
7137               "\xB6\x8C\x90\xC6\xCD\x15\xA0\x04"
7138               "\x25\x8B\x5D\x5B\x5F\xDB\xAE\x68"
7139               "\xEF\xB3\x61\x18\xDB\x83\x9B\x39"
7140               "\xCA\x82\xD1\x88\xF0\xA2\x5C\x02"
7141               "\x87\xBD\x8D\x8F\xBB\x62\xF0\x35"
7142               "\x75\x6F\x06\x81\x0A\x97\x4D\xF0"
7143               "\x43\x12\x73\x77\xDB\x91\x83\x5B"
7144               "\xE7\x3A\xA6\x07\x7B\xBF\x2C\x50"
7145               "\x94\xDE\x7B\x65\xDA\x1C\xF1\x9F"
7146               "\x7E\x12\x40\xB2\x3E\x19\x23\xF1"
7147               "\x7C\x1B\x5F\xA8\xF3\xAC\x63\x87"
7148               "\xEB\x3E\x0C\xBE\xA3\x63\x97\x88"
7149               "\x8D\x27\xC6\x2A\xF8\xF2\x67\x9A"
7150               "\x0D\x14\x16\x2B\x6F\xCB\xD4\x76"
7151               "\x14\x48\x2E\xDE\x2A\x44\x5E\x45"
7152               "\xF1\x97\x82\xEF\xB7\xAE\xED\x3A"
7153               "\xED\x73\xD3\x79\xF7\x38\x1D\xD0"
7154               "\xC5\xF8\x69\x83\x28\x84\x87\x56"
7155               "\x3F\xAE\x81\x04\x79\x1F\xD1\x09"
7156               "\xC5\xE5\x05\x0D\x64\x16\xCE\x42"
7157               "\xC5\xF8\xDB\x57\x89\x33\x22\xFC"
7158               "\xB4\xD7\x94\xB9\xF3\xCC\x02\x90"
7159               "\x02\xBA\x55\x1E\x24\x3E\x02\x1D"
7160               "\xC6\xCD\x8F\xD9\xBD\xED\xB0\x51"
7161               "\xCD\xE9\xD5\x0C\xFE\x12\x39\xA9"
7162               "\x93\x9B\xEE\xB5\x97\x41\xD2\xA0"
7163               "\xB4\x98\xD8\x6B\x74\xE7\x65\xF4",
7164         .rlen   = 504,
7165         .also_non_np = 1,
7166         .np = 3,
7167         .tap    = { 504 - 10, 2, 8 },
7168     },
7169 };
7170 
7171 static struct cipher_testvec bf_cbc_dec_tv_template[] = {
7172     { /* From OpenSSL */
7173         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
7174               "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
7175         .klen   = 16,
7176         .iv = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
7177         .input  = "\x6b\x77\xb4\xd6\x30\x06\xde\xe6"
7178               "\x05\xb1\x56\xe2\x74\x03\x97\x93"
7179               "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
7180               "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
7181         .ilen   = 32,
7182         .result = "\x37\x36\x35\x34\x33\x32\x31\x20"
7183               "\x4e\x6f\x77\x20\x69\x73\x20\x74"
7184               "\x68\x65\x20\x74\x69\x6d\x65\x20"
7185               "\x66\x6f\x72\x20\x00\x00\x00\x00",
7186         .rlen   = 32,
7187     }, { /* Generated with Crypto++ */
7188         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7189               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7190               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7191               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7192         .klen   = 32,
7193         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7194         .input  = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
7195               "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
7196               "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
7197               "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
7198               "\x01\x9C\x93\x63\x51\x60\x82\xD2"
7199               "\x4D\xE5\xC2\xB7\xAE\x60\xD8\xAD"
7200               "\x9F\xAB\x6C\xFA\x20\x05\xDA\x6F"
7201               "\x1F\xD1\xD8\x36\x0F\xB5\x16\x69"
7202               "\x3C\xAF\xB3\x30\x18\x33\xE6\xB5"
7203               "\x43\x29\x9D\x94\xF4\x2F\x0A\x65"
7204               "\x40\xB2\xB2\xB2\x42\x89\xEE\x8A"
7205               "\x60\xD3\x52\xA8\xED\x91\xDF\xE1"
7206               "\x91\x73\x7C\x28\xA1\x14\xC3\x4C"
7207               "\x82\x72\x4B\x7D\x7D\x32\xD5\x19"
7208               "\xE8\xB8\x6B\x30\x21\x09\x0E\x27"
7209               "\x10\x9D\x2D\x3A\x6A\x4B\x7B\xE6"
7210               "\x8D\x4E\x02\x32\xFF\x7F\x8E\x13"
7211               "\xB0\x96\xF4\xC2\xA1\x60\x8A\x69"
7212               "\xEF\x0F\x86\xD0\x25\x13\x1A\x7C"
7213               "\x6E\xF0\x41\xA3\xFB\xB3\xAB\x40"
7214               "\x7D\x19\xA0\x11\x4F\x3E\x1D\x43"
7215               "\x65\xFE\x15\x40\xD0\x62\x41\x02"
7216               "\xEA\x0C\x7A\xC3\x84\xEE\xB0\xBE"
7217               "\xBE\xC8\x57\x51\xCD\x4F\xAD\x5C"
7218               "\xCC\x79\xBA\x0D\x85\x3A\xED\x6B"
7219               "\xAC\x6B\xA3\x4D\xBC\xE8\x02\x6A"
7220               "\xC2\x6D\xBD\x5E\x89\x95\x86\x43"
7221               "\x2C\x17\x4B\xC6\x40\xA2\xBD\x24"
7222               "\x04\xF0\x86\x08\x78\x18\x42\xE0"
7223               "\x39\x1B\x22\x9E\x89\x4C\x04\x6B"
7224               "\x65\xC5\xB6\x0E\xF6\x63\xFC\xD7"
7225               "\xAE\x9E\x87\x13\xCC\xD3\x1A\xEC"
7226               "\xF0\x51\xCC\x93\x68\xFC\xE9\x19"
7227               "\x7C\x4E\x9B\xCC\x17\xAD\xD2\xFC"
7228               "\x97\x18\x92\xFF\x15\x11\xCE\xED"
7229               "\x04\x41\x05\xA3\x92\xFF\x3B\xE6"
7230               "\xB6\x8C\x90\xC6\xCD\x15\xA0\x04"
7231               "\x25\x8B\x5D\x5B\x5F\xDB\xAE\x68"
7232               "\xEF\xB3\x61\x18\xDB\x83\x9B\x39"
7233               "\xCA\x82\xD1\x88\xF0\xA2\x5C\x02"
7234               "\x87\xBD\x8D\x8F\xBB\x62\xF0\x35"
7235               "\x75\x6F\x06\x81\x0A\x97\x4D\xF0"
7236               "\x43\x12\x73\x77\xDB\x91\x83\x5B"
7237               "\xE7\x3A\xA6\x07\x7B\xBF\x2C\x50"
7238               "\x94\xDE\x7B\x65\xDA\x1C\xF1\x9F"
7239               "\x7E\x12\x40\xB2\x3E\x19\x23\xF1"
7240               "\x7C\x1B\x5F\xA8\xF3\xAC\x63\x87"
7241               "\xEB\x3E\x0C\xBE\xA3\x63\x97\x88"
7242               "\x8D\x27\xC6\x2A\xF8\xF2\x67\x9A"
7243               "\x0D\x14\x16\x2B\x6F\xCB\xD4\x76"
7244               "\x14\x48\x2E\xDE\x2A\x44\x5E\x45"
7245               "\xF1\x97\x82\xEF\xB7\xAE\xED\x3A"
7246               "\xED\x73\xD3\x79\xF7\x38\x1D\xD0"
7247               "\xC5\xF8\x69\x83\x28\x84\x87\x56"
7248               "\x3F\xAE\x81\x04\x79\x1F\xD1\x09"
7249               "\xC5\xE5\x05\x0D\x64\x16\xCE\x42"
7250               "\xC5\xF8\xDB\x57\x89\x33\x22\xFC"
7251               "\xB4\xD7\x94\xB9\xF3\xCC\x02\x90"
7252               "\x02\xBA\x55\x1E\x24\x3E\x02\x1D"
7253               "\xC6\xCD\x8F\xD9\xBD\xED\xB0\x51"
7254               "\xCD\xE9\xD5\x0C\xFE\x12\x39\xA9"
7255               "\x93\x9B\xEE\xB5\x97\x41\xD2\xA0"
7256               "\xB4\x98\xD8\x6B\x74\xE7\x65\xF4",
7257         .ilen   = 504,
7258         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7259               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7260               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7261               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7262               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7263               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7264               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7265               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7266               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7267               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7268               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7269               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7270               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7271               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7272               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7273               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7274               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7275               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7276               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7277               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7278               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7279               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7280               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7281               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7282               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7283               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7284               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7285               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7286               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7287               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7288               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7289               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7290               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7291               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7292               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7293               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7294               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7295               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7296               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7297               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7298               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7299               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7300               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7301               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7302               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7303               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7304               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7305               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7306               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7307               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7308               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7309               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7310               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7311               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7312               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7313               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7314               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7315               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7316               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7317               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7318               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7319               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7320               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7321         .rlen   = 504,
7322         .also_non_np = 1,
7323         .np = 3,
7324         .tap    = { 504 - 10, 2, 8 },
7325     },
7326 };
7327 
7328 static struct cipher_testvec bf_ctr_enc_tv_template[] = {
7329     { /* Generated with Crypto++ */
7330         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7331               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7332               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7333               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7334         .klen   = 32,
7335         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7336         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7337               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7338               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7339               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7340               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7341               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7342               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7343               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7344               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7345               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7346               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7347               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7348               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7349               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7350               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7351               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7352               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7353               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7354               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7355               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7356               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7357               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7358               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7359               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7360               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7361               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7362               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7363               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7364               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7365               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7366               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7367               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7368               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7369               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7370               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7371               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7372               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7373               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7374               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7375               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7376               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7377               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7378               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7379               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7380               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7381               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7382               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7383               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7384               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7385               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7386               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7387               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7388               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7389               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7390               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7391               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7392               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7393               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7394               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7395               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7396               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7397               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7398               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7399         .ilen   = 504,
7400         .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
7401               "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
7402               "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
7403               "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
7404               "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
7405               "\x3D\xA7\xE9\x0A\x5C\x70\x4D\xDE"
7406               "\x99\x38\x07\xCA\x1D\x21\xC1\x11"
7407               "\x97\xEB\x98\x75\xC4\x73\x45\x83"
7408               "\x46\x1C\x9C\x91\x87\xC1\xA0\x56"
7409               "\x98\xA1\x8B\xDB\x22\x76\xBD\x62"
7410               "\xA4\xBC\xE8\x86\xDA\xD2\x51\x13"
7411               "\x13\xD2\x96\x68\x69\x10\x67\x0C"
7412               "\xD0\x17\x25\x7C\xB2\xAE\x4F\x93"
7413               "\xA6\x82\x20\xCF\x0F\xA6\x47\x79"
7414               "\x88\x09\x40\x59\xBD\x12\x64\xB5"
7415               "\x19\x38\x0D\xFF\x86\xD9\x42\x20"
7416               "\x81\x0D\x96\x99\xAF\x22\x1F\x94"
7417               "\x5C\x6E\xEC\xEA\xA3\x39\xCB\x09"
7418               "\x43\x19\x7F\xD0\xBB\x10\xC2\x49"
7419               "\xF7\xE9\xF2\xEE\xBF\xF7\xF8\xB3"
7420               "\x0E\x1A\xF1\x8D\x70\x82\x0C\x04"
7421               "\xFD\x29\x1A\xAC\xC0\x92\x48\x34"
7422               "\x6A\xE3\x1D\x4F\xFC\x1C\x72\x6A"
7423               "\x57\xCB\xAD\xD0\x98\xAB\xB1\x01"
7424               "\x03\x6A\x45\xDD\x07\x71\x5F\x5B"
7425               "\xB5\x4A\xE4\xE5\xB9\xB9\xBC\xAC"
7426               "\x44\xF7\x41\xA4\x5F\x2E\xE9\x28"
7427               "\xE3\x05\xD2\x94\x78\x4C\x33\x1B"
7428               "\xBD\xC1\x6E\x51\xD9\xAD\xD9\x86"
7429               "\x15\x4A\x78\xAE\x7B\xAD\x3B\xBC"
7430               "\x2F\xE0\x0E\xC5\x7B\x54\x97\x5F"
7431               "\x60\x51\x14\x65\xF9\x91\xE9\xDA"
7432               "\x9A\xBC\xFC\x19\x29\x67\xAA\x63"
7433               "\x5E\xF2\x48\x88\xEB\x79\xE1\xE4"
7434               "\xF7\xF6\x4C\xA9\xE2\x8C\x3B\xE0"
7435               "\xED\x52\xAE\x90\x8F\x5B\x98\x34"
7436               "\x29\x94\x34\x7F\xF9\x6C\x1E\xB6"
7437               "\xA4\xE7\x2D\x06\x54\x9D\xC3\x02"
7438               "\xC1\x90\xA4\x72\x31\x6B\x24\x51"
7439               "\x0B\xB3\x7C\x63\x15\xBA\xAF\x5D"
7440               "\x41\xE0\x37\x6D\xBE\x41\x58\xDE"
7441               "\xF2\x07\x62\x99\xBE\xC1\x8C\x0F"
7442               "\x0F\x28\xFB\x8F\x0E\x1D\x91\xE2"
7443               "\xDA\x99\x5C\x49\xBA\x9C\xA8\x86"
7444               "\x82\x63\x11\xB3\x54\x49\x00\x08"
7445               "\x07\xF2\xE8\x1F\x34\x49\x61\xF4"
7446               "\x81\xE9\xF6\xA9\x5A\x28\x60\x1F"
7447               "\x66\x99\x08\x06\xF2\xE8\x2D\xD1"
7448               "\xD0\x67\xBA\x32\x1F\x02\x86\x7B"
7449               "\xFB\x79\x3D\xC5\xB1\x7F\x15\xAF"
7450               "\xD7\xBF\x31\x46\x22\x7F\xAE\x5B"
7451               "\x8B\x95\x47\xC2\xB1\x62\xA1\xCE"
7452               "\x52\xAC\x9C\x8B\xC2\x49\x7F\xBC"
7453               "\x9C\x89\xB8\xB6\xCA\xE3\x8F\xEA"
7454               "\xAC\xB4\x5D\xE4\x50\xDC\x3A\xB5"
7455               "\x91\x04\x94\x99\x03\x3B\x42\x6D"
7456               "\x9C\x4A\x02\xF5\xB5\x38\x98\xA8"
7457               "\x5C\x97\x2E\x4D\x79\x67\x71\xAF"
7458               "\xF0\x70\x77\xFF\x2D\xDA\xA0\x9E"
7459               "\x23\x8D\xD6\xA6\x68\x10\x78\x9A"
7460               "\x64\xBB\x15\xB8\x56\xCF\xEE\xE5"
7461               "\x32\x44\x96\x1C\xD8\xEB\x95\xD2"
7462               "\xF3\x71\xEF\xEB\x4E\xBB\x4D\x29",
7463         .rlen   = 504,
7464     }, { /* Generated with Crypto++ */
7465         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7466               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7467               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7468               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7469         .klen   = 32,
7470         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7471         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7472               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7473               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7474               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7475               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7476               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7477               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7478               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7479               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7480               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7481               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7482               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7483               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7484               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7485               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7486               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7487               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7488               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7489               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7490               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7491               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7492               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7493               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7494               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7495               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7496               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7497               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7498               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7499               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7500               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7501               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7502               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7503               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7504               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7505               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7506               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7507               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7508               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7509               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7510               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7511               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7512               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7513               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7514               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7515               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7516               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7517               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7518               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7519               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7520               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7521               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7522               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7523               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7524               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7525               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7526               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7527               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7528               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7529               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7530               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7531               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7532               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7533               "\x2B\xC2\x59\xF0\x64\xFB\x92",
7534         .ilen   = 503,
7535         .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
7536               "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
7537               "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
7538               "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
7539               "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
7540               "\x3D\xA7\xE9\x0A\x5C\x70\x4D\xDE"
7541               "\x99\x38\x07\xCA\x1D\x21\xC1\x11"
7542               "\x97\xEB\x98\x75\xC4\x73\x45\x83"
7543               "\x46\x1C\x9C\x91\x87\xC1\xA0\x56"
7544               "\x98\xA1\x8B\xDB\x22\x76\xBD\x62"
7545               "\xA4\xBC\xE8\x86\xDA\xD2\x51\x13"
7546               "\x13\xD2\x96\x68\x69\x10\x67\x0C"
7547               "\xD0\x17\x25\x7C\xB2\xAE\x4F\x93"
7548               "\xA6\x82\x20\xCF\x0F\xA6\x47\x79"
7549               "\x88\x09\x40\x59\xBD\x12\x64\xB5"
7550               "\x19\x38\x0D\xFF\x86\xD9\x42\x20"
7551               "\x81\x0D\x96\x99\xAF\x22\x1F\x94"
7552               "\x5C\x6E\xEC\xEA\xA3\x39\xCB\x09"
7553               "\x43\x19\x7F\xD0\xBB\x10\xC2\x49"
7554               "\xF7\xE9\xF2\xEE\xBF\xF7\xF8\xB3"
7555               "\x0E\x1A\xF1\x8D\x70\x82\x0C\x04"
7556               "\xFD\x29\x1A\xAC\xC0\x92\x48\x34"
7557               "\x6A\xE3\x1D\x4F\xFC\x1C\x72\x6A"
7558               "\x57\xCB\xAD\xD0\x98\xAB\xB1\x01"
7559               "\x03\x6A\x45\xDD\x07\x71\x5F\x5B"
7560               "\xB5\x4A\xE4\xE5\xB9\xB9\xBC\xAC"
7561               "\x44\xF7\x41\xA4\x5F\x2E\xE9\x28"
7562               "\xE3\x05\xD2\x94\x78\x4C\x33\x1B"
7563               "\xBD\xC1\x6E\x51\xD9\xAD\xD9\x86"
7564               "\x15\x4A\x78\xAE\x7B\xAD\x3B\xBC"
7565               "\x2F\xE0\x0E\xC5\x7B\x54\x97\x5F"
7566               "\x60\x51\x14\x65\xF9\x91\xE9\xDA"
7567               "\x9A\xBC\xFC\x19\x29\x67\xAA\x63"
7568               "\x5E\xF2\x48\x88\xEB\x79\xE1\xE4"
7569               "\xF7\xF6\x4C\xA9\xE2\x8C\x3B\xE0"
7570               "\xED\x52\xAE\x90\x8F\x5B\x98\x34"
7571               "\x29\x94\x34\x7F\xF9\x6C\x1E\xB6"
7572               "\xA4\xE7\x2D\x06\x54\x9D\xC3\x02"
7573               "\xC1\x90\xA4\x72\x31\x6B\x24\x51"
7574               "\x0B\xB3\x7C\x63\x15\xBA\xAF\x5D"
7575               "\x41\xE0\x37\x6D\xBE\x41\x58\xDE"
7576               "\xF2\x07\x62\x99\xBE\xC1\x8C\x0F"
7577               "\x0F\x28\xFB\x8F\x0E\x1D\x91\xE2"
7578               "\xDA\x99\x5C\x49\xBA\x9C\xA8\x86"
7579               "\x82\x63\x11\xB3\x54\x49\x00\x08"
7580               "\x07\xF2\xE8\x1F\x34\x49\x61\xF4"
7581               "\x81\xE9\xF6\xA9\x5A\x28\x60\x1F"
7582               "\x66\x99\x08\x06\xF2\xE8\x2D\xD1"
7583               "\xD0\x67\xBA\x32\x1F\x02\x86\x7B"
7584               "\xFB\x79\x3D\xC5\xB1\x7F\x15\xAF"
7585               "\xD7\xBF\x31\x46\x22\x7F\xAE\x5B"
7586               "\x8B\x95\x47\xC2\xB1\x62\xA1\xCE"
7587               "\x52\xAC\x9C\x8B\xC2\x49\x7F\xBC"
7588               "\x9C\x89\xB8\xB6\xCA\xE3\x8F\xEA"
7589               "\xAC\xB4\x5D\xE4\x50\xDC\x3A\xB5"
7590               "\x91\x04\x94\x99\x03\x3B\x42\x6D"
7591               "\x9C\x4A\x02\xF5\xB5\x38\x98\xA8"
7592               "\x5C\x97\x2E\x4D\x79\x67\x71\xAF"
7593               "\xF0\x70\x77\xFF\x2D\xDA\xA0\x9E"
7594               "\x23\x8D\xD6\xA6\x68\x10\x78\x9A"
7595               "\x64\xBB\x15\xB8\x56\xCF\xEE\xE5"
7596               "\x32\x44\x96\x1C\xD8\xEB\x95\xD2"
7597               "\xF3\x71\xEF\xEB\x4E\xBB\x4D",
7598         .rlen   = 503,
7599         .also_non_np = 1,
7600         .np = 2,
7601         .tap    = { 503 - 8, 8 },
7602     }, { /* Generated with Crypto++ */
7603         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7604               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7605               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7606               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7607         .klen   = 32,
7608         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
7609         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7610               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7611               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7612               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7613               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7614               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7615               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7616               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7617               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7618               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7619               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7620               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7621               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7622               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7623               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7624               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7625               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7626               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7627               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7628               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7629               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7630               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7631               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7632               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7633               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7634               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7635               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7636               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7637               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7638               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7639               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7640               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7641               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7642               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7643               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7644               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7645               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7646               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7647               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7648               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7649               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7650               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7651               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7652               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7653               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7654               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7655               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7656               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7657               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7658               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7659               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7660               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7661               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7662               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7663               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7664               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7665               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7666               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7667               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7668               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7669               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7670               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7671               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7672         .ilen   = 504,
7673         .result = "\x5F\x58\x6E\x60\x51\x6E\xDC\x3D"
7674               "\xD1\xBB\xF7\xB7\xFD\x04\x44\x82"
7675               "\xDC\x9F\x4B\x02\xF1\xD2\x5A\x6F"
7676               "\x25\xF9\x27\x21\xF2\xD2\x9A\x01"
7677               "\xBD\xAD\x3D\x93\x87\xCA\x0D\xFE"
7678               "\xB7\x2C\x17\x1F\x42\x8C\x13\xB2"
7679               "\x62\x44\x72\xB9\x5D\xC0\xF8\x37"
7680               "\xDF\xEA\x78\x81\x8F\xA6\x34\xB2"
7681               "\x07\x09\x7C\xB9\x3A\xA0\x2B\x18"
7682               "\x34\x6A\x9D\x3D\xA5\xEB\xF4\x60"
7683               "\xF8\x98\xA2\x39\x81\x23\x6C\xA9"
7684               "\x70\xCA\xCC\x45\xD8\x1F\xDF\x44"
7685               "\x2A\x67\x7A\x88\x28\xDC\x36\x83"
7686               "\x18\xD7\x48\x43\x17\x2B\x1B\xE6"
7687               "\x0B\x82\x59\x14\x26\x67\x08\x09"
7688               "\x5B\x5D\x38\xD0\x81\xCE\x54\x2A"
7689               "\xCD\x22\x94\x42\xF5\xBA\x74\x7E"
7690               "\xD9\x00\x40\xA9\x0D\x0B\xBD\x8E"
7691               "\xC4\x8E\x5E\x17\x8F\x48\xE2\xB8"
7692               "\xF4\xCC\x19\x76\xAB\x48\x29\xAA"
7693               "\x81\xD5\xCE\xD5\x8A\x3B\xC9\x21"
7694               "\xEF\x50\x4F\x04\x02\xBF\xE1\x1F"
7695               "\x59\x28\x1A\xE4\x18\x16\xA0\x29"
7696               "\xBF\x34\xA9\x2D\x28\x83\xC0\x5E"
7697               "\xEA\x44\xC4\x6E\xAB\x24\x79\x9D"
7698               "\x2D\xA1\xE8\x55\xCA\x74\xFC\xBD"
7699               "\xFE\xDD\xDA\xA5\xFB\x34\x90\x31"
7700               "\x0E\x62\x28\x9B\xDC\xD7\xA1\xBB"
7701               "\xF0\x1A\xB3\xE2\xD0\xFA\xBD\xE8"
7702               "\x5C\x5A\x10\x67\xF6\x6A\x17\x3F"
7703               "\xC5\xE9\x09\x08\xDD\x22\x77\x42"
7704               "\x26\x6A\x6A\x7A\x3F\x87\x80\x0C"
7705               "\xF0\xFF\x15\x8E\x84\x86\xC0\x10"
7706               "\x0F\x8D\x33\x06\xB8\x72\xA4\x47"
7707               "\x6B\xED\x2E\x05\x94\x6C\x5C\x5B"
7708               "\x13\xF6\x77\xEE\x3B\x16\xDF\xC2"
7709               "\x63\x66\x07\x6D\x3F\x6C\x51\x7C"
7710               "\x1C\xAC\x80\xB6\x58\x48\xB7\x9D"
7711               "\xB4\x19\xD8\x19\x45\x66\x27\x02"
7712               "\xA1\xA9\x99\xF3\x1F\xE5\xA7\x1D"
7713               "\x31\xE7\x1B\x0D\xFF\xBB\xB5\xA1"
7714               "\xF5\x9C\x45\x1E\x18\x19\xA1\xE7"
7715               "\xC2\xF1\xBF\x68\xC3\xEC\xCF\x53"
7716               "\x67\xA6\x2B\x7D\x3C\x6D\x24\xC3"
7717               "\xE8\xE6\x07\x5A\x09\xE0\x32\xA8"
7718               "\x52\xF6\xE9\xED\x0E\xC6\x0A\x6A"
7719               "\xFC\x60\x2A\xE0\x93\xCE\xB8\x2E"
7720               "\xA2\xA8\x0E\x79\x9E\x34\x5D\x37"
7721               "\x6F\x12\xFE\x48\x7B\xE7\xB9\x22"
7722               "\x29\xE8\xD7\xBE\x5D\xD1\x8B\xD9"
7723               "\x91\x51\x4E\x71\xF2\x98\x85\x16"
7724               "\x25\x7A\x76\x8A\x51\x0E\x65\x14"
7725               "\x81\xB5\x3A\x37\xFD\xEC\xB5\x8A"
7726               "\xE1\xCF\x41\x72\x14\x29\x4C\xF0"
7727               "\x20\xD9\x9A\xC5\x66\xA4\x03\x76"
7728               "\x5B\xA4\x15\x4F\x0E\x64\x39\x40"
7729               "\x25\xF9\x20\x22\xF5\x88\xF5\xBA"
7730               "\xE4\xDF\x45\x61\xBF\x8D\x7A\x24"
7731               "\x4B\x92\x71\xD9\x2F\x77\xA7\x95"
7732               "\xA8\x7F\x61\xD5\xA4\x57\xB0\xFB"
7733               "\xB5\x77\xBA\x1C\xEE\x71\xFA\xB0"
7734               "\x16\x4C\x18\x6B\xF2\x69\xA0\x07"
7735               "\xEF\xBE\xEC\x69\xAC\xA8\x63\x9E",
7736         .rlen   = 504,
7737     },
7738 };
7739 
7740 static struct cipher_testvec bf_ctr_dec_tv_template[] = {
7741     { /* Generated with Crypto++ */
7742         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7743               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7744               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7745               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7746         .klen   = 32,
7747         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7748         .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
7749               "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
7750               "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
7751               "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
7752               "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
7753               "\x3D\xA7\xE9\x0A\x5C\x70\x4D\xDE"
7754               "\x99\x38\x07\xCA\x1D\x21\xC1\x11"
7755               "\x97\xEB\x98\x75\xC4\x73\x45\x83"
7756               "\x46\x1C\x9C\x91\x87\xC1\xA0\x56"
7757               "\x98\xA1\x8B\xDB\x22\x76\xBD\x62"
7758               "\xA4\xBC\xE8\x86\xDA\xD2\x51\x13"
7759               "\x13\xD2\x96\x68\x69\x10\x67\x0C"
7760               "\xD0\x17\x25\x7C\xB2\xAE\x4F\x93"
7761               "\xA6\x82\x20\xCF\x0F\xA6\x47\x79"
7762               "\x88\x09\x40\x59\xBD\x12\x64\xB5"
7763               "\x19\x38\x0D\xFF\x86\xD9\x42\x20"
7764               "\x81\x0D\x96\x99\xAF\x22\x1F\x94"
7765               "\x5C\x6E\xEC\xEA\xA3\x39\xCB\x09"
7766               "\x43\x19\x7F\xD0\xBB\x10\xC2\x49"
7767               "\xF7\xE9\xF2\xEE\xBF\xF7\xF8\xB3"
7768               "\x0E\x1A\xF1\x8D\x70\x82\x0C\x04"
7769               "\xFD\x29\x1A\xAC\xC0\x92\x48\x34"
7770               "\x6A\xE3\x1D\x4F\xFC\x1C\x72\x6A"
7771               "\x57\xCB\xAD\xD0\x98\xAB\xB1\x01"
7772               "\x03\x6A\x45\xDD\x07\x71\x5F\x5B"
7773               "\xB5\x4A\xE4\xE5\xB9\xB9\xBC\xAC"
7774               "\x44\xF7\x41\xA4\x5F\x2E\xE9\x28"
7775               "\xE3\x05\xD2\x94\x78\x4C\x33\x1B"
7776               "\xBD\xC1\x6E\x51\xD9\xAD\xD9\x86"
7777               "\x15\x4A\x78\xAE\x7B\xAD\x3B\xBC"
7778               "\x2F\xE0\x0E\xC5\x7B\x54\x97\x5F"
7779               "\x60\x51\x14\x65\xF9\x91\xE9\xDA"
7780               "\x9A\xBC\xFC\x19\x29\x67\xAA\x63"
7781               "\x5E\xF2\x48\x88\xEB\x79\xE1\xE4"
7782               "\xF7\xF6\x4C\xA9\xE2\x8C\x3B\xE0"
7783               "\xED\x52\xAE\x90\x8F\x5B\x98\x34"
7784               "\x29\x94\x34\x7F\xF9\x6C\x1E\xB6"
7785               "\xA4\xE7\x2D\x06\x54\x9D\xC3\x02"
7786               "\xC1\x90\xA4\x72\x31\x6B\x24\x51"
7787               "\x0B\xB3\x7C\x63\x15\xBA\xAF\x5D"
7788               "\x41\xE0\x37\x6D\xBE\x41\x58\xDE"
7789               "\xF2\x07\x62\x99\xBE\xC1\x8C\x0F"
7790               "\x0F\x28\xFB\x8F\x0E\x1D\x91\xE2"
7791               "\xDA\x99\x5C\x49\xBA\x9C\xA8\x86"
7792               "\x82\x63\x11\xB3\x54\x49\x00\x08"
7793               "\x07\xF2\xE8\x1F\x34\x49\x61\xF4"
7794               "\x81\xE9\xF6\xA9\x5A\x28\x60\x1F"
7795               "\x66\x99\x08\x06\xF2\xE8\x2D\xD1"
7796               "\xD0\x67\xBA\x32\x1F\x02\x86\x7B"
7797               "\xFB\x79\x3D\xC5\xB1\x7F\x15\xAF"
7798               "\xD7\xBF\x31\x46\x22\x7F\xAE\x5B"
7799               "\x8B\x95\x47\xC2\xB1\x62\xA1\xCE"
7800               "\x52\xAC\x9C\x8B\xC2\x49\x7F\xBC"
7801               "\x9C\x89\xB8\xB6\xCA\xE3\x8F\xEA"
7802               "\xAC\xB4\x5D\xE4\x50\xDC\x3A\xB5"
7803               "\x91\x04\x94\x99\x03\x3B\x42\x6D"
7804               "\x9C\x4A\x02\xF5\xB5\x38\x98\xA8"
7805               "\x5C\x97\x2E\x4D\x79\x67\x71\xAF"
7806               "\xF0\x70\x77\xFF\x2D\xDA\xA0\x9E"
7807               "\x23\x8D\xD6\xA6\x68\x10\x78\x9A"
7808               "\x64\xBB\x15\xB8\x56\xCF\xEE\xE5"
7809               "\x32\x44\x96\x1C\xD8\xEB\x95\xD2"
7810               "\xF3\x71\xEF\xEB\x4E\xBB\x4D\x29",
7811         .ilen   = 504,
7812         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7813               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7814               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7815               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7816               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7817               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7818               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7819               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7820               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7821               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7822               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7823               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7824               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7825               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7826               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7827               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7828               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7829               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7830               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7831               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7832               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7833               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7834               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7835               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7836               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7837               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7838               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7839               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7840               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7841               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7842               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7843               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7844               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7845               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7846               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7847               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7848               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7849               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7850               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7851               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7852               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7853               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7854               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7855               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7856               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7857               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7858               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7859               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7860               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7861               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7862               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7863               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7864               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7865               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7866               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7867               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7868               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7869               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7870               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7871               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7872               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7873               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
7874               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
7875         .rlen   = 504,
7876     }, { /* Generated with Crypto++ */
7877         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7878               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7879               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7880               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7881         .klen   = 32,
7882         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
7883         .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
7884               "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
7885               "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
7886               "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
7887               "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
7888               "\x3D\xA7\xE9\x0A\x5C\x70\x4D\xDE"
7889               "\x99\x38\x07\xCA\x1D\x21\xC1\x11"
7890               "\x97\xEB\x98\x75\xC4\x73\x45\x83"
7891               "\x46\x1C\x9C\x91\x87\xC1\xA0\x56"
7892               "\x98\xA1\x8B\xDB\x22\x76\xBD\x62"
7893               "\xA4\xBC\xE8\x86\xDA\xD2\x51\x13"
7894               "\x13\xD2\x96\x68\x69\x10\x67\x0C"
7895               "\xD0\x17\x25\x7C\xB2\xAE\x4F\x93"
7896               "\xA6\x82\x20\xCF\x0F\xA6\x47\x79"
7897               "\x88\x09\x40\x59\xBD\x12\x64\xB5"
7898               "\x19\x38\x0D\xFF\x86\xD9\x42\x20"
7899               "\x81\x0D\x96\x99\xAF\x22\x1F\x94"
7900               "\x5C\x6E\xEC\xEA\xA3\x39\xCB\x09"
7901               "\x43\x19\x7F\xD0\xBB\x10\xC2\x49"
7902               "\xF7\xE9\xF2\xEE\xBF\xF7\xF8\xB3"
7903               "\x0E\x1A\xF1\x8D\x70\x82\x0C\x04"
7904               "\xFD\x29\x1A\xAC\xC0\x92\x48\x34"
7905               "\x6A\xE3\x1D\x4F\xFC\x1C\x72\x6A"
7906               "\x57\xCB\xAD\xD0\x98\xAB\xB1\x01"
7907               "\x03\x6A\x45\xDD\x07\x71\x5F\x5B"
7908               "\xB5\x4A\xE4\xE5\xB9\xB9\xBC\xAC"
7909               "\x44\xF7\x41\xA4\x5F\x2E\xE9\x28"
7910               "\xE3\x05\xD2\x94\x78\x4C\x33\x1B"
7911               "\xBD\xC1\x6E\x51\xD9\xAD\xD9\x86"
7912               "\x15\x4A\x78\xAE\x7B\xAD\x3B\xBC"
7913               "\x2F\xE0\x0E\xC5\x7B\x54\x97\x5F"
7914               "\x60\x51\x14\x65\xF9\x91\xE9\xDA"
7915               "\x9A\xBC\xFC\x19\x29\x67\xAA\x63"
7916               "\x5E\xF2\x48\x88\xEB\x79\xE1\xE4"
7917               "\xF7\xF6\x4C\xA9\xE2\x8C\x3B\xE0"
7918               "\xED\x52\xAE\x90\x8F\x5B\x98\x34"
7919               "\x29\x94\x34\x7F\xF9\x6C\x1E\xB6"
7920               "\xA4\xE7\x2D\x06\x54\x9D\xC3\x02"
7921               "\xC1\x90\xA4\x72\x31\x6B\x24\x51"
7922               "\x0B\xB3\x7C\x63\x15\xBA\xAF\x5D"
7923               "\x41\xE0\x37\x6D\xBE\x41\x58\xDE"
7924               "\xF2\x07\x62\x99\xBE\xC1\x8C\x0F"
7925               "\x0F\x28\xFB\x8F\x0E\x1D\x91\xE2"
7926               "\xDA\x99\x5C\x49\xBA\x9C\xA8\x86"
7927               "\x82\x63\x11\xB3\x54\x49\x00\x08"
7928               "\x07\xF2\xE8\x1F\x34\x49\x61\xF4"
7929               "\x81\xE9\xF6\xA9\x5A\x28\x60\x1F"
7930               "\x66\x99\x08\x06\xF2\xE8\x2D\xD1"
7931               "\xD0\x67\xBA\x32\x1F\x02\x86\x7B"
7932               "\xFB\x79\x3D\xC5\xB1\x7F\x15\xAF"
7933               "\xD7\xBF\x31\x46\x22\x7F\xAE\x5B"
7934               "\x8B\x95\x47\xC2\xB1\x62\xA1\xCE"
7935               "\x52\xAC\x9C\x8B\xC2\x49\x7F\xBC"
7936               "\x9C\x89\xB8\xB6\xCA\xE3\x8F\xEA"
7937               "\xAC\xB4\x5D\xE4\x50\xDC\x3A\xB5"
7938               "\x91\x04\x94\x99\x03\x3B\x42\x6D"
7939               "\x9C\x4A\x02\xF5\xB5\x38\x98\xA8"
7940               "\x5C\x97\x2E\x4D\x79\x67\x71\xAF"
7941               "\xF0\x70\x77\xFF\x2D\xDA\xA0\x9E"
7942               "\x23\x8D\xD6\xA6\x68\x10\x78\x9A"
7943               "\x64\xBB\x15\xB8\x56\xCF\xEE\xE5"
7944               "\x32\x44\x96\x1C\xD8\xEB\x95\xD2"
7945               "\xF3\x71\xEF\xEB\x4E\xBB\x4D",
7946         .ilen   = 503,
7947         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7948               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7949               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7950               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7951               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7952               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7953               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7954               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7955               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7956               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7957               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7958               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7959               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7960               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7961               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7962               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7963               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7964               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7965               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7966               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7967               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7968               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7969               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7970               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7971               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7972               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7973               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7974               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7975               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7976               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7977               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7978               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7979               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7980               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7981               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7982               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7983               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7984               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7985               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7986               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7987               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7988               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7989               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7990               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7991               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7992               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7993               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7994               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7995               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7996               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7997               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7998               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7999               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8000               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8001               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8002               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8003               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8004               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8005               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8006               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8007               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8008               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
8009               "\x2B\xC2\x59\xF0\x64\xFB\x92",
8010         .rlen   = 503,
8011         .also_non_np = 1,
8012         .np = 2,
8013         .tap    = { 503 - 8, 8 },
8014     }, { /* Generated with Crypto++ */
8015         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8016               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8017               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8018               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8019         .klen   = 32,
8020         .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
8021         .input  = "\x5F\x58\x6E\x60\x51\x6E\xDC\x3D"
8022               "\xD1\xBB\xF7\xB7\xFD\x04\x44\x82"
8023               "\xDC\x9F\x4B\x02\xF1\xD2\x5A\x6F"
8024               "\x25\xF9\x27\x21\xF2\xD2\x9A\x01"
8025               "\xBD\xAD\x3D\x93\x87\xCA\x0D\xFE"
8026               "\xB7\x2C\x17\x1F\x42\x8C\x13\xB2"
8027               "\x62\x44\x72\xB9\x5D\xC0\xF8\x37"
8028               "\xDF\xEA\x78\x81\x8F\xA6\x34\xB2"
8029               "\x07\x09\x7C\xB9\x3A\xA0\x2B\x18"
8030               "\x34\x6A\x9D\x3D\xA5\xEB\xF4\x60"
8031               "\xF8\x98\xA2\x39\x81\x23\x6C\xA9"
8032               "\x70\xCA\xCC\x45\xD8\x1F\xDF\x44"
8033               "\x2A\x67\x7A\x88\x28\xDC\x36\x83"
8034               "\x18\xD7\x48\x43\x17\x2B\x1B\xE6"
8035               "\x0B\x82\x59\x14\x26\x67\x08\x09"
8036               "\x5B\x5D\x38\xD0\x81\xCE\x54\x2A"
8037               "\xCD\x22\x94\x42\xF5\xBA\x74\x7E"
8038               "\xD9\x00\x40\xA9\x0D\x0B\xBD\x8E"
8039               "\xC4\x8E\x5E\x17\x8F\x48\xE2\xB8"
8040               "\xF4\xCC\x19\x76\xAB\x48\x29\xAA"
8041               "\x81\xD5\xCE\xD5\x8A\x3B\xC9\x21"
8042               "\xEF\x50\x4F\x04\x02\xBF\xE1\x1F"
8043               "\x59\x28\x1A\xE4\x18\x16\xA0\x29"
8044               "\xBF\x34\xA9\x2D\x28\x83\xC0\x5E"
8045               "\xEA\x44\xC4\x6E\xAB\x24\x79\x9D"
8046               "\x2D\xA1\xE8\x55\xCA\x74\xFC\xBD"
8047               "\xFE\xDD\xDA\xA5\xFB\x34\x90\x31"
8048               "\x0E\x62\x28\x9B\xDC\xD7\xA1\xBB"
8049               "\xF0\x1A\xB3\xE2\xD0\xFA\xBD\xE8"
8050               "\x5C\x5A\x10\x67\xF6\x6A\x17\x3F"
8051               "\xC5\xE9\x09\x08\xDD\x22\x77\x42"
8052               "\x26\x6A\x6A\x7A\x3F\x87\x80\x0C"
8053               "\xF0\xFF\x15\x8E\x84\x86\xC0\x10"
8054               "\x0F\x8D\x33\x06\xB8\x72\xA4\x47"
8055               "\x6B\xED\x2E\x05\x94\x6C\x5C\x5B"
8056               "\x13\xF6\x77\xEE\x3B\x16\xDF\xC2"
8057               "\x63\x66\x07\x6D\x3F\x6C\x51\x7C"
8058               "\x1C\xAC\x80\xB6\x58\x48\xB7\x9D"
8059               "\xB4\x19\xD8\x19\x45\x66\x27\x02"
8060               "\xA1\xA9\x99\xF3\x1F\xE5\xA7\x1D"
8061               "\x31\xE7\x1B\x0D\xFF\xBB\xB5\xA1"
8062               "\xF5\x9C\x45\x1E\x18\x19\xA1\xE7"
8063               "\xC2\xF1\xBF\x68\xC3\xEC\xCF\x53"
8064               "\x67\xA6\x2B\x7D\x3C\x6D\x24\xC3"
8065               "\xE8\xE6\x07\x5A\x09\xE0\x32\xA8"
8066               "\x52\xF6\xE9\xED\x0E\xC6\x0A\x6A"
8067               "\xFC\x60\x2A\xE0\x93\xCE\xB8\x2E"
8068               "\xA2\xA8\x0E\x79\x9E\x34\x5D\x37"
8069               "\x6F\x12\xFE\x48\x7B\xE7\xB9\x22"
8070               "\x29\xE8\xD7\xBE\x5D\xD1\x8B\xD9"
8071               "\x91\x51\x4E\x71\xF2\x98\x85\x16"
8072               "\x25\x7A\x76\x8A\x51\x0E\x65\x14"
8073               "\x81\xB5\x3A\x37\xFD\xEC\xB5\x8A"
8074               "\xE1\xCF\x41\x72\x14\x29\x4C\xF0"
8075               "\x20\xD9\x9A\xC5\x66\xA4\x03\x76"
8076               "\x5B\xA4\x15\x4F\x0E\x64\x39\x40"
8077               "\x25\xF9\x20\x22\xF5\x88\xF5\xBA"
8078               "\xE4\xDF\x45\x61\xBF\x8D\x7A\x24"
8079               "\x4B\x92\x71\xD9\x2F\x77\xA7\x95"
8080               "\xA8\x7F\x61\xD5\xA4\x57\xB0\xFB"
8081               "\xB5\x77\xBA\x1C\xEE\x71\xFA\xB0"
8082               "\x16\x4C\x18\x6B\xF2\x69\xA0\x07"
8083               "\xEF\xBE\xEC\x69\xAC\xA8\x63\x9E",
8084         .ilen   = 504,
8085         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8086               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8087               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8088               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8089               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8090               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8091               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8092               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8093               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8094               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8095               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8096               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8097               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8098               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8099               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8100               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8101               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8102               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8103               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8104               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8105               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8106               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8107               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8108               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8109               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8110               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8111               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8112               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8113               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8114               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8115               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8116               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8117               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8118               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8119               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8120               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8121               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8122               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8123               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8124               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8125               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8126               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8127               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8128               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8129               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8130               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8131               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8132               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8133               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8134               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8135               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8136               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8137               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8138               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8139               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8140               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8141               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8142               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8143               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8144               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8145               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8146               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
8147               "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
8148         .rlen   = 504,
8149     },
8150 };
8151 
8152 /*
8153  * Twofish test vectors.
8154  */
8155 #define TF_ENC_TEST_VECTORS     4
8156 #define TF_DEC_TEST_VECTORS     4
8157 #define TF_CBC_ENC_TEST_VECTORS     5
8158 #define TF_CBC_DEC_TEST_VECTORS     5
8159 #define TF_CTR_ENC_TEST_VECTORS     2
8160 #define TF_CTR_DEC_TEST_VECTORS     2
8161 #define TF_LRW_ENC_TEST_VECTORS     8
8162 #define TF_LRW_DEC_TEST_VECTORS     8
8163 #define TF_XTS_ENC_TEST_VECTORS     5
8164 #define TF_XTS_DEC_TEST_VECTORS     5
8165 
8166 static struct cipher_testvec tf_enc_tv_template[] = {
8167     {
8168         .key    = zeroed_string,
8169         .klen   = 16,
8170         .input  = zeroed_string,
8171         .ilen   = 16,
8172         .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
8173               "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
8174         .rlen   = 16,
8175     }, {
8176         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
8177               "\xfe\xdc\xba\x98\x76\x54\x32\x10"
8178               "\x00\x11\x22\x33\x44\x55\x66\x77",
8179         .klen   = 24,
8180         .input  = zeroed_string,
8181         .ilen   = 16,
8182         .result = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
8183               "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
8184         .rlen   = 16,
8185     }, {
8186         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
8187               "\xfe\xdc\xba\x98\x76\x54\x32\x10"
8188               "\x00\x11\x22\x33\x44\x55\x66\x77"
8189               "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8190         .klen   = 32,
8191         .input  = zeroed_string,
8192         .ilen   = 16,
8193         .result = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
8194               "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
8195         .rlen   = 16,
8196     }, { /* Generated with Crypto++ */
8197         .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
8198               "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
8199               "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
8200               "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
8201         .klen   = 32,
8202         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8203               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8204               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8205               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8206               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8207               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8208               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8209               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8210               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8211               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8212               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8213               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8214               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8215               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8216               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8217               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8218               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8219               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8220               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8221               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8222               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8223               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8224               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8225               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8226               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8227               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8228               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8229               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8230               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8231               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8232               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8233               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8234               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8235               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8236               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8237               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8238               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8239               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8240               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8241               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8242               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8243               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8244               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8245               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8246               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8247               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8248               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8249               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8250               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8251               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8252               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8253               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8254               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8255               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8256               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8257               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8258               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8259               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8260               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8261               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8262               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8263               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8264         .ilen   = 496,
8265         .result = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
8266               "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
8267               "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
8268               "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
8269               "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
8270               "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
8271               "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
8272               "\x89\xF6\x82\xF0\xD3\xDB\x06\x02"
8273               "\xB5\x11\x5C\x5E\x79\x1A\xAC\x43"
8274               "\x5C\xC0\x30\x4B\x6B\x16\xA1\x40"
8275               "\x80\x27\x88\xBA\x2C\x74\x42\xE0"
8276               "\x1B\xA5\x85\x08\xB9\xE6\x22\x7A"
8277               "\x36\x3B\x0D\x9F\xA0\x22\x6C\x2A"
8278               "\x91\x75\x47\xBC\x67\x21\x4E\xF9"
8279               "\xEA\xFF\xD9\xD5\xC0\xFC\x9E\x2C"
8280               "\x3E\xAD\xC6\x61\x0E\x93\x7A\x22"
8281               "\x09\xC8\x8D\xC1\x8E\xB4\x8B\x5C"
8282               "\xC6\x24\x42\xB8\x23\x66\x80\xA9"
8283               "\x32\x0B\x7A\x29\xBF\xB3\x0B\x63"
8284               "\x43\x27\x13\xA9\xBE\xEB\xBD\xF3"
8285               "\x33\x62\x70\xE2\x1B\x86\x7A\xA1"
8286               "\x51\x4A\x16\xFE\x29\x63\x7E\xD0"
8287               "\x7A\xA4\x6E\x2C\xF8\xC1\xDB\xE8"
8288               "\xCB\x4D\xD2\x8C\x04\x14\xB4\x66"
8289               "\x41\xB7\x3A\x96\x16\x7C\x1D\x5B"
8290               "\xB6\x41\x42\x64\x43\xEE\x6E\x7C"
8291               "\x8B\xAF\x01\x9C\xA4\x6E\x75\x8F"
8292               "\xDE\x10\x9F\xA6\xE7\xD6\x44\x97"
8293               "\x66\xA3\x96\x0F\x1C\x25\x60\xF5"
8294               "\x3C\x2E\x32\x69\x0E\x82\xFF\x27"
8295               "\x0F\xB5\x06\xDA\xD8\x31\x15\x6C"
8296               "\xDF\x18\x6C\x87\xF5\x3B\x11\x9A"
8297               "\x1B\x42\x1F\x5B\x29\x19\x96\x13"
8298               "\x68\x2E\x5E\x08\x1C\x8F\x32\x4B"
8299               "\x81\x77\x6D\xF4\xA0\x01\x42\xEC"
8300               "\xDD\x5B\xFD\x3A\x8E\x6A\x14\xFB"
8301               "\x83\x54\xDF\x0F\x86\xB7\xEA\x40"
8302               "\x46\x39\xF7\x2A\x89\x8D\x4E\x96"
8303               "\x5F\x5F\x6D\x76\xC6\x13\x9D\x3D"
8304               "\x1D\x5F\x0C\x7D\xE2\xBC\xC2\x16"
8305               "\x16\xBE\x89\x3E\xB0\x61\xA2\x5D"
8306               "\xAF\xD1\x40\x5F\x1A\xB8\x26\x41"
8307               "\xC6\xBD\x36\xEF\xED\x29\x50\x6D"
8308               "\x10\xEF\x26\xE8\xA8\x93\x11\x3F"
8309               "\x2D\x1F\x88\x20\x77\x45\xF5\x66"
8310               "\x08\xB9\xF1\xEF\xB1\x93\xA8\x81"
8311               "\x65\xC5\xCD\x3E\x8C\x06\x60\x2C"
8312               "\xB2\x10\x7A\xCA\x05\x25\x59\xDB"
8313               "\xC7\x28\xF5\x20\x35\x52\x9E\x62"
8314               "\xF8\x88\x24\x1C\x4D\x84\x12\x39"
8315               "\x39\xE4\x2E\xF4\xD4\x9D\x2B\xBC"
8316               "\x87\x66\xE6\xC0\x6B\x31\x9A\x66"
8317               "\x03\xDC\x95\xD8\x6B\xD0\x30\x8F"
8318               "\xDF\x8F\x8D\xFA\xEC\x1F\x08\xBD"
8319               "\xA3\x63\xE2\x71\x4F\x03\x94\x87"
8320               "\x50\xDF\x15\x1F\xED\x3A\xA3\x7F"
8321               "\x1F\x2A\xB5\xA1\x69\xAC\x4B\x0D"
8322               "\x84\x9B\x2A\xE9\x55\xDD\x46\x91"
8323               "\x15\x33\xF3\x2B\x9B\x46\x97\x00"
8324               "\xF0\x29\xD8\x59\x5D\x33\x37\xF9"
8325               "\x58\x33\x9B\x78\xC7\x58\x48\x6B"
8326               "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5",
8327         .rlen   = 496,
8328         .also_non_np = 1,
8329         .np = 3,
8330         .tap    = { 496 - 20, 4, 16 },
8331     },
8332 };
8333 
8334 static struct cipher_testvec tf_dec_tv_template[] = {
8335     {
8336         .key    = zeroed_string,
8337         .klen   = 16,
8338         .input  = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
8339               "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
8340         .ilen   = 16,
8341         .result = zeroed_string,
8342         .rlen   = 16,
8343     }, {
8344         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
8345               "\xfe\xdc\xba\x98\x76\x54\x32\x10"
8346               "\x00\x11\x22\x33\x44\x55\x66\x77",
8347         .klen   = 24,
8348         .input  = "\xcf\xd1\xd2\xe5\xa9\xbe\x9c\xdf"
8349               "\x50\x1f\x13\xb8\x92\xbd\x22\x48",
8350         .ilen   = 16,
8351         .result = zeroed_string,
8352         .rlen   = 16,
8353     }, {
8354         .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
8355               "\xfe\xdc\xba\x98\x76\x54\x32\x10"
8356               "\x00\x11\x22\x33\x44\x55\x66\x77"
8357               "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
8358         .klen   = 32,
8359         .input  = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
8360               "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
8361         .ilen   = 16,
8362         .result = zeroed_string,
8363         .rlen   = 16,
8364     }, { /* Generated with Crypto++ */
8365         .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
8366               "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
8367               "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
8368               "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
8369         .klen   = 32,
8370         .input  = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
8371               "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
8372               "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
8373               "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
8374               "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
8375               "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
8376               "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
8377               "\x89\xF6\x82\xF0\xD3\xDB\x06\x02"
8378               "\xB5\x11\x5C\x5E\x79\x1A\xAC\x43"
8379               "\x5C\xC0\x30\x4B\x6B\x16\xA1\x40"
8380               "\x80\x27\x88\xBA\x2C\x74\x42\xE0"
8381               "\x1B\xA5\x85\x08\xB9\xE6\x22\x7A"
8382               "\x36\x3B\x0D\x9F\xA0\x22\x6C\x2A"
8383               "\x91\x75\x47\xBC\x67\x21\x4E\xF9"
8384               "\xEA\xFF\xD9\xD5\xC0\xFC\x9E\x2C"
8385               "\x3E\xAD\xC6\x61\x0E\x93\x7A\x22"
8386               "\x09\xC8\x8D\xC1\x8E\xB4\x8B\x5C"
8387               "\xC6\x24\x42\xB8\x23\x66\x80\xA9"
8388               "\x32\x0B\x7A\x29\xBF\xB3\x0B\x63"
8389               "\x43\x27\x13\xA9\xBE\xEB\xBD\xF3"
8390               "\x33\x62\x70\xE2\x1B\x86\x7A\xA1"
8391               "\x51\x4A\x16\xFE\x29\x63\x7E\xD0"
8392               "\x7A\xA4\x6E\x2C\xF8\xC1\xDB\xE8"
8393               "\xCB\x4D\xD2\x8C\x04\x14\xB4\x66"
8394               "\x41\xB7\x3A\x96\x16\x7C\x1D\x5B"
8395               "\xB6\x41\x42\x64\x43\xEE\x6E\x7C"
8396               "\x8B\xAF\x01\x9C\xA4\x6E\x75\x8F"
8397               "\xDE\x10\x9F\xA6\xE7\xD6\x44\x97"
8398               "\x66\xA3\x96\x0F\x1C\x25\x60\xF5"
8399               "\x3C\x2E\x32\x69\x0E\x82\xFF\x27"
8400               "\x0F\xB5\x06\xDA\xD8\x31\x15\x6C"
8401               "\xDF\x18\x6C\x87\xF5\x3B\x11\x9A"
8402               "\x1B\x42\x1F\x5B\x29\x19\x96\x13"
8403               "\x68\x2E\x5E\x08\x1C\x8F\x32\x4B"
8404               "\x81\x77\x6D\xF4\xA0\x01\x42\xEC"
8405               "\xDD\x5B\xFD\x3A\x8E\x6A\x14\xFB"
8406               "\x83\x54\xDF\x0F\x86\xB7\xEA\x40"
8407               "\x46\x39\xF7\x2A\x89\x8D\x4E\x96"
8408               "\x5F\x5F\x6D\x76\xC6\x13\x9D\x3D"
8409               "\x1D\x5F\x0C\x7D\xE2\xBC\xC2\x16"
8410               "\x16\xBE\x89\x3E\xB0\x61\xA2\x5D"
8411               "\xAF\xD1\x40\x5F\x1A\xB8\x26\x41"
8412               "\xC6\xBD\x36\xEF\xED\x29\x50\x6D"
8413               "\x10\xEF\x26\xE8\xA8\x93\x11\x3F"
8414               "\x2D\x1F\x88\x20\x77\x45\xF5\x66"
8415               "\x08\xB9\xF1\xEF\xB1\x93\xA8\x81"
8416               "\x65\xC5\xCD\x3E\x8C\x06\x60\x2C"
8417               "\xB2\x10\x7A\xCA\x05\x25\x59\xDB"
8418               "\xC7\x28\xF5\x20\x35\x52\x9E\x62"
8419               "\xF8\x88\x24\x1C\x4D\x84\x12\x39"
8420               "\x39\xE4\x2E\xF4\xD4\x9D\x2B\xBC"
8421               "\x87\x66\xE6\xC0\x6B\x31\x9A\x66"
8422               "\x03\xDC\x95\xD8\x6B\xD0\x30\x8F"
8423               "\xDF\x8F\x8D\xFA\xEC\x1F\x08\xBD"
8424               "\xA3\x63\xE2\x71\x4F\x03\x94\x87"
8425               "\x50\xDF\x15\x1F\xED\x3A\xA3\x7F"
8426               "\x1F\x2A\xB5\xA1\x69\xAC\x4B\x0D"
8427               "\x84\x9B\x2A\xE9\x55\xDD\x46\x91"
8428               "\x15\x33\xF3\x2B\x9B\x46\x97\x00"
8429               "\xF0\x29\xD8\x59\x5D\x33\x37\xF9"
8430               "\x58\x33\x9B\x78\xC7\x58\x48\x6B"
8431               "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5",
8432         .ilen   = 496,
8433         .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8434               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8435               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8436               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8437               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8438               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8439               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8440               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8441               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8442               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8443               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8444               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8445               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8446               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8447               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8448               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8449               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8450               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8451               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8452               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8453               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8454               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8455               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8456               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8457               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8458               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8459               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8460               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8461               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8462               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8463               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8464               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8465               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8466               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8467               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8468               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8469               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8470               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8471               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8472               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8473               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8474               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8475               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8476               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8477               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8478               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8479               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8480               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8481               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8482               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8483               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8484               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8485               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8486               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8487               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8488               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8489               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8490               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8491               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8492               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8493               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8494               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8495         .rlen   = 496,
8496         .also_non_np = 1,
8497         .np = 3,
8498         .tap    = { 496 - 20, 4, 16 },
8499     },
8500 };
8501 
8502 static struct cipher_testvec tf_cbc_enc_tv_template[] = {
8503     { /* Generated with Nettle */
8504         .key    = zeroed_string,
8505         .klen   = 16,
8506         .iv = zeroed_string,
8507         .input  = zeroed_string,
8508         .ilen   = 16,
8509         .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
8510               "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
8511         .rlen   = 16,
8512     }, {
8513         .key    = zeroed_string,
8514         .klen   = 16,
8515         .iv = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
8516               "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a",
8517         .input  = zeroed_string,
8518         .ilen   = 16,
8519         .result = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
8520               "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
8521         .rlen   = 16,
8522     }, {
8523         .key    = zeroed_string,
8524         .klen   = 16,
8525         .iv = "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
8526               "\x86\xcb\x08\x6b\x78\x9f\x54\x19",
8527         .input  = zeroed_string,
8528         .ilen   = 16,
8529         .result = "\x05\xef\x8c\x61\xa8\x11\x58\x26"
8530               "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
8531         .rlen   = 16,
8532     }, {
8533         .key    = zeroed_string,
8534         .klen   = 16,
8535         .iv = zeroed_string,
8536         .input  = zeroed_string,
8537         .ilen   = 48,
8538         .result = "\x9f\x58\x9f\x5c\xf6\x12\x2c\x32"
8539               "\xb6\xbf\xec\x2f\x2a\xe8\xc3\x5a"
8540               "\xd4\x91\xdb\x16\xe7\xb1\xc3\x9e"
8541               "\x86\xcb\x08\x6b\x78\x9f\x54\x19"
8542               "\x05\xef\x8c\x61\xa8\x11\x58\x26"
8543               "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
8544         .rlen   = 48,
8545     }, { /* Generated with Crypto++ */
8546         .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8547               "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8548               "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8549               "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8550         .klen   = 32,
8551         .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8552               "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8553         .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8554               "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8555               "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8556               "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8557               "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8558               "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8559               "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8560               "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8561               "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8562               "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8563               "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8564               "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8565               "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8566               "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8567               "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8568               "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8569               "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8570               "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8571               "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8572               "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8573               "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8574               "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8575               "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8576               "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8577               "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8578               "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8579               "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8580               "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8581               "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8582               "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8583               "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8584               "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8585               "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8586               "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8587               "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8588               "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8589               "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8590               "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8591               "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8592               "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8593               "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8594               "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8595               "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8596               "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8597               "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8598               "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8599               "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8600               "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8601               "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8602               "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8603               "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8604               "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8605               "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8606               "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8607               "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8608               "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8609               "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8610               "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8611               "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8612               "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8613               "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8614               "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8615         .ilen   = 496,
8616         .result = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
8617               "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
8618               "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
8619               "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
8620               "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
8621               "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
8622               "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
8623               "\xB1\xD3\x44\x65\xDF\xE7\x63\x38"
8624               "\x4A\xFC\xDC\xEC\x3F\x26\x8E\xB8"
8625               "\x43\xFC\xFE\x18\xB5\x11\x6D\x31"
8626               "\x81\x8B\x0D\x75\xF6\x80\xEC\x84"
8627               "\x04\xB9\xE6\x09\x63\xED\x39\xDB"
8628               "\xC3\xF6\x14\xD6\x6E\x5E\x8B\xBD"
8629               "\x3E\xFA\xD7\x98\x50\x6F\xD9\x63"
8630               "\x02\xCD\x0D\x39\x4B\x0D\xEC\x80"
8631               "\xE3\x6A\x17\xF4\xCC\xAD\xFF\x68"
8632               "\x45\xDD\xC8\x83\x1D\x41\x96\x0D"
8633               "\x91\x2E\x05\xD3\x59\x82\xE0\x43"
8634               "\x90\x4F\xB9\xF7\xAD\x6B\x2E\xAF"
8635               "\xA7\x84\x00\x53\xCD\x6F\xD1\x0C"
8636               "\x4E\xF9\x5A\x23\xFB\xCA\xC7\xD3"
8637               "\xA9\xAA\x9D\xB2\x3F\x66\xF1\xAC"
8638               "\x25\x21\x8F\xF7\xEF\xF2\x6A\xDF"
8639               "\xE8\xDA\x75\x1A\x8A\xF1\xDD\x38"
8640               "\x1F\xF9\x3D\x68\x4A\xBB\x9E\x34"
8641               "\x1F\x66\x1F\x9C\x2B\x54\xFF\x60"
8642               "\x7F\x29\x4B\x55\x80\x8F\x4E\xA7"
8643               "\xA6\x9A\x0A\xD9\x0D\x19\x00\xF8"
8644               "\x1F\xBC\x0C\x40\x6B\xEC\x99\x25"
8645               "\x94\x70\x74\x0E\x1D\xC5\xBC\x12"
8646               "\xF3\x42\xBE\x95\xBF\xFB\x4E\x55"
8647               "\x9A\xB9\xCE\x14\x16\x5B\xDC\xD3"
8648               "\x75\x42\x62\x04\x31\x1F\x95\x7C"
8649               "\x66\x1A\x97\xDC\x2F\x40\x5C\x39"
8650               "\x78\xE6\x02\xDB\x49\xE1\xC6\x47"
8651               "\xC2\x78\x9A\xBB\xF3\xBE\xCB\x93"
8652               "\xD8\xB8\xE8\xBB\x8C\xB3\x9B\xA7"
8653               "\xC2\x89\xF3\x91\x88\x83\x3D\xF0"
8654               "\x29\xA2\xCD\xB5\x79\x16\xC2\x40"
8655               "\x11\x03\x8E\x9C\xFD\xC9\x43\xC4"
8656               "\xC2\x19\xF0\x4A\x32\xEF\x0C\x2B"
8657               "\xD3\x2B\xE9\xD4\x4C\xDE\x95\xCF"
8658               "\x04\x03\xD3\x2C\x7F\x82\xC8\xFA"
8659               "\x0F\xD8\x7A\x39\x7B\x01\x41\x9C"
8660               "\x78\xB6\xC9\xBF\xF9\x78\x57\x8