linux/crypto/testmgr.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-or-later */
   2/*
   3 * Algorithm testing framework and tests.
   4 *
   5 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
   6 * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
   7 * Copyright (c) 2007 Nokia Siemens Networks
   8 * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
   9 * Copyright (c) 2019 Google LLC
  10 *
  11 * Updated RFC4106 AES-GCM testing. Some test vectors were taken from
  12 * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
  13 * gcm/gcm-test-vectors.tar.gz
  14 *     Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
  15 *              Adrian Hoban <adrian.hoban@intel.com>
  16 *              Gabriele Paoloni <gabriele.paoloni@intel.com>
  17 *              Tadeusz Struk (tadeusz.struk@intel.com)
  18 *     Copyright (c) 2010, Intel Corporation.
  19 */
  20#ifndef _CRYPTO_TESTMGR_H
  21#define _CRYPTO_TESTMGR_H
  22
  23#include <linux/oid_registry.h>
  24
  25#define MAX_IVLEN               32
  26
  27/*
  28 * hash_testvec:        structure to describe a hash (message digest) test
  29 * @key:        Pointer to key (NULL if none)
  30 * @plaintext:  Pointer to source data
  31 * @digest:     Pointer to expected digest
  32 * @psize:      Length of source data in bytes
  33 * @ksize:      Length of @key in bytes (0 if no key)
  34 * @setkey_error: Expected error from setkey()
  35 * @digest_error: Expected error from digest()
  36 */
  37struct hash_testvec {
  38        const char *key;
  39        const char *plaintext;
  40        const char *digest;
  41        unsigned int psize;
  42        unsigned short ksize;
  43        int setkey_error;
  44        int digest_error;
  45};
  46
  47/*
  48 * cipher_testvec:      structure to describe a symmetric cipher test
  49 * @key:        Pointer to key
  50 * @klen:       Length of @key in bytes
  51 * @iv:         Pointer to IV.  If NULL, an all-zeroes IV is used.
  52 * @iv_out:     Pointer to output IV, if applicable for the cipher.
  53 * @ptext:      Pointer to plaintext
  54 * @ctext:      Pointer to ciphertext
  55 * @len:        Length of @ptext and @ctext in bytes
  56 * @wk:         Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
  57 *              ( e.g. test needs to fail due to a weak key )
  58 * @fips_skip:  Skip the test vector in FIPS mode
  59 * @generates_iv: Encryption should ignore the given IV, and output @iv_out.
  60 *                Decryption takes @iv_out.  Needed for AES Keywrap ("kw(aes)").
  61 * @setkey_error: Expected error from setkey()
  62 * @crypt_error: Expected error from encrypt() and decrypt()
  63 */
  64struct cipher_testvec {
  65        const char *key;
  66        const char *iv;
  67        const char *iv_out;
  68        const char *ptext;
  69        const char *ctext;
  70        unsigned char wk; /* weak key flag */
  71        unsigned short klen;
  72        unsigned int len;
  73        bool fips_skip;
  74        bool generates_iv;
  75        int setkey_error;
  76        int crypt_error;
  77};
  78
  79/*
  80 * aead_testvec:        structure to describe an AEAD test
  81 * @key:        Pointer to key
  82 * @iv:         Pointer to IV.  If NULL, an all-zeroes IV is used.
  83 * @ptext:      Pointer to plaintext
  84 * @assoc:      Pointer to associated data
  85 * @ctext:      Pointer to the full authenticated ciphertext.  For AEADs that
  86 *              produce a separate "ciphertext" and "authentication tag", these
  87 *              two parts are concatenated: ciphertext || tag.
  88 * @novrfy:     If set, this is an inauthentic input test: only decryption is
  89 *              tested, and it is expected to fail with either -EBADMSG or
  90 *              @crypt_error if it is nonzero.
  91 * @wk:         Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
  92 *              (e.g. setkey() needs to fail due to a weak key)
  93 * @klen:       Length of @key in bytes
  94 * @plen:       Length of @ptext in bytes
  95 * @alen:       Length of @assoc in bytes
  96 * @clen:       Length of @ctext in bytes
  97 * @setkey_error: Expected error from setkey().  If set, neither encryption nor
  98 *                decryption is tested.
  99 * @setauthsize_error: Expected error from setauthsize().  If set, neither
 100 *                     encryption nor decryption is tested.
 101 * @crypt_error: When @novrfy=0, the expected error from encrypt().  When
 102 *               @novrfy=1, an optional alternate error code that is acceptable
 103 *               for decrypt() to return besides -EBADMSG.
 104 */
 105struct aead_testvec {
 106        const char *key;
 107        const char *iv;
 108        const char *ptext;
 109        const char *assoc;
 110        const char *ctext;
 111        unsigned char novrfy;
 112        unsigned char wk;
 113        unsigned char klen;
 114        unsigned int plen;
 115        unsigned int clen;
 116        unsigned int alen;
 117        int setkey_error;
 118        int setauthsize_error;
 119        int crypt_error;
 120};
 121
 122struct cprng_testvec {
 123        const char *key;
 124        const char *dt;
 125        const char *v;
 126        const char *result;
 127        unsigned char klen;
 128        unsigned short dtlen;
 129        unsigned short vlen;
 130        unsigned short rlen;
 131        unsigned short loops;
 132};
 133
 134struct drbg_testvec {
 135        const unsigned char *entropy;
 136        size_t entropylen;
 137        const unsigned char *entpra;
 138        const unsigned char *entprb;
 139        size_t entprlen;
 140        const unsigned char *addtla;
 141        const unsigned char *addtlb;
 142        size_t addtllen;
 143        const unsigned char *pers;
 144        size_t perslen;
 145        const unsigned char *expected;
 146        size_t expectedlen;
 147};
 148
 149struct akcipher_testvec {
 150        const unsigned char *key;
 151        const unsigned char *params;
 152        const unsigned char *m;
 153        const unsigned char *c;
 154        unsigned int key_len;
 155        unsigned int param_len;
 156        unsigned int m_size;
 157        unsigned int c_size;
 158        bool public_key_vec;
 159        bool siggen_sigver_test;
 160        enum OID algo;
 161};
 162
 163struct kpp_testvec {
 164        const unsigned char *secret;
 165        const unsigned char *b_secret;
 166        const unsigned char *b_public;
 167        const unsigned char *expected_a_public;
 168        const unsigned char *expected_ss;
 169        unsigned short secret_size;
 170        unsigned short b_secret_size;
 171        unsigned short b_public_size;
 172        unsigned short expected_a_public_size;
 173        unsigned short expected_ss_size;
 174        bool genkey;
 175};
 176
 177static const char zeroed_string[48];
 178
 179/*
 180 * RSA test vectors. Borrowed from openSSL.
 181 */
 182static const struct akcipher_testvec rsa_tv_template[] = {
 183        {
 184#ifndef CONFIG_CRYPTO_FIPS
 185        .key =
 186        "\x30\x81\x9A" /* sequence of 154 bytes */
 187        "\x02\x01\x01" /* version - integer of 1 byte */
 188        "\x02\x41" /* modulus - integer of 65 bytes */
 189        "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
 190        "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
 191        "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
 192        "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
 193        "\xF5"
 194        "\x02\x01\x11" /* public key - integer of 1 byte */
 195        "\x02\x40" /* private key - integer of 64 bytes */
 196        "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
 197        "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
 198        "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
 199        "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"
 200        "\x02\x01\x00" /* prime1 - integer of 1 byte */
 201        "\x02\x01\x00" /* prime2 - integer of 1 byte */
 202        "\x02\x01\x00" /* exponent1 - integer of 1 byte */
 203        "\x02\x01\x00" /* exponent2 - integer of 1 byte */
 204        "\x02\x01\x00", /* coefficient - integer of 1 byte */
 205        .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
 206        .c =
 207        "\x63\x1c\xcd\x7b\xe1\x7e\xe4\xde\xc9\xa8\x89\xa1\x74\xcb\x3c\x63"
 208        "\x7d\x24\xec\x83\xc3\x15\xe4\x7f\x73\x05\x34\xd1\xec\x22\xbb\x8a"
 209        "\x5e\x32\x39\x6d\xc1\x1d\x7d\x50\x3b\x9f\x7a\xad\xf0\x2e\x25\x53"
 210        "\x9f\x6e\xbd\x4c\x55\x84\x0c\x9b\xcf\x1a\x4b\x51\x1e\x9e\x0c\x06",
 211        .key_len = 157,
 212        .m_size = 8,
 213        .c_size = 64,
 214        }, {
 215        .key =
 216        "\x30\x82\x01\x1D" /* sequence of 285 bytes */
 217        "\x02\x01\x01" /* version - integer of 1 byte */
 218        "\x02\x81\x81" /* modulus - integer of 129 bytes */
 219        "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
 220        "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
 221        "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
 222        "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80"
 223        "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25"
 224        "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39"
 225        "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68"
 226        "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
 227        "\xCB"
 228        "\x02\x01\x11" /* public key - integer of 1 byte */
 229        "\x02\x81\x81"  /* private key - integer of 129 bytes */
 230        "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD"
 231        "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41"
 232        "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69"
 233        "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA"
 234        "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94"
 235        "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A"
 236        "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94"
 237        "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3"
 238        "\xC1"
 239        "\x02\x01\x00" /* prime1 - integer of 1 byte */
 240        "\x02\x01\x00" /* prime2 - integer of 1 byte */
 241        "\x02\x01\x00" /* exponent1 - integer of 1 byte */
 242        "\x02\x01\x00" /* exponent2 - integer of 1 byte */
 243        "\x02\x01\x00", /* coefficient - integer of 1 byte */
 244        .key_len = 289,
 245        .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
 246        .c =
 247        "\x74\x1b\x55\xac\x47\xb5\x08\x0a\x6e\x2b\x2d\xf7\x94\xb8\x8a\x95"
 248        "\xed\xa3\x6b\xc9\x29\xee\xb2\x2c\x80\xc3\x39\x3b\x8c\x62\x45\x72"
 249        "\xc2\x7f\x74\x81\x91\x68\x44\x48\x5a\xdc\xa0\x7e\xa7\x0b\x05\x7f"
 250        "\x0e\xa0\x6c\xe5\x8f\x19\x4d\xce\x98\x47\x5f\xbd\x5f\xfe\xe5\x34"
 251        "\x59\x89\xaf\xf0\xba\x44\xd7\xf1\x1a\x50\x72\xef\x5e\x4a\xb6\xb7"
 252        "\x54\x34\xd1\xc4\x83\x09\xdf\x0f\x91\x5f\x7d\x91\x70\x2f\xd4\x13"
 253        "\xcc\x5e\xa4\x6c\xc3\x4d\x28\xef\xda\xaf\xec\x14\x92\xfc\xa3\x75"
 254        "\x13\xb4\xc1\xa1\x11\xfc\x40\x2f\x4c\x9d\xdf\x16\x76\x11\x20\x6b",
 255        .m_size = 8,
 256        .c_size = 128,
 257        }, {
 258#endif
 259        .key =
 260        "\x30\x82\x02\x1F" /* sequence of 543 bytes */
 261        "\x02\x01\x01" /* version - integer of 1 byte */
 262        "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
 263        "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
 264        "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
 265        "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
 266        "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
 267        "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
 268        "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
 269        "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
 270        "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
 271        "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
 272        "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
 273        "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
 274        "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
 275        "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
 276        "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
 277        "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
 278        "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
 279        "\x02\x03\x01\x00\x01" /* public key - integer of 3 bytes */
 280        "\x02\x82\x01\x00" /* private key - integer of 256 bytes */
 281        "\x52\x41\xF4\xDA\x7B\xB7\x59\x55\xCA\xD4\x2F\x0F\x3A\xCB\xA4\x0D"
 282        "\x93\x6C\xCC\x9D\xC1\xB2\xFB\xFD\xAE\x40\x31\xAC\x69\x52\x21\x92"
 283        "\xB3\x27\xDF\xEA\xEE\x2C\x82\xBB\xF7\x40\x32\xD5\x14\xC4\x94\x12"
 284        "\xEC\xB8\x1F\xCA\x59\xE3\xC1\x78\xF3\x85\xD8\x47\xA5\xD7\x02\x1A"
 285        "\x65\x79\x97\x0D\x24\xF4\xF0\x67\x6E\x75\x2D\xBF\x10\x3D\xA8\x7D"
 286        "\xEF\x7F\x60\xE4\xE6\x05\x82\x89\x5D\xDF\xC6\xD2\x6C\x07\x91\x33"
 287        "\x98\x42\xF0\x02\x00\x25\x38\xC5\x85\x69\x8A\x7D\x2F\x95\x6C\x43"
 288        "\x9A\xB8\x81\xE2\xD0\x07\x35\xAA\x05\x41\xC9\x1E\xAF\xE4\x04\x3B"
 289        "\x19\xB8\x73\xA2\xAC\x4B\x1E\x66\x48\xD8\x72\x1F\xAC\xF6\xCB\xBC"
 290        "\x90\x09\xCA\xEC\x0C\xDC\xF9\x2C\xD7\xEB\xAE\xA3\xA4\x47\xD7\x33"
 291        "\x2F\x8A\xCA\xBC\x5E\xF0\x77\xE4\x97\x98\x97\xC7\x10\x91\x7D\x2A"
 292        "\xA6\xFF\x46\x83\x97\xDE\xE9\xE2\x17\x03\x06\x14\xE2\xD7\xB1\x1D"
 293        "\x77\xAF\x51\x27\x5B\x5E\x69\xB8\x81\xE6\x11\xC5\x43\x23\x81\x04"
 294        "\x62\xFF\xE9\x46\xB8\xD8\x44\xDB\xA5\xCC\x31\x54\x34\xCE\x3E\x82"
 295        "\xD6\xBF\x7A\x0B\x64\x21\x6D\x88\x7E\x5B\x45\x12\x1E\x63\x8D\x49"
 296        "\xA7\x1D\xD9\x1E\x06\xCD\xE8\xBA\x2C\x8C\x69\x32\xEA\xBE\x60\x71"
 297        "\x02\x01\x00" /* prime1 - integer of 1 byte */
 298        "\x02\x01\x00" /* prime2 - integer of 1 byte */
 299        "\x02\x01\x00" /* exponent1 - integer of 1 byte */
 300        "\x02\x01\x00" /* exponent2 - integer of 1 byte */
 301        "\x02\x01\x00", /* coefficient - integer of 1 byte */
 302        .key_len = 547,
 303        .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
 304        .c =
 305        "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
 306        "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
 307        "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
 308        "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
 309        "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
 310        "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
 311        "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
 312        "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
 313        "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
 314        "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
 315        "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
 316        "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
 317        "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
 318        "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
 319        "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
 320        "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
 321        .m_size = 8,
 322        .c_size = 256,
 323        }, {
 324        .key =
 325        "\x30\x82\x01\x09" /* sequence of 265 bytes */
 326        "\x02\x82\x01\x00" /* modulus - integer of 256 bytes */
 327        "\xDB\x10\x1A\xC2\xA3\xF1\xDC\xFF\x13\x6B\xED\x44\xDF\xF0\x02\x6D"
 328        "\x13\xC7\x88\xDA\x70\x6B\x54\xF1\xE8\x27\xDC\xC3\x0F\x99\x6A\xFA"
 329        "\xC6\x67\xFF\x1D\x1E\x3C\x1D\xC1\xB5\x5F\x6C\xC0\xB2\x07\x3A\x6D"
 330        "\x41\xE4\x25\x99\xAC\xFC\xD2\x0F\x02\xD3\xD1\x54\x06\x1A\x51\x77"
 331        "\xBD\xB6\xBF\xEA\xA7\x5C\x06\xA9\x5D\x69\x84\x45\xD7\xF5\x05\xBA"
 332        "\x47\xF0\x1B\xD7\x2B\x24\xEC\xCB\x9B\x1B\x10\x8D\x81\xA0\xBE\xB1"
 333        "\x8C\x33\xE4\x36\xB8\x43\xEB\x19\x2A\x81\x8D\xDE\x81\x0A\x99\x48"
 334        "\xB6\xF6\xBC\xCD\x49\x34\x3A\x8F\x26\x94\xE3\x28\x82\x1A\x7C\x8F"
 335        "\x59\x9F\x45\xE8\x5D\x1A\x45\x76\x04\x56\x05\xA1\xD0\x1B\x8C\x77"
 336        "\x6D\xAF\x53\xFA\x71\xE2\x67\xE0\x9A\xFE\x03\xA9\x85\xD2\xC9\xAA"
 337        "\xBA\x2A\xBC\xF4\xA0\x08\xF5\x13\x98\x13\x5D\xF0\xD9\x33\x34\x2A"
 338        "\x61\xC3\x89\x55\xF0\xAE\x1A\x9C\x22\xEE\x19\x05\x8D\x32\xFE\xEC"
 339        "\x9C\x84\xBA\xB7\xF9\x6C\x3A\x4F\x07\xFC\x45\xEB\x12\xE5\x7B\xFD"
 340        "\x55\xE6\x29\x69\xD1\xC2\xE8\xB9\x78\x59\xF6\x79\x10\xC6\x4E\xEB"
 341        "\x6A\x5E\xB9\x9A\xC7\xC4\x5B\x63\xDA\xA3\x3F\x5E\x92\x7A\x81\x5E"
 342        "\xD6\xB0\xE2\x62\x8F\x74\x26\xC2\x0C\xD3\x9A\x17\x47\xE6\x8E\xAB"
 343        "\x02\x03\x01\x00\x01", /* public key - integer of 3 bytes */
 344        .key_len = 269,
 345        .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
 346        .c =
 347        "\xb2\x97\x76\xb4\xae\x3e\x38\x3c\x7e\x64\x1f\xcc\xa2\x7f\xf6\xbe"
 348        "\xcf\x49\xbc\x48\xd3\x6c\x8f\x0a\x0e\xc1\x73\xbd\x7b\x55\x79\x36"
 349        "\x0e\xa1\x87\x88\xb9\x2c\x90\xa6\x53\x5e\xe9\xef\xc4\xe2\x4d\xdd"
 350        "\xf7\xa6\x69\x82\x3f\x56\xa4\x7b\xfb\x62\xe0\xae\xb8\xd3\x04\xb3"
 351        "\xac\x5a\x15\x2a\xe3\x19\x9b\x03\x9a\x0b\x41\xda\x64\xec\x0a\x69"
 352        "\xfc\xf2\x10\x92\xf3\xc1\xbf\x84\x7f\xfd\x2c\xae\xc8\xb5\xf6\x41"
 353        "\x70\xc5\x47\x03\x8a\xf8\xff\x6f\x3f\xd2\x6f\x09\xb4\x22\xf3\x30"
 354        "\xbe\xa9\x85\xcb\x9c\x8d\xf9\x8f\xeb\x32\x91\xa2\x25\x84\x8f\xf5"
 355        "\xdc\xc7\x06\x9c\x2d\xe5\x11\x2c\x09\x09\x87\x09\xa9\xf6\x33\x73"
 356        "\x90\xf1\x60\xf2\x65\xdd\x30\xa5\x66\xce\x62\x7b\xd0\xf8\x2d\x3d"
 357        "\x19\x82\x77\xe3\x0a\x5f\x75\x2f\x8e\xb1\xe5\xe8\x91\x35\x1b\x3b"
 358        "\x33\xb7\x66\x92\xd1\xf2\x8e\x6f\xe5\x75\x0c\xad\x36\xfb\x4e\xd0"
 359        "\x66\x61\xbd\x49\xfe\xf4\x1a\xa2\x2b\x49\xfe\x03\x4c\x74\x47\x8d"
 360        "\x9a\x66\xb2\x49\x46\x4d\x77\xea\x33\x4d\x6b\x3c\xb4\x49\x4a\xc6"
 361        "\x7d\x3d\xb5\xb9\x56\x41\x15\x67\x0f\x94\x3c\x93\x65\x27\xe0\x21"
 362        "\x5d\x59\xc3\x62\xd5\xa6\xda\x38\x26\x22\x5e\x34\x1c\x94\xaf\x98",
 363        .m_size = 8,
 364        .c_size = 256,
 365        .public_key_vec = true,
 366#ifndef CONFIG_CRYPTO_FIPS
 367        }, {
 368        .key =
 369        "\x30\x82\x09\x29" /* sequence of 2345 bytes */
 370        "\x02\x01\x00" /* version integer of 1 byte */
 371        "\x02\x82\x02\x01" /* modulus - integer of 513 bytes */
 372        "\x00\xC3\x8B\x55\x7B\x73\x4D\xFF\xE9\x9B\xC6\xDC\x67\x3C\xB4\x8E"
 373        "\xA0\x86\xED\xF2\xB9\x50\x5C\x54\x5C\xBA\xE4\xA1\xB2\xA7\xAE\x2F"
 374        "\x1B\x7D\xF1\xFB\xAC\x79\xC5\xDF\x1A\x00\xC9\xB2\xC1\x61\x25\x33"
 375        "\xE6\x9C\xE9\xCF\xD6\x27\xC4\x4E\x44\x30\x44\x5E\x08\xA1\x87\x52"
 376        "\xCC\x6B\x97\x70\x8C\xBC\xA5\x06\x31\x0C\xD4\x2F\xD5\x7D\x26\x24"
 377        "\xA2\xE2\xAC\x78\xF4\x53\x14\xCE\xF7\x19\x2E\xD7\xF7\xE6\x0C\xB9"
 378        "\x56\x7F\x0B\xF1\xB1\xE2\x43\x70\xBD\x86\x1D\xA1\xCC\x2B\x19\x08"
 379        "\x76\xEF\x91\xAC\xBF\x20\x24\x0D\x38\xC0\x89\xB8\x9A\x70\xB3\x64"
 380        "\xD9\x8F\x80\x41\x10\x5B\x9F\xB1\xCB\x76\x43\x00\x21\x25\x36\xD4"
 381        "\x19\xFC\x55\x95\x10\xE4\x26\x74\x98\x2C\xD9\xBD\x0B\x2B\x04\xC2"
 382        "\xAC\x82\x38\xB4\xDD\x4C\x04\x7E\x51\x36\x40\x1E\x0B\xC4\x7C\x25"
 383        "\xDD\x4B\xB2\xE7\x20\x0A\x57\xF9\xB4\x94\xC3\x08\x33\x22\x6F\x8B"
 384        "\x48\xDB\x03\x68\x5A\x5B\xBA\xAE\xF3\xAD\xCF\xC3\x6D\xBA\xF1\x28"
 385        "\x67\x7E\x6C\x79\x07\xDE\xFC\xED\xE7\x96\xE3\x6C\xE0\x2C\x87\xF8"
 386        "\x02\x01\x28\x38\x43\x21\x53\x84\x69\x75\x78\x15\x7E\xEE\xD2\x1B"
 387        "\xB9\x23\x40\xA8\x86\x1E\x38\x83\xB2\x73\x1D\x53\xFB\x9E\x2A\x8A"
 388        "\xB2\x75\x35\x01\xC3\xC3\xC4\x94\xE8\x84\x86\x64\x81\xF4\x42\xAA"
 389        "\x3C\x0E\xD6\x4F\xBC\x0A\x09\x2D\xE7\x1B\xD4\x10\xA8\x54\xEA\x89"
 390        "\x84\x8A\xCB\xF7\x5A\x3C\xCA\x76\x08\x29\x62\xB4\x6A\x22\xDF\x14"
 391        "\x95\x71\xFD\xB6\x86\x39\xB8\x8B\xF8\x91\x7F\x38\xAA\x14\xCD\xE5"
 392        "\xF5\x1D\xC2\x6D\x53\x69\x52\x84\x7F\xA3\x1A\x5E\x26\x04\x83\x06"
 393        "\x73\x52\x56\xCF\x76\x26\xC9\xDD\x75\xD7\xFC\xF4\x69\xD8\x7B\x55"
 394        "\xB7\x68\x13\x53\xB9\xE7\x89\xC3\xE8\xD6\x6E\xA7\x6D\xEA\x81\xFD"
 395        "\xC4\xB7\x05\x5A\xB7\x41\x0A\x23\x8E\x03\x8A\x1C\xAE\xD3\x1E\xCE"
 396        "\xE3\x5E\xFC\x19\x4A\xEE\x61\x9B\x8E\xE5\xE5\xDD\x85\xF9\x41\xEC"
 397        "\x14\x53\x92\xF7\xDD\x06\x85\x02\x91\xE3\xEB\x6C\x43\x03\xB1\x36"
 398        "\x7B\x89\x5A\xA8\xEB\xFC\xD5\xA8\x35\xDC\x81\xD9\x5C\xBD\xCA\xDC"
 399        "\x9B\x98\x0B\x06\x5D\x0C\x5B\xEE\xF3\xD5\xCC\x57\xC9\x71\x2F\x90"
 400        "\x3B\x3C\xF0\x8E\x4E\x35\x48\xAE\x63\x74\xA9\xFC\x72\x75\x8E\x34"
 401        "\xA8\xF2\x1F\xEA\xDF\x3A\x37\x2D\xE5\x39\x39\xF8\x57\x58\x3C\x04"
 402        "\xFE\x87\x06\x98\xBC\x7B\xD3\x21\x36\x60\x25\x54\xA7\x3D\xFA\x91"
 403        "\xCC\xA8\x0B\x92\x8E\xB4\xF7\x06\xFF\x1E\x95\xCB\x07\x76\x97\x3B"
 404        "\x9D"
 405        "\x02\x03\x01\x00\x01" /* public key integer of 3 bytes */
 406        "\x02\x82\x02\x00" /* private key integer of 512 bytes */
 407        "\x74\xA9\xE0\x6A\x32\xB4\xCA\x85\xD9\x86\x9F\x60\x88\x7B\x40\xCC"
 408        "\xCD\x33\x91\xA8\xB6\x25\x1F\xBF\xE3\x51\x1C\x97\xB6\x2A\xD9\xB8"
 409        "\x11\x40\x19\xE3\x21\x13\xC8\xB3\x7E\xDC\xD7\x65\x40\x4C\x2D\xD6"
 410        "\xDC\xAF\x32\x6C\x96\x75\x2C\x2C\xCA\x8F\x3F\x7A\xEE\xC4\x09\xC6"
 411        "\x24\x3A\xC9\xCF\x6D\x8D\x17\x50\x94\x52\xD3\xE7\x0F\x2F\x7E\x94"
 412        "\x1F\xA0\xBE\xD9\x25\xE8\x38\x42\x7C\x27\xD2\x79\xF8\x2A\x87\x38"
 413        "\xEF\xBB\x74\x8B\xA8\x6E\x8C\x08\xC6\xC7\x4F\x0C\xBC\x79\xC6\xEF"
 414        "\x0E\xA7\x5E\xE4\xF8\x8C\x09\xC7\x5E\x37\xCC\x87\x77\xCD\xCF\xD1"
 415        "\x6D\x28\x1B\xA9\x62\xC0\xB8\x16\xA7\x8B\xF9\xBB\xCC\xB4\x15\x7F"
 416        "\x1B\x69\x03\xF2\x7B\xEB\xE5\x8C\x14\xD6\x23\x4F\x52\x6F\x18\xA6"
 417        "\x4B\x5B\x01\xAD\x35\xF9\x48\x53\xB3\x86\x35\x66\xD7\xE7\x29\xC0"
 418        "\x09\xB5\xC6\xE6\xFA\xC4\xDA\x19\xBE\xD7\x4D\x41\x14\xBE\x6F\xDF"
 419        "\x1B\xAB\xC0\xCA\x88\x07\xAC\xF1\x7D\x35\x83\x67\x28\x2D\x50\xE9"
 420        "\xCE\x27\x71\x5E\x1C\xCF\xD2\x30\x65\x79\x72\x2F\x9C\xE1\xD2\x39"
 421        "\x7F\xEF\x3B\x01\xF2\x14\x1D\xDF\xBD\x51\xD3\xA1\x53\x62\xCF\x5F"
 422        "\x79\x84\xCE\x06\x96\x69\x29\x49\x82\x1C\x71\x4A\xA1\x66\xC8\x2F"
 423        "\xFD\x7B\x96\x7B\xFC\xC4\x26\x58\xC4\xFC\x7C\xAF\xB5\xE8\x95\x83"
 424        "\x87\xCB\x46\xDE\x97\xA7\xB3\xA2\x54\x5B\xD7\xAF\xAB\xEB\xC8\xF3"
 425        "\x55\x9D\x48\x2B\x30\x9C\xDC\x26\x4B\xC2\x89\x45\x13\xB2\x01\x9A"
 426        "\xA4\x65\xC3\xEC\x24\x2D\x26\x97\xEB\x80\x8A\x9D\x03\xBC\x59\x66"
 427        "\x9E\xE2\xBB\xBB\x63\x19\x64\x93\x11\x7B\x25\x65\x30\xCD\x5B\x4B"
 428        "\x2C\xFF\xDC\x2D\x30\x87\x1F\x3C\x88\x07\xD0\xFC\x48\xCC\x05\x8A"
 429        "\xA2\xC8\x39\x3E\xD5\x51\xBC\x0A\xBE\x6D\xA8\xA0\xF6\x88\x06\x79"
 430        "\x13\xFF\x1B\x45\xDA\x54\xC9\x24\x25\x8A\x75\x0A\x26\xD1\x69\x81"
 431        "\x14\x14\xD1\x79\x7D\x8E\x76\xF2\xE0\xEB\xDD\x0F\xDE\xC2\xEC\x80"
 432        "\xD7\xDC\x16\x99\x92\xBE\xCB\x40\x0C\xCE\x7C\x3B\x46\xA2\x5B\x5D"
 433        "\x0C\x45\xEB\xE1\x00\xDE\x72\x50\xB1\xA6\x0B\x76\xC5\x8D\xFC\x82"
 434        "\x38\x6D\x99\x14\x1D\x1A\x4A\xD3\x7C\x53\xB8\x12\x46\xA2\x30\x38"
 435        "\x82\xF4\x96\x6E\x8C\xCE\x47\x0D\xAF\x0A\x3B\x45\xB7\x43\x95\x43"
 436        "\x9E\x02\x2C\x44\x07\x6D\x1F\x3C\x66\x89\x09\xB6\x1F\x06\x30\xCC"
 437        "\xAD\xCE\x7D\x9A\xDE\x3E\xFB\x6C\xE4\x58\x43\xD2\x4F\xA5\x9E\x5E"
 438        "\xA7\x7B\xAE\x3A\xF6\x7E\xD9\xDB\xD3\xF5\xC5\x41\xAF\xE6\x9C\x91"
 439        "\x02\x82\x01\x01" /* prime1 - integer of 257 bytes */
 440        "\x00\xE0\xA6\x6C\xF0\xA2\xF8\x81\x85\x36\x43\xD0\x13\x0B\x33\x8B"
 441        "\x8F\x78\x3D\xAC\xC7\x5E\x46\x6A\x7F\x05\xAE\x3E\x26\x0A\xA6\xD0"
 442        "\x51\xF3\xC8\x61\xF5\x77\x22\x48\x10\x87\x4C\xD5\xA4\xD5\xAE\x2D"
 443        "\x4E\x7A\xFE\x1C\x31\xE7\x6B\xFF\xA4\x69\x20\xF9\x2A\x0B\x99\xBE"
 444        "\x7C\x32\x68\xAD\xB0\xC6\x94\x81\x41\x75\xDC\x06\x78\x0A\xB4\xCF"
 445        "\xCD\x1B\x2D\x31\xE4\x7B\xEA\xA8\x35\x99\x75\x57\xC6\x0E\xF6\x78"
 446        "\x4F\xA0\x92\x4A\x00\x1B\xE7\x96\xF2\x5B\xFD\x2C\x0A\x0A\x13\x81"
 447        "\xAF\xCB\x59\x87\x31\xD9\x83\x65\xF2\x22\x48\xD0\x03\x67\x39\xF6"
 448        "\xFF\xA8\x36\x07\x3A\x68\xE3\x7B\xA9\x64\xFD\x9C\xF7\xB1\x3D\xBF"
 449        "\x26\x5C\xCC\x7A\xFC\xA2\x8F\x51\xD1\xE1\xE2\x3C\xEC\x06\x75\x7C"
 450        "\x34\xF9\xA9\x33\x70\x11\xAD\x5A\xDC\x5F\xCF\x50\xF6\x23\x2F\x39"
 451        "\xAC\x92\x48\x53\x4D\x01\x96\x3C\xD8\xDC\x1F\x23\x23\x78\x80\x34"
 452        "\x54\x14\x76\x8B\xB6\xBB\xFB\x88\x78\x31\x59\x28\xD2\xB1\x75\x17"
 453        "\x88\x04\x4A\x78\x62\x18\x2E\xF5\xFB\x9B\xEF\x15\xD8\x16\x47\xC6"
 454        "\x42\xB1\x02\xDA\x9E\xE3\x84\x90\xB4\x2D\xC3\xCE\x13\xC9\x12\x7D"
 455        "\x3E\xCD\x39\x39\xC9\xAD\xA1\x1A\xE6\xD5\xAD\x5A\x09\x4D\x1B\x0C"
 456        "\xAB"
 457        "\x02\x82\x01\x01" /* prime 2 - integer of 257 bytes */
 458        "\x00\xDE\xD5\x1B\xF6\xCD\x83\xB1\xC6\x47\x7E\xB9\xC0\x6B\xA9\xB8"
 459        "\x02\xF3\xAE\x40\x5D\xFC\xD3\xE5\x4E\xF1\xE3\x39\x04\x52\x84\x89"
 460        "\x40\x37\xBB\xC2\xCD\x7F\x71\x77\x17\xDF\x6A\x4C\x31\x24\x7F\xB9"
 461        "\x7E\x7F\xC8\x43\x4A\x3C\xEB\x8D\x1B\x7F\x21\x51\x67\x45\x8F\xA0"
 462        "\x36\x29\x3A\x18\x45\xA5\x32\xEC\x74\x88\x3C\x98\x5D\x67\x3B\xD7"
 463        "\x51\x1F\xE9\xAE\x09\x01\xDE\xDE\x7C\xFB\x60\xD1\xA5\x6C\xE9\x6A"
 464        "\x93\x04\x02\x3A\xBB\x67\x02\xB9\xFD\x23\xF0\x02\x2B\x49\x85\xC9"
 465        "\x5B\xE7\x4B\xDF\xA3\xF4\xEE\x59\x4C\x45\xEF\x8B\xC1\x6B\xDE\xDE"
 466        "\xBC\x1A\xFC\xD2\x76\x3F\x33\x74\xA9\x8E\xA3\x7E\x0C\xC6\xCE\x70"
 467        "\xA1\x5B\xA6\x77\xEA\x76\xEB\x18\xCE\xB9\xD7\x78\x8D\xAE\x06\xBB"
 468        "\xD3\x1F\x16\x0D\x05\xAB\x4F\xC6\x52\xC8\x6B\x36\x51\x7D\x1D\x27"
 469        "\xAF\x88\x9A\x6F\xCC\x25\x2E\x74\x06\x72\xCE\x9E\xDB\xE0\x9D\x30"
 470        "\xEF\x55\xA5\x58\x21\xA7\x42\x12\x2C\x2C\x23\x87\xC1\x0F\xE8\x51"
 471        "\xDA\x53\xDA\xFC\x05\x36\xDF\x08\x0E\x08\x36\xBE\x5C\x86\x9E\xCA"
 472        "\x68\x90\x33\x12\x0B\x14\x82\xAB\x90\x1A\xD4\x49\x32\x9C\xBD\xAA"
 473        "\xAB\x4E\x38\xF1\xEE\xED\x3D\x3F\xE8\xBD\x48\x56\xA6\x64\xEE\xC8"
 474        "\xD7"
 475        "\x02\x82\x01\x01" /* exponent 1 - integer of 257 bytes */
 476        "\x00\x96\x5E\x6F\x8F\x06\xD6\xE6\x03\x1F\x96\x76\x81\x38\xBF\x30"
 477        "\xCC\x40\x84\xAF\xD0\xE7\x06\xA5\x24\x0E\xCE\x59\xA5\x26\xFE\x0F"
 478        "\x74\xBB\x83\xC6\x26\x02\xAF\x3C\xA3\x6B\x9C\xFF\x68\x0C\xEB\x40"
 479        "\x42\x46\xCB\x2E\x5E\x2C\xF4\x3A\x32\x77\x77\xED\xAF\xBA\x02\x17"
 480        "\xE1\x93\xF0\x43\x4A\x8F\x31\x39\xEF\x72\x0F\x6B\x79\x10\x59\x84"
 481        "\xBA\x5A\x55\x7F\x0E\xDB\xEE\xEE\xD6\xA9\xB8\x44\x9F\x3A\xC6\xB9"
 482        "\x33\x3B\x5C\x90\x11\xD0\x9B\xCC\x8A\xBF\x0E\x10\x5B\x4B\xF1\x50"
 483        "\x9E\x35\xB3\xE0\x6D\x7A\x95\x9C\x38\x5D\xC0\x75\x13\xC2\x15\xA7"
 484        "\x81\xEA\xBA\xF7\x4D\x9E\x85\x9D\xF1\x7D\xBA\xD0\x45\x6F\x2A\xD0"
 485        "\x76\xC2\x28\xD0\xAD\xA7\xB5\xDC\xE3\x6A\x99\xFF\x83\x50\xB3\x75"
 486        "\x07\x14\x91\xAF\xEF\x74\xB5\x9F\x9A\xE0\xBA\xA9\x0B\x87\xF3\x85"
 487        "\x5C\x40\xB2\x0E\xA7\xFD\xC6\xED\x45\x8E\xD9\x7C\xB0\xB2\x68\xC6"
 488        "\x1D\xFD\x70\x78\x06\x41\x7F\x95\x12\x36\x9D\xE2\x58\x5D\x15\xEE"
 489        "\x41\x49\xF5\xFA\xEC\x56\x19\xA0\xE6\xE0\xB2\x40\xE1\xD9\xD0\x03"
 490        "\x22\x02\xCF\xD1\x3C\x07\x38\x65\x8F\x65\x0E\xAA\x32\xCE\x25\x05"
 491        "\x16\x73\x51\xB9\x9F\x88\x0B\xCD\x30\xF3\x97\xCC\x2B\x6B\xA4\x0E"
 492        "\x6F"
 493        "\x02\x82\x01\x00" /* exponent 2 - integer of 256 bytes */
 494        "\x2A\x5F\x3F\xB8\x08\x90\x58\x47\xA9\xE4\xB1\x11\xA3\xE7\x5B\xF4"
 495        "\x43\xBE\x08\xC3\x56\x86\x3C\x7E\x6C\x84\x96\x9C\xF9\xCB\xF6\x05"
 496        "\x5E\x13\xB8\x11\x37\x80\xAD\xF2\xBE\x2B\x0A\x5D\xF5\xE0\xCB\xB7"
 497        "\x00\x39\x66\x82\x41\x5F\x51\x2F\xBF\x56\xE8\x91\xC8\xAA\x6C\xFE"
 498        "\x9F\x8C\x4A\x7D\x43\xD2\x91\x1F\xFF\x9F\xF6\x21\x1C\xB6\x46\x55"
 499        "\x48\xCA\x38\xAB\xC1\xCD\x4D\x65\x5A\xAF\xA8\x6D\xDA\x6D\xF0\x34"
 500        "\x10\x79\x14\x0D\xFA\xA2\x8C\x17\x54\xB4\x18\xD5\x7E\x5F\x90\x50"
 501        "\x87\x84\xE7\xFB\xD7\x61\x53\x5D\xAB\x96\xC7\x6E\x7A\x42\xA0\xFC"
 502        "\x07\xED\xB7\x5F\x80\xD9\x19\xFF\xFB\xFD\x9E\xC4\x73\x31\x62\x3D"
 503        "\x6C\x9E\x15\x03\x62\xA5\x85\xCC\x19\x8E\x9D\x7F\xE3\x6D\xA8\x5D"
 504        "\x96\xF5\xAC\x78\x3D\x81\x27\xE7\x29\xF1\x29\x1D\x09\xBB\x77\x86"
 505        "\x6B\x65\x62\x88\xE1\x31\x1A\x22\xF7\xC5\xCE\x73\x65\x1C\xBE\xE7"
 506        "\x63\xD3\xD3\x14\x63\x27\xAF\x28\xF3\x23\xB6\x76\xC1\xBD\x9D\x82"
 507        "\xF4\x9B\x19\x7D\x2C\x57\xF0\xC2\x2A\x51\xAE\x95\x0D\x8C\x38\x54"
 508        "\xF5\xC6\xA0\x51\xB7\x0E\xB9\xEC\xE7\x0D\x22\xF6\x1A\xD3\xFE\x16"
 509        "\x21\x03\xB7\x0D\x85\xD3\x35\xC9\xDD\xE4\x59\x85\xBE\x7F\xA1\x75"
 510        "\x02\x82\x01\x01" /* coefficient - integer of 257 bytes */
 511        "\x00\xB9\x48\xD2\x54\x2F\x19\x54\x64\xAE\x62\x80\x61\x89\x80\xB4"
 512        "\x48\x0B\x8D\x7E\x1B\x0F\x50\x08\x82\x3F\xED\x75\x84\xB7\x13\xE4"
 513        "\xF8\x8D\xA8\xBB\x54\x21\x4C\x5A\x54\x07\x16\x4B\xB4\xA4\x9E\x30"
 514        "\xBF\x7A\x30\x1B\x39\x60\xA3\x21\x53\xFB\xB0\xDC\x0F\x7C\x2C\xFB"
 515        "\xAA\x95\x7D\x51\x39\x28\x33\x1F\x25\x31\x53\xF5\xD2\x64\x2B\xF2"
 516        "\x1E\xB3\xC0\x6A\x0B\xC9\xA4\x42\x64\x5C\xFB\x15\xA3\xE8\x4C\x3A"
 517        "\x9C\x3C\xBE\xA3\x39\x83\x23\xE3\x6D\x18\xCC\xC2\xDC\x63\x8D\xBA"
 518        "\x98\xE0\xE0\x31\x4A\x2B\x37\x9C\x4D\x6B\xF3\x9F\x51\xE4\x43\x5C"
 519        "\x83\x5F\xBF\x5C\xFE\x92\x45\x01\xAF\xF5\xC2\xF4\xB7\x56\x93\xA5"
 520        "\xF4\xAA\x67\x3C\x48\x37\xBD\x9A\x3C\xFE\xA5\x9A\xB0\xD1\x6B\x85"
 521        "\xDD\x81\xD4\xFA\xAD\x31\x83\xA8\x22\x9B\xFD\xB4\x61\xDC\x7A\x51"
 522        "\x59\x62\x10\x1B\x7E\x44\xA3\xFE\x90\x51\x5A\x3E\x02\x87\xAD\xFA"
 523        "\xDD\x0B\x1F\x3D\x35\xAF\xEE\x13\x85\x51\xA7\x42\xC0\xEE\x9E\x20"
 524        "\xE9\xD0\x29\xB2\xE4\x21\xE4\x6D\x62\xB9\xF4\x48\x4A\xD8\x46\x8E"
 525        "\x61\xA6\x2C\x5D\xDF\x8F\x97\x2B\x3A\x75\x1D\x83\x17\x6F\xC6\xB0"
 526        "\xDE\xFC\x14\x25\x06\x5A\x60\xBB\xB8\x21\x89\xD1\xEF\x57\xF1\x71"
 527        "\x3D",
 528        .m = "\x54\x85\x9b\x34\x2c\x49\xea\x2a",
 529        .c =
 530        "\x5c\xce\x9c\xd7\x9a\x9e\xa1\xfe\x7a\x82\x3c\x68\x27\x98\xe3\x5d"
 531        "\xd5\xd7\x07\x29\xf5\xfb\xc3\x1a\x7f\x63\x1e\x62\x31\x3b\x19\x87"
 532        "\x79\x4f\xec\x7b\xf3\xcb\xea\x9b\x95\x52\x3a\x40\xe5\x87\x7b\x72"
 533        "\xd1\x72\xc9\xfb\x54\x63\xd8\xc9\xd7\x2c\xfc\x7b\xc3\x14\x1e\xbc"
 534        "\x18\xb4\x34\xa1\xbf\x14\xb1\x37\x31\x6e\xf0\x1b\x35\x19\x54\x07"
 535        "\xf7\x99\xec\x3e\x63\xe2\xcd\x61\x28\x65\xc3\xcd\xb1\x38\x36\xa5"
 536        "\xb2\xd7\xb0\xdc\x1f\xf5\xef\x19\xc7\x53\x32\x2d\x1c\x26\xda\xe4"
 537        "\x0d\xd6\x90\x7e\x28\xd8\xdc\xe4\x61\x05\xd2\x25\x90\x01\xd3\x96"
 538        "\x6d\xa6\xcf\x58\x20\xbb\x03\xf4\x01\xbc\x79\xb9\x18\xd8\xb8\xba"
 539        "\xbd\x93\xfc\xf2\x62\x5d\x8c\x66\x1e\x0e\x84\x59\x93\xdd\xe2\x93"
 540        "\xa2\x62\x7d\x08\x82\x7a\xdd\xfc\xb8\xbc\xc5\x4f\x9c\x4e\xbf\xb4"
 541        "\xfc\xf4\xc5\x01\xe8\x00\x70\x4d\x28\x26\xcc\x2e\xfe\x0e\x58\x41"
 542        "\x8b\xec\xaf\x7c\x4b\x54\xd0\xa0\x64\xf9\x32\xf4\x2e\x47\x65\x0a"
 543        "\x67\x88\x39\x3a\xdb\xb2\xdb\x7b\xb5\xf6\x17\xa8\xd9\xc6\x5e\x28"
 544        "\x13\x82\x8a\x99\xdb\x60\x08\xa5\x23\x37\xfa\x88\x90\x31\xc8\x9d"
 545        "\x8f\xec\xfb\x85\x9f\xb1\xce\xa6\x24\x50\x46\x44\x47\xcb\x65\xd1"
 546        "\xdf\xc0\xb1\x6c\x90\x1f\x99\x8e\x4d\xd5\x9e\x31\x07\x66\x87\xdf"
 547        "\x01\xaa\x56\x3c\x71\xe0\x2b\x6f\x67\x3b\x23\xed\xc2\xbd\x03\x30"
 548        "\x79\x76\x02\x10\x10\x98\x85\x8a\xff\xfd\x0b\xda\xa5\xd9\x32\x48"
 549        "\x02\xa0\x0b\xb9\x2a\x8a\x18\xca\xc6\x8f\x3f\xbb\x16\xb2\xaa\x98"
 550        "\x27\xe3\x60\x43\xed\x15\x70\xd4\x57\x15\xfe\x19\xd4\x9b\x13\x78"
 551        "\x8a\xf7\x21\xf1\xa2\xa2\x2d\xb3\x09\xcf\x44\x91\x6e\x08\x3a\x30"
 552        "\x81\x3e\x90\x93\x8a\x67\x33\x00\x59\x54\x9a\x25\xd3\x49\x8e\x9f"
 553        "\xc1\x4b\xe5\x86\xf3\x50\x4c\xbc\xc5\xd3\xf5\x3a\x54\xe1\x36\x3f"
 554        "\xe2\x5a\xb4\x37\xc0\xeb\x70\x35\xec\xf6\xb7\xe8\x44\x3b\x7b\xf3"
 555        "\xf1\xf2\x1e\xdb\x60\x7d\xd5\xbe\xf0\x71\x34\x90\x4c\xcb\xd4\x35"
 556        "\x51\xc7\xdd\xd8\xc9\x81\xf5\x5d\x57\x46\x2c\xb1\x7b\x9b\xaa\xcb"
 557        "\xd1\x22\x25\x49\x44\xa3\xd4\x6b\x29\x7b\xd8\xb2\x07\x93\xbf\x3d"
 558        "\x52\x49\x84\x79\xef\xb8\xe5\xc4\xad\xca\xa8\xc6\xf6\xa6\x76\x70"
 559        "\x5b\x0b\xe5\x83\xc6\x0e\xef\x55\xf2\xe7\xff\x04\xea\xe6\x13\xbe"
 560        "\x40\xe1\x40\x45\x48\x66\x75\x31\xae\x35\x64\x91\x11\x6f\xda\xee"
 561        "\x26\x86\x45\x6f\x0b\xd5\x9f\x03\xb1\x65\x5b\xdb\xa4\xe4\xf9\x45",
 562        .key_len = 2349,
 563        .m_size = 8,
 564        .c_size = 512,
 565#endif
 566        }
 567};
 568
 569/*
 570 * ECDSA test vectors.
 571 */
 572static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
 573        {
 574        .key =
 575        "\x04\xf7\x46\xf8\x2f\x15\xf6\x22\x8e\xd7\x57\x4f\xcc\xe7\xbb\xc1"
 576        "\xd4\x09\x73\xcf\xea\xd0\x15\x07\x3d\xa5\x8a\x8a\x95\x43\xe4\x68"
 577        "\xea\xc6\x25\xc1\xc1\x01\x25\x4c\x7e\xc3\x3c\xa6\x04\x0a\xe7\x08"
 578        "\x98",
 579        .key_len = 49,
 580        .params =
 581        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 582        "\xce\x3d\x03\x01\x01",
 583        .param_len = 21,
 584        .m =
 585        "\xcd\xb9\xd2\x1c\xb7\x6f\xcd\x44\xb3\xfd\x63\xea\xa3\x66\x7f\xae"
 586        "\x63\x85\xe7\x82",
 587        .m_size = 20,
 588        .algo = OID_id_ecdsa_with_sha1,
 589        .c =
 590        "\x30\x35\x02\x19\x00\xba\xe5\x93\x83\x6e\xb6\x3b\x63\xa0\x27\x91"
 591        "\xc6\xf6\x7f\xc3\x09\xad\x59\xad\x88\x27\xd6\x92\x6b\x02\x18\x10"
 592        "\x68\x01\x9d\xba\xce\x83\x08\xef\x95\x52\x7b\xa0\x0f\xe4\x18\x86"
 593        "\x80\x6f\xa5\x79\x77\xda\xd0",
 594        .c_size = 55,
 595        .public_key_vec = true,
 596        .siggen_sigver_test = true,
 597        }, {
 598        .key =
 599        "\x04\xb6\x4b\xb1\xd1\xac\xba\x24\x8f\x65\xb2\x60\x00\x90\xbf\xbd"
 600        "\x78\x05\x73\xe9\x79\x1d\x6f\x7c\x0b\xd2\xc3\x93\xa7\x28\xe1\x75"
 601        "\xf7\xd5\x95\x1d\x28\x10\xc0\x75\x50\x5c\x1a\x4f\x3f\x8f\xa5\xee"
 602        "\xa3",
 603        .key_len = 49,
 604        .params =
 605        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 606        "\xce\x3d\x03\x01\x01",
 607        .param_len = 21,
 608        .m =
 609        "\x8d\xd6\xb8\x3e\xe5\xff\x23\xf6\x25\xa2\x43\x42\x74\x45\xa7\x40"
 610        "\x3a\xff\x2f\xe1\xd3\xf6\x9f\xe8\x33\xcb\x12\x11",
 611        .m_size = 28,
 612        .algo = OID_id_ecdsa_with_sha224,
 613        .c =
 614        "\x30\x34\x02\x18\x5a\x8b\x82\x69\x7e\x8a\x0a\x09\x14\xf8\x11\x2b"
 615        "\x55\xdc\xae\x37\x83\x7b\x12\xe6\xb6\x5b\xcb\xd4\x02\x18\x6a\x14"
 616        "\x4f\x53\x75\xc8\x02\x48\xeb\xc3\x92\x0f\x1e\x72\xee\xc4\xa3\xe3"
 617        "\x5c\x99\xdb\x92\x5b\x36",
 618        .c_size = 54,
 619        .public_key_vec = true,
 620        .siggen_sigver_test = true,
 621        }, {
 622        .key =
 623        "\x04\xe2\x51\x24\x9b\xf7\xb6\x32\x82\x39\x66\x3d\x5b\xec\x3b\xae"
 624        "\x0c\xd5\xf2\x67\xd1\xc7\xe1\x02\xe4\xbf\x90\x62\xb8\x55\x75\x56"
 625        "\x69\x20\x5e\xcb\x4e\xca\x33\xd6\xcb\x62\x6b\x94\xa9\xa2\xe9\x58"
 626        "\x91",
 627        .key_len = 49,
 628        .params =
 629        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 630        "\xce\x3d\x03\x01\x01",
 631        .param_len = 21,
 632        .m =
 633        "\x35\xec\xa1\xa0\x9e\x14\xde\x33\x03\xb6\xf6\xbd\x0c\x2f\xb2\xfd"
 634        "\x1f\x27\x82\xa5\xd7\x70\x3f\xef\xa0\x82\x69\x8e\x73\x31\x8e\xd7",
 635        .m_size = 32,
 636        .algo = OID_id_ecdsa_with_sha256,
 637        .c =
 638        "\x30\x35\x02\x18\x3f\x72\x3f\x1f\x42\xd2\x3f\x1d\x6b\x1a\x58\x56"
 639        "\xf1\x8f\xf7\xfd\x01\x48\xfb\x5f\x72\x2a\xd4\x8f\x02\x19\x00\xb3"
 640        "\x69\x43\xfd\x48\x19\x86\xcf\x32\xdd\x41\x74\x6a\x51\xc7\xd9\x7d"
 641        "\x3a\x97\xd9\xcd\x1a\x6a\x49",
 642        .c_size = 55,
 643        .public_key_vec = true,
 644        .siggen_sigver_test = true,
 645        }, {
 646        .key =
 647        "\x04\x5a\x13\xfe\x68\x86\x4d\xf4\x17\xc7\xa4\xe5\x8c\x65\x57\xb7"
 648        "\x03\x73\x26\x57\xfb\xe5\x58\x40\xd8\xfd\x49\x05\xab\xf1\x66\x1f"
 649        "\xe2\x9d\x93\x9e\xc2\x22\x5a\x8b\x4f\xf3\x77\x22\x59\x7e\xa6\x4e"
 650        "\x8b",
 651        .key_len = 49,
 652        .params =
 653        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 654        "\xce\x3d\x03\x01\x01",
 655        .param_len = 21,
 656        .m =
 657        "\x9d\x2e\x1a\x8f\xed\x6c\x4b\x61\xae\xac\xd5\x19\x79\xce\x67\xf9"
 658        "\xa0\x34\xeb\xb0\x81\xf9\xd9\xdc\x6e\xb3\x5c\xa8\x69\xfc\x8a\x61"
 659        "\x39\x81\xfb\xfd\x5c\x30\x6b\xa8\xee\xed\x89\xaf\xa3\x05\xe4\x78",
 660        .m_size = 48,
 661        .algo = OID_id_ecdsa_with_sha384,
 662        .c =
 663        "\x30\x35\x02\x19\x00\xf0\xa3\x38\xce\x2b\xf8\x9d\x1a\xcf\x7f\x34"
 664        "\xb4\xb4\xe5\xc5\x00\xdd\x15\xbb\xd6\x8c\xa7\x03\x78\x02\x18\x64"
 665        "\xbc\x5a\x1f\x82\x96\x61\xd7\xd1\x01\x77\x44\x5d\x53\xa4\x7c\x93"
 666        "\x12\x3b\x3b\x28\xfb\x6d\xe1",
 667        .c_size = 55,
 668        .public_key_vec = true,
 669        .siggen_sigver_test = true,
 670        }, {
 671        .key =
 672        "\x04\xd5\xf2\x6e\xc3\x94\x5c\x52\xbc\xdf\x86\x6c\x14\xd1\xca\xea"
 673        "\xcc\x72\x3a\x8a\xf6\x7a\x3a\x56\x36\x3b\xca\xc6\x94\x0e\x17\x1d"
 674        "\x9e\xa0\x58\x28\xf9\x4b\xe6\xd1\xa5\x44\x91\x35\x0d\xe7\xf5\x11"
 675        "\x57",
 676        .key_len = 49,
 677        .params =
 678        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 679        "\xce\x3d\x03\x01\x01",
 680        .param_len = 21,
 681        .m =
 682        "\xd5\x4b\xe9\x36\xda\xd8\x6e\xc0\x50\x03\xbe\x00\x43\xff\xf0\x23"
 683        "\xac\xa2\x42\xe7\x37\x77\x79\x52\x8f\x3e\xc0\x16\xc1\xfc\x8c\x67"
 684        "\x16\xbc\x8a\x5d\x3b\xd3\x13\xbb\xb6\xc0\x26\x1b\xeb\x33\xcc\x70"
 685        "\x4a\xf2\x11\x37\xe8\x1b\xba\x55\xac\x69\xe1\x74\x62\x7c\x6e\xb5",
 686        .m_size = 64,
 687        .algo = OID_id_ecdsa_with_sha512,
 688        .c =
 689        "\x30\x35\x02\x19\x00\x88\x5b\x8f\x59\x43\xbf\xcf\xc6\xdd\x3f\x07"
 690        "\x87\x12\xa0\xd4\xac\x2b\x11\x2d\x1c\xb6\x06\xc9\x6c\x02\x18\x73"
 691        "\xb4\x22\x9a\x98\x73\x3c\x83\xa9\x14\x2a\x5e\xf5\xe5\xfb\x72\x28"
 692        "\x6a\xdf\x97\xfd\x82\x76\x24",
 693        .c_size = 55,
 694        .public_key_vec = true,
 695        .siggen_sigver_test = true,
 696        },
 697};
 698
 699static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
 700        {
 701        .key =
 702        "\x04\xb9\x7b\xbb\xd7\x17\x64\xd2\x7e\xfc\x81\x5d\x87\x06\x83\x41"
 703        "\x22\xd6\x9a\xaa\x87\x17\xec\x4f\x63\x55\x2f\x94\xba\xdd\x83\xe9"
 704        "\x34\x4b\xf3\xe9\x91\x13\x50\xb6\xcb\xca\x62\x08\xe7\x3b\x09\xdc"
 705        "\xc3\x63\x4b\x2d\xb9\x73\x53\xe4\x45\xe6\x7c\xad\xe7\x6b\xb0\xe8"
 706        "\xaf",
 707        .key_len = 65,
 708        .params =
 709        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 710        "\xce\x3d\x03\x01\x07",
 711        .param_len = 21,
 712        .m =
 713        "\xc2\x2b\x5f\x91\x78\x34\x26\x09\x42\x8d\x6f\x51\xb2\xc5\xaf\x4c"
 714        "\x0b\xde\x6a\x42",
 715        .m_size = 20,
 716        .algo = OID_id_ecdsa_with_sha1,
 717        .c =
 718        "\x30\x46\x02\x21\x00\xf9\x25\xce\x9f\x3a\xa6\x35\x81\xcf\xd4\xe7"
 719        "\xb7\xf0\x82\x56\x41\xf7\xd4\xad\x8d\x94\x5a\x69\x89\xee\xca\x6a"
 720        "\x52\x0e\x48\x4d\xcc\x02\x21\x00\xd7\xe4\xef\x52\x66\xd3\x5b\x9d"
 721        "\x8a\xfa\x54\x93\x29\xa7\x70\x86\xf1\x03\x03\xf3\x3b\xe2\x73\xf7"
 722        "\xfb\x9d\x8b\xde\xd4\x8d\x6f\xad",
 723        .c_size = 72,
 724        .public_key_vec = true,
 725        .siggen_sigver_test = true,
 726        }, {
 727        .key =
 728        "\x04\x8b\x6d\xc0\x33\x8e\x2d\x8b\x67\xf5\xeb\xc4\x7f\xa0\xf5\xd9"
 729        "\x7b\x03\xa5\x78\x9a\xb5\xea\x14\xe4\x23\xd0\xaf\xd7\x0e\x2e\xa0"
 730        "\xc9\x8b\xdb\x95\xf8\xb3\xaf\xac\x00\x2c\x2c\x1f\x7a\xfd\x95\x88"
 731        "\x43\x13\xbf\xf3\x1c\x05\x1a\x14\x18\x09\x3f\xd6\x28\x3e\xc5\xa0"
 732        "\xd4",
 733        .key_len = 65,
 734        .params =
 735        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 736        "\xce\x3d\x03\x01\x07",
 737        .param_len = 21,
 738        .m =
 739        "\x1a\x15\xbc\xa3\xe4\xed\x3a\xb8\x23\x67\xc6\xc4\x34\xf8\x6c\x41"
 740        "\x04\x0b\xda\xc5\x77\xfa\x1c\x2d\xe6\x2c\x3b\xe0",
 741        .m_size = 28,
 742        .algo = OID_id_ecdsa_with_sha224,
 743        .c =
 744        "\x30\x44\x02\x20\x20\x43\xfa\xc0\x9f\x9d\x7b\xe7\xae\xce\x77\x59"
 745        "\x1a\xdb\x59\xd5\x34\x62\x79\xcb\x6a\x91\x67\x2e\x7d\x25\xd8\x25"
 746        "\xf5\x81\xd2\x1e\x02\x20\x5f\xf8\x74\xf8\x57\xd0\x5e\x54\x76\x20"
 747        "\x4a\x77\x22\xec\xc8\x66\xbf\x50\x05\x58\x39\x0e\x26\x92\xce\xd5"
 748        "\x2e\x8b\xde\x5a\x04\x0e",
 749        .c_size = 70,
 750        .public_key_vec = true,
 751        .siggen_sigver_test = true,
 752        }, {
 753        .key =
 754        "\x04\xf1\xea\xc4\x53\xf3\xb9\x0e\x9f\x7e\xad\xe3\xea\xd7\x0e\x0f"
 755        "\xd6\x98\x9a\xca\x92\x4d\x0a\x80\xdb\x2d\x45\xc7\xec\x4b\x97\x00"
 756        "\x2f\xe9\x42\x6c\x29\xdc\x55\x0e\x0b\x53\x12\x9b\x2b\xad\x2c\xe9"
 757        "\x80\xe6\xc5\x43\xc2\x1d\x5e\xbb\x65\x21\x50\xb6\x37\xb0\x03\x8e"
 758        "\xb8",
 759        .key_len = 65,
 760        .params =
 761        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 762        "\xce\x3d\x03\x01\x07",
 763        .param_len = 21,
 764        .m =
 765        "\x8f\x43\x43\x46\x64\x8f\x6b\x96\xdf\x89\xdd\xa9\x01\xc5\x17\x6b"
 766        "\x10\xa6\xd8\x39\x61\xdd\x3c\x1a\xc8\x8b\x59\xb2\xdc\x32\x7a\xa4",
 767        .m_size = 32,
 768        .algo = OID_id_ecdsa_with_sha256,
 769        .c =
 770        "\x30\x45\x02\x20\x08\x31\xfa\x74\x0d\x1d\x21\x5d\x09\xdc\x29\x63"
 771        "\xa8\x1a\xad\xfc\xac\x44\xc3\xe8\x24\x11\x2d\xa4\x91\xdc\x02\x67"
 772        "\xdc\x0c\xd0\x82\x02\x21\x00\xbd\xff\xce\xee\x42\xc3\x97\xff\xf9"
 773        "\xa9\x81\xac\x4a\x50\xd0\x91\x0a\x6e\x1b\xc4\xaf\xe1\x83\xc3\x4f"
 774        "\x2a\x65\x35\x23\xe3\x1d\xfa",
 775        .c_size = 71,
 776        .public_key_vec = true,
 777        .siggen_sigver_test = true,
 778        }, {
 779        .key =
 780        "\x04\xc5\xc6\xea\x60\xc9\xce\xad\x02\x8d\xf5\x3e\x24\xe3\x52\x1d"
 781        "\x28\x47\x3b\xc3\x6b\xa4\x99\x35\x99\x11\x88\x88\xc8\xf4\xee\x7e"
 782        "\x8c\x33\x8f\x41\x03\x24\x46\x2b\x1a\x82\xf9\x9f\xe1\x97\x1b\x00"
 783        "\xda\x3b\x24\x41\xf7\x66\x33\x58\x3d\x3a\x81\xad\xcf\x16\xe9\xe2"
 784        "\x7c",
 785        .key_len = 65,
 786        .params =
 787        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 788        "\xce\x3d\x03\x01\x07",
 789        .param_len = 21,
 790        .m =
 791        "\x3e\x78\x70\xfb\xcd\x66\xba\x91\xa1\x79\xff\x1e\x1c\x6b\x78\xe6"
 792        "\xc0\x81\x3a\x65\x97\x14\x84\x36\x14\x1a\x9a\xb7\xc5\xab\x84\x94"
 793        "\x5e\xbb\x1b\x34\x71\xcb\x41\xe1\xf6\xfc\x92\x7b\x34\xbb\x86\xbb",
 794        .m_size = 48,
 795        .algo = OID_id_ecdsa_with_sha384,
 796        .c =
 797        "\x30\x46\x02\x21\x00\x8e\xf3\x6f\xdc\xf8\x69\xa6\x2e\xd0\x2e\x95"
 798        "\x54\xd1\x95\x64\x93\x08\xb2\x6b\x24\x94\x48\x46\x5e\xf2\xe4\x6c"
 799        "\xc7\x94\xb1\xd5\xfe\x02\x21\x00\xeb\xa7\x80\x26\xdc\xf9\x3a\x44"
 800        "\x19\xfb\x5f\x92\xf4\xc9\x23\x37\x69\xf4\x3b\x4f\x47\xcf\x9b\x16"
 801        "\xc0\x60\x11\x92\xdc\x17\x89\x12",
 802        .c_size = 72,
 803        .public_key_vec = true,
 804        .siggen_sigver_test = true,
 805        }, {
 806        .key =
 807        "\x04\xd7\x27\x46\x49\xf6\x26\x85\x12\x40\x76\x8e\xe2\xe6\x2a\x7a"
 808        "\x83\xb1\x4e\x7a\xeb\x3b\x5c\x67\x4a\xb5\xa4\x92\x8c\x69\xff\x38"
 809        "\xee\xd9\x4e\x13\x29\x59\xad\xde\x6b\xbb\x45\x31\xee\xfd\xd1\x1b"
 810        "\x64\xd3\xb5\xfc\xaf\x9b\x4b\x88\x3b\x0e\xb7\xd6\xdf\xf1\xd5\x92"
 811        "\xbf",
 812        .key_len = 65,
 813        .params =
 814        "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
 815        "\xce\x3d\x03\x01\x07",
 816        .param_len = 21,
 817        .m =
 818        "\x57\xb7\x9e\xe9\x05\x0a\x8c\x1b\xc9\x13\xe5\x4a\x24\xc7\xe2\xe9"
 819        "\x43\xc3\xd1\x76\x62\xf4\x98\x1a\x9c\x13\xb0\x20\x1b\xe5\x39\xca"
 820        "\x4f\xd9\x85\x34\x95\xa2\x31\xbc\xbb\xde\xdd\x76\xbb\x61\xe3\xcf"
 821        "\x9d\xc0\x49\x7a\xf3\x7a\xc4\x7d\xa8\x04\x4b\x8d\xb4\x4d\x5b\xd6",
 822        .m_size = 64,
 823        .algo = OID_id_ecdsa_with_sha512,
 824        .c =
 825        "\x30\x45\x02\x21\x00\xb8\x6d\x87\x81\x43\xdf\xfb\x9f\x40\xea\x44"
 826        "\x81\x00\x4e\x29\x08\xed\x8c\x73\x30\x6c\x22\xb3\x97\x76\xf6\x04"
 827        "\x99\x09\x37\x4d\xfa\x02\x20\x1e\xb9\x75\x31\xf6\x04\xa5\x4d\xf8"
 828        "\x00\xdd\xab\xd4\xc0\x2b\xe6\x5c\xad\xc3\x78\x1c\xc2\xc1\x19\x76"
 829        "\x31\x79\x4a\xe9\x81\x6a\xee",
 830        .c_size = 71,
 831        .public_key_vec = true,
 832        .siggen_sigver_test = true,
 833        },
 834};
 835
 836static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
 837        {
 838        .key = /* secp384r1(sha1) */
 839        "\x04\x89\x25\xf3\x97\x88\xcb\xb0\x78\xc5\x72\x9a\x14\x6e\x7a\xb1"
 840        "\x5a\xa5\x24\xf1\x95\x06\x9e\x28\xfb\xc4\xb9\xbe\x5a\x0d\xd9\x9f"
 841        "\xf3\xd1\x4d\x2d\x07\x99\xbd\xda\xa7\x66\xec\xbb\xea\xba\x79\x42"
 842        "\xc9\x34\x89\x6a\xe7\x0b\xc3\xf2\xfe\x32\x30\xbe\xba\xf9\xdf\x7e"
 843        "\x4b\x6a\x07\x8e\x26\x66\x3f\x1d\xec\xa2\x57\x91\x51\xdd\x17\x0e"
 844        "\x0b\x25\xd6\x80\x5c\x3b\xe6\x1a\x98\x48\x91\x45\x7a\x73\xb0\xc3"
 845        "\xf1",
 846        .key_len = 97,
 847        .params =
 848        "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
 849        "\x00\x22",
 850        .param_len = 18,
 851        .m =
 852        "\x12\x55\x28\xf0\x77\xd5\xb6\x21\x71\x32\x48\xcd\x28\xa8\x25\x22"
 853        "\x3a\x69\xc1\x93",
 854        .m_size = 20,
 855        .algo = OID_id_ecdsa_with_sha1,
 856        .c =
 857        "\x30\x66\x02\x31\x00\xf5\x0f\x24\x4c\x07\x93\x6f\x21\x57\x55\x07"
 858        "\x20\x43\x30\xde\xa0\x8d\x26\x8e\xae\x63\x3f\xbc\x20\x3a\xc6\xf1"
 859        "\x32\x3c\xce\x70\x2b\x78\xf1\x4c\x26\xe6\x5b\x86\xcf\xec\x7c\x7e"
 860        "\xd0\x87\xd7\xd7\x6e\x02\x31\x00\xcd\xbb\x7e\x81\x5d\x8f\x63\xc0"
 861        "\x5f\x63\xb1\xbe\x5e\x4c\x0e\xa1\xdf\x28\x8c\x1b\xfa\xf9\x95\x88"
 862        "\x74\xa0\x0f\xbf\xaf\xc3\x36\x76\x4a\xa1\x59\xf1\x1c\xa4\x58\x26"
 863        "\x79\x12\x2a\xb7\xc5\x15\x92\xc5",
 864        .c_size = 104,
 865        .public_key_vec = true,
 866        .siggen_sigver_test = true,
 867        }, {
 868        .key = /* secp384r1(sha224) */
 869        "\x04\x69\x6c\xcf\x62\xee\xd0\x0d\xe5\xb5\x2f\x70\x54\xcf\x26\xa0"
 870        "\xd9\x98\x8d\x92\x2a\xab\x9b\x11\xcb\x48\x18\xa1\xa9\x0d\xd5\x18"
 871        "\x3e\xe8\x29\x6e\xf6\xe4\xb5\x8e\xc7\x4a\xc2\x5f\x37\x13\x99\x05"
 872        "\xb6\xa4\x9d\xf9\xfb\x79\x41\xe7\xd7\x96\x9f\x73\x3b\x39\x43\xdc"
 873        "\xda\xf4\x06\xb9\xa5\x29\x01\x9d\x3b\xe1\xd8\x68\x77\x2a\xf4\x50"
 874        "\x6b\x93\x99\x6c\x66\x4c\x42\x3f\x65\x60\x6c\x1c\x0b\x93\x9b\x9d"
 875        "\xe0",
 876        .key_len = 97,
 877        .params =
 878        "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
 879        "\x00\x22",
 880        .param_len = 18,
 881        .m =
 882        "\x12\x80\xb6\xeb\x25\xe2\x3d\xf0\x21\x32\x96\x17\x3a\x38\x39\xfd"
 883        "\x1f\x05\x34\x7b\xb8\xf9\x71\x66\x03\x4f\xd5\xe5",
 884        .m_size = 28,
 885        .algo = OID_id_ecdsa_with_sha224,
 886        .c =
 887        "\x30\x66\x02\x31\x00\x8a\x51\x84\xce\x13\x1e\xd2\xdc\xec\xcb\xe4"
 888        "\x89\x47\xb2\xf7\xbc\x97\xf1\xc8\x72\x26\xcf\x5a\x5e\xc5\xda\xb4"
 889        "\xe3\x93\x07\xe0\x99\xc9\x9c\x11\xb8\x10\x01\xc5\x41\x3f\xdd\x15"
 890        "\x1b\x68\x2b\x9d\x8b\x02\x31\x00\x8b\x03\x2c\xfc\x1f\xd1\xa9\xa4"
 891        "\x4b\x00\x08\x31\x6c\xf5\xd5\xf6\xdf\xd8\x68\xa2\x64\x42\x65\xf3"
 892        "\x4d\xd0\xc6\x6e\xb0\xe9\xfc\x14\x9f\x19\xd0\x42\x8b\x93\xc2\x11"
 893        "\x88\x2b\x82\x26\x5e\x1c\xda\xfb",
 894        .c_size = 104,
 895        .public_key_vec = true,
 896        .siggen_sigver_test = true,
 897        }, {
 898        .key = /* secp384r1(sha256) */
 899        "\x04\xee\xd6\xda\x3e\x94\x90\x00\x27\xed\xf8\x64\x55\xd6\x51\x9a"
 900        "\x1f\x52\x00\x63\x78\xf1\xa9\xfd\x75\x4c\x9e\xb2\x20\x1a\x91\x5a"
 901        "\xba\x7a\xa3\xe5\x6c\xb6\x25\x68\x4b\xe8\x13\xa6\x54\x87\x2c\x0e"
 902        "\xd0\x83\x95\xbc\xbf\xc5\x28\x4f\x77\x1c\x46\xa6\xf0\xbc\xd4\xa4"
 903        "\x8d\xc2\x8f\xb3\x32\x37\x40\xd6\xca\xf8\xae\x07\x34\x52\x39\x52"
 904        "\x17\xc3\x34\x29\xd6\x40\xea\x5c\xb9\x3f\xfb\x32\x2e\x12\x33\xbc"
 905        "\xab",
 906        .key_len = 97,
 907        .params =
 908        "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
 909        "\x00\x22",
 910        .param_len = 18,
 911        .m =
 912        "\xaa\xe7\xfd\x03\x26\xcb\x94\x71\xe4\xce\x0f\xc5\xff\xa6\x29\xa3"
 913        "\xe1\xcc\x4c\x35\x4e\xde\xca\x80\xab\x26\x0c\x25\xe6\x68\x11\xc2",
 914        .m_size = 32,
 915        .algo = OID_id_ecdsa_with_sha256,
 916        .c =
 917        "\x30\x64\x02\x30\x08\x09\x12\x9d\x6e\x96\x64\xa6\x8e\x3f\x7e\xce"
 918        "\x0a\x9b\xaa\x59\xcc\x47\x53\x87\xbc\xbd\x83\x3f\xaf\x06\x3f\x84"
 919        "\x04\xe2\xf9\x67\xb6\xc6\xfc\x70\x2e\x66\x3c\x77\xc8\x8d\x2c\x79"
 920        "\x3a\x8e\x32\xc4\x02\x30\x40\x34\xb8\x90\xa9\x80\xab\x47\x26\xa2"
 921        "\xb0\x89\x42\x0a\xda\xd9\xdd\xce\xbc\xb2\x97\xf4\x9c\xf3\x15\x68"
 922        "\xc0\x75\x3e\x23\x5e\x36\x4f\x8d\xde\x1e\x93\x8d\x95\xbb\x10\x0e"
 923        "\xf4\x1f\x39\xca\x4d\x43",
 924        .c_size = 102,
 925        .public_key_vec = true,
 926        .siggen_sigver_test = true,
 927        }, {
 928        .key = /* secp384r1(sha384) */
 929        "\x04\x3a\x2f\x62\xe7\x1a\xcf\x24\xd0\x0b\x7c\xe0\xed\x46\x0a\x4f"
 930        "\x74\x16\x43\xe9\x1a\x25\x7c\x55\xff\xf0\x29\x68\x66\x20\x91\xf9"
 931        "\xdb\x2b\xf6\xb3\x6c\x54\x01\xca\xc7\x6a\x5c\x0d\xeb\x68\xd9\x3c"
 932        "\xf1\x01\x74\x1f\xf9\x6c\xe5\x5b\x60\xe9\x7f\x5d\xb3\x12\x80\x2a"
 933        "\xd8\x67\x92\xc9\x0e\x4c\x4c\x6b\xa1\xb2\xa8\x1e\xac\x1c\x97\xd9"
 934        "\x21\x67\xe5\x1b\x5a\x52\x31\x68\xd6\xee\xf0\x19\xb0\x55\xed\x89"
 935        "\x9e",
 936        .key_len = 97,
 937        .params =
 938        "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
 939        "\x00\x22",
 940        .param_len = 18,
 941        .m =
 942        "\x8d\xf2\xc0\xe9\xa8\xf3\x8e\x44\xc4\x8c\x1a\xa0\xb8\xd7\x17\xdf"
 943        "\xf2\x37\x1b\xc6\xe3\xf5\x62\xcc\x68\xf5\xd5\x0b\xbf\x73\x2b\xb1"
 944        "\xb0\x4c\x04\x00\x31\xab\xfe\xc8\xd6\x09\xc8\xf2\xea\xd3\x28\xff",
 945        .m_size = 48,
 946        .algo = OID_id_ecdsa_with_sha384,
 947        .c =
 948        "\x30\x66\x02\x31\x00\x9b\x28\x68\xc0\xa1\xea\x8c\x50\xee\x2e\x62"
 949        "\x35\x46\xfa\x00\xd8\x2d\x7a\x91\x5f\x49\x2d\x22\x08\x29\xe6\xfb"
 950        "\xca\x8c\xd6\xb6\xb4\x3b\x1f\x07\x8f\x15\x02\xfe\x1d\xa2\xa4\xc8"
 951        "\xf2\xea\x9d\x11\x1f\x02\x31\x00\xfc\x50\xf6\x43\xbd\x50\x82\x0e"
 952        "\xbf\xe3\x75\x24\x49\xac\xfb\xc8\x71\xcd\x8f\x18\x99\xf0\x0f\x13"
 953        "\x44\x92\x8c\x86\x99\x65\xb3\x97\x96\x17\x04\xc9\x05\x77\xf1\x8e"
 954        "\xab\x8d\x4e\xde\xe6\x6d\x9b\x66",
 955        .c_size = 104,
 956        .public_key_vec = true,
 957        .siggen_sigver_test = true,
 958        }, {
 959        .key = /* secp384r1(sha512) */
 960        "\x04\xb4\xe7\xc1\xeb\x64\x25\x22\x46\xc3\x86\x61\x80\xbe\x1e\x46"
 961        "\xcb\xf6\x05\xc2\xee\x73\x83\xbc\xea\x30\x61\x4d\x40\x05\x41\xf4"
 962        "\x8c\xe3\x0e\x5c\xf0\x50\xf2\x07\x19\xe8\x4f\x25\xbe\xee\x0c\x95"
 963        "\x54\x36\x86\xec\xc2\x20\x75\xf3\x89\xb5\x11\xa1\xb7\xf5\xaf\xbe"
 964        "\x81\xe4\xc3\x39\x06\xbd\xe4\xfe\x68\x1c\x6d\x99\x2b\x1b\x63\xfa"
 965        "\xdf\x42\x5c\xc2\x5a\xc7\x0c\xf4\x15\xf7\x1b\xa3\x2e\xd7\x00\xac"
 966        "\xa3",
 967        .key_len = 97,
 968        .params =
 969        "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
 970        "\x00\x22",
 971        .param_len = 18,
 972        .m =
 973        "\xe8\xb7\x52\x7d\x1a\x44\x20\x05\x53\x6b\x3a\x68\xf2\xe7\x6c\xa1"
 974        "\xae\x9d\x84\xbb\xba\x52\x43\x3e\x2c\x42\x78\x49\xbf\x78\xb2\x71"
 975        "\xeb\xe1\xe0\xe8\x42\x7b\x11\xad\x2b\x99\x05\x1d\x36\xe6\xac\xfc"
 976        "\x55\x73\xf0\x15\x63\x39\xb8\x6a\x6a\xc5\x91\x5b\xca\x6a\xa8\x0e",
 977        .m_size = 64,
 978        .algo = OID_id_ecdsa_with_sha512,
 979        .c =
 980        "\x30\x63\x02\x2f\x1d\x20\x94\x77\xfe\x31\xfa\x4d\xc6\xef\xda\x02"
 981        "\xe7\x0f\x52\x9a\x02\xde\x93\xe8\x83\xe4\x84\x4c\xfc\x6f\x80\xe3"
 982        "\xaf\xb3\xd9\xdc\x2b\x43\x0e\x6a\xb3\x53\x6f\x3e\xb3\xc7\xa8\xb3"
 983        "\x17\x77\xd1\x02\x30\x63\xf6\xf0\x3d\x5f\x5f\x99\x3f\xde\x3a\x3d"
 984        "\x16\xaf\xb4\x52\x6a\xec\x63\xe3\x0c\xec\x50\xdc\xcc\xc4\x6a\x03"
 985        "\x5f\x8d\x7a\xf9\xfb\x34\xe4\x8b\x80\xa5\xb6\xda\x2c\x4e\x45\xcf"
 986        "\x3c\x93\xff\x50\x5d",
 987        .c_size = 101,
 988        .public_key_vec = true,
 989        .siggen_sigver_test = true,
 990        },
 991};
 992
 993/*
 994 * EC-RDSA test vectors are generated by gost-engine.
 995 */
 996static const struct akcipher_testvec ecrdsa_tv_template[] = {
 997        {
 998        .key =
 999        "\x04\x40\xd5\xa7\x77\xf9\x26\x2f\x8c\xbd\xcc\xe3\x1f\x01\x94\x05"
1000        "\x3d\x2f\xec\xb5\x00\x34\xf5\x51\x6d\x3b\x90\x4b\x23\x28\x6f\x1d"
1001        "\xc8\x36\x61\x60\x36\xec\xbb\xb4\x0b\x95\x4e\x54\x4f\x15\x21\x05"
1002        "\xd8\x52\x66\x44\x31\x7e\x5d\xc5\xd1\x26\x00\x5f\x60\xd8\xf0\xc7"
1003        "\x27\xfc",
1004        .key_len = 66,
1005        .params = /* OID_gostCPSignA */
1006        "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x01\x06\x08\x2a\x85\x03"
1007        "\x07\x01\x01\x02\x02",
1008        .param_len = 21,
1009        .c =
1010        "\x41\x32\x09\x73\xa4\xc1\x38\xd6\x63\x7d\x8b\xf7\x50\x3f\xda\x9f"
1011        "\x68\x48\xc1\x50\xe3\x42\x3a\x9b\x2b\x28\x12\x2a\xa7\xc2\x75\x31"
1012        "\x65\x77\x8c\x3c\x9e\x0d\x56\xb2\xf9\xdc\x04\x33\x3e\xb0\x9e\xf9"
1013        "\x74\x4e\x59\xb3\x83\xf2\x91\x27\xda\x5e\xc7\x33\xc0\xc1\x8f\x41",
1014        .c_size = 64,
1015        .algo = OID_gost2012PKey256,
1016        .m =
1017        "\x75\x1b\x9b\x40\x25\xb9\x96\xd2\x9b\x00\x41\xb3\x58\xbf\x23\x14"
1018        "\x79\xd2\x76\x64\xa3\xbd\x66\x10\x79\x05\x5a\x06\x42\xec\xb9\xc9",
1019        .m_size = 32,
1020        .public_key_vec = true,
1021        .siggen_sigver_test = true,
1022        },
1023        {
1024        .key =
1025        "\x04\x40\x66\x6f\xd6\xb7\x06\xd0\xf5\xa5\x6f\x69\x5c\xa5\x13\x45"
1026        "\x14\xdd\xcb\x12\x9c\x1b\xf5\x28\x64\x7a\x49\x48\x29\x14\x66\x42"
1027        "\xb8\x1b\x5c\xf9\x56\x6d\x08\x3b\xce\xbb\x62\x2f\xc2\x3c\xc5\x49"
1028        "\x93\x27\x70\x20\xcc\x79\xeb\xdc\x76\x8e\x48\x6e\x04\x96\xc3\x29"
1029        "\xa0\x73",
1030        .key_len = 66,
1031        .params = /* OID_gostCPSignB */
1032        "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x02\x06\x08\x2a\x85\x03"
1033        "\x07\x01\x01\x02\x02",
1034        .param_len = 21,
1035        .c =
1036        "\x45\x6d\x4a\x03\x1d\x5c\x0b\x17\x79\xe7\x19\xdb\xbf\x81\x9f\x82"
1037        "\xae\x06\xda\xf5\x47\x00\x05\x80\xc3\x16\x06\x9a\x8e\x7c\xb2\x8e"
1038        "\x7f\x74\xaa\xec\x6b\x7b\x7f\x8b\xc6\x0b\x10\x42\x4e\x91\x2c\xdf"
1039        "\x7b\x8b\x15\xf4\x9e\x59\x0f\xc7\xa4\x68\x2e\xce\x89\xdf\x84\xe9",
1040        .c_size = 64,
1041        .algo = OID_gost2012PKey256,
1042        .m =
1043        "\xd0\x54\x00\x27\x6a\xeb\xce\x6c\xf5\xf6\xfb\x57\x18\x18\x21\x13"
1044        "\x11\x23\x4a\x70\x43\x52\x7a\x68\x11\x65\x45\x37\xbb\x25\xb7\x40",
1045        .m_size = 32,
1046        .public_key_vec = true,
1047        .siggen_sigver_test = true,
1048        },
1049        {
1050        .key =
1051        "\x04\x40\x05\x91\xa9\x7d\xcb\x87\xdc\x98\xa1\xbf\xff\xdd\x20\x61"
1052        "\xaa\x58\x3b\x2d\x8e\x9c\x41\x9d\x4f\xc6\x23\x17\xf9\xca\x60\x65"
1053        "\xbc\x97\x97\xf6\x6b\x24\xe8\xac\xb1\xa7\x61\x29\x3c\x71\xdc\xad"
1054        "\xcb\x20\xbe\x96\xe8\xf4\x44\x2e\x49\xd5\x2c\xb9\xc9\x3b\x9c\xaa"
1055        "\xba\x15",
1056        .key_len = 66,
1057        .params = /* OID_gostCPSignC */
1058        "\x30\x13\x06\x07\x2a\x85\x03\x02\x02\x23\x03\x06\x08\x2a\x85\x03"
1059        "\x07\x01\x01\x02\x02",
1060        .param_len = 21,
1061        .c =
1062        "\x3b\x2e\x2e\x74\x74\x47\xda\xea\x93\x90\x6a\xe2\xf5\xf5\xe6\x46"
1063        "\x11\xfc\xab\xdc\x52\xbc\x58\xdb\x45\x44\x12\x4a\xf7\xd0\xab\xc9"
1064        "\x73\xba\x64\xab\x0d\xac\x4e\x72\x10\xa8\x04\xf6\x1e\xe0\x48\x6a"
1065        "\xcd\xe8\xe3\x78\x73\x77\x82\x24\x8d\xf1\xd3\xeb\x4c\x25\x7e\xc0",
1066        .c_size = 64,
1067        .algo = OID_gost2012PKey256,
1068        .m =
1069        "\x52\x33\xf4\x3f\x7b\x5d\xcf\x20\xee\xe4\x5c\xab\x0b\x3f\x14\xd6"
1070        "\x9f\x16\xc6\x1c\xb1\x3f\x84\x41\x69\xec\x34\xfd\xf1\xf9\xa3\x39",
1071        .m_size = 32,
1072        .public_key_vec = true,
1073        .siggen_sigver_test = true,
1074        },
1075        {
1076        .key =
1077        "\x04\x81\x80\x85\x46\x8f\x16\xf8\x7a\x7e\x4a\xc3\x81\x9e\xf1\x6e"
1078        "\x94\x1e\x5d\x02\x87\xea\xfa\xa0\x0a\x17\x70\x49\x64\xad\x95\x68"
1079        "\x60\x0a\xf0\x57\x29\x41\x79\x30\x3c\x61\x69\xf2\xa6\x94\x87\x17"
1080        "\x54\xfa\x97\x2c\xe6\x1e\x0a\xbb\x55\x10\x57\xbe\xf7\xc1\x77\x2b"
1081        "\x11\x74\x0a\x50\x37\x14\x10\x2a\x45\xfc\x7a\xae\x1c\x4c\xce\x08"
1082        "\x05\xb7\xa4\x50\xc8\x3d\x39\x3d\xdc\x5c\x8f\x96\x6c\xe7\xfc\x21"
1083        "\xc3\x2d\x1e\x9f\x11\xb3\xec\x22\x18\x8a\x8c\x08\x6b\x8b\xed\xf5"
1084        "\xc5\x47\x3c\x7e\x73\x59\x44\x1e\x77\x83\x84\x52\x9e\x3b\x7d\xff"
1085        "\x9d\x86\x1a",
1086        .key_len = 131,
1087        .params = /* OID_gostTC26Sign512A */
1088        "\x30\x0b\x06\x09\x2a\x85\x03\x07\x01\x02\x01\x02\x01",
1089        .param_len = 13,
1090        .c =
1091        "\x92\x81\x74\x5f\x95\x48\x38\x87\xd9\x8f\x5e\xc8\x8a\xbb\x01\x4e"
1092        "\xb0\x75\x3c\x2f\xc7\x5a\x08\x4c\x68\xab\x75\x01\x32\x75\x75\xb5"
1093        "\x37\xe0\x74\x6d\x94\x84\x31\x2a\x6b\xf4\xf7\xb7\xa7\x39\x7b\x46"
1094        "\x07\xf0\x98\xbd\x33\x18\xa1\x72\xb2\x6d\x54\xe3\xde\x91\xc2\x2e"
1095        "\x4f\x6a\xf8\xb7\xec\xa8\x83\xc9\x8f\xd9\xce\x7c\x45\x06\x02\xf4"
1096        "\x4f\x21\xb5\x24\x3d\xb4\xb5\xd8\x58\x42\xbe\x2d\x29\xae\x93\xc0"
1097        "\x13\x41\x96\x35\x08\x69\xe8\x36\xc7\xd1\x83\x81\xd7\xca\xfb\xc0"
1098        "\xd2\xb7\x78\x32\x3e\x30\x1a\x1e\xce\xdc\x34\x35\xc6\xad\x68\x24",
1099        .c_size = 128,
1100        .algo = OID_gost2012PKey512,
1101        .m =
1102        "\x1f\x70\xb5\xe9\x55\x12\xd6\x88\xcc\x55\xb9\x0c\x7f\xc4\x94\xf2"
1103        "\x04\x77\x41\x12\x02\xd6\xf1\x1f\x83\x56\xe9\xd6\x5a\x6a\x72\xb9"
1104        "\x6e\x8e\x24\x2a\x84\xf1\xba\x67\xe8\xbf\xff\xc1\xd3\xde\xfb\xc6"
1105        "\xa8\xf6\x80\x01\xb9\x27\xac\xd8\x45\x96\x66\xa1\xee\x48\x08\x3f",
1106        .m_size = 64,
1107        .public_key_vec = true,
1108        .siggen_sigver_test = true,
1109        },
1110        {
1111        .key =
1112        "\x04\x81\x80\x28\xf3\x2b\x92\x04\x32\xea\x66\x20\xde\xa0\x2f\x74"
1113        "\xbf\x2d\xf7\xb5\x30\x76\xb1\xc8\xee\x38\x9f\xea\xe5\xad\xc6\xa3"
1114        "\x28\x1e\x51\x3d\x67\xa3\x41\xcc\x6b\x81\xe2\xe2\x9e\x82\xf3\x78"
1115        "\x56\xd7\x2e\xb2\xb5\xbe\xb4\x50\x21\x05\xe5\x29\x82\xef\x15\x1b"
1116        "\xc0\xd7\x30\xd6\x2f\x96\xe8\xff\x99\x4c\x25\xcf\x9a\xfc\x54\x30"
1117        "\xce\xdf\x59\xe9\xc6\x45\xce\xe4\x22\xe8\x01\xd5\xcd\x2f\xaa\x78"
1118        "\x99\xc6\x04\x1e\x6f\x4c\x25\x6a\x76\xad\xff\x48\xf3\xb3\xb4\xd6"
1119        "\x14\x5c\x2c\x0e\xea\xa2\x4b\xb9\x7e\x89\x77\x02\x3a\x29\xc8\x16"
1120        "\x8e\x78\x48",
1121        .key_len = 131,
1122        .params = /* OID_gostTC26Sign512B */
1123        "\x30\x0b\x06\x09\x2a\x85\x03\x07\x01\x02\x01\x02\x02",
1124        .param_len = 13,
1125        .c =
1126        "\x0a\xed\xb6\x27\xea\xa7\xa6\x7e\x2f\xc1\x02\x21\x74\xce\x27\xd2"
1127        "\xee\x8a\x92\x4d\xa9\x43\x2d\xa4\x5b\xdc\x23\x02\xfc\x3a\xf3\xb2"
1128        "\x10\x93\x0b\x40\x1b\x75\x95\x3e\x39\x41\x37\xb9\xab\x51\x09\xeb"
1129        "\xf1\xb9\x49\x58\xec\x58\xc7\xf9\x2e\xb9\xc9\x40\xf2\x00\x39\x7e"
1130        "\x3f\xde\x72\xe3\x85\x67\x06\xbe\xd8\xb8\xc1\x81\x1e\xe3\x0a\xfe"
1131        "\xce\xd3\x77\x92\x56\x8c\x58\xf9\x37\x60\x2d\xe6\x8b\x66\xa3\xdd"
1132        "\xd2\xf0\xf8\xda\x1b\x20\xbc\x9c\xec\x29\x5d\xd1\x8f\xcc\x37\xd1"
1133        "\x3b\x8d\xb7\xc1\xe0\xb8\x3b\xef\x14\x1b\x87\xbc\xc1\x03\x9a\x93",
1134        .c_size = 128,
1135        .algo = OID_gost2012PKey512,
1136        .m =
1137        "\x11\x24\x21\x27\xf2\x42\x9f\xce\x5a\xf9\x01\x70\xe0\x07\x2b\x57"
1138        "\xfb\x7d\x77\x5e\x74\x66\xe6\xa5\x40\x4c\x1a\x85\x18\xff\xd0\x63"
1139        "\xe0\x39\xd3\xd6\xe5\x17\xf8\xc3\x4b\xc6\x1c\x33\x1a\xca\xa6\x66"
1140        "\x6d\xf4\xd2\x45\xc2\x83\xa0\x42\x95\x05\x9d\x89\x8e\x0a\xca\xcc",
1141        .m_size = 64,
1142        .public_key_vec = true,
1143        .siggen_sigver_test = true,
1144        },
1145};
1146
1147/*
1148 * PKCS#1 RSA test vectors. Obtained from CAVS testing.
1149 */
1150static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = {
1151        {
1152        .key =
1153        "\x30\x82\x03\x1f\x02\x01\x00\x02\x82\x01\x01\x00\xd7\x1e\x77\x82"
1154        "\x8c\x92\x31\xe7\x69\x02\xa2\xd5\x5c\x78\xde\xa2\x0c\x8f\xfe\x28"
1155        "\x59\x31\xdf\x40\x9c\x60\x61\x06\xb9\x2f\x62\x40\x80\x76\xcb\x67"
1156        "\x4a\xb5\x59\x56\x69\x17\x07\xfa\xf9\x4c\xbd\x6c\x37\x7a\x46\x7d"
1157        "\x70\xa7\x67\x22\xb3\x4d\x7a\x94\xc3\xba\x4b\x7c\x4b\xa9\x32\x7c"
1158        "\xb7\x38\x95\x45\x64\xa4\x05\xa8\x9f\x12\x7c\x4e\xc6\xc8\x2d\x40"
1159        "\x06\x30\xf4\x60\xa6\x91\xbb\x9b\xca\x04\x79\x11\x13\x75\xf0\xae"
1160        "\xd3\x51\x89\xc5\x74\xb9\xaa\x3f\xb6\x83\xe4\x78\x6b\xcd\xf9\x5c"
1161        "\x4c\x85\xea\x52\x3b\x51\x93\xfc\x14\x6b\x33\x5d\x30\x70\xfa\x50"
1162        "\x1b\x1b\x38\x81\x13\x8d\xf7\xa5\x0c\xc0\x8e\xf9\x63\x52\x18\x4e"
1163        "\xa9\xf9\xf8\x5c\x5d\xcd\x7a\x0d\xd4\x8e\x7b\xee\x91\x7b\xad\x7d"
1164        "\xb4\x92\xd5\xab\x16\x3b\x0a\x8a\xce\x8e\xde\x47\x1a\x17\x01\x86"
1165        "\x7b\xab\x99\xf1\x4b\x0c\x3a\x0d\x82\x47\xc1\x91\x8c\xbb\x2e\x22"
1166        "\x9e\x49\x63\x6e\x02\xc1\xc9\x3a\x9b\xa5\x22\x1b\x07\x95\xd6\x10"
1167        "\x02\x50\xfd\xfd\xd1\x9b\xbe\xab\xc2\xc0\x74\xd7\xec\x00\xfb\x11"
1168        "\x71\xcb\x7a\xdc\x81\x79\x9f\x86\x68\x46\x63\x82\x4d\xb7\xf1\xe6"
1169        "\x16\x6f\x42\x63\xf4\x94\xa0\xca\x33\xcc\x75\x13\x02\x82\x01\x00"
1170        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1171        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1172        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1173        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1174        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1175        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1176        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1177        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1178        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1179        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1180        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1181        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1182        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1183        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1184        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
1185        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01"
1186        "\x02\x82\x01\x00\x62\xb5\x60\x31\x4f\x3f\x66\x16\xc1\x60\xac\x47"
1187        "\x2a\xff\x6b\x69\x00\x4a\xb2\x5c\xe1\x50\xb9\x18\x74\xa8\xe4\xdc"
1188        "\xa8\xec\xcd\x30\xbb\xc1\xc6\xe3\xc6\xac\x20\x2a\x3e\x5e\x8b\x12"
1189        "\xe6\x82\x08\x09\x38\x0b\xab\x7c\xb3\xcc\x9c\xce\x97\x67\xdd\xef"
1190        "\x95\x40\x4e\x92\xe2\x44\xe9\x1d\xc1\x14\xfd\xa9\xb1\xdc\x71\x9c"
1191        "\x46\x21\xbd\x58\x88\x6e\x22\x15\x56\xc1\xef\xe0\xc9\x8d\xe5\x80"
1192        "\x3e\xda\x7e\x93\x0f\x52\xf6\xf5\xc1\x91\x90\x9e\x42\x49\x4f\x8d"
1193        "\x9c\xba\x38\x83\xe9\x33\xc2\x50\x4f\xec\xc2\xf0\xa8\xb7\x6e\x28"
1194        "\x25\x56\x6b\x62\x67\xfe\x08\xf1\x56\xe5\x6f\x0e\x99\xf1\xe5\x95"
1195        "\x7b\xef\xeb\x0a\x2c\x92\x97\x57\x23\x33\x36\x07\xdd\xfb\xae\xf1"
1196        "\xb1\xd8\x33\xb7\x96\x71\x42\x36\xc5\xa4\xa9\x19\x4b\x1b\x52\x4c"
1197        "\x50\x69\x91\xf0\x0e\xfa\x80\x37\x4b\xb5\xd0\x2f\xb7\x44\x0d\xd4"
1198        "\xf8\x39\x8d\xab\x71\x67\x59\x05\x88\x3d\xeb\x48\x48\x33\x88\x4e"
1199        "\xfe\xf8\x27\x1b\xd6\x55\x60\x5e\x48\xb7\x6d\x9a\xa8\x37\xf9\x7a"
1200        "\xde\x1b\xcd\x5d\x1a\x30\xd4\xe9\x9e\x5b\x3c\x15\xf8\x9c\x1f\xda"
1201        "\xd1\x86\x48\x55\xce\x83\xee\x8e\x51\xc7\xde\x32\x12\x47\x7d\x46"
1202        "\xb8\x35\xdf\x41\x02\x01\x00\x02\x01\x00\x02\x01\x00\x02\x01\x00"
1203        "\x02\x01\x00",
1204        .key_len = 804,
1205        /*
1206         * m is SHA256 hash of following message:
1207         * "\x49\x41\xbe\x0a\x0c\xc9\xf6\x35\x51\xe4\x27\x56\x13\x71\x4b\xd0"
1208         * "\x36\x92\x84\x89\x1b\xf8\x56\x4a\x72\x61\x14\x69\x4f\x5e\x98\xa5"
1209         * "\x80\x5a\x37\x51\x1f\xd8\xf5\xb5\x63\xfc\xf4\xb1\xbb\x4d\x33\xa3"
1210         * "\x1e\xb9\x75\x8b\x9c\xda\x7e\x6d\x3a\x77\x85\xf7\xfc\x4e\xe7\x64"
1211         * "\x43\x10\x19\xa0\x59\xae\xe0\xad\x4b\xd3\xc4\x45\xf7\xb1\xc2\xc1"
1212         * "\x65\x01\x41\x39\x5b\x45\x47\xed\x2b\x51\xed\xe3\xd0\x09\x10\xd2"
1213         * "\x39\x6c\x4a\x3f\xe5\xd2\x20\xe6\xb0\x71\x7d\x5b\xed\x26\x60\xf1"
1214         * "\xb4\x73\xd1\xdb\x7d\xc4\x19\x91\xee\xf6\x32\x76\xf2\x19\x7d\xb7"
1215         */
1216        .m =
1217        "\x3e\xc8\xa1\x26\x20\x54\x44\x52\x48\x0d\xe5\x66\xf3\xb3\xf5\x04"
1218        "\xbe\x10\xa8\x48\x94\x22\x2d\xdd\xba\x7a\xb4\x76\x8d\x79\x98\x89",
1219        .m_size = 32,
1220        .c =
1221        "\xc7\xa3\x98\xeb\x43\xd1\x08\xc2\x3d\x78\x45\x04\x70\xc9\x01\xee"
1222        "\xf8\x85\x37\x7c\x0b\xf9\x19\x70\x5c\x45\x7b\x2f\x3a\x0b\xb7\x8b"
1223        "\xc4\x0d\x7b\x3a\x64\x0b\x0f\xdb\x78\xa9\x0b\xfd\x8d\x82\xa4\x86"
1224        "\x39\xbf\x21\xb8\x84\xc4\xce\x9f\xc2\xe8\xb6\x61\x46\x17\xb9\x4e"
1225        "\x0b\x57\x05\xb4\x4f\xf9\x9c\x93\x2d\x9b\xd5\x48\x1d\x80\x12\xef"
1226        "\x3a\x77\x7f\xbc\xb5\x8e\x2b\x6b\x7c\xfc\x9f\x8c\x9d\xa2\xc4\x85"
1227        "\xb0\x87\xe9\x17\x9b\xb6\x23\x62\xd2\xa9\x9f\x57\xe8\xf7\x04\x45"
1228        "\x24\x3a\x45\xeb\xeb\x6a\x08\x8e\xaf\xc8\xa0\x84\xbc\x5d\x13\x38"
1229        "\xf5\x17\x8c\xa3\x96\x9b\xa9\x38\x8d\xf0\x35\xad\x32\x8a\x72\x5b"
1230        "\xdf\x21\xab\x4b\x0e\xa8\x29\xbb\x61\x54\xbf\x05\xdb\x84\x84\xde"
1231        "\xdd\x16\x36\x31\xda\xf3\x42\x6d\x7a\x90\x22\x9b\x11\x29\xa6\xf8"
1232        "\x30\x61\xda\xd3\x8b\x54\x1e\x42\xd1\x47\x1d\x6f\xd1\xcd\x42\x0b"
1233        "\xd1\xe4\x15\x85\x7e\x08\xd6\x59\x64\x4c\x01\x34\x91\x92\x26\xe8"
1234        "\xb0\x25\x8c\xf8\xf4\xfa\x8b\xc9\x31\x33\x76\x72\xfb\x64\x92\x9f"
1235        "\xda\x62\x8d\xe1\x2a\x71\x91\x43\x40\x61\x3c\x5a\xbe\x86\xfc\x5b"
1236        "\xe6\xf9\xa9\x16\x31\x1f\xaf\x25\x6d\xc2\x4a\x23\x6e\x63\x02\xa2",
1237        .c_size = 256,
1238        .siggen_sigver_test = true,
1239        }
1240};
1241
1242static const struct kpp_testvec dh_tv_template[] = {
1243        {
1244        .secret =
1245#ifdef __LITTLE_ENDIAN
1246        "\x01\x00" /* type */
1247        "\x15\x02" /* len */
1248        "\x00\x01\x00\x00" /* key_size */
1249        "\x00\x01\x00\x00" /* p_size */
1250        "\x00\x00\x00\x00" /* q_size */
1251        "\x01\x00\x00\x00" /* g_size */
1252#else
1253        "\x00\x01" /* type */
1254        "\x02\x15" /* len */
1255        "\x00\x00\x01\x00" /* key_size */
1256        "\x00\x00\x01\x00" /* p_size */
1257        "\x00\x00\x00\x00" /* q_size */
1258        "\x00\x00\x00\x01" /* g_size */
1259#endif
1260        /* xa */
1261        "\x44\xc1\x48\x36\xa7\x2b\x6f\x4e\x43\x03\x68\xad\x31\x00\xda\xf3"
1262        "\x2a\x01\xa8\x32\x63\x5f\x89\x32\x1f\xdf\x4c\xa1\x6a\xbc\x10\x15"
1263        "\x90\x35\xc9\x26\x41\xdf\x7b\xaa\x56\x56\x3d\x85\x44\xb5\xc0\x8e"
1264        "\x37\x83\x06\x50\xb3\x5f\x0e\x28\x2c\xd5\x46\x15\xe3\xda\x7d\x74"
1265        "\x87\x13\x91\x4f\xd4\x2d\xf6\xc7\x5e\x14\x2c\x11\xc2\x26\xb4\x3a"
1266        "\xe3\xb2\x36\x20\x11\x3b\x22\xf2\x06\x65\x66\xe2\x57\x58\xf8\x22"
1267        "\x1a\x94\xbd\x2b\x0e\x8c\x55\xad\x61\x23\x45\x2b\x19\x1e\x63\x3a"
1268        "\x13\x61\xe3\xa0\x79\x70\x3e\x6d\x98\x32\xbc\x7f\x82\xc3\x11\xd8"
1269        "\xeb\x53\xb5\xfc\xb5\xd5\x3c\x4a\xea\x92\x3e\x01\xce\x15\x65\xd4"
1270        "\xaa\x85\xc1\x11\x90\x83\x31\x6e\xfe\xe7\x7f\x7d\xed\xab\xf9\x29"
1271        "\xf8\xc7\xf1\x68\xc6\xb7\xe4\x1f\x2f\x28\xa0\xc9\x1a\x50\x64\x29"
1272        "\x4b\x01\x6d\x1a\xda\x46\x63\x21\x07\x40\x8c\x8e\x4c\x6f\xb5\xe5"
1273        "\x12\xf3\xc2\x1b\x48\x27\x5e\x27\x01\xb1\xaa\xed\x68\x9b\x83\x18"
1274        "\x8f\xb1\xeb\x1f\x04\xd1\x3c\x79\xed\x4b\xf7\x0a\x33\xdc\xe0\xc6"
1275        "\xd8\x02\x51\x59\x00\x74\x30\x07\x4c\x2d\xac\xe4\x13\xf1\x80\xf0"
1276        "\xce\xfa\xff\xa9\xce\x29\x46\xdd\x9d\xad\xd1\xc3\xc6\x58\x1a\x63"
1277        /* p */
1278        "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
1279        "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
1280        "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
1281        "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
1282        "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
1283        "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
1284        "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
1285        "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
1286        "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
1287        "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
1288        "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
1289        "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
1290        "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
1291        "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
1292        "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
1293        "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
1294        /* g */
1295        "\x02",
1296        .b_public =
1297        "\x2a\x67\x5c\xfd\x63\x5d\xc0\x97\x0a\x8b\xa2\x1f\xf8\x8a\xcb\x54"
1298        "\xca\x2f\xd3\x49\x3f\x01\x8e\x87\xfe\xcc\x94\xa0\x3e\xd4\x26\x79"
1299        "\x9a\x94\x3c\x11\x81\x58\x5c\x60\x3d\xf5\x98\x90\x89\x64\x62\x1f"
1300        "\xbd\x05\x6d\x2b\xcd\x84\x40\x9b\x4a\x1f\xe0\x19\xf1\xca\x20\xb3"
1301        "\x4e\xa0\x4f\x15\xcc\xa5\xfe\xa5\xb4\xf5\x0b\x18\x7a\x5a\x37\xaa"
1302        "\x58\x00\x19\x7f\xe2\xa3\xd9\x1c\x44\x57\xcc\xde\x2e\xc1\x38\xea"
1303        "\xeb\xe3\x90\x40\xc4\x6c\xf7\xcd\xe9\x22\x50\x71\xf5\x7c\xdb\x37"
1304        "\x0e\x80\xc3\xed\x7e\xb1\x2b\x2f\xbe\x71\xa6\x11\xa5\x9d\xf5\x39"
1305        "\xf1\xa2\xe5\x85\xbc\x25\x91\x4e\x84\x8d\x26\x9f\x4f\xe6\x0f\xa6"
1306        "\x2b\x6b\xf9\x0d\xaf\x6f\xbb\xfa\x2d\x79\x15\x31\x57\xae\x19\x60"
1307        "\x22\x0a\xf5\xfd\x98\x0e\xbf\x5d\x49\x75\x58\x37\xbc\x7f\xf5\x21"
1308        "\x56\x1e\xd5\xb3\x50\x0b\xca\x96\xf3\xd1\x3f\xb3\x70\xa8\x6d\x63"
1309        "\x48\xfb\x3d\xd7\x29\x91\x45\xb5\x48\xcd\xb6\x78\x30\xf2\x3f\x1e"
1310        "\xd6\x22\xd6\x35\x9b\xf9\x1f\x85\xae\xab\x4b\xd7\xe0\xc7\x86\x67"
1311        "\x3f\x05\x7f\xa6\x0d\x2f\x0d\xbf\x53\x5f\x4d\x2c\x6d\x5e\x57\x40"
1312        "\x30\x3a\x23\x98\xf9\xb4\x32\xf5\x32\x83\xdd\x0b\xae\x33\x97\x2f",
1313        .expected_a_public =
1314        "\x5c\x24\xdf\xeb\x5b\x4b\xf8\xc5\xef\x39\x48\x82\xe0\x1e\x62\xee"
1315        "\x8a\xae\xdf\x93\x6c\x2b\x16\x95\x92\x16\x3f\x16\x7b\x75\x03\x85"
1316        "\xd9\xf1\x69\xc2\x14\x87\x45\xfc\xa4\x19\xf6\xf0\xa4\xf3\xec\xd4"
1317        "\x6c\x5c\x03\x3b\x94\xc2\x2f\x92\xe4\xce\xb3\xe4\x72\xe8\x17\xe6"
1318        "\x23\x7e\x00\x01\x09\x59\x13\xbf\xc1\x2f\x99\xa9\x07\xaa\x02\x23"
1319        "\x4a\xca\x39\x4f\xbc\xec\x0f\x27\x4f\x19\x93\x6c\xb9\x30\x52\xfd"
1320        "\x2b\x9d\x86\xf1\x06\x1e\xb6\x56\x27\x4a\xc9\x8a\xa7\x8a\x48\x5e"
1321        "\xb5\x60\xcb\xdf\xff\x03\x26\x10\xbf\x90\x8f\x46\x60\xeb\x9b\x9a"
1322        "\xd6\x6f\x44\x91\x03\x92\x18\x2c\x96\x5e\x40\x19\xfb\xf4\x4f\x3a"
1323        "\x02\x7b\xaf\xcc\x22\x20\x79\xb9\xf8\x9f\x8f\x85\x6b\xec\x44\xbb"
1324        "\xe6\xa8\x8e\xb1\xe8\x2c\xee\x64\xee\xf8\xbd\x00\xf3\xe2\x2b\x93"
1325        "\xcd\xe7\xc4\xdf\xc9\x19\x46\xfe\xb6\x07\x73\xc1\x8a\x64\x79\x26"
1326        "\xe7\x30\xad\x2a\xdf\xe6\x8f\x59\xf5\x81\xbf\x4a\x29\x91\xe7\xb7"
1327        "\xcf\x48\x13\x27\x75\x79\x40\xd9\xd6\x32\x52\x4e\x6a\x86\xae\x6f"
1328        "\xc2\xbf\xec\x1f\xc2\x69\xb2\xb6\x59\xe5\xa5\x17\xa4\x77\xb7\x62"
1329        "\x46\xde\xe8\xd2\x89\x78\x9a\xef\xa3\xb5\x8f\x26\xec\x80\xda\x39",
1330        .expected_ss =
1331        "\x8f\xf3\xac\xa2\xea\x22\x11\x5c\x45\x65\x1a\x77\x75\x2e\xcf\x46"
1332        "\x23\x14\x1e\x67\x53\x4d\x35\xb0\x38\x1d\x4e\xb9\x41\x9a\x21\x24"
1333        "\x6e\x9f\x40\xfe\x90\x51\xb1\x06\xa4\x7b\x87\x17\x2f\xe7\x5e\x22"
1334        "\xf0\x7b\x54\x84\x0a\xac\x0a\x90\xd2\xd7\xe8\x7f\xe7\xe3\x30\x75"
1335        "\x01\x1f\x24\x75\x56\xbe\xcc\x8d\x1e\x68\x0c\x41\x72\xd3\xfa\xbb"
1336        "\xe5\x9c\x60\xc7\x28\x77\x0c\xbe\x89\xab\x08\xd6\x21\xe7\x2e\x1a"
1337        "\x58\x7a\xca\x4f\x22\xf3\x2b\x30\xfd\xf4\x98\xc1\xa3\xf8\xf6\xcc"
1338        "\xa9\xe4\xdb\x5b\xee\xd5\x5c\x6f\x62\x4c\xd1\x1a\x02\x2a\x23\xe4"
1339        "\xb5\x57\xf3\xf9\xec\x04\x83\x54\xfe\x08\x5e\x35\xac\xfb\xa8\x09"
1340        "\x82\x32\x60\x11\xb2\x16\x62\x6b\xdf\xda\xde\x9c\xcb\x63\x44\x6c"
1341        "\x59\x26\x6a\x8f\xb0\x24\xcb\xa6\x72\x48\x1e\xeb\xe0\xe1\x09\x44"
1342        "\xdd\xee\x66\x6d\x84\xcf\xa5\xc1\xb8\x36\x74\xd3\x15\x96\xc3\xe4"
1343        "\xc6\x5a\x4d\x23\x97\x0c\x5c\xcb\xa9\xf5\x29\xc2\x0e\xff\x93\x82"
1344        "\xd3\x34\x49\xad\x64\xa6\xb1\xc0\x59\x28\x75\x60\xa7\x8a\xb0\x11"
1345        "\x56\x89\x42\x74\x11\xf5\xf6\x5e\x6f\x16\x54\x6a\xb1\x76\x4d\x50"
1346        "\x8a\x68\xc1\x5b\x82\xb9\x0d\x00\x32\x50\xed\x88\x87\x48\x92\x17",
1347        .secret_size = 533,
1348        .b_public_size = 256,
1349        .expected_a_public_size = 256,
1350        .expected_ss_size = 256,
1351        },
1352        {
1353        .secret =
1354#ifdef __LITTLE_ENDIAN
1355        "\x01\x00" /* type */
1356        "\x15\x02" /* len */
1357        "\x00\x01\x00\x00" /* key_size */
1358        "\x00\x01\x00\x00" /* p_size */
1359        "\x00\x00\x00\x00" /* q_size */
1360        "\x01\x00\x00\x00" /* g_size */
1361#else
1362        "\x00\x01" /* type */
1363        "\x02\x15" /* len */
1364        "\x00\x00\x01\x00" /* key_size */
1365        "\x00\x00\x01\x00" /* p_size */
1366        "\x00\x00\x00\x00" /* q_size */
1367        "\x00\x00\x00\x01" /* g_size */
1368#endif
1369        /* xa */
1370        "\x4d\x75\xa8\x6e\xba\x23\x3a\x0c\x63\x56\xc8\xc9\x5a\xa7\xd6\x0e"
1371        "\xed\xae\x40\x78\x87\x47\x5f\xe0\xa7\x7b\xba\x84\x88\x67\x4e\xe5"
1372        "\x3c\xcc\x5c\x6a\xe7\x4a\x20\xec\xbe\xcb\xf5\x52\x62\x9f\x37\x80"
1373        "\x0c\x72\x7b\x83\x66\xa4\xf6\x7f\x95\x97\x1c\x6a\x5c\x7e\xf1\x67"
1374        "\x37\xb3\x93\x39\x3d\x0b\x55\x35\xd9\xe5\x22\x04\x9f\xf8\xc1\x04"
1375        "\xce\x13\xa5\xac\xe1\x75\x05\xd1\x2b\x53\xa2\x84\xef\xb1\x18\xf4"
1376        "\x66\xdd\xea\xe6\x24\x69\x5a\x49\xe0\x7a\xd8\xdf\x1b\xb7\xf1\x6d"
1377        "\x9b\x50\x2c\xc8\x1c\x1c\xa3\xb4\x37\xfb\x66\x3f\x67\x71\x73\xa9"
1378        "\xff\x5f\xd9\xa2\x25\x6e\x25\x1b\x26\x54\xbf\x0c\xc6\xdb\xea\x0a"
1379        "\x52\x6c\x16\x7c\x27\x68\x15\x71\x58\x73\x9d\xe6\xc2\x80\xaa\x97"
1380        "\x31\x66\xfb\xa6\xfb\xfd\xd0\x9c\x1d\xbe\x81\x48\xf5\x9a\x32\xf1"
1381        "\x69\x62\x18\x78\xae\x72\x36\xe6\x94\x27\xd1\xff\x18\x4f\x28\x6a"
1382        "\x16\xbd\x6a\x60\xee\xe5\xf9\x6d\x16\xe4\xb8\xa6\x41\x9b\x23\x7e"
1383        "\xf7\x9d\xd1\x1d\x03\x15\x66\x3a\xcf\xb6\x2c\x13\x96\x2c\x52\x21"
1384        "\xe4\x2d\x48\x7a\x8a\x5d\xb2\x88\xed\x98\x61\x79\x8b\x6a\x1e\x5f"
1385        "\xd0\x8a\x2d\x99\x5a\x2b\x0f\xbc\xef\x53\x8f\x32\xc1\xa2\x99\x26"
1386        /* p */
1387        "\xb9\x36\x3a\xf1\x82\x1f\x60\xd3\x22\x47\xb8\xbc\x2d\x22\x6b\x81"
1388        "\x7f\xe8\x20\x06\x09\x23\x73\x49\x9a\x59\x8b\x35\x25\xf8\x31\xbc"
1389        "\x7d\xa8\x1c\x9d\x56\x0d\x1a\xf7\x4b\x4f\x96\xa4\x35\x77\x6a\x89"
1390        "\xab\x42\x00\x49\x21\x71\xed\x28\x16\x1d\x87\x5a\x10\xa7\x9c\x64"
1391        "\x94\xd4\x87\x3d\x28\xef\x44\xfe\x4b\xe2\xb4\x15\x8c\x82\xa6\xf3"
1392        "\x50\x5f\xa8\xe8\xa2\x60\xe7\x00\x86\x78\x05\xd4\x78\x19\xa1\x98"
1393        "\x62\x4e\x4a\x00\x78\x56\x96\xe6\xcf\xd7\x10\x1b\x74\x5d\xd0\x26"
1394        "\x61\xdb\x6b\x32\x09\x51\xd8\xa5\xfd\x54\x16\x71\x01\xb3\x39\xe6"
1395        "\x4e\x69\xb1\xd7\x06\x8f\xd6\x1e\xdc\x72\x25\x26\x74\xc8\x41\x06"
1396        "\x5c\xd1\x26\x5c\xb0\x2f\xf9\x59\x13\xc1\x2a\x0f\x78\xea\x7b\xf7"
1397        "\xbd\x59\xa0\x90\x1d\xfc\x33\x5b\x4c\xbf\x05\x9c\x3a\x3f\x69\xa2"
1398        "\x45\x61\x4e\x10\x6a\xb3\x17\xc5\x68\x30\xfb\x07\x5f\x34\xc6\xfb"
1399        "\x73\x07\x3c\x70\xf6\xae\xe7\x72\x84\xc3\x18\x81\x8f\xe8\x11\x1f"
1400        "\x3d\x83\x83\x01\x2a\x14\x73\xbf\x32\x32\x2e\xc9\x4d\xdb\x2a\xca"
1401        "\xee\x71\xf9\xda\xad\xe8\x82\x0b\x4d\x0c\x1f\xb6\x1d\xef\x00\x67"
1402        "\x74\x3d\x95\xe0\xb7\xc4\x30\x8a\x24\x87\x12\x47\x27\x70\x0d\x73"
1403        /* g */
1404        "\x02",
1405        .b_public =
1406        "\x99\x4d\xd9\x01\x84\x8e\x4a\x5b\xb8\xa5\x64\x8c\x6c\x00\x5c\x0e"
1407        "\x1e\x1b\xee\x5d\x9f\x53\xe3\x16\x70\x01\xed\xbf\x4f\x14\x36\x6e"
1408        "\xe4\x43\x45\x43\x49\xcc\xb1\xb0\x2a\xc0\x6f\x22\x55\x42\x17\x94"
1409        "\x18\x83\xd7\x2a\x5c\x51\x54\xf8\x4e\x7c\x10\xda\x76\x68\x57\x77"
1410        "\x1e\x62\x03\x30\x04\x7b\x4c\x39\x9c\x54\x01\x54\xec\xef\xb3\x55"
1411        "\xa4\xc0\x24\x6d\x3d\xbd\xcc\x46\x5b\x00\x96\xc7\xea\x93\xd1\x3f"
1412        "\xf2\x6a\x72\xe3\xf2\xc1\x92\x24\x5b\xda\x48\x70\x2c\xa9\x59\x97"
1413        "\x19\xb1\xd6\x54\xb3\x9c\x2e\xb0\x63\x07\x9b\x5e\xac\xb5\xf2\xb1"
1414        "\x5b\xf8\xf3\xd7\x2d\x37\x9b\x68\x6c\xf8\x90\x07\xbc\x37\x9a\xa5"
1415        "\xe2\x91\x12\x25\x47\x77\xe3\x3d\xb2\x95\x69\x44\x0b\x91\x1e\xaf"
1416        "\x7c\x8c\x7c\x34\x41\x6a\xab\x60\x6e\xc6\x52\xec\x7e\x94\x0a\x37"
1417        "\xec\x98\x90\xdf\x3f\x02\xbd\x23\x52\xdd\xd9\xe5\x31\x80\x74\x25"
1418        "\xb6\xd2\xd3\xcc\xd5\xcc\x6d\xf9\x7e\x4d\x78\xab\x77\x51\xfa\x77"
1419        "\x19\x94\x49\x8c\x05\xd4\x75\xed\xd2\xb3\x64\x57\xe0\x52\x99\xc0"
1420        "\x83\xe3\xbb\x5e\x2b\xf1\xd2\xc0\xb1\x37\x36\x0b\x7c\xb5\x63\x96"
1421        "\x8e\xde\x04\x23\x11\x95\x62\x11\x9a\xce\x6f\x63\xc8\xd5\xd1\x8f",
1422        .expected_a_public =
1423        "\x90\x89\xe4\x82\xd6\x0a\xcf\x1a\xae\xce\x1b\x66\xa7\x19\x71\x18"
1424        "\x8f\x95\x4b\x5b\x80\x45\x4a\x5a\x43\x99\x4d\x37\xcf\xa3\xa7\x28"
1425        "\x9c\xc7\x73\xf1\xb2\x17\xf6\x99\xe3\x6b\x56\xcb\x3e\x35\x60\x7d"
1426        "\x65\xc7\x84\x6b\x3e\x60\xee\xcd\xd2\x70\xe7\xc9\x32\x1c\xf0\xb4"
1427        "\xf9\x52\xd9\x88\x75\xfd\x40\x2c\xa7\xbe\x19\x1c\x0a\xae\x93\xe1"
1428        "\x71\xc7\xcd\x4f\x33\x5c\x10\x7d\x39\x56\xfc\x73\x84\xb2\x67\xc3"
1429        "\x77\x26\x20\x97\x2b\xf8\x13\x43\x93\x9c\x9a\xa4\x08\xc7\x34\x83"
1430        "\xe6\x98\x61\xe7\x16\x30\x2c\xb1\xdb\x2a\xb2\xcc\xc3\x02\xa5\x3c"
1431        "\x71\x50\x14\x83\xc7\xbb\xa4\xbe\x98\x1b\xfe\xcb\x43\xe9\x97\x62"
1432        "\xd6\xf0\x8c\xcb\x1c\xba\x1e\xa8\xa6\xa6\x50\xfc\x85\x7d\x47\xbf"
1433        "\xf4\x3e\x23\xd3\x5f\xb2\x71\x3e\x40\x94\xaa\x87\x83\x2c\x6c\x8e"
1434        "\x60\xfd\xdd\xf7\xf4\x76\x03\xd3\x1d\xec\x18\x51\xa3\xf2\x44\x1a"
1435        "\x3f\xb4\x7c\x18\x0d\x68\x65\x92\x54\x0d\x2d\x81\x16\xf1\x84\x66"
1436        "\x89\x92\xd0\x1a\x5e\x1f\x42\x46\x5b\xe5\x83\x86\x80\xd9\xcd\x3a"
1437        "\x5a\x2f\xb9\x59\x9b\xe4\x43\x84\x64\xf3\x09\x1a\x0a\xa2\x64\x0f"
1438        "\x77\x4e\x8d\x8b\xe6\x88\xd1\xfc\xaf\x8f\xdf\x1d\xbc\x31\xb3\xbd",
1439        .expected_ss =
1440        "\x34\xc3\x35\x14\x88\x46\x26\x23\x97\xbb\xdd\x28\x5c\x94\xf6\x47"
1441        "\xca\xb3\x19\xaf\xca\x44\x9b\xc2\x7d\x89\xfd\x96\x14\xfd\x6d\x58"
1442        "\xd8\xc4\x6b\x61\x2a\x0d\xf2\x36\x45\xc8\xe4\xa4\xed\x81\x53\x81"
1443        "\x66\x1e\xe0\x5a\xb1\x78\x2d\x0b\x5c\xb4\xd1\xfc\x90\xc6\x9c\xdb"
1444        "\x5a\x30\x0b\x14\x7d\xbe\xb3\x7d\xb1\xb2\x76\x3c\x6c\xef\x74\x6b"
1445        "\xe7\x1f\x64\x0c\xab\x65\xe1\x76\x5c\x3d\x83\xb5\x8a\xfb\xaf\x0f"
1446        "\xf2\x06\x14\x8f\xa0\xf6\xc1\x89\x78\xf2\xba\x72\x73\x3c\xf7\x76"
1447        "\x21\x67\xbc\x24\x31\xb8\x09\x65\x0f\x0c\x02\x32\x4a\x98\x14\xfc"
1448        "\x72\x2c\x25\x60\x68\x5f\x2f\x30\x1e\x5b\xf0\x3b\xd1\xa2\x87\xa0"
1449        "\x54\xdf\xdb\xc0\xee\x0a\x0f\x47\xc9\x90\x20\x2c\xf9\xe3\x52\xad"
1450        "\x27\x65\x8d\x54\x8d\xa8\xa1\xf3\xed\x15\xd4\x94\x28\x90\x31\x93"
1451        "\x1b\xc0\x51\xbb\x43\x5d\x76\x3b\x1d\x2a\x71\x50\xea\x5d\x48\x94"
1452        "\x7f\x6f\xf1\x48\xdb\x30\xe5\xae\x64\x79\xd9\x7a\xdb\xc6\xff\xd8"
1453        "\x5e\x5a\x64\xbd\xf6\x85\x04\xe8\x28\x6a\xac\xef\xce\x19\x8e\x9a"
1454        "\xfe\x75\xc0\x27\x69\xe3\xb3\x7b\x21\xa7\xb1\x16\xa4\x85\x23\xee"
1455        "\xb0\x1b\x04\x6e\xbd\xab\x16\xde\xfd\x86\x6b\xa9\x95\xd7\x0b\xfd",
1456        .secret_size = 533,
1457        .b_public_size = 256,
1458        .expected_a_public_size = 256,
1459        .expected_ss_size = 256,
1460        }
1461};
1462
1463static const struct kpp_testvec curve25519_tv_template[] = {
1464{
1465        .secret = (u8[32]){ 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d,
1466                     0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45,
1467                     0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a,
1468                     0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a },
1469        .b_public = (u8[32]){ 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4,
1470                    0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37,
1471                    0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d,
1472                    0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f },
1473        .expected_ss = (u8[32]){ 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1,
1474                    0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35, 0x0f, 0x25,
1475                    0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1, 0x9e, 0x33,
1476                    0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 },
1477        .secret_size = 32,
1478        .b_public_size = 32,
1479        .expected_ss_size = 32,
1480
1481},
1482{
1483        .secret = (u8[32]){ 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b,
1484                     0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6,
1485                     0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd,
1486                     0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb },
1487        .b_public = (u8[32]){ 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
1488                    0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
1489                    0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
1490                    0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a },
1491        .expected_ss = (u8[32]){ 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1,
1492                    0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35, 0x0f, 0x25,
1493                    0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1, 0x9e, 0x33,
1494                    0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 },
1495        .secret_size = 32,
1496        .b_public_size = 32,
1497        .expected_ss_size = 32,
1498
1499},
1500{
1501        .secret = (u8[32]){ 1 },
1502        .b_public = (u8[32]){ 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1503                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1504                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1505                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1506        .expected_ss = (u8[32]){ 0x3c, 0x77, 0x77, 0xca, 0xf9, 0x97, 0xb2, 0x64,
1507                    0x41, 0x60, 0x77, 0x66, 0x5b, 0x4e, 0x22, 0x9d,
1508                    0x0b, 0x95, 0x48, 0xdc, 0x0c, 0xd8, 0x19, 0x98,
1509                    0xdd, 0xcd, 0xc5, 0xc8, 0x53, 0x3c, 0x79, 0x7f },
1510        .secret_size = 32,
1511        .b_public_size = 32,
1512        .expected_ss_size = 32,
1513
1514},
1515{
1516        .secret = (u8[32]){ 1 },
1517        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1518                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1519                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1520                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1521        .expected_ss = (u8[32]){ 0xb3, 0x2d, 0x13, 0x62, 0xc2, 0x48, 0xd6, 0x2f,
1522                    0xe6, 0x26, 0x19, 0xcf, 0xf0, 0x4d, 0xd4, 0x3d,
1523                    0xb7, 0x3f, 0xfc, 0x1b, 0x63, 0x08, 0xed, 0xe3,
1524                    0x0b, 0x78, 0xd8, 0x73, 0x80, 0xf1, 0xe8, 0x34 },
1525        .secret_size = 32,
1526        .b_public_size = 32,
1527        .expected_ss_size = 32,
1528
1529},
1530{
1531        .secret = (u8[32]){ 0xa5, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d,
1532                     0x3b, 0x16, 0x15, 0x4b, 0x82, 0x46, 0x5e, 0xdd,
1533                     0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc, 0x5a, 0x18,
1534                     0x50, 0x6a, 0x22, 0x44, 0xba, 0x44, 0x9a, 0xc4 },
1535        .b_public = (u8[32]){ 0xe6, 0xdb, 0x68, 0x67, 0x58, 0x30, 0x30, 0xdb,
1536                    0x35, 0x94, 0xc1, 0xa4, 0x24, 0xb1, 0x5f, 0x7c,
1537                    0x72, 0x66, 0x24, 0xec, 0x26, 0xb3, 0x35, 0x3b,
1538                    0x10, 0xa9, 0x03, 0xa6, 0xd0, 0xab, 0x1c, 0x4c },
1539        .expected_ss = (u8[32]){ 0xc3, 0xda, 0x55, 0x37, 0x9d, 0xe9, 0xc6, 0x90,
1540                    0x8e, 0x94, 0xea, 0x4d, 0xf2, 0x8d, 0x08, 0x4f,
1541                    0x32, 0xec, 0xcf, 0x03, 0x49, 0x1c, 0x71, 0xf7,
1542                    0x54, 0xb4, 0x07, 0x55, 0x77, 0xa2, 0x85, 0x52 },
1543        .secret_size = 32,
1544        .b_public_size = 32,
1545        .expected_ss_size = 32,
1546
1547},
1548{
1549        .secret = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0x0a, 0xff, 0xff, 0xff,
1550                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1551                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1552                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1553        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1554                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1555                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1556                    0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0xfb, 0x9f },
1557        .expected_ss = (u8[32]){ 0x77, 0x52, 0xb6, 0x18, 0xc1, 0x2d, 0x48, 0xd2,
1558                    0xc6, 0x93, 0x46, 0x83, 0x81, 0x7c, 0xc6, 0x57,
1559                    0xf3, 0x31, 0x03, 0x19, 0x49, 0x48, 0x20, 0x05,
1560                    0x42, 0x2b, 0x4e, 0xae, 0x8d, 0x1d, 0x43, 0x23 },
1561        .secret_size = 32,
1562        .b_public_size = 32,
1563        .expected_ss_size = 32,
1564
1565},
1566{
1567        .secret = (u8[32]){ 0x8e, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1568                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1569                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1570                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1571        .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1572                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1573                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1574                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x06 },
1575        .expected_ss = (u8[32]){ 0x5a, 0xdf, 0xaa, 0x25, 0x86, 0x8e, 0x32, 0x3d,
1576                    0xae, 0x49, 0x62, 0xc1, 0x01, 0x5c, 0xb3, 0x12,
1577                    0xe1, 0xc5, 0xc7, 0x9e, 0x95, 0x3f, 0x03, 0x99,
1578                    0xb0, 0xba, 0x16, 0x22, 0xf3, 0xb6, 0xf7, 0x0c },
1579        .secret_size = 32,
1580        .b_public_size = 32,
1581        .expected_ss_size = 32,
1582
1583},
1584/* wycheproof - normal case */
1585{
1586        .secret = (u8[32]){ 0x48, 0x52, 0x83, 0x4d, 0x9d, 0x6b, 0x77, 0xda,
1587                     0xde, 0xab, 0xaa, 0xf2, 0xe1, 0x1d, 0xca, 0x66,
1588                     0xd1, 0x9f, 0xe7, 0x49, 0x93, 0xa7, 0xbe, 0xc3,
1589                     0x6c, 0x6e, 0x16, 0xa0, 0x98, 0x3f, 0xea, 0xba },
1590        .b_public = (u8[32]){ 0x9c, 0x64, 0x7d, 0x9a, 0xe5, 0x89, 0xb9, 0xf5,
1591                    0x8f, 0xdc, 0x3c, 0xa4, 0x94, 0x7e, 0xfb, 0xc9,
1592                    0x15, 0xc4, 0xb2, 0xe0, 0x8e, 0x74, 0x4a, 0x0e,
1593                    0xdf, 0x46, 0x9d, 0xac, 0x59, 0xc8, 0xf8, 0x5a },
1594        .expected_ss = (u8[32]){ 0x87, 0xb7, 0xf2, 0x12, 0xb6, 0x27, 0xf7, 0xa5,
1595                    0x4c, 0xa5, 0xe0, 0xbc, 0xda, 0xdd, 0xd5, 0x38,
1596                    0x9d, 0x9d, 0xe6, 0x15, 0x6c, 0xdb, 0xcf, 0x8e,
1597                    0xbe, 0x14, 0xff, 0xbc, 0xfb, 0x43, 0x65, 0x51 },
1598        .secret_size = 32,
1599        .b_public_size = 32,
1600        .expected_ss_size = 32,
1601
1602},
1603/* wycheproof - public key on twist */
1604{
1605        .secret = (u8[32]){ 0x58, 0x8c, 0x06, 0x1a, 0x50, 0x80, 0x4a, 0xc4,
1606                     0x88, 0xad, 0x77, 0x4a, 0xc7, 0x16, 0xc3, 0xf5,
1607                     0xba, 0x71, 0x4b, 0x27, 0x12, 0xe0, 0x48, 0x49,
1608                     0x13, 0x79, 0xa5, 0x00, 0x21, 0x19, 0x98, 0xa8 },
1609        .b_public = (u8[32]){ 0x63, 0xaa, 0x40, 0xc6, 0xe3, 0x83, 0x46, 0xc5,
1610                    0xca, 0xf2, 0x3a, 0x6d, 0xf0, 0xa5, 0xe6, 0xc8,
1611                    0x08, 0x89, 0xa0, 0x86, 0x47, 0xe5, 0x51, 0xb3,
1612                    0x56, 0x34, 0x49, 0xbe, 0xfc, 0xfc, 0x97, 0x33 },
1613        .expected_ss = (u8[32]){ 0xb1, 0xa7, 0x07, 0x51, 0x94, 0x95, 0xff, 0xff,
1614                    0xb2, 0x98, 0xff, 0x94, 0x17, 0x16, 0xb0, 0x6d,
1615                    0xfa, 0xb8, 0x7c, 0xf8, 0xd9, 0x11, 0x23, 0xfe,
1616                    0x2b, 0xe9, 0xa2, 0x33, 0xdd, 0xa2, 0x22, 0x12 },
1617        .secret_size = 32,
1618        .b_public_size = 32,
1619        .expected_ss_size = 32,
1620
1621},
1622/* wycheproof - public key on twist */
1623{
1624        .secret = (u8[32]){ 0xb0, 0x5b, 0xfd, 0x32, 0xe5, 0x53, 0x25, 0xd9,
1625                     0xfd, 0x64, 0x8c, 0xb3, 0x02, 0x84, 0x80, 0x39,
1626                     0x00, 0x0b, 0x39, 0x0e, 0x44, 0xd5, 0x21, 0xe5,
1627                     0x8a, 0xab, 0x3b, 0x29, 0xa6, 0x96, 0x0b, 0xa8 },
1628        .b_public = (u8[32]){ 0x0f, 0x83, 0xc3, 0x6f, 0xde, 0xd9, 0xd3, 0x2f,
1629                    0xad, 0xf4, 0xef, 0xa3, 0xae, 0x93, 0xa9, 0x0b,
1630                    0xb5, 0xcf, 0xa6, 0x68, 0x93, 0xbc, 0x41, 0x2c,
1631                    0x43, 0xfa, 0x72, 0x87, 0xdb, 0xb9, 0x97, 0x79 },
1632        .expected_ss = (u8[32]){ 0x67, 0xdd, 0x4a, 0x6e, 0x16, 0x55, 0x33, 0x53,
1633                    0x4c, 0x0e, 0x3f, 0x17, 0x2e, 0x4a, 0xb8, 0x57,
1634                    0x6b, 0xca, 0x92, 0x3a, 0x5f, 0x07, 0xb2, 0xc0,
1635                    0x69, 0xb4, 0xc3, 0x10, 0xff, 0x2e, 0x93, 0x5b },
1636        .secret_size = 32,
1637        .b_public_size = 32,
1638        .expected_ss_size = 32,
1639
1640},
1641/* wycheproof - public key on twist */
1642{
1643        .secret = (u8[32]){ 0x70, 0xe3, 0x4b, 0xcb, 0xe1, 0xf4, 0x7f, 0xbc,
1644                     0x0f, 0xdd, 0xfd, 0x7c, 0x1e, 0x1a, 0xa5, 0x3d,
1645                     0x57, 0xbf, 0xe0, 0xf6, 0x6d, 0x24, 0x30, 0x67,
1646                     0xb4, 0x24, 0xbb, 0x62, 0x10, 0xbe, 0xd1, 0x9c },
1647        .b_public = (u8[32]){ 0x0b, 0x82, 0x11, 0xa2, 0xb6, 0x04, 0x90, 0x97,
1648                    0xf6, 0x87, 0x1c, 0x6c, 0x05, 0x2d, 0x3c, 0x5f,
1649                    0xc1, 0xba, 0x17, 0xda, 0x9e, 0x32, 0xae, 0x45,
1650                    0x84, 0x03, 0xb0, 0x5b, 0xb2, 0x83, 0x09, 0x2a },
1651        .expected_ss = (u8[32]){ 0x4a, 0x06, 0x38, 0xcf, 0xaa, 0x9e, 0xf1, 0x93,
1652                    0x3b, 0x47, 0xf8, 0x93, 0x92, 0x96, 0xa6, 0xb2,
1653                    0x5b, 0xe5, 0x41, 0xef, 0x7f, 0x70, 0xe8, 0x44,
1654                    0xc0, 0xbc, 0xc0, 0x0b, 0x13, 0x4d, 0xe6, 0x4a },
1655        .secret_size = 32,
1656        .b_public_size = 32,
1657        .expected_ss_size = 32,
1658
1659},
1660/* wycheproof - public key on twist */
1661{
1662        .secret = (u8[32]){ 0x68, 0xc1, 0xf3, 0xa6, 0x53, 0xa4, 0xcd, 0xb1,
1663                     0xd3, 0x7b, 0xba, 0x94, 0x73, 0x8f, 0x8b, 0x95,
1664                     0x7a, 0x57, 0xbe, 0xb2, 0x4d, 0x64, 0x6e, 0x99,
1665                     0x4d, 0xc2, 0x9a, 0x27, 0x6a, 0xad, 0x45, 0x8d },
1666        .b_public = (u8[32]){ 0x34, 0x3a, 0xc2, 0x0a, 0x3b, 0x9c, 0x6a, 0x27,
1667                    0xb1, 0x00, 0x81, 0x76, 0x50, 0x9a, 0xd3, 0x07,
1668                    0x35, 0x85, 0x6e, 0xc1, 0xc8, 0xd8, 0xfc, 0xae,
1669                    0x13, 0x91, 0x2d, 0x08, 0xd1, 0x52, 0xf4, 0x6c },
1670        .expected_ss = (u8[32]){ 0x39, 0x94, 0x91, 0xfc, 0xe8, 0xdf, 0xab, 0x73,
1671                    0xb4, 0xf9, 0xf6, 0x11, 0xde, 0x8e, 0xa0, 0xb2,
1672                    0x7b, 0x28, 0xf8, 0x59, 0x94, 0x25, 0x0b, 0x0f,
1673                    0x47, 0x5d, 0x58, 0x5d, 0x04, 0x2a, 0xc2, 0x07 },
1674        .secret_size = 32,
1675        .b_public_size = 32,
1676        .expected_ss_size = 32,
1677
1678},
1679/* wycheproof - public key on twist */
1680{
1681        .secret = (u8[32]){ 0xd8, 0x77, 0xb2, 0x6d, 0x06, 0xdf, 0xf9, 0xd9,
1682                     0xf7, 0xfd, 0x4c, 0x5b, 0x37, 0x69, 0xf8, 0xcd,
1683                     0xd5, 0xb3, 0x05, 0x16, 0xa5, 0xab, 0x80, 0x6b,
1684                     0xe3, 0x24, 0xff, 0x3e, 0xb6, 0x9e, 0xa0, 0xb2 },
1685        .b_public = (u8[32]){ 0xfa, 0x69, 0x5f, 0xc7, 0xbe, 0x8d, 0x1b, 0xe5,
1686                    0xbf, 0x70, 0x48, 0x98, 0xf3, 0x88, 0xc4, 0x52,
1687                    0xba, 0xfd, 0xd3, 0xb8, 0xea, 0xe8, 0x05, 0xf8,
1688                    0x68, 0x1a, 0x8d, 0x15, 0xc2, 0xd4, 0xe1, 0x42 },
1689        .expected_ss = (u8[32]){ 0x2c, 0x4f, 0xe1, 0x1d, 0x49, 0x0a, 0x53, 0x86,
1690                    0x17, 0x76, 0xb1, 0x3b, 0x43, 0x54, 0xab, 0xd4,
1691                    0xcf, 0x5a, 0x97, 0x69, 0x9d, 0xb6, 0xe6, 0xc6,
1692                    0x8c, 0x16, 0x26, 0xd0, 0x76, 0x62, 0xf7, 0x58 },
1693        .secret_size = 32,
1694        .b_public_size = 32,
1695        .expected_ss_size = 32,
1696
1697},
1698/* wycheproof - edge case on twist */
1699{
1700        .secret = (u8[32]){ 0x38, 0xdd, 0xe9, 0xf3, 0xe7, 0xb7, 0x99, 0x04,
1701                     0x5f, 0x9a, 0xc3, 0x79, 0x3d, 0x4a, 0x92, 0x77,
1702                     0xda, 0xde, 0xad, 0xc4, 0x1b, 0xec, 0x02, 0x90,
1703                     0xf8, 0x1f, 0x74, 0x4f, 0x73, 0x77, 0x5f, 0x84 },
1704        .b_public = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1705                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1706                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1707                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1708        .expected_ss = (u8[32]){ 0x9a, 0x2c, 0xfe, 0x84, 0xff, 0x9c, 0x4a, 0x97,
1709                    0x39, 0x62, 0x5c, 0xae, 0x4a, 0x3b, 0x82, 0xa9,
1710                    0x06, 0x87, 0x7a, 0x44, 0x19, 0x46, 0xf8, 0xd7,
1711                    0xb3, 0xd7, 0x95, 0xfe, 0x8f, 0x5d, 0x16, 0x39 },
1712        .secret_size = 32,
1713        .b_public_size = 32,
1714        .expected_ss_size = 32,
1715
1716},
1717/* wycheproof - edge case on twist */
1718{
1719        .secret = (u8[32]){ 0x98, 0x57, 0xa9, 0x14, 0xe3, 0xc2, 0x90, 0x36,
1720                     0xfd, 0x9a, 0x44, 0x2b, 0xa5, 0x26, 0xb5, 0xcd,
1721                     0xcd, 0xf2, 0x82, 0x16, 0x15, 0x3e, 0x63, 0x6c,
1722                     0x10, 0x67, 0x7a, 0xca, 0xb6, 0xbd, 0x6a, 0xa5 },
1723        .b_public = (u8[32]){ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1724                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1725                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1726                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1727        .expected_ss = (u8[32]){ 0x4d, 0xa4, 0xe0, 0xaa, 0x07, 0x2c, 0x23, 0x2e,
1728                    0xe2, 0xf0, 0xfa, 0x4e, 0x51, 0x9a, 0xe5, 0x0b,
1729                    0x52, 0xc1, 0xed, 0xd0, 0x8a, 0x53, 0x4d, 0x4e,
1730                    0xf3, 0x46, 0xc2, 0xe1, 0x06, 0xd2, 0x1d, 0x60 },
1731        .secret_size = 32,
1732        .b_public_size = 32,
1733        .expected_ss_size = 32,
1734
1735},
1736/* wycheproof - edge case on twist */
1737{
1738        .secret = (u8[32]){ 0x48, 0xe2, 0x13, 0x0d, 0x72, 0x33, 0x05, 0xed,
1739                     0x05, 0xe6, 0xe5, 0x89, 0x4d, 0x39, 0x8a, 0x5e,
1740                     0x33, 0x36, 0x7a, 0x8c, 0x6a, 0xac, 0x8f, 0xcd,
1741                     0xf0, 0xa8, 0x8e, 0x4b, 0x42, 0x82, 0x0d, 0xb7 },
1742        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff,
1743                    0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
1744                    0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00,
1745                    0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00 },
1746        .expected_ss = (u8[32]){ 0x9e, 0xd1, 0x0c, 0x53, 0x74, 0x7f, 0x64, 0x7f,
1747                    0x82, 0xf4, 0x51, 0x25, 0xd3, 0xde, 0x15, 0xa1,
1748                    0xe6, 0xb8, 0x24, 0x49, 0x6a, 0xb4, 0x04, 0x10,
1749                    0xff, 0xcc, 0x3c, 0xfe, 0x95, 0x76, 0x0f, 0x3b },
1750        .secret_size = 32,
1751        .b_public_size = 32,
1752        .expected_ss_size = 32,
1753
1754},
1755/* wycheproof - edge case on twist */
1756{
1757        .secret = (u8[32]){ 0x28, 0xf4, 0x10, 0x11, 0x69, 0x18, 0x51, 0xb3,
1758                     0xa6, 0x2b, 0x64, 0x15, 0x53, 0xb3, 0x0d, 0x0d,
1759                     0xfd, 0xdc, 0xb8, 0xff, 0xfc, 0xf5, 0x37, 0x00,
1760                     0xa7, 0xbe, 0x2f, 0x6a, 0x87, 0x2e, 0x9f, 0xb0 },
1761        .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00,
1762                    0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
1763                    0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff,
1764                    0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f },
1765        .expected_ss = (u8[32]){ 0xcf, 0x72, 0xb4, 0xaa, 0x6a, 0xa1, 0xc9, 0xf8,
1766                    0x94, 0xf4, 0x16, 0x5b, 0x86, 0x10, 0x9a, 0xa4,
1767                    0x68, 0x51, 0x76, 0x48, 0xe1, 0xf0, 0xcc, 0x70,
1768                    0xe1, 0xab, 0x08, 0x46, 0x01, 0x76, 0x50, 0x6b },
1769        .secret_size = 32,
1770        .b_public_size = 32,
1771        .expected_ss_size = 32,
1772
1773},
1774/* wycheproof - edge case on twist */
1775{
1776        .secret = (u8[32]){ 0x18, 0xa9, 0x3b, 0x64, 0x99, 0xb9, 0xf6, 0xb3,
1777                     0x22, 0x5c, 0xa0, 0x2f, 0xef, 0x41, 0x0e, 0x0a,
1778                     0xde, 0xc2, 0x35, 0x32, 0x32, 0x1d, 0x2d, 0x8e,
1779                     0xf1, 0xa6, 0xd6, 0x02, 0xa8, 0xc6, 0x5b, 0x83 },
1780        .b_public = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1781                    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1782                    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
1783                    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f },
1784        .expected_ss = (u8[32]){ 0x5d, 0x50, 0xb6, 0x28, 0x36, 0xbb, 0x69, 0x57,
1785                    0x94, 0x10, 0x38, 0x6c, 0xf7, 0xbb, 0x81, 0x1c,
1786                    0x14, 0xbf, 0x85, 0xb1, 0xc7, 0xb1, 0x7e, 0x59,
1787                    0x24, 0xc7, 0xff, 0xea, 0x91, 0xef, 0x9e, 0x12 },
1788        .secret_size = 32,
1789        .b_public_size = 32,
1790        .expected_ss_size = 32,
1791
1792},
1793/* wycheproof - edge case on twist */
1794{
1795        .secret = (u8[32]){ 0xc0, 0x1d, 0x13, 0x05, 0xa1, 0x33, 0x8a, 0x1f,
1796                     0xca, 0xc2, 0xba, 0x7e, 0x2e, 0x03, 0x2b, 0x42,
1797                     0x7e, 0x0b, 0x04, 0x90, 0x31, 0x65, 0xac, 0xa9,
1798                     0x57, 0xd8, 0xd0, 0x55, 0x3d, 0x87, 0x17, 0xb0 },
1799        .b_public = (u8[32]){ 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1800                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1801                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1802                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1803        .expected_ss = (u8[32]){ 0x19, 0x23, 0x0e, 0xb1, 0x48, 0xd5, 0xd6, 0x7c,
1804                    0x3c, 0x22, 0xab, 0x1d, 0xae, 0xff, 0x80, 0xa5,
1805                    0x7e, 0xae, 0x42, 0x65, 0xce, 0x28, 0x72, 0x65,
1806                    0x7b, 0x2c, 0x80, 0x99, 0xfc, 0x69, 0x8e, 0x50 },
1807        .secret_size = 32,
1808        .b_public_size = 32,
1809        .expected_ss_size = 32,
1810
1811},
1812/* wycheproof - edge case for public key */
1813{
1814        .secret = (u8[32]){ 0x38, 0x6f, 0x7f, 0x16, 0xc5, 0x07, 0x31, 0xd6,
1815                     0x4f, 0x82, 0xe6, 0xa1, 0x70, 0xb1, 0x42, 0xa4,
1816                     0xe3, 0x4f, 0x31, 0xfd, 0x77, 0x68, 0xfc, 0xb8,
1817                     0x90, 0x29, 0x25, 0xe7, 0xd1, 0xe2, 0x1a, 0xbe },
1818        .b_public = (u8[32]){ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1819                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1820                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1821                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1822        .expected_ss = (u8[32]){ 0x0f, 0xca, 0xb5, 0xd8, 0x42, 0xa0, 0x78, 0xd7,
1823                    0xa7, 0x1f, 0xc5, 0x9b, 0x57, 0xbf, 0xb4, 0xca,
1824                    0x0b, 0xe6, 0x87, 0x3b, 0x49, 0xdc, 0xdb, 0x9f,
1825                    0x44, 0xe1, 0x4a, 0xe8, 0xfb, 0xdf, 0xa5, 0x42 },
1826        .secret_size = 32,
1827        .b_public_size = 32,
1828        .expected_ss_size = 32,
1829
1830},
1831/* wycheproof - edge case for public key */
1832{
1833        .secret = (u8[32]){ 0xe0, 0x23, 0xa2, 0x89, 0xbd, 0x5e, 0x90, 0xfa,
1834                     0x28, 0x04, 0xdd, 0xc0, 0x19, 0xa0, 0x5e, 0xf3,
1835                     0xe7, 0x9d, 0x43, 0x4b, 0xb6, 0xea, 0x2f, 0x52,
1836                     0x2e, 0xcb, 0x64, 0x3a, 0x75, 0x29, 0x6e, 0x95 },
1837        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1838                    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1839                    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
1840                    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 },
1841        .expected_ss = (u8[32]){ 0x54, 0xce, 0x8f, 0x22, 0x75, 0xc0, 0x77, 0xe3,
1842                    0xb1, 0x30, 0x6a, 0x39, 0x39, 0xc5, 0xe0, 0x3e,
1843                    0xef, 0x6b, 0xbb, 0x88, 0x06, 0x05, 0x44, 0x75,
1844                    0x8d, 0x9f, 0xef, 0x59, 0xb0, 0xbc, 0x3e, 0x4f },
1845        .secret_size = 32,
1846        .b_public_size = 32,
1847        .expected_ss_size = 32,
1848
1849},
1850/* wycheproof - edge case for public key */
1851{
1852        .secret = (u8[32]){ 0x68, 0xf0, 0x10, 0xd6, 0x2e, 0xe8, 0xd9, 0x26,
1853                     0x05, 0x3a, 0x36, 0x1c, 0x3a, 0x75, 0xc6, 0xea,
1854                     0x4e, 0xbd, 0xc8, 0x60, 0x6a, 0xb2, 0x85, 0x00,
1855                     0x3a, 0x6f, 0x8f, 0x40, 0x76, 0xb0, 0x1e, 0x83 },
1856        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1857                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1858                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1859                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03 },
1860        .expected_ss = (u8[32]){ 0xf1, 0x36, 0x77, 0x5c, 0x5b, 0xeb, 0x0a, 0xf8,
1861                    0x11, 0x0a, 0xf1, 0x0b, 0x20, 0x37, 0x23, 0x32,
1862                    0x04, 0x3c, 0xab, 0x75, 0x24, 0x19, 0x67, 0x87,
1863                    0x75, 0xa2, 0x23, 0xdf, 0x57, 0xc9, 0xd3, 0x0d },
1864        .secret_size = 32,
1865        .b_public_size = 32,
1866        .expected_ss_size = 32,
1867
1868},
1869/* wycheproof - edge case for public key */
1870{
1871        .secret = (u8[32]){ 0x58, 0xeb, 0xcb, 0x35, 0xb0, 0xf8, 0x84, 0x5c,
1872                     0xaf, 0x1e, 0xc6, 0x30, 0xf9, 0x65, 0x76, 0xb6,
1873                     0x2c, 0x4b, 0x7b, 0x6c, 0x36, 0xb2, 0x9d, 0xeb,
1874                     0x2c, 0xb0, 0x08, 0x46, 0x51, 0x75, 0x5c, 0x96 },
1875        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xfb, 0xff,
1876                    0xff, 0xdf, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff,
1877                    0xfe, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xf7, 0xff,
1878                    0xff, 0xf7, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x3f },
1879        .expected_ss = (u8[32]){ 0xbf, 0x9a, 0xff, 0xd0, 0x6b, 0x84, 0x40, 0x85,
1880                    0x58, 0x64, 0x60, 0x96, 0x2e, 0xf2, 0x14, 0x6f,
1881                    0xf3, 0xd4, 0x53, 0x3d, 0x94, 0x44, 0xaa, 0xb0,
1882                    0x06, 0xeb, 0x88, 0xcc, 0x30, 0x54, 0x40, 0x7d },
1883        .secret_size = 32,
1884        .b_public_size = 32,
1885        .expected_ss_size = 32,
1886
1887},
1888/* wycheproof - edge case for public key */
1889{
1890        .secret = (u8[32]){ 0x18, 0x8c, 0x4b, 0xc5, 0xb9, 0xc4, 0x4b, 0x38,
1891                     0xbb, 0x65, 0x8b, 0x9b, 0x2a, 0xe8, 0x2d, 0x5b,
1892                     0x01, 0x01, 0x5e, 0x09, 0x31, 0x84, 0xb1, 0x7c,
1893                     0xb7, 0x86, 0x35, 0x03, 0xa7, 0x83, 0xe1, 0xbb },
1894        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1895                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1896                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1897                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
1898        .expected_ss = (u8[32]){ 0xd4, 0x80, 0xde, 0x04, 0xf6, 0x99, 0xcb, 0x3b,
1899                    0xe0, 0x68, 0x4a, 0x9c, 0xc2, 0xe3, 0x12, 0x81,
1900                    0xea, 0x0b, 0xc5, 0xa9, 0xdc, 0xc1, 0x57, 0xd3,
1901                    0xd2, 0x01, 0x58, 0xd4, 0x6c, 0xa5, 0x24, 0x6d },
1902        .secret_size = 32,
1903        .b_public_size = 32,
1904        .expected_ss_size = 32,
1905
1906},
1907/* wycheproof - edge case for public key */
1908{
1909        .secret = (u8[32]){ 0xe0, 0x6c, 0x11, 0xbb, 0x2e, 0x13, 0xce, 0x3d,
1910                     0xc7, 0x67, 0x3f, 0x67, 0xf5, 0x48, 0x22, 0x42,
1911                     0x90, 0x94, 0x23, 0xa9, 0xae, 0x95, 0xee, 0x98,
1912                     0x6a, 0x98, 0x8d, 0x98, 0xfa, 0xee, 0x23, 0xa2 },
1913        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1914                    0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1915                    0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
1916                    0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f },
1917        .expected_ss = (u8[32]){ 0x4c, 0x44, 0x01, 0xcc, 0xe6, 0xb5, 0x1e, 0x4c,
1918                    0xb1, 0x8f, 0x27, 0x90, 0x24, 0x6c, 0x9b, 0xf9,
1919                    0x14, 0xdb, 0x66, 0x77, 0x50, 0xa1, 0xcb, 0x89,
1920                    0x06, 0x90, 0x92, 0xaf, 0x07, 0x29, 0x22, 0x76 },
1921        .secret_size = 32,
1922        .b_public_size = 32,
1923        .expected_ss_size = 32,
1924
1925},
1926/* wycheproof - edge case for public key */
1927{
1928        .secret = (u8[32]){ 0xc0, 0x65, 0x8c, 0x46, 0xdd, 0xe1, 0x81, 0x29,
1929                     0x29, 0x38, 0x77, 0x53, 0x5b, 0x11, 0x62, 0xb6,
1930                     0xf9, 0xf5, 0x41, 0x4a, 0x23, 0xcf, 0x4d, 0x2c,
1931                     0xbc, 0x14, 0x0a, 0x4d, 0x99, 0xda, 0x2b, 0x8f },
1932        .b_public = (u8[32]){ 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1933                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1934                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1935                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1936        .expected_ss = (u8[32]){ 0x57, 0x8b, 0xa8, 0xcc, 0x2d, 0xbd, 0xc5, 0x75,
1937                    0xaf, 0xcf, 0x9d, 0xf2, 0xb3, 0xee, 0x61, 0x89,
1938                    0xf5, 0x33, 0x7d, 0x68, 0x54, 0xc7, 0x9b, 0x4c,
1939                    0xe1, 0x65, 0xea, 0x12, 0x29, 0x3b, 0x3a, 0x0f },
1940        .secret_size = 32,
1941        .b_public_size = 32,
1942        .expected_ss_size = 32,
1943
1944},
1945/* wycheproof - public key >= p */
1946{
1947        .secret = (u8[32]){ 0xf0, 0x1e, 0x48, 0xda, 0xfa, 0xc9, 0xd7, 0xbc,
1948                     0xf5, 0x89, 0xcb, 0xc3, 0x82, 0xc8, 0x78, 0xd1,
1949                     0x8b, 0xda, 0x35, 0x50, 0x58, 0x9f, 0xfb, 0x5d,
1950                     0x50, 0xb5, 0x23, 0xbe, 0xbe, 0x32, 0x9d, 0xae },
1951        .b_public = (u8[32]){ 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1952                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1953                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1954                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1955        .expected_ss = (u8[32]){ 0xbd, 0x36, 0xa0, 0x79, 0x0e, 0xb8, 0x83, 0x09,
1956                    0x8c, 0x98, 0x8b, 0x21, 0x78, 0x67, 0x73, 0xde,
1957                    0x0b, 0x3a, 0x4d, 0xf1, 0x62, 0x28, 0x2c, 0xf1,
1958                    0x10, 0xde, 0x18, 0xdd, 0x48, 0x4c, 0xe7, 0x4b },
1959        .secret_size = 32,
1960        .b_public_size = 32,
1961        .expected_ss_size = 32,
1962
1963},
1964/* wycheproof - public key >= p */
1965{
1966        .secret = (u8[32]){ 0x28, 0x87, 0x96, 0xbc, 0x5a, 0xff, 0x4b, 0x81,
1967                     0xa3, 0x75, 0x01, 0x75, 0x7b, 0xc0, 0x75, 0x3a,
1968                     0x3c, 0x21, 0x96, 0x47, 0x90, 0xd3, 0x86, 0x99,
1969                     0x30, 0x8d, 0xeb, 0xc1, 0x7a, 0x6e, 0xaf, 0x8d },
1970        .b_public = (u8[32]){ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1971                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1972                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1973                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1974        .expected_ss = (u8[32]){ 0xb4, 0xe0, 0xdd, 0x76, 0xda, 0x7b, 0x07, 0x17,
1975                    0x28, 0xb6, 0x1f, 0x85, 0x67, 0x71, 0xaa, 0x35,
1976                    0x6e, 0x57, 0xed, 0xa7, 0x8a, 0x5b, 0x16, 0x55,
1977                    0xcc, 0x38, 0x20, 0xfb, 0x5f, 0x85, 0x4c, 0x5c },
1978        .secret_size = 32,
1979        .b_public_size = 32,
1980        .expected_ss_size = 32,
1981
1982},
1983/* wycheproof - public key >= p */
1984{
1985        .secret = (u8[32]){ 0x98, 0xdf, 0x84, 0x5f, 0x66, 0x51, 0xbf, 0x11,
1986                     0x38, 0x22, 0x1f, 0x11, 0x90, 0x41, 0xf7, 0x2b,
1987                     0x6d, 0xbc, 0x3c, 0x4a, 0xce, 0x71, 0x43, 0xd9,
1988                     0x9f, 0xd5, 0x5a, 0xd8, 0x67, 0x48, 0x0d, 0xa8 },
1989        .b_public = (u8[32]){ 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1990                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1991                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1992                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
1993        .expected_ss = (u8[32]){ 0x6f, 0xdf, 0x6c, 0x37, 0x61, 0x1d, 0xbd, 0x53,
1994                    0x04, 0xdc, 0x0f, 0x2e, 0xb7, 0xc9, 0x51, 0x7e,
1995                    0xb3, 0xc5, 0x0e, 0x12, 0xfd, 0x05, 0x0a, 0xc6,
1996                    0xde, 0xc2, 0x70, 0x71, 0xd4, 0xbf, 0xc0, 0x34 },
1997        .secret_size = 32,
1998        .b_public_size = 32,
1999        .expected_ss_size = 32,
2000
2001},
2002/* wycheproof - public key >= p */
2003{
2004        .secret = (u8[32]){ 0xf0, 0x94, 0x98, 0xe4, 0x6f, 0x02, 0xf8, 0x78,
2005                     0x82, 0x9e, 0x78, 0xb8, 0x03, 0xd3, 0x16, 0xa2,
2006                     0xed, 0x69, 0x5d, 0x04, 0x98, 0xa0, 0x8a, 0xbd,
2007                     0xf8, 0x27, 0x69, 0x30, 0xe2, 0x4e, 0xdc, 0xb0 },
2008        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2009                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2010                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2011                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2012        .expected_ss = (u8[32]){ 0x4c, 0x8f, 0xc4, 0xb1, 0xc6, 0xab, 0x88, 0xfb,
2013                    0x21, 0xf1, 0x8f, 0x6d, 0x4c, 0x81, 0x02, 0x40,
2014                    0xd4, 0xe9, 0x46, 0x51, 0xba, 0x44, 0xf7, 0xa2,
2015                    0xc8, 0x63, 0xce, 0xc7, 0xdc, 0x56, 0x60, 0x2d },
2016        .secret_size = 32,
2017        .b_public_size = 32,
2018        .expected_ss_size = 32,
2019
2020},
2021/* wycheproof - public key >= p */
2022{
2023        .secret = (u8[32]){ 0x18, 0x13, 0xc1, 0x0a, 0x5c, 0x7f, 0x21, 0xf9,
2024                     0x6e, 0x17, 0xf2, 0x88, 0xc0, 0xcc, 0x37, 0x60,
2025                     0x7c, 0x04, 0xc5, 0xf5, 0xae, 0xa2, 0xdb, 0x13,
2026                     0x4f, 0x9e, 0x2f, 0xfc, 0x66, 0xbd, 0x9d, 0xb8 },
2027        .b_public = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2028                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2029                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2030                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
2031        .expected_ss = (u8[32]){ 0x1c, 0xd0, 0xb2, 0x82, 0x67, 0xdc, 0x54, 0x1c,
2032                    0x64, 0x2d, 0x6d, 0x7d, 0xca, 0x44, 0xa8, 0xb3,
2033                    0x8a, 0x63, 0x73, 0x6e, 0xef, 0x5c, 0x4e, 0x65,
2034                    0x01, 0xff, 0xbb, 0xb1, 0x78, 0x0c, 0x03, 0x3c },
2035        .secret_size = 32,
2036        .b_public_size = 32,
2037        .expected_ss_size = 32,
2038
2039},
2040/* wycheproof - public key >= p */
2041{
2042        .secret = (u8[32]){ 0x78, 0x57, 0xfb, 0x80, 0x86, 0x53, 0x64, 0x5a,
2043                     0x0b, 0xeb, 0x13, 0x8a, 0x64, 0xf5, 0xf4, 0xd7,
2044                     0x33, 0xa4, 0x5e, 0xa8, 0x4c, 0x3c, 0xda, 0x11,
2045                     0xa9, 0xc0, 0x6f, 0x7e, 0x71, 0x39, 0x14, 0x9e },
2046        .b_public = (u8[32]){ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2047                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2048                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2049                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
2050        .expected_ss = (u8[32]){ 0x87, 0x55, 0xbe, 0x01, 0xc6, 0x0a, 0x7e, 0x82,
2051                    0x5c, 0xff, 0x3e, 0x0e, 0x78, 0xcb, 0x3a, 0xa4,
2052                    0x33, 0x38, 0x61, 0x51, 0x6a, 0xa5, 0x9b, 0x1c,
2053                    0x51, 0xa8, 0xb2, 0xa5, 0x43, 0xdf, 0xa8, 0x22 },
2054        .secret_size = 32,
2055        .b_public_size = 32,
2056        .expected_ss_size = 32,
2057
2058},
2059/* wycheproof - public key >= p */
2060{
2061        .secret = (u8[32]){ 0xe0, 0x3a, 0xa8, 0x42, 0xe2, 0xab, 0xc5, 0x6e,
2062                     0x81, 0xe8, 0x7b, 0x8b, 0x9f, 0x41, 0x7b, 0x2a,
2063                     0x1e, 0x59, 0x13, 0xc7, 0x23, 0xee, 0xd2, 0x8d,
2064                     0x75, 0x2f, 0x8d, 0x47, 0xa5, 0x9f, 0x49, 0x8f },
2065        .b_public = (u8[32]){ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2066                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2067                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2068                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 },
2069        .expected_ss = (u8[32]){ 0x54, 0xc9, 0xa1, 0xed, 0x95, 0xe5, 0x46, 0xd2,
2070                    0x78, 0x22, 0xa3, 0x60, 0x93, 0x1d, 0xda, 0x60,
2071                    0xa1, 0xdf, 0x04, 0x9d, 0xa6, 0xf9, 0x04, 0x25,
2072                    0x3c, 0x06, 0x12, 0xbb, 0xdc, 0x08, 0x74, 0x76 },
2073        .secret_size = 32,
2074        .b_public_size = 32,
2075        .expected_ss_size = 32,
2076
2077},
2078/* wycheproof - public key >= p */
2079{
2080        .secret = (u8[32]){ 0xf8, 0xf7, 0x07, 0xb7, 0x99, 0x9b, 0x18, 0xcb,
2081                     0x0d, 0x6b, 0x96, 0x12, 0x4f, 0x20, 0x45, 0x97,
2082                     0x2c, 0xa2, 0x74, 0xbf, 0xc1, 0x54, 0xad, 0x0c,
2083                     0x87, 0x03, 0x8c, 0x24, 0xc6, 0xd0, 0xd4, 0xb2 },
2084        .b_public = (u8[32]){ 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2085                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2086                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2087                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2088        .expected_ss = (u8[32]){ 0xcc, 0x1f, 0x40, 0xd7, 0x43, 0xcd, 0xc2, 0x23,
2089                    0x0e, 0x10, 0x43, 0xda, 0xba, 0x8b, 0x75, 0xe8,
2090                    0x10, 0xf1, 0xfb, 0xab, 0x7f, 0x25, 0x52, 0x69,
2091                    0xbd, 0x9e, 0xbb, 0x29, 0xe6, 0xbf, 0x49, 0x4f },
2092        .secret_size = 32,
2093        .b_public_size = 32,
2094        .expected_ss_size = 32,
2095
2096},
2097/* wycheproof - public key >= p */
2098{
2099        .secret = (u8[32]){ 0xa0, 0x34, 0xf6, 0x84, 0xfa, 0x63, 0x1e, 0x1a,
2100                     0x34, 0x81, 0x18, 0xc1, 0xce, 0x4c, 0x98, 0x23,
2101                     0x1f, 0x2d, 0x9e, 0xec, 0x9b, 0xa5, 0x36, 0x5b,
2102                     0x4a, 0x05, 0xd6, 0x9a, 0x78, 0x5b, 0x07, 0x96 },
2103        .b_public = (u8[32]){ 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2104                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2105                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2106                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2107        .expected_ss = (u8[32]){ 0x54, 0x99, 0x8e, 0xe4, 0x3a, 0x5b, 0x00, 0x7b,
2108                    0xf4, 0x99, 0xf0, 0x78, 0xe7, 0x36, 0x52, 0x44,
2109                    0x00, 0xa8, 0xb5, 0xc7, 0xe9, 0xb9, 0xb4, 0x37,
2110                    0x71, 0x74, 0x8c, 0x7c, 0xdf, 0x88, 0x04, 0x12 },
2111        .secret_size = 32,
2112        .b_public_size = 32,
2113        .expected_ss_size = 32,
2114
2115},
2116/* wycheproof - public key >= p */
2117{
2118        .secret = (u8[32]){ 0x30, 0xb6, 0xc6, 0xa0, 0xf2, 0xff, 0xa6, 0x80,
2119                     0x76, 0x8f, 0x99, 0x2b, 0xa8, 0x9e, 0x15, 0x2d,
2120                     0x5b, 0xc9, 0x89, 0x3d, 0x38, 0xc9, 0x11, 0x9b,
2121                     0xe4, 0xf7, 0x67, 0xbf, 0xab, 0x6e, 0x0c, 0xa5 },
2122        .b_public = (u8[32]){ 0xdc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2123                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2124                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2125                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2126        .expected_ss = (u8[32]){ 0xea, 0xd9, 0xb3, 0x8e, 0xfd, 0xd7, 0x23, 0x63,
2127                    0x79, 0x34, 0xe5, 0x5a, 0xb7, 0x17, 0xa7, 0xae,
2128                    0x09, 0xeb, 0x86, 0xa2, 0x1d, 0xc3, 0x6a, 0x3f,
2129                    0xee, 0xb8, 0x8b, 0x75, 0x9e, 0x39, 0x1e, 0x09 },
2130        .secret_size = 32,
2131        .b_public_size = 32,
2132        .expected_ss_size = 32,
2133
2134},
2135/* wycheproof - public key >= p */
2136{
2137        .secret = (u8[32]){ 0x90, 0x1b, 0x9d, 0xcf, 0x88, 0x1e, 0x01, 0xe0,
2138                     0x27, 0x57, 0x50, 0x35, 0xd4, 0x0b, 0x43, 0xbd,
2139                     0xc1, 0xc5, 0x24, 0x2e, 0x03, 0x08, 0x47, 0x49,
2140                     0x5b, 0x0c, 0x72, 0x86, 0x46, 0x9b, 0x65, 0x91 },
2141        .b_public = (u8[32]){ 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2142                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2143                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2144                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2145        .expected_ss = (u8[32]){ 0x60, 0x2f, 0xf4, 0x07, 0x89, 0xb5, 0x4b, 0x41,
2146                    0x80, 0x59, 0x15, 0xfe, 0x2a, 0x62, 0x21, 0xf0,
2147                    0x7a, 0x50, 0xff, 0xc2, 0xc3, 0xfc, 0x94, 0xcf,
2148                    0x61, 0xf1, 0x3d, 0x79, 0x04, 0xe8, 0x8e, 0x0e },
2149        .secret_size = 32,
2150        .b_public_size = 32,
2151        .expected_ss_size = 32,
2152
2153},
2154/* wycheproof - public key >= p */
2155{
2156        .secret = (u8[32]){ 0x80, 0x46, 0x67, 0x7c, 0x28, 0xfd, 0x82, 0xc9,
2157                     0xa1, 0xbd, 0xb7, 0x1a, 0x1a, 0x1a, 0x34, 0xfa,
2158                     0xba, 0x12, 0x25, 0xe2, 0x50, 0x7f, 0xe3, 0xf5,
2159                     0x4d, 0x10, 0xbd, 0x5b, 0x0d, 0x86, 0x5f, 0x8e },
2160        .b_public = (u8[32]){ 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2161                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2162                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2163                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2164        .expected_ss = (u8[32]){ 0xe0, 0x0a, 0xe8, 0xb1, 0x43, 0x47, 0x12, 0x47,
2165                    0xba, 0x24, 0xf1, 0x2c, 0x88, 0x55, 0x36, 0xc3,
2166                    0xcb, 0x98, 0x1b, 0x58, 0xe1, 0xe5, 0x6b, 0x2b,
2167                    0xaf, 0x35, 0xc1, 0x2a, 0xe1, 0xf7, 0x9c, 0x26 },
2168        .secret_size = 32,
2169        .b_public_size = 32,
2170        .expected_ss_size = 32,
2171
2172},
2173/* wycheproof - public key >= p */
2174{
2175        .secret = (u8[32]){ 0x60, 0x2f, 0x7e, 0x2f, 0x68, 0xa8, 0x46, 0xb8,
2176                     0x2c, 0xc2, 0x69, 0xb1, 0xd4, 0x8e, 0x93, 0x98,
2177                     0x86, 0xae, 0x54, 0xfd, 0x63, 0x6c, 0x1f, 0xe0,
2178                     0x74, 0xd7, 0x10, 0x12, 0x7d, 0x47, 0x24, 0x91 },
2179        .b_public = (u8[32]){ 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2180                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2181                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2182                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2183        .expected_ss = (u8[32]){ 0x98, 0xcb, 0x9b, 0x50, 0xdd, 0x3f, 0xc2, 0xb0,
2184                    0xd4, 0xf2, 0xd2, 0xbf, 0x7c, 0x5c, 0xfd, 0xd1,
2185                    0x0c, 0x8f, 0xcd, 0x31, 0xfc, 0x40, 0xaf, 0x1a,
2186                    0xd4, 0x4f, 0x47, 0xc1, 0x31, 0x37, 0x63, 0x62 },
2187        .secret_size = 32,
2188        .b_public_size = 32,
2189        .expected_ss_size = 32,
2190
2191},
2192/* wycheproof - public key >= p */
2193{
2194        .secret = (u8[32]){ 0x60, 0x88, 0x7b, 0x3d, 0xc7, 0x24, 0x43, 0x02,
2195                     0x6e, 0xbe, 0xdb, 0xbb, 0xb7, 0x06, 0x65, 0xf4,
2196                     0x2b, 0x87, 0xad, 0xd1, 0x44, 0x0e, 0x77, 0x68,
2197                     0xfb, 0xd7, 0xe8, 0xe2, 0xce, 0x5f, 0x63, 0x9d },
2198        .b_public = (u8[32]){ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2199                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2200                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2201                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2202        .expected_ss = (u8[32]){ 0x38, 0xd6, 0x30, 0x4c, 0x4a, 0x7e, 0x6d, 0x9f,
2203                    0x79, 0x59, 0x33, 0x4f, 0xb5, 0x24, 0x5b, 0xd2,
2204                    0xc7, 0x54, 0x52, 0x5d, 0x4c, 0x91, 0xdb, 0x95,
2205                    0x02, 0x06, 0x92, 0x62, 0x34, 0xc1, 0xf6, 0x33 },
2206        .secret_size = 32,
2207        .b_public_size = 32,
2208        .expected_ss_size = 32,
2209
2210},
2211/* wycheproof - public key >= p */
2212{
2213        .secret = (u8[32]){ 0x78, 0xd3, 0x1d, 0xfa, 0x85, 0x44, 0x97, 0xd7,
2214                     0x2d, 0x8d, 0xef, 0x8a, 0x1b, 0x7f, 0xb0, 0x06,
2215                     0xce, 0xc2, 0xd8, 0xc4, 0x92, 0x46, 0x47, 0xc9,
2216                     0x38, 0x14, 0xae, 0x56, 0xfa, 0xed, 0xa4, 0x95 },
2217        .b_public = (u8[32]){ 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2218                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2219                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2220                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2221        .expected_ss = (u8[32]){ 0x78, 0x6c, 0xd5, 0x49, 0x96, 0xf0, 0x14, 0xa5,
2222                    0xa0, 0x31, 0xec, 0x14, 0xdb, 0x81, 0x2e, 0xd0,
2223                    0x83, 0x55, 0x06, 0x1f, 0xdb, 0x5d, 0xe6, 0x80,
2224                    0xa8, 0x00, 0xac, 0x52, 0x1f, 0x31, 0x8e, 0x23 },
2225        .secret_size = 32,
2226        .b_public_size = 32,
2227        .expected_ss_size = 32,
2228
2229},
2230/* wycheproof - public key >= p */
2231{
2232        .secret = (u8[32]){ 0xc0, 0x4c, 0x5b, 0xae, 0xfa, 0x83, 0x02, 0xdd,
2233                     0xde, 0xd6, 0xa4, 0xbb, 0x95, 0x77, 0x61, 0xb4,
2234                     0xeb, 0x97, 0xae, 0xfa, 0x4f, 0xc3, 0xb8, 0x04,
2235                     0x30, 0x85, 0xf9, 0x6a, 0x56, 0x59, 0xb3, 0xa5 },
2236        .b_public = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2237                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2238                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2239                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
2240        .expected_ss = (u8[32]){ 0x29, 0xae, 0x8b, 0xc7, 0x3e, 0x9b, 0x10, 0xa0,
2241                    0x8b, 0x4f, 0x68, 0x1c, 0x43, 0xc3, 0xe0, 0xac,
2242                    0x1a, 0x17, 0x1d, 0x31, 0xb3, 0x8f, 0x1a, 0x48,
2243                    0xef, 0xba, 0x29, 0xae, 0x63, 0x9e, 0xa1, 0x34 },
2244        .secret_size = 32,
2245        .b_public_size = 32,
2246        .expected_ss_size = 32,
2247
2248},
2249/* wycheproof - RFC 7748 */
2250{
2251        .secret = (u8[32]){ 0xa0, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d,
2252                     0x3b, 0x16, 0x15, 0x4b, 0x82, 0x46, 0x5e, 0xdd,
2253                     0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc, 0x5a, 0x18,
2254                     0x50, 0x6a, 0x22, 0x44, 0xba, 0x44, 0x9a, 0x44 },
2255        .b_public = (u8[32]){ 0xe6, 0xdb, 0x68, 0x67, 0x58, 0x30, 0x30, 0xdb,
2256                    0x35, 0x94, 0xc1, 0xa4, 0x24, 0xb1, 0x5f, 0x7c,
2257                    0x72, 0x66, 0x24, 0xec, 0x26, 0xb3, 0x35, 0x3b,
2258                    0x10, 0xa9, 0x03, 0xa6, 0xd0, 0xab, 0x1c, 0x4c },
2259        .expected_ss = (u8[32]){ 0xc3, 0xda, 0x55, 0x37, 0x9d, 0xe9, 0xc6, 0x90,
2260                    0x8e, 0x94, 0xea, 0x4d, 0xf2, 0x8d, 0x08, 0x4f,
2261                    0x32, 0xec, 0xcf, 0x03, 0x49, 0x1c, 0x71, 0xf7,
2262                    0x54, 0xb4, 0x07, 0x55, 0x77, 0xa2, 0x85, 0x52 },
2263        .secret_size = 32,
2264        .b_public_size = 32,
2265        .expected_ss_size = 32,
2266
2267},
2268/* wycheproof - RFC 7748 */
2269{
2270        .secret = (u8[32]){ 0x48, 0x66, 0xe9, 0xd4, 0xd1, 0xb4, 0x67, 0x3c,
2271                     0x5a, 0xd2, 0x26, 0x91, 0x95, 0x7d, 0x6a, 0xf5,
2272                     0xc1, 0x1b, 0x64, 0x21, 0xe0, 0xea, 0x01, 0xd4,
2273                     0x2c, 0xa4, 0x16, 0x9e, 0x79, 0x18, 0xba, 0x4d },
2274        .b_public = (u8[32]){ 0xe5, 0x21, 0x0f, 0x12, 0x78, 0x68, 0x11, 0xd3,
2275                    0xf4, 0xb7, 0x95, 0x9d, 0x05, 0x38, 0xae, 0x2c,
2276                    0x31, 0xdb, 0xe7, 0x10, 0x6f, 0xc0, 0x3c, 0x3e,
2277                    0xfc, 0x4c, 0xd5, 0x49, 0xc7, 0x15, 0xa4, 0x13 },
2278        .expected_ss = (u8[32]){ 0x95, 0xcb, 0xde, 0x94, 0x76, 0xe8, 0x90, 0x7d,
2279                    0x7a, 0xad, 0xe4, 0x5c, 0xb4, 0xb8, 0x73, 0xf8,
2280                    0x8b, 0x59, 0x5a, 0x68, 0x79, 0x9f, 0xa1, 0x52,
2281                    0xe6, 0xf8, 0xf7, 0x64, 0x7a, 0xac, 0x79, 0x57 },
2282        .secret_size = 32,
2283        .b_public_size = 32,
2284        .expected_ss_size = 32,
2285
2286},
2287/* wycheproof - edge case for shared secret */
2288{
2289        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2290                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2291                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2292                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2293        .b_public = (u8[32]){ 0x0a, 0xb4, 0xe7, 0x63, 0x80, 0xd8, 0x4d, 0xde,
2294                    0x4f, 0x68, 0x33, 0xc5, 0x8f, 0x2a, 0x9f, 0xb8,
2295                    0xf8, 0x3b, 0xb0, 0x16, 0x9b, 0x17, 0x2b, 0xe4,
2296                    0xb6, 0xe0, 0x59, 0x28, 0x87, 0x74, 0x1a, 0x36 },
2297        .expected_ss = (u8[32]){ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2298                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2299                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2300                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2301        .secret_size = 32,
2302        .b_public_size = 32,
2303        .expected_ss_size = 32,
2304
2305},
2306/* wycheproof - edge case for shared secret */
2307{
2308        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2309                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2310                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2311                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2312        .b_public = (u8[32]){ 0x89, 0xe1, 0x0d, 0x57, 0x01, 0xb4, 0x33, 0x7d,
2313                    0x2d, 0x03, 0x21, 0x81, 0x53, 0x8b, 0x10, 0x64,
2314                    0xbd, 0x40, 0x84, 0x40, 0x1c, 0xec, 0xa1, 0xfd,
2315                    0x12, 0x66, 0x3a, 0x19, 0x59, 0x38, 0x80, 0x00 },
2316        .expected_ss = (u8[32]){ 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2317                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2318                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2319                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2320        .secret_size = 32,
2321        .b_public_size = 32,
2322        .expected_ss_size = 32,
2323
2324},
2325/* wycheproof - edge case for shared secret */
2326{
2327        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2328                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2329                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2330                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2331        .b_public = (u8[32]){ 0x2b, 0x55, 0xd3, 0xaa, 0x4a, 0x8f, 0x80, 0xc8,
2332                    0xc0, 0xb2, 0xae, 0x5f, 0x93, 0x3e, 0x85, 0xaf,
2333                    0x49, 0xbe, 0xac, 0x36, 0xc2, 0xfa, 0x73, 0x94,
2334                    0xba, 0xb7, 0x6c, 0x89, 0x33, 0xf8, 0xf8, 0x1d },
2335        .expected_ss = (u8[32]){ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2336                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2337                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2338                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2339        .secret_size = 32,
2340        .b_public_size = 32,
2341        .expected_ss_size = 32,
2342
2343},
2344/* wycheproof - edge case for shared secret */
2345{
2346        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2347                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2348                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2349                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2350        .b_public = (u8[32]){ 0x63, 0xe5, 0xb1, 0xfe, 0x96, 0x01, 0xfe, 0x84,
2351                    0x38, 0x5d, 0x88, 0x66, 0xb0, 0x42, 0x12, 0x62,
2352                    0xf7, 0x8f, 0xbf, 0xa5, 0xaf, 0xf9, 0x58, 0x5e,
2353                    0x62, 0x66, 0x79, 0xb1, 0x85, 0x47, 0xd9, 0x59 },
2354        .expected_ss = (u8[32]){ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2355                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2356                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2357                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
2358        .secret_size = 32,
2359        .b_public_size = 32,
2360        .expected_ss_size = 32,
2361
2362},
2363/* wycheproof - edge case for shared secret */
2364{
2365        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2366                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2367                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2368                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2369        .b_public = (u8[32]){ 0xe4, 0x28, 0xf3, 0xda, 0xc1, 0x78, 0x09, 0xf8,
2370                    0x27, 0xa5, 0x22, 0xce, 0x32, 0x35, 0x50, 0x58,
2371                    0xd0, 0x73, 0x69, 0x36, 0x4a, 0xa7, 0x89, 0x02,
2372                    0xee, 0x10, 0x13, 0x9b, 0x9f, 0x9d, 0xd6, 0x53 },
2373        .expected_ss = (u8[32]){ 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2374                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2375                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2376                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
2377        .secret_size = 32,
2378        .b_public_size = 32,
2379        .expected_ss_size = 32,
2380
2381},
2382/* wycheproof - edge case for shared secret */
2383{
2384        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2385                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2386                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2387                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2388        .b_public = (u8[32]){ 0xb3, 0xb5, 0x0e, 0x3e, 0xd3, 0xa4, 0x07, 0xb9,
2389                    0x5d, 0xe9, 0x42, 0xef, 0x74, 0x57, 0x5b, 0x5a,
2390                    0xb8, 0xa1, 0x0c, 0x09, 0xee, 0x10, 0x35, 0x44,
2391                    0xd6, 0x0b, 0xdf, 0xed, 0x81, 0x38, 0xab, 0x2b },
2392        .expected_ss = (u8[32]){ 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2393                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2394                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2395                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
2396        .secret_size = 32,
2397        .b_public_size = 32,
2398        .expected_ss_size = 32,
2399
2400},
2401/* wycheproof - edge case for shared secret */
2402{
2403        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2404                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2405                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2406                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2407        .b_public = (u8[32]){ 0x21, 0x3f, 0xff, 0xe9, 0x3d, 0x5e, 0xa8, 0xcd,
2408                    0x24, 0x2e, 0x46, 0x28, 0x44, 0x02, 0x99, 0x22,
2409                    0xc4, 0x3c, 0x77, 0xc9, 0xe3, 0xe4, 0x2f, 0x56,
2410                    0x2f, 0x48, 0x5d, 0x24, 0xc5, 0x01, 0xa2, 0x0b },
2411        .expected_ss = (u8[32]){ 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2412                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2413                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2414                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f },
2415        .secret_size = 32,
2416        .b_public_size = 32,
2417        .expected_ss_size = 32,
2418
2419},
2420/* wycheproof - edge case for shared secret */
2421{
2422        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2423                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2424                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2425                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2426        .b_public = (u8[32]){ 0x91, 0xb2, 0x32, 0xa1, 0x78, 0xb3, 0xcd, 0x53,
2427                    0x09, 0x32, 0x44, 0x1e, 0x61, 0x39, 0x41, 0x8f,
2428                    0x72, 0x17, 0x22, 0x92, 0xf1, 0xda, 0x4c, 0x18,
2429                    0x34, 0xfc, 0x5e, 0xbf, 0xef, 0xb5, 0x1e, 0x3f },
2430        .expected_ss = (u8[32]){ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2431                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2432                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2433                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03 },
2434        .secret_size = 32,
2435        .b_public_size = 32,
2436        .expected_ss_size = 32,
2437
2438},
2439/* wycheproof - edge case for shared secret */
2440{
2441        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2442                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2443                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2444                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2445        .b_public = (u8[32]){ 0x04, 0x5c, 0x6e, 0x11, 0xc5, 0xd3, 0x32, 0x55,
2446                    0x6c, 0x78, 0x22, 0xfe, 0x94, 0xeb, 0xf8, 0x9b,
2447                    0x56, 0xa3, 0x87, 0x8d, 0xc2, 0x7c, 0xa0, 0x79,
2448                    0x10, 0x30, 0x58, 0x84, 0x9f, 0xab, 0xcb, 0x4f },
2449        .expected_ss = (u8[32]){ 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2450                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2451                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2452                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2453        .secret_size = 32,
2454        .b_public_size = 32,
2455        .expected_ss_size = 32,
2456
2457},
2458/* wycheproof - edge case for shared secret */
2459{
2460        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2461                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2462                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2463                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2464        .b_public = (u8[32]){ 0x1c, 0xa2, 0x19, 0x0b, 0x71, 0x16, 0x35, 0x39,
2465                    0x06, 0x3c, 0x35, 0x77, 0x3b, 0xda, 0x0c, 0x9c,
2466                    0x92, 0x8e, 0x91, 0x36, 0xf0, 0x62, 0x0a, 0xeb,
2467                    0x09, 0x3f, 0x09, 0x91, 0x97, 0xb7, 0xf7, 0x4e },
2468        .expected_ss = (u8[32]){ 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2469                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2470                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2471                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2472        .secret_size = 32,
2473        .b_public_size = 32,
2474        .expected_ss_size = 32,
2475
2476},
2477/* wycheproof - edge case for shared secret */
2478{
2479        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2480                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2481                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2482                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2483        .b_public = (u8[32]){ 0xf7, 0x6e, 0x90, 0x10, 0xac, 0x33, 0xc5, 0x04,
2484                    0x3b, 0x2d, 0x3b, 0x76, 0xa8, 0x42, 0x17, 0x10,
2485                    0x00, 0xc4, 0x91, 0x62, 0x22, 0xe9, 0xe8, 0x58,
2486                    0x97, 0xa0, 0xae, 0xc7, 0xf6, 0x35, 0x0b, 0x3c },
2487        .expected_ss = (u8[32]){ 0xdd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2488                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2489                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2490                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2491        .secret_size = 32,
2492        .b_public_size = 32,
2493        .expected_ss_size = 32,
2494
2495},
2496/* wycheproof - edge case for shared secret */
2497{
2498        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2499                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2500                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2501                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2502        .b_public = (u8[32]){ 0xbb, 0x72, 0x68, 0x8d, 0x8f, 0x8a, 0xa7, 0xa3,
2503                    0x9c, 0xd6, 0x06, 0x0c, 0xd5, 0xc8, 0x09, 0x3c,
2504                    0xde, 0xc6, 0xfe, 0x34, 0x19, 0x37, 0xc3, 0x88,
2505                    0x6a, 0x99, 0x34, 0x6c, 0xd0, 0x7f, 0xaa, 0x55 },
2506        .expected_ss = (u8[32]){ 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2507                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2508                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2509                    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
2510        .secret_size = 32,
2511        .b_public_size = 32,
2512        .expected_ss_size = 32,
2513
2514},
2515/* wycheproof - edge case for shared secret */
2516{
2517        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2518                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2519                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2520                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2521        .b_public = (u8[32]){ 0x88, 0xfd, 0xde, 0xa1, 0x93, 0x39, 0x1c, 0x6a,
2522                    0x59, 0x33, 0xef, 0x9b, 0x71, 0x90, 0x15, 0x49,
2523                    0x44, 0x72, 0x05, 0xaa, 0xe9, 0xda, 0x92, 0x8a,
2524                    0x6b, 0x91, 0xa3, 0x52, 0xba, 0x10, 0xf4, 0x1f },
2525        .expected_ss = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2526                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2527                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2528                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 },
2529        .secret_size = 32,
2530        .b_public_size = 32,
2531        .expected_ss_size = 32,
2532
2533},
2534/* wycheproof - edge case for shared secret */
2535{
2536        .secret = (u8[32]){ 0xa0, 0xa4, 0xf1, 0x30, 0xb9, 0x8a, 0x5b, 0xe4,
2537                     0xb1, 0xce, 0xdb, 0x7c, 0xb8, 0x55, 0x84, 0xa3,
2538                     0x52, 0x0e, 0x14, 0x2d, 0x47, 0x4d, 0xc9, 0xcc,
2539                     0xb9, 0x09, 0xa0, 0x73, 0xa9, 0x76, 0xbf, 0x63 },
2540        .b_public = (u8[32]){ 0x30, 0x3b, 0x39, 0x2f, 0x15, 0x31, 0x16, 0xca,
2541                    0xd9, 0xcc, 0x68, 0x2a, 0x00, 0xcc, 0xc4, 0x4c,
2542                    0x95, 0xff, 0x0d, 0x3b, 0xbe, 0x56, 0x8b, 0xeb,
2543                    0x6c, 0x4e, 0x73, 0x9b, 0xaf, 0xdc, 0x2c, 0x68 },
2544        .expected_ss = (u8[32]){ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2545                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2546                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2547                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00 },
2548        .secret_size = 32,
2549        .b_public_size = 32,
2550        .expected_ss_size = 32,
2551
2552},
2553/* wycheproof - checking for overflow */
2554{
2555        .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2556                     0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2557                     0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2558                     0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2559        .b_public = (u8[32]){ 0xfd, 0x30, 0x0a, 0xeb, 0x40, 0xe1, 0xfa, 0x58,
2560                    0x25, 0x18, 0x41, 0x2b, 0x49, 0xb2, 0x08, 0xa7,
2561                    0x84, 0x2b, 0x1e, 0x1f, 0x05, 0x6a, 0x04, 0x01,
2562                    0x78, 0xea, 0x41, 0x41, 0x53, 0x4f, 0x65, 0x2d },
2563        .expected_ss = (u8[32]){ 0xb7, 0x34, 0x10, 0x5d, 0xc2, 0x57, 0x58, 0x5d,
2564                    0x73, 0xb5, 0x66, 0xcc, 0xb7, 0x6f, 0x06, 0x27,
2565                    0x95, 0xcc, 0xbe, 0xc8, 0x91, 0x28, 0xe5, 0x2b,
2566                    0x02, 0xf3, 0xe5, 0x96, 0x39, 0xf1, 0x3c, 0x46 },
2567        .secret_size = 32,
2568        .b_public_size = 32,
2569        .expected_ss_size = 32,
2570
2571},
2572/* wycheproof - checking for overflow */
2573{
2574        .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2575                     0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2576                     0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2577                     0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2578        .b_public = (u8[32]){ 0xc8, 0xef, 0x79, 0xb5, 0x14, 0xd7, 0x68, 0x26,
2579                    0x77, 0xbc, 0x79, 0x31, 0xe0, 0x6e, 0xe5, 0xc2,
2580                    0x7c, 0x9b, 0x39, 0x2b, 0x4a, 0xe9, 0x48, 0x44,
2581                    0x73, 0xf5, 0x54, 0xe6, 0x67, 0x8e, 0xcc, 0x2e },
2582        .expected_ss = (u8[32]){ 0x64, 0x7a, 0x46, 0xb6, 0xfc, 0x3f, 0x40, 0xd6,
2583                    0x21, 0x41, 0xee, 0x3c, 0xee, 0x70, 0x6b, 0x4d,
2584                    0x7a, 0x92, 0x71, 0x59, 0x3a, 0x7b, 0x14, 0x3e,
2585                    0x8e, 0x2e, 0x22, 0x79, 0x88, 0x3e, 0x45, 0x50 },
2586        .secret_size = 32,
2587        .b_public_size = 32,
2588        .expected_ss_size = 32,
2589
2590},
2591/* wycheproof - checking for overflow */
2592{
2593        .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2594                     0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2595                     0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2596                     0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2597        .b_public = (u8[32]){ 0x64, 0xae, 0xac, 0x25, 0x04, 0x14, 0x48, 0x61,
2598                    0x53, 0x2b, 0x7b, 0xbc, 0xb6, 0xc8, 0x7d, 0x67,
2599                    0xdd, 0x4c, 0x1f, 0x07, 0xeb, 0xc2, 0xe0, 0x6e,
2600                    0xff, 0xb9, 0x5a, 0xec, 0xc6, 0x17, 0x0b, 0x2c },
2601        .expected_ss = (u8[32]){ 0x4f, 0xf0, 0x3d, 0x5f, 0xb4, 0x3c, 0xd8, 0x65,
2602                    0x7a, 0x3c, 0xf3, 0x7c, 0x13, 0x8c, 0xad, 0xce,
2603                    0xcc, 0xe5, 0x09, 0xe4, 0xeb, 0xa0, 0x89, 0xd0,
2604                    0xef, 0x40, 0xb4, 0xe4, 0xfb, 0x94, 0x61, 0x55 },
2605        .secret_size = 32,
2606        .b_public_size = 32,
2607        .expected_ss_size = 32,
2608
2609},
2610/* wycheproof - checking for overflow */
2611{
2612        .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2613                     0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2614                     0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2615                     0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2616        .b_public = (u8[32]){ 0xbf, 0x68, 0xe3, 0x5e, 0x9b, 0xdb, 0x7e, 0xee,
2617                    0x1b, 0x50, 0x57, 0x02, 0x21, 0x86, 0x0f, 0x5d,
2618                    0xcd, 0xad, 0x8a, 0xcb, 0xab, 0x03, 0x1b, 0x14,
2619                    0x97, 0x4c, 0xc4, 0x90, 0x13, 0xc4, 0x98, 0x31 },
2620        .expected_ss = (u8[32]){ 0x21, 0xce, 0xe5, 0x2e, 0xfd, 0xbc, 0x81, 0x2e,
2621                    0x1d, 0x02, 0x1a, 0x4a, 0xf1, 0xe1, 0xd8, 0xbc,
2622                    0x4d, 0xb3, 0xc4, 0x00, 0xe4, 0xd2, 0xa2, 0xc5,
2623                    0x6a, 0x39, 0x26, 0xdb, 0x4d, 0x99, 0xc6, 0x5b },
2624        .secret_size = 32,
2625        .b_public_size = 32,
2626        .expected_ss_size = 32,
2627
2628},
2629/* wycheproof - checking for overflow */
2630{
2631        .secret = (u8[32]){ 0xc8, 0x17, 0x24, 0x70, 0x40, 0x00, 0xb2, 0x6d,
2632                     0x31, 0x70, 0x3c, 0xc9, 0x7e, 0x3a, 0x37, 0x8d,
2633                     0x56, 0xfa, 0xd8, 0x21, 0x93, 0x61, 0xc8, 0x8c,
2634                     0xca, 0x8b, 0xd7, 0xc5, 0x71, 0x9b, 0x12, 0xb2 },
2635        .b_public = (u8[32]){ 0x53, 0x47, 0xc4, 0x91, 0x33, 0x1a, 0x64, 0xb4,
2636                    0x3d, 0xdc, 0x68, 0x30, 0x34, 0xe6, 0x77, 0xf5,
2637                    0x3d, 0xc3, 0x2b, 0x52, 0xa5, 0x2a, 0x57, 0x7c,
2638                    0x15, 0xa8, 0x3b, 0xf2, 0x98, 0xe9, 0x9f, 0x19 },
2639        .expected_ss = (u8[32]){ 0x18, 0xcb, 0x89, 0xe4, 0xe2, 0x0c, 0x0c, 0x2b,
2640                    0xd3, 0x24, 0x30, 0x52, 0x45, 0x26, 0x6c, 0x93,
2641                    0x27, 0x69, 0x0b, 0xbe, 0x79, 0xac, 0xb8, 0x8f,
2642                    0x5b, 0x8f, 0xb3, 0xf7, 0x4e, 0xca, 0x3e, 0x52 },
2643        .secret_size = 32,
2644        .b_public_size = 32,
2645        .expected_ss_size = 32,
2646
2647},
2648/* wycheproof - private key == -1 (mod order) */
2649{
2650        .secret = (u8[32]){ 0xa0, 0x23, 0xcd, 0xd0, 0x83, 0xef, 0x5b, 0xb8,
2651                     0x2f, 0x10, 0xd6, 0x2e, 0x59, 0xe1, 0x5a, 0x68,
2652                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2653                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50 },
2654        .b_public = (u8[32]){ 0x25, 0x8e, 0x04, 0x52, 0x3b, 0x8d, 0x25, 0x3e,
2655                    0xe6, 0x57, 0x19, 0xfc, 0x69, 0x06, 0xc6, 0x57,
2656                    0x19, 0x2d, 0x80, 0x71, 0x7e, 0xdc, 0x82, 0x8f,
2657                    0xa0, 0xaf, 0x21, 0x68, 0x6e, 0x2f, 0xaa, 0x75 },
2658        .expected_ss = (u8[32]){ 0x25, 0x8e, 0x04, 0x52, 0x3b, 0x8d, 0x25, 0x3e,
2659                    0xe6, 0x57, 0x19, 0xfc, 0x69, 0x06, 0xc6, 0x57,
2660                    0x19, 0x2d, 0x80, 0x71, 0x7e, 0xdc, 0x82, 0x8f,
2661                    0xa0, 0xaf, 0x21, 0x68, 0x6e, 0x2f, 0xaa, 0x75 },
2662        .secret_size = 32,
2663        .b_public_size = 32,
2664        .expected_ss_size = 32,
2665
2666},
2667/* wycheproof - private key == 1 (mod order) on twist */
2668{
2669        .secret = (u8[32]){ 0x58, 0x08, 0x3d, 0xd2, 0x61, 0xad, 0x91, 0xef,
2670                     0xf9, 0x52, 0x32, 0x2e, 0xc8, 0x24, 0xc6, 0x82,
2671                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2672                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f },
2673        .b_public = (u8[32]){ 0x2e, 0xae, 0x5e, 0xc3, 0xdd, 0x49, 0x4e, 0x9f,
2674                    0x2d, 0x37, 0xd2, 0x58, 0xf8, 0x73, 0xa8, 0xe6,
2675                    0xe9, 0xd0, 0xdb, 0xd1, 0xe3, 0x83, 0xef, 0x64,
2676                    0xd9, 0x8b, 0xb9, 0x1b, 0x3e, 0x0b, 0xe0, 0x35 },
2677        .expected_ss = (u8[32]){ 0x2e, 0xae, 0x5e, 0xc3, 0xdd, 0x49, 0x4e, 0x9f,
2678                    0x2d, 0x37, 0xd2, 0x58, 0xf8, 0x73, 0xa8, 0xe6,
2679                    0xe9, 0xd0, 0xdb, 0xd1, 0xe3, 0x83, 0xef, 0x64,
2680                    0xd9, 0x8b, 0xb9, 0x1b, 0x3e, 0x0b, 0xe0, 0x35 },
2681        .secret_size = 32,
2682        .b_public_size = 32,
2683        .expected_ss_size = 32,
2684
2685}
2686};
2687
2688static const struct kpp_testvec ecdh_p192_tv_template[] = {
2689        {
2690        .secret =
2691#ifdef __LITTLE_ENDIAN
2692        "\x02\x00" /* type */
2693        "\x1e\x00" /* len */
2694        "\x18\x00" /* key_size */
2695#else
2696        "\x00\x02" /* type */
2697        "\x00\x1e" /* len */
2698        "\x00\x18" /* key_size */
2699#endif
2700        "\xb5\x05\xb1\x71\x1e\xbf\x8c\xda"
2701        "\x4e\x19\x1e\x62\x1f\x23\x23\x31"
2702        "\x36\x1e\xd3\x84\x2f\xcc\x21\x72",
2703        .b_public =
2704        "\xc3\xba\x67\x4b\x71\xec\xd0\x76"
2705        "\x7a\x99\x75\x64\x36\x13\x9a\x94"
2706        "\x5d\x8b\xdc\x60\x90\x91\xfd\x3f"
2707        "\xb0\x1f\x8a\x0a\x68\xc6\x88\x6e"
2708        "\x83\x87\xdd\x67\x09\xf8\x8d\x96"
2709        "\x07\xd6\xbd\x1c\xe6\x8d\x9d\x67",
2710        .expected_a_public =
2711        "\x1a\x04\xdb\xa5\xe1\xdd\x4e\x79"
2712        "\xa3\xe6\xef\x0e\x5c\x80\x49\x85"
2713        "\xfa\x78\xb4\xef\x49\xbd\x4c\x7c"
2714        "\x22\x90\x21\x02\xf9\x1b\x81\x5d"
2715        "\x0c\x8a\xa8\x98\xd6\x27\x69\x88"
2716        "\x5e\xbc\x94\xd8\x15\x9e\x21\xce",
2717        .expected_ss =
2718        "\xf4\x57\xcc\x4f\x1f\x4e\x31\xcc"
2719        "\xe3\x40\x60\xc8\x06\x93\xc6\x2e"
2720        "\x99\x80\x81\x28\xaf\xc5\x51\x74",
2721        .secret_size = 30,
2722        .b_public_size = 48,
2723        .expected_a_public_size = 48,
2724        .expected_ss_size = 24
2725        }
2726};
2727
2728static const struct kpp_testvec ecdh_p256_tv_template[] = {
2729        {
2730        .secret =
2731#ifdef __LITTLE_ENDIAN
2732        "\x02\x00" /* type */
2733        "\x26\x00" /* len */
2734        "\x20\x00" /* key_size */
2735#else
2736        "\x00\x02" /* type */
2737        "\x00\x26" /* len */
2738        "\x00\x20" /* key_size */
2739#endif
2740        "\x24\xd1\x21\xeb\xe5\xcf\x2d\x83"
2741        "\xf6\x62\x1b\x6e\x43\x84\x3a\xa3"
2742        "\x8b\xe0\x86\xc3\x20\x19\xda\x92"
2743        "\x50\x53\x03\xe1\xc0\xea\xb8\x82",
2744        .expected_a_public =
2745        "\x1a\x7f\xeb\x52\x00\xbd\x3c\x31"
2746        "\x7d\xb6\x70\xc1\x86\xa6\xc7\xc4"
2747        "\x3b\xc5\x5f\x6c\x6f\x58\x3c\xf5"
2748        "\xb6\x63\x82\x77\x33\x24\xa1\x5f"
2749        "\x6a\xca\x43\x6f\xf7\x7e\xff\x02"
2750        "\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
2751        "\x6a\x02\x6e\x41\x87\x68\x38\x77"
2752        "\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
2753        .expected_ss =
2754        "\xea\x17\x6f\x7e\x6e\x57\x26\x38"
2755        "\x8b\xfb\x41\xeb\xba\xc8\x6d\xa5"
2756        "\xa8\x72\xd1\xff\xc9\x47\x3d\xaa"
2757        "\x58\x43\x9f\x34\x0f\x8c\xf3\xc9",
2758        .b_public =
2759        "\xcc\xb4\xda\x74\xb1\x47\x3f\xea"
2760        "\x6c\x70\x9e\x38\x2d\xc7\xaa\xb7"
2761        "\x29\xb2\x47\x03\x19\xab\xdd\x34"
2762        "\xbd\xa8\x2c\x93\xe1\xa4\x74\xd9"
2763        "\x64\x63\xf7\x70\x20\x2f\xa4\xe6"
2764        "\x9f\x4a\x38\xcc\xc0\x2c\x49\x2f"
2765        "\xb1\x32\xbb\xaf\x22\x61\xda\xcb"
2766        "\x6f\xdb\xa9\xaa\xfc\x77\x81\xf3",
2767        .secret_size = 38,
2768        .b_public_size = 64,
2769        .expected_a_public_size = 64,
2770        .expected_ss_size = 32
2771        }, {
2772        .secret =
2773#ifdef __LITTLE_ENDIAN
2774        "\x02\x00" /* type */
2775        "\x06\x00" /* len */
2776        "\x00\x00", /* key_size */
2777#else
2778        "\x00\x02" /* type */
2779        "\x00\x06" /* len */
2780        "\x00\x00", /* key_size */
2781#endif
2782        .b_secret =
2783#ifdef __LITTLE_ENDIAN
2784        "\x02\x00" /* type */
2785        "\x26\x00" /* len */
2786        "\x20\x00" /* key_size */
2787#else
2788        "\x00\x02" /* type */
2789        "\x00\x26" /* len */
2790        "\x00\x20" /* key_size */
2791#endif
2792        "\x24\xd1\x21\xeb\xe5\xcf\x2d\x83"
2793        "\xf6\x62\x1b\x6e\x43\x84\x3a\xa3"
2794        "\x8b\xe0\x86\xc3\x20\x19\xda\x92"
2795        "\x50\x53\x03\xe1\xc0\xea\xb8\x82",
2796        .b_public =
2797        "\x1a\x7f\xeb\x52\x00\xbd\x3c\x31"
2798        "\x7d\xb6\x70\xc1\x86\xa6\xc7\xc4"
2799        "\x3b\xc5\x5f\x6c\x6f\x58\x3c\xf5"
2800        "\xb6\x63\x82\x77\x33\x24\xa1\x5f"
2801        "\x6a\xca\x43\x6f\xf7\x7e\xff\x02"
2802        "\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
2803        "\x6a\x02\x6e\x41\x87\x68\x38\x77"
2804        "\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
2805        .secret_size = 6,
2806        .b_secret_size = 38,
2807        .b_public_size = 64,
2808        .expected_a_public_size = 64,
2809        .expected_ss_size = 32,
2810        .genkey = true,
2811        }
2812};
2813
2814/*
2815 * NIST P384 test vectors from RFC5903
2816 */
2817static const struct kpp_testvec ecdh_p384_tv_template[] = {
2818        {
2819        .secret =
2820#ifdef __LITTLE_ENDIAN
2821        "\x02\x00" /* type */
2822        "\x36\x00" /* len */
2823        "\x30\x00" /* key_size */
2824#else
2825        "\x00\x02" /* type */
2826        "\x00\x36" /* len */
2827        "\x00\x30" /* key_size */
2828#endif
2829        "\x09\x9F\x3C\x70\x34\xD4\xA2\xC6"
2830        "\x99\x88\x4D\x73\xA3\x75\xA6\x7F"
2831        "\x76\x24\xEF\x7C\x6B\x3C\x0F\x16"
2832        "\x06\x47\xB6\x74\x14\xDC\xE6\x55"
2833        "\xE3\x5B\x53\x80\x41\xE6\x49\xEE"
2834        "\x3F\xAE\xF8\x96\x78\x3A\xB1\x94",
2835        .b_public =
2836        "\xE5\x58\xDB\xEF\x53\xEE\xCD\xE3"
2837        "\xD3\xFC\xCF\xC1\xAE\xA0\x8A\x89"
2838        "\xA9\x87\x47\x5D\x12\xFD\x95\x0D"
2839        "\x83\xCF\xA4\x17\x32\xBC\x50\x9D"
2840        "\x0D\x1A\xC4\x3A\x03\x36\xDE\xF9"
2841        "\x6F\xDA\x41\xD0\x77\x4A\x35\x71"
2842        "\xDC\xFB\xEC\x7A\xAC\xF3\x19\x64"
2843        "\x72\x16\x9E\x83\x84\x30\x36\x7F"
2844        "\x66\xEE\xBE\x3C\x6E\x70\xC4\x16"
2845        "\xDD\x5F\x0C\x68\x75\x9D\xD1\xFF"
2846        "\xF8\x3F\xA4\x01\x42\x20\x9D\xFF"
2847        "\x5E\xAA\xD9\x6D\xB9\xE6\x38\x6C",
2848        .expected_a_public =
2849        "\x66\x78\x42\xD7\xD1\x80\xAC\x2C"
2850        "\xDE\x6F\x74\xF3\x75\x51\xF5\x57"
2851        "\x55\xC7\x64\x5C\x20\xEF\x73\xE3"
2852        "\x16\x34\xFE\x72\xB4\xC5\x5E\xE6"
2853        "\xDE\x3A\xC8\x08\xAC\xB4\xBD\xB4"
2854        "\xC8\x87\x32\xAE\xE9\x5F\x41\xAA"
2855        "\x94\x82\xED\x1F\xC0\xEE\xB9\xCA"
2856        "\xFC\x49\x84\x62\x5C\xCF\xC2\x3F"
2857        "\x65\x03\x21\x49\xE0\xE1\x44\xAD"
2858        "\xA0\x24\x18\x15\x35\xA0\xF3\x8E"
2859        "\xEB\x9F\xCF\xF3\xC2\xC9\x47\xDA"
2860        "\xE6\x9B\x4C\x63\x45\x73\xA8\x1C",
2861        .expected_ss =
2862        "\x11\x18\x73\x31\xC2\x79\x96\x2D"
2863        "\x93\xD6\x04\x24\x3F\xD5\x92\xCB"
2864        "\x9D\x0A\x92\x6F\x42\x2E\x47\x18"
2865        "\x75\x21\x28\x7E\x71\x56\xC5\xC4"
2866        "\xD6\x03\x13\x55\x69\xB9\xE9\xD0"
2867        "\x9C\xF5\xD4\xA2\x70\xF5\x97\x46",
2868        .secret_size = 54,
2869        .b_public_size = 96,
2870        .expected_a_public_size = 96,
2871        .expected_ss_size = 48
2872        }
2873};
2874
2875/*
2876 * MD4 test vectors from RFC1320
2877 */
2878static const struct hash_testvec md4_tv_template[] = {
2879        {
2880                .plaintext = "",
2881                .digest = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31"
2882                          "\xb7\x3c\x59\xd7\xe0\xc0\x89\xc0",
2883        }, {
2884                .plaintext = "a",
2885                .psize  = 1,
2886                .digest = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46"
2887                          "\x24\x5e\x05\xfb\xdb\xd6\xfb\x24",
2888        }, {
2889                .plaintext = "abc",
2890                .psize  = 3,
2891                .digest = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52"
2892                          "\x5f\xc1\x0a\xe8\x7a\xa6\x72\x9d",
2893        }, {
2894                .plaintext = "message digest",
2895                .psize  = 14,
2896                .digest = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8"
2897                        "\x18\x87\x48\x06\xe1\xc7\x01\x4b",
2898        }, {
2899                .plaintext = "abcdefghijklmnopqrstuvwxyz",
2900                .psize  = 26,
2901                .digest = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd"
2902                          "\xee\xa8\xed\x63\xdf\x41\x2d\xa9",
2903        }, {
2904                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
2905                .psize  = 62,
2906                .digest = "\x04\x3f\x85\x82\xf2\x41\xdb\x35"
2907                          "\x1c\xe6\x27\xe1\x53\xe7\xf0\xe4",
2908        }, {
2909                .plaintext = "123456789012345678901234567890123456789012345678901234567890123"
2910                           "45678901234567890",
2911                .psize  = 80,
2912                .digest = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19"
2913                          "\x9c\x3e\x7b\x16\x4f\xcc\x05\x36",
2914        },
2915};
2916
2917static const struct hash_testvec sha3_224_tv_template[] = {
2918        {
2919                .plaintext = "",
2920                .digest = "\x6b\x4e\x03\x42\x36\x67\xdb\xb7"
2921                                "\x3b\x6e\x15\x45\x4f\x0e\xb1\xab"
2922                                "\xd4\x59\x7f\x9a\x1b\x07\x8e\x3f"
2923                                "\x5b\x5a\x6b\xc7",
2924        }, {
2925                .plaintext = "a",
2926                .psize  = 1,
2927                .digest = "\x9e\x86\xff\x69\x55\x7c\xa9\x5f"
2928                                "\x40\x5f\x08\x12\x69\x68\x5b\x38"
2929                                "\xe3\xa8\x19\xb3\x09\xee\x94\x2f"
2930                                "\x48\x2b\x6a\x8b",
2931        }, {
2932                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
2933                                "jklmklmnlmnomnopnopq",
2934                .psize  = 56,
2935                .digest = "\x8a\x24\x10\x8b\x15\x4a\xda\x21"
2936                                "\xc9\xfd\x55\x74\x49\x44\x79\xba"
2937                                "\x5c\x7e\x7a\xb7\x6e\xf2\x64\xea"
2938                                "\xd0\xfc\xce\x33",
2939        }, {
2940                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
2941                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
2942                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
2943                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
2944                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
2945                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
2946                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
2947                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
2948                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
2949                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
2950                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
2951                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
2952                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
2953                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
2954                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
2955                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
2956                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
2957                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
2958                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
2959                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
2960                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
2961                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
2962                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
2963                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
2964                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
2965                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
2966                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
2967                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
2968                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
2969                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
2970                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
2971                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
2972                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
2973                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
2974                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
2975                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
2976                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
2977                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
2978                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
2979                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
2980                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
2981                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
2982                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
2983                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
2984                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
2985                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
2986                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
2987                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
2988                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
2989                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
2990                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
2991                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
2992                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
2993                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
2994                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
2995                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
2996                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
2997                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
2998                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
2999                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
3000                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
3001                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
3002                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
3003                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
3004                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
3005                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
3006                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
3007                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
3008                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
3009                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
3010                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
3011                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
3012                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
3013                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
3014                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
3015                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
3016                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
3017                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
3018                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
3019                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
3020                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
3021                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
3022                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
3023                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
3024                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
3025                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
3026                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
3027                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
3028                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
3029                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
3030                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
3031                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
3032                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
3033                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
3034                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
3035                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
3036                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
3037                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
3038                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
3039                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
3040                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
3041                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
3042                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
3043                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
3044                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
3045                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
3046                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
3047                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
3048                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
3049                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
3050                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
3051                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
3052                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
3053                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
3054                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
3055                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
3056                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
3057                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
3058                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
3059                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
3060                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
3061                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
3062                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
3063                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
3064                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
3065                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
3066                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
3067                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
3068                .psize     = 1023,
3069                .digest    = "\x7d\x0f\x2f\xb7\x65\x3b\xa7\x26"
3070                             "\xc3\x88\x20\x71\x15\x06\xe8\x2d"
3071                             "\xa3\x92\x44\xab\x3e\xe7\xff\x86"
3072                             "\xb6\x79\x10\x72",
3073        },
3074};
3075
3076static const struct hash_testvec sha3_256_tv_template[] = {
3077        {
3078                .plaintext = "",
3079                .digest = "\xa7\xff\xc6\xf8\xbf\x1e\xd7\x66"
3080                                "\x51\xc1\x47\x56\xa0\x61\xd6\x62"
3081                                "\xf5\x80\xff\x4d\xe4\x3b\x49\xfa"
3082                                "\x82\xd8\x0a\x4b\x80\xf8\x43\x4a",
3083        }, {
3084                .plaintext = "a",
3085                .psize  = 1,
3086                .digest = "\x80\x08\x4b\xf2\xfb\xa0\x24\x75"
3087                                "\x72\x6f\xeb\x2c\xab\x2d\x82\x15"
3088                                "\xea\xb1\x4b\xc6\xbd\xd8\xbf\xb2"
3089                                "\xc8\x15\x12\x57\x03\x2e\xcd\x8b",
3090        }, {
3091                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
3092                             "jklmklmnlmnomnopnopq",
3093                .psize  = 56,
3094                .digest = "\x41\xc0\xdb\xa2\xa9\xd6\x24\x08"
3095                                "\x49\x10\x03\x76\xa8\x23\x5e\x2c"
3096                                "\x82\xe1\xb9\x99\x8a\x99\x9e\x21"
3097                                "\xdb\x32\xdd\x97\x49\x6d\x33\x76",
3098        }, {
3099                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
3100                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
3101                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
3102                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
3103                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
3104                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
3105                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
3106                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
3107                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
3108                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
3109                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
3110                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
3111                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
3112                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
3113                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
3114                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
3115                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
3116                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
3117                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
3118                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
3119                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
3120                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
3121                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
3122                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
3123                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
3124                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
3125                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
3126                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
3127                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
3128                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
3129                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
3130                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
3131                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
3132                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
3133                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
3134                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
3135                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
3136                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
3137                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
3138                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
3139                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
3140                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
3141                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
3142                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
3143                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
3144                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
3145                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
3146                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
3147                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
3148                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
3149                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
3150                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
3151                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
3152                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
3153                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
3154                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
3155                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
3156                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
3157                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
3158                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
3159                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
3160                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
3161                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
3162                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
3163                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
3164                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
3165                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
3166                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
3167                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
3168                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
3169                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
3170                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
3171                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
3172                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
3173                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
3174                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
3175                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
3176                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
3177                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
3178                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
3179                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
3180                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
3181                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
3182                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
3183                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
3184                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
3185                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
3186                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
3187                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
3188                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
3189                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
3190                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
3191                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
3192                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
3193                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
3194                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
3195                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
3196                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
3197                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
3198                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
3199                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
3200                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
3201                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
3202                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
3203                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
3204                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
3205                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
3206                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
3207                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
3208                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
3209                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
3210                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
3211                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
3212                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
3213                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
3214                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
3215                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
3216                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
3217                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
3218                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
3219                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
3220                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
3221                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
3222                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
3223                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
3224                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
3225                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
3226                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
3227                .psize     = 1023,
3228                .digest    = "\xde\x41\x04\xbd\xda\xda\xd9\x71"
3229                             "\xf7\xfa\x80\xf5\xea\x11\x03\xb1"
3230                             "\x3b\x6a\xbc\x5f\xb9\x66\x26\xf7"
3231                             "\x8a\x97\xbb\xf2\x07\x08\x38\x30",
3232        },
3233};
3234
3235
3236static const struct hash_testvec sha3_384_tv_template[] = {
3237        {
3238                .plaintext = "",
3239                .digest = "\x0c\x63\xa7\x5b\x84\x5e\x4f\x7d"
3240                                "\x01\x10\x7d\x85\x2e\x4c\x24\x85"
3241                                "\xc5\x1a\x50\xaa\xaa\x94\xfc\x61"
3242                                "\x99\x5e\x71\xbb\xee\x98\x3a\x2a"
3243                                "\xc3\x71\x38\x31\x26\x4a\xdb\x47"
3244                                "\xfb\x6b\xd1\xe0\x58\xd5\xf0\x04",
3245        }, {
3246                .plaintext = "a",
3247                .psize  = 1,
3248                .digest = "\x18\x15\xf7\x74\xf3\x20\x49\x1b"
3249                                "\x48\x56\x9e\xfe\xc7\x94\xd2\x49"
3250                                "\xee\xb5\x9a\xae\x46\xd2\x2b\xf7"
3251                                "\x7d\xaf\xe2\x5c\x5e\xdc\x28\xd7"
3252                                "\xea\x44\xf9\x3e\xe1\x23\x4a\xa8"
3253                                "\x8f\x61\xc9\x19\x12\xa4\xcc\xd9",
3254        }, {
3255                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
3256                             "jklmklmnlmnomnopnopq",
3257                .psize  = 56,
3258                .digest = "\x99\x1c\x66\x57\x55\xeb\x3a\x4b"
3259                                "\x6b\xbd\xfb\x75\xc7\x8a\x49\x2e"
3260                                "\x8c\x56\xa2\x2c\x5c\x4d\x7e\x42"
3261                                "\x9b\xfd\xbc\x32\xb9\xd4\xad\x5a"
3262                                "\xa0\x4a\x1f\x07\x6e\x62\xfe\xa1"
3263                                "\x9e\xef\x51\xac\xd0\x65\x7c\x22",
3264        }, {
3265                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
3266                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
3267                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
3268                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
3269                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
3270                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
3271                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
3272                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
3273                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
3274                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
3275                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
3276                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
3277                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
3278                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
3279                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
3280                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
3281                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
3282                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
3283                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
3284                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
3285                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
3286                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
3287                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
3288                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
3289                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
3290                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
3291                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
3292                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
3293                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
3294                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
3295                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
3296                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
3297                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
3298                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
3299                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
3300                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
3301                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
3302                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
3303                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
3304                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
3305                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
3306                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
3307                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
3308                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
3309                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
3310                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
3311                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
3312                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
3313                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
3314                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
3315                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
3316                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
3317                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
3318                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
3319                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
3320                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
3321                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
3322                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
3323                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
3324                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
3325                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
3326                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
3327                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
3328                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
3329                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
3330                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
3331                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
3332                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
3333                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
3334                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
3335                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
3336                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
3337                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
3338                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
3339                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
3340                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
3341                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
3342                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
3343                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
3344                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
3345                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
3346                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
3347                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
3348                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
3349                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
3350                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
3351                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
3352                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
3353                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
3354                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
3355                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
3356                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
3357                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
3358                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
3359                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
3360                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
3361                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
3362                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
3363                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
3364                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
3365                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
3366                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
3367                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
3368                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
3369                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
3370                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
3371                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
3372                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
3373                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
3374                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
3375                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
3376                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
3377                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
3378                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
3379                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
3380                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
3381                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
3382                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
3383                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
3384                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
3385                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
3386                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
3387                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
3388                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
3389                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
3390                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
3391                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
3392                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
3393                .psize     = 1023,
3394                .digest    = "\x1b\x19\x4d\x8f\xd5\x36\x87\x71"
3395                             "\xcf\xca\x30\x85\x9b\xc1\x25\xc7"
3396                             "\x00\xcb\x73\x8a\x8e\xd4\xfe\x2b"
3397                             "\x1a\xa2\xdc\x2e\x41\xfd\x52\x51"
3398                             "\xd2\x21\xae\x2d\xc7\xae\x8c\x40"
3399                             "\xb9\xe6\x56\x48\x03\xcd\x88\x6b",
3400        },
3401};
3402
3403
3404static const struct hash_testvec sha3_512_tv_template[] = {
3405        {
3406                .plaintext = "",
3407                .digest = "\xa6\x9f\x73\xcc\xa2\x3a\x9a\xc5"
3408                                "\xc8\xb5\x67\xdc\x18\x5a\x75\x6e"
3409                                "\x97\xc9\x82\x16\x4f\xe2\x58\x59"
3410                                "\xe0\xd1\xdc\xc1\x47\x5c\x80\xa6"
3411                                "\x15\xb2\x12\x3a\xf1\xf5\xf9\x4c"
3412                                "\x11\xe3\xe9\x40\x2c\x3a\xc5\x58"
3413                                "\xf5\x00\x19\x9d\x95\xb6\xd3\xe3"
3414                                "\x01\x75\x85\x86\x28\x1d\xcd\x26",
3415        }, {
3416                .plaintext = "a",
3417                .psize  = 1,
3418                .digest = "\x69\x7f\x2d\x85\x61\x72\xcb\x83"
3419                                "\x09\xd6\xb8\xb9\x7d\xac\x4d\xe3"
3420                                "\x44\xb5\x49\xd4\xde\xe6\x1e\xdf"
3421                                "\xb4\x96\x2d\x86\x98\xb7\xfa\x80"
3422                                "\x3f\x4f\x93\xff\x24\x39\x35\x86"
3423                                "\xe2\x8b\x5b\x95\x7a\xc3\xd1\xd3"
3424                                "\x69\x42\x0c\xe5\x33\x32\x71\x2f"
3425                                "\x99\x7b\xd3\x36\xd0\x9a\xb0\x2a",
3426        }, {
3427                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl"
3428                             "jklmklmnlmnomnopnopq",
3429                .psize  = 56,
3430                .digest = "\x04\xa3\x71\xe8\x4e\xcf\xb5\xb8"
3431                                "\xb7\x7c\xb4\x86\x10\xfc\xa8\x18"
3432                                "\x2d\xd4\x57\xce\x6f\x32\x6a\x0f"
3433                                "\xd3\xd7\xec\x2f\x1e\x91\x63\x6d"
3434                                "\xee\x69\x1f\xbe\x0c\x98\x53\x02"
3435                                "\xba\x1b\x0d\x8d\xc7\x8c\x08\x63"
3436                                "\x46\xb5\x33\xb4\x9c\x03\x0d\x99"
3437                                "\xa2\x7d\xaf\x11\x39\xd6\xe7\x5e",
3438        }, {
3439                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
3440                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
3441                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
3442                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
3443                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
3444                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
3445                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
3446                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
3447                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
3448                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
3449                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
3450                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
3451                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
3452                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
3453                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
3454                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
3455                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
3456                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
3457                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
3458                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
3459                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
3460                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
3461                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
3462                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
3463                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
3464                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
3465                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
3466                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
3467                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
3468                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
3469                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
3470                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
3471                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
3472                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
3473                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
3474                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
3475                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
3476                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
3477                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
3478                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
3479                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
3480                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
3481                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
3482                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
3483                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
3484                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
3485                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
3486                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
3487                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
3488                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
3489                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
3490                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
3491                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
3492                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
3493                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
3494                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
3495                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
3496                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
3497                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
3498                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
3499                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
3500                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
3501                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
3502                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
3503                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
3504                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
3505                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
3506                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
3507                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
3508                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
3509                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
3510                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
3511                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
3512                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
3513                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
3514                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
3515                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
3516                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
3517                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
3518                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
3519                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
3520                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
3521                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
3522                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
3523                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
3524                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
3525                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
3526                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
3527                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
3528                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
3529                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
3530                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
3531                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
3532                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
3533                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
3534                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
3535                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
3536                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
3537                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
3538                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
3539                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
3540                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
3541                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
3542                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
3543                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
3544                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
3545                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
3546                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
3547                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
3548                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
3549                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
3550                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
3551                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
3552                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
3553                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
3554                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
3555                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
3556                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
3557                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
3558                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
3559                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
3560                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
3561                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
3562                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
3563                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
3564                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
3565                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
3566                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
3567                .psize     = 1023,
3568                .digest    = "\x59\xda\x30\xe3\x90\xe4\x3d\xde"
3569                             "\xf0\xc6\x42\x17\xd7\xb2\x26\x47"
3570                             "\x90\x28\xa6\x84\xe8\x49\x7a\x86"
3571                             "\xd6\xb8\x9e\xf8\x07\x59\x21\x03"
3572                             "\xad\xd2\xed\x48\xa3\xb9\xa5\xf0"
3573                             "\xb3\xae\x02\x2b\xb8\xaf\xc3\x3b"
3574                             "\xd6\xb0\x8f\xcb\x76\x8b\xa7\x41"
3575                             "\x32\xc2\x8e\x50\x91\x86\x90\xfb",
3576        },
3577};
3578
3579
3580/*
3581 * MD5 test vectors from RFC1321
3582 */
3583static const struct hash_testvec md5_tv_template[] = {
3584        {
3585                .digest = "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04"
3586                          "\xe9\x80\x09\x98\xec\xf8\x42\x7e",
3587        }, {
3588                .plaintext = "a",
3589                .psize  = 1,
3590                .digest = "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8"
3591                          "\x31\xc3\x99\xe2\x69\x77\x26\x61",
3592        }, {
3593                .plaintext = "abc",
3594                .psize  = 3,
3595                .digest = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
3596                          "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72",
3597        }, {
3598                .plaintext = "message digest",
3599                .psize  = 14,
3600                .digest = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d"
3601                          "\x52\x5a\x2f\x31\xaa\xf1\x61\xd0",
3602        }, {
3603                .plaintext = "abcdefghijklmnopqrstuvwxyz",
3604                .psize  = 26,
3605                .digest = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
3606                          "\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
3607        }, {
3608                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
3609                .psize  = 62,
3610                .digest = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5"
3611                          "\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f",
3612        }, {
3613                .plaintext = "12345678901234567890123456789012345678901234567890123456789012"
3614                           "345678901234567890",
3615                .psize  = 80,
3616                .digest = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55"
3617                          "\xac\x49\xda\x2e\x21\x07\xb6\x7a",
3618        }
3619
3620};
3621
3622/*
3623 * RIPEMD-160 test vectors from ISO/IEC 10118-3:2004(E)
3624 */
3625static const struct hash_testvec rmd160_tv_template[] = {
3626        {
3627                .digest = "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
3628                          "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31",
3629        }, {
3630                .plaintext = "a",
3631                .psize  = 1,
3632                .digest = "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae"
3633                          "\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe",
3634        }, {
3635                .plaintext = "abc",
3636                .psize  = 3,
3637                .digest = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04"
3638                          "\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc",
3639        }, {
3640                .plaintext = "message digest",
3641                .psize  = 14,
3642                .digest = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
3643                          "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36",
3644        }, {
3645                .plaintext = "abcdefghijklmnopqrstuvwxyz",
3646                .psize  = 26,
3647                .digest = "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb"
3648                          "\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc",
3649        }, {
3650                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
3651                             "fghijklmnopqrstuvwxyz0123456789",
3652                .psize  = 62,
3653                .digest = "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed"
3654                          "\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89",
3655        }, {
3656                .plaintext = "1234567890123456789012345678901234567890"
3657                             "1234567890123456789012345678901234567890",
3658                .psize  = 80,
3659                .digest = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb"
3660                          "\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb",
3661        }, {
3662                .plaintext = "abcdbcdecdefdefgefghfghighij"
3663                             "hijkijkljklmklmnlmnomnopnopq",
3664                .psize  = 56,
3665                .digest = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05"
3666                          "\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b",
3667        }, {
3668                .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghi"
3669                             "jklmghijklmnhijklmnoijklmnopjklmnopqklmnopqr"
3670                             "lmnopqrsmnopqrstnopqrstu",
3671                .psize  = 112,
3672                .digest = "\x6f\x3f\xa3\x9b\x6b\x50\x3c\x38\x4f\x91"
3673                          "\x9a\x49\xa7\xaa\x5c\x2c\x08\xbd\xfb\x45",
3674        }, {
3675                .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
3676                .psize  = 32,
3677                .digest = "\x94\xc2\x64\x11\x54\x04\xe6\x33\x79\x0d"
3678                          "\xfc\xc8\x7b\x58\x7d\x36\x77\x06\x7d\x9f",
3679        }
3680};
3681
3682static const struct hash_testvec crct10dif_tv_template[] = {
3683        {
3684                .plaintext      = "abc",
3685                .psize          = 3,
3686                .digest         = (u8 *)(u16 []){ 0x443b },
3687        }, {
3688                .plaintext      = "1234567890123456789012345678901234567890"
3689                                  "123456789012345678901234567890123456789",
3690                .psize          = 79,
3691                .digest         = (u8 *)(u16 []){ 0x4b70 },
3692        }, {
3693                .plaintext      = "abcdddddddddddddddddddddddddddddddddddddddd"
3694                                  "ddddddddddddd",
3695                .psize          = 56,
3696                .digest         = (u8 *)(u16 []){ 0x9ce3 },
3697        }, {
3698                .plaintext      = "1234567890123456789012345678901234567890"
3699                                  "1234567890123456789012345678901234567890"
3700                                  "1234567890123456789012345678901234567890"
3701                                  "1234567890123456789012345678901234567890"
3702                                  "1234567890123456789012345678901234567890"
3703                                  "1234567890123456789012345678901234567890"
3704                                  "1234567890123456789012345678901234567890"
3705                                  "123456789012345678901234567890123456789",
3706                .psize          = 319,
3707                .digest         = (u8 *)(u16 []){ 0x44c6 },
3708        }, {
3709                .plaintext =    "\x6e\x05\x79\x10\xa7\x1b\xb2\x49"
3710                                "\xe0\x54\xeb\x82\x19\x8d\x24\xbb"
3711                                "\x2f\xc6\x5d\xf4\x68\xff\x96\x0a"
3712                                "\xa1\x38\xcf\x43\xda\x71\x08\x7c"
3713                                "\x13\xaa\x1e\xb5\x4c\xe3\x57\xee"
3714                                "\x85\x1c\x90\x27\xbe\x32\xc9\x60"
3715                                "\xf7\x6b\x02\x99\x0d\xa4\x3b\xd2"
3716                                "\x46\xdd\x74\x0b\x7f\x16\xad\x21"
3717                                "\xb8\x4f\xe6\x5a\xf1\x88\x1f\x93"
3718                                "\x2a\xc1\x35\xcc\x63\xfa\x6e\x05"
3719                                "\x9c\x10\xa7\x3e\xd5\x49\xe0\x77"
3720                                "\x0e\x82\x19\xb0\x24\xbb\x52\xe9"
3721                                "\x5d\xf4\x8b\x22\x96\x2d\xc4\x38"
3722                                "\xcf\x66\xfd\x71\x08\x9f\x13\xaa"
3723                                "\x41\xd8\x4c\xe3\x7a\x11\x85\x1c"
3724                                "\xb3\x27\xbe\x55\xec\x60\xf7\x8e"
3725                                "\x02\x99\x30\xc7\x3b\xd2\x69\x00"
3726                                "\x74\x0b\xa2\x16\xad\x44\xdb\x4f"
3727                                "\xe6\x7d\x14\x88\x1f\xb6\x2a\xc1"
3728                                "\x58\xef\x63\xfa\x91\x05\x9c\x33"
3729                                "\xca\x3e\xd5\x6c\x03\x77\x0e\xa5"
3730                                "\x19\xb0\x47\xde\x52\xe9\x80\x17"
3731                                "\x8b\x22\xb9\x2d\xc4\x5b\xf2\x66"
3732                                "\xfd\x94\x08\x9f\x36\xcd\x41\xd8"
3733                                "\x6f\x06\x7a\x11\xa8\x1c\xb3\x4a"
3734                                "\xe1\x55\xec\x83\x1a\x8e\x25\xbc"
3735                                "\x30\xc7\x5e\xf5\x69\x00\x97\x0b"
3736                                "\xa2\x39\xd0\x44\xdb\x72\x09\x7d"
3737                                "\x14\xab\x1f\xb6\x4d\xe4\x58\xef"
3738                                "\x86\x1d\x91\x28\xbf\x33\xca\x61"
3739                                "\xf8\x6c\x03\x9a\x0e\xa5\x3c\xd3"
3740                                "\x47\xde\x75\x0c\x80\x17\xae\x22"
3741                                "\xb9\x50\xe7\x5b\xf2\x89\x20\x94"
3742                                "\x2b\xc2\x36\xcd\x64\xfb\x6f\x06"
3743                                "\x9d\x11\xa8\x3f\xd6\x4a\xe1\x78"
3744                                "\x0f\x83\x1a\xb1\x25\xbc\x53\xea"
3745                                "\x5e\xf5\x8c\x00\x97\x2e\xc5\x39"
3746                                "\xd0\x67\xfe\x72\x09\xa0\x14\xab"
3747                                "\x42\xd9\x4d\xe4\x7b\x12\x86\x1d"
3748                                "\xb4\x28\xbf\x56\xed\x61\xf8\x8f"
3749                                "\x03\x9a\x31\xc8\x3c\xd3\x6a\x01"
3750                                "\x75\x0c\xa3\x17\xae\x45\xdc\x50"
3751                                "\xe7\x7e\x15\x89\x20\xb7\x2b\xc2"
3752                                "\x59\xf0\x64\xfb\x92\x06\x9d\x34"
3753                                "\xcb\x3f\xd6\x6d\x04\x78\x0f\xa6"
3754                                "\x1a\xb1\x48\xdf\x53\xea\x81\x18"
3755                                "\x8c\x23\xba\x2e\xc5\x5c\xf3\x67"
3756                                "\xfe\x95\x09\xa0\x37\xce\x42\xd9"
3757                                "\x70\x07\x7b\x12\xa9\x1d\xb4\x4b"
3758                                "\xe2\x56\xed\x84\x1b\x8f\x26\xbd"
3759                                "\x31\xc8\x5f\xf6\x6a\x01\x98\x0c"
3760                                "\xa3\x3a\xd1\x45\xdc\x73\x0a\x7e"
3761                                "\x15\xac\x20\xb7\x4e\xe5\x59\xf0"
3762                                "\x87\x1e\x92\x29\xc0\x34\xcb\x62"
3763                                "\xf9\x6d\x04\x9b\x0f\xa6\x3d\xd4"
3764                                "\x48\xdf\x76\x0d\x81\x18\xaf\x23"
3765                                "\xba\x51\xe8\x5c\xf3\x8a\x21\x95"
3766                                "\x2c\xc3\x37\xce\x65\xfc\x70\x07"
3767                                "\x9e\x12\xa9\x40\xd7\x4b\xe2\x79"
3768                                "\x10\x84\x1b\xb2\x26\xbd\x54\xeb"
3769                                "\x5f\xf6\x8d\x01\x98\x2f\xc6\x3a"
3770                                "\xd1\x68\xff\x73\x0a\xa1\x15\xac"
3771                                "\x43\xda\x4e\xe5\x7c\x13\x87\x1e"
3772                                "\xb5\x29\xc0\x57\xee\x62\xf9\x90"
3773                                "\x04\x9b\x32\xc9\x3d\xd4\x6b\x02"
3774                                "\x76\x0d\xa4\x18\xaf\x46\xdd\x51"
3775                                "\xe8\x7f\x16\x8a\x21\xb8\x2c\xc3"
3776                                "\x5a\xf1\x65\xfc\x93\x07\x9e\x35"
3777                                "\xcc\x40\xd7\x6e\x05\x79\x10\xa7"
3778                                "\x1b\xb2\x49\xe0\x54\xeb\x82\x19"
3779                                "\x8d\x24\xbb\x2f\xc6\x5d\xf4\x68"
3780                                "\xff\x96\x0a\xa1\x38\xcf\x43\xda"
3781                                "\x71\x08\x7c\x13\xaa\x1e\xb5\x4c"
3782                                "\xe3\x57\xee\x85\x1c\x90\x27\xbe"
3783                                "\x32\xc9\x60\xf7\x6b\x02\x99\x0d"
3784                                "\xa4\x3b\xd2\x46\xdd\x74\x0b\x7f"
3785                                "\x16\xad\x21\xb8\x4f\xe6\x5a\xf1"
3786                                "\x88\x1f\x93\x2a\xc1\x35\xcc\x63"
3787                                "\xfa\x6e\x05\x9c\x10\xa7\x3e\xd5"
3788                                "\x49\xe0\x77\x0e\x82\x19\xb0\x24"
3789                                "\xbb\x52\xe9\x5d\xf4\x8b\x22\x96"
3790                                "\x2d\xc4\x38\xcf\x66\xfd\x71\x08"
3791                                "\x9f\x13\xaa\x41\xd8\x4c\xe3\x7a"
3792                                "\x11\x85\x1c\xb3\x27\xbe\x55\xec"
3793                                "\x60\xf7\x8e\x02\x99\x30\xc7\x3b"
3794                                "\xd2\x69\x00\x74\x0b\xa2\x16\xad"
3795                                "\x44\xdb\x4f\xe6\x7d\x14\x88\x1f"
3796                                "\xb6\x2a\xc1\x58\xef\x63\xfa\x91"
3797                                "\x05\x9c\x33\xca\x3e\xd5\x6c\x03"
3798                                "\x77\x0e\xa5\x19\xb0\x47\xde\x52"
3799                                "\xe9\x80\x17\x8b\x22\xb9\x2d\xc4"
3800                                "\x5b\xf2\x66\xfd\x94\x08\x9f\x36"
3801                                "\xcd\x41\xd8\x6f\x06\x7a\x11\xa8"
3802                                "\x1c\xb3\x4a\xe1\x55\xec\x83\x1a"
3803                                "\x8e\x25\xbc\x30\xc7\x5e\xf5\x69"
3804                                "\x00\x97\x0b\xa2\x39\xd0\x44\xdb"
3805                                "\x72\x09\x7d\x14\xab\x1f\xb6\x4d"
3806                                "\xe4\x58\xef\x86\x1d\x91\x28\xbf"
3807                                "\x33\xca\x61\xf8\x6c\x03\x9a\x0e"
3808                                "\xa5\x3c\xd3\x47\xde\x75\x0c\x80"
3809                                "\x17\xae\x22\xb9\x50\xe7\x5b\xf2"
3810                                "\x89\x20\x94\x2b\xc2\x36\xcd\x64"
3811                                "\xfb\x6f\x06\x9d\x11\xa8\x3f\xd6"
3812                                "\x4a\xe1\x78\x0f\x83\x1a\xb1\x25"
3813                                "\xbc\x53\xea\x5e\xf5\x8c\x00\x97"
3814                                "\x2e\xc5\x39\xd0\x67\xfe\x72\x09"
3815                                "\xa0\x14\xab\x42\xd9\x4d\xe4\x7b"
3816                                "\x12\x86\x1d\xb4\x28\xbf\x56\xed"
3817                                "\x61\xf8\x8f\x03\x9a\x31\xc8\x3c"
3818                                "\xd3\x6a\x01\x75\x0c\xa3\x17\xae"
3819                                "\x45\xdc\x50\xe7\x7e\x15\x89\x20"
3820                                "\xb7\x2b\xc2\x59\xf0\x64\xfb\x92"
3821                                "\x06\x9d\x34\xcb\x3f\xd6\x6d\x04"
3822                                "\x78\x0f\xa6\x1a\xb1\x48\xdf\x53"
3823                                "\xea\x81\x18\x8c\x23\xba\x2e\xc5"
3824                                "\x5c\xf3\x67\xfe\x95\x09\xa0\x37"
3825                                "\xce\x42\xd9\x70\x07\x7b\x12\xa9"
3826                                "\x1d\xb4\x4b\xe2\x56\xed\x84\x1b"
3827                                "\x8f\x26\xbd\x31\xc8\x5f\xf6\x6a"
3828                                "\x01\x98\x0c\xa3\x3a\xd1\x45\xdc"
3829                                "\x73\x0a\x7e\x15\xac\x20\xb7\x4e"
3830                                "\xe5\x59\xf0\x87\x1e\x92\x29\xc0"
3831                                "\x34\xcb\x62\xf9\x6d\x04\x9b\x0f"
3832                                "\xa6\x3d\xd4\x48\xdf\x76\x0d\x81"
3833                                "\x18\xaf\x23\xba\x51\xe8\x5c\xf3"
3834                                "\x8a\x21\x95\x2c\xc3\x37\xce\x65"
3835                                "\xfc\x70\x07\x9e\x12\xa9\x40\xd7"
3836                                "\x4b\xe2\x79\x10\x84\x1b\xb2\x26"
3837                                "\xbd\x54\xeb\x5f\xf6\x8d\x01\x98"
3838                                "\x2f\xc6\x3a\xd1\x68\xff\x73\x0a"
3839                                "\xa1\x15\xac\x43\xda\x4e\xe5\x7c"
3840                                "\x13\x87\x1e\xb5\x29\xc0\x57\xee"
3841                                "\x62\xf9\x90\x04\x9b\x32\xc9\x3d"
3842                                "\xd4\x6b\x02\x76\x0d\xa4\x18\xaf"
3843                                "\x46\xdd\x51\xe8\x7f\x16\x8a\x21"
3844                                "\xb8\x2c\xc3\x5a\xf1\x65\xfc\x93"
3845                                "\x07\x9e\x35\xcc\x40\xd7\x6e\x05"
3846                                "\x79\x10\xa7\x1b\xb2\x49\xe0\x54"
3847                                "\xeb\x82\x19\x8d\x24\xbb\x2f\xc6"
3848                                "\x5d\xf4\x68\xff\x96\x0a\xa1\x38"
3849                                "\xcf\x43\xda\x71\x08\x7c\x13\xaa"
3850                                "\x1e\xb5\x4c\xe3\x57\xee\x85\x1c"
3851                                "\x90\x27\xbe\x32\xc9\x60\xf7\x6b"
3852                                "\x02\x99\x0d\xa4\x3b\xd2\x46\xdd"
3853                                "\x74\x0b\x7f\x16\xad\x21\xb8\x4f"
3854                                "\xe6\x5a\xf1\x88\x1f\x93\x2a\xc1"
3855                                "\x35\xcc\x63\xfa\x6e\x05\x9c\x10"
3856                                "\xa7\x3e\xd5\x49\xe0\x77\x0e\x82"
3857                                "\x19\xb0\x24\xbb\x52\xe9\x5d\xf4"
3858                                "\x8b\x22\x96\x2d\xc4\x38\xcf\x66"
3859                                "\xfd\x71\x08\x9f\x13\xaa\x41\xd8"
3860                                "\x4c\xe3\x7a\x11\x85\x1c\xb3\x27"
3861                                "\xbe\x55\xec\x60\xf7\x8e\x02\x99"
3862                                "\x30\xc7\x3b\xd2\x69\x00\x74\x0b"
3863                                "\xa2\x16\xad\x44\xdb\x4f\xe6\x7d"
3864                                "\x14\x88\x1f\xb6\x2a\xc1\x58\xef"
3865                                "\x63\xfa\x91\x05\x9c\x33\xca\x3e"
3866                                "\xd5\x6c\x03\x77\x0e\xa5\x19\xb0"
3867                                "\x47\xde\x52\xe9\x80\x17\x8b\x22"
3868                                "\xb9\x2d\xc4\x5b\xf2\x66\xfd\x94"
3869                                "\x08\x9f\x36\xcd\x41\xd8\x6f\x06"
3870                                "\x7a\x11\xa8\x1c\xb3\x4a\xe1\x55"
3871                                "\xec\x83\x1a\x8e\x25\xbc\x30\xc7"
3872                                "\x5e\xf5\x69\x00\x97\x0b\xa2\x39"
3873                                "\xd0\x44\xdb\x72\x09\x7d\x14\xab"
3874                                "\x1f\xb6\x4d\xe4\x58\xef\x86\x1d"
3875                                "\x91\x28\xbf\x33\xca\x61\xf8\x6c"
3876                                "\x03\x9a\x0e\xa5\x3c\xd3\x47\xde"
3877                                "\x75\x0c\x80\x17\xae\x22\xb9\x50"
3878                                "\xe7\x5b\xf2\x89\x20\x94\x2b\xc2"
3879                                "\x36\xcd\x64\xfb\x6f\x06\x9d\x11"
3880                                "\xa8\x3f\xd6\x4a\xe1\x78\x0f\x83"
3881                                "\x1a\xb1\x25\xbc\x53\xea\x5e\xf5"
3882                                "\x8c\x00\x97\x2e\xc5\x39\xd0\x67"
3883                                "\xfe\x72\x09\xa0\x14\xab\x42\xd9"
3884                                "\x4d\xe4\x7b\x12\x86\x1d\xb4\x28"
3885                                "\xbf\x56\xed\x61\xf8\x8f\x03\x9a"
3886                                "\x31\xc8\x3c\xd3\x6a\x01\x75\x0c"
3887                                "\xa3\x17\xae\x45\xdc\x50\xe7\x7e"
3888                                "\x15\x89\x20\xb7\x2b\xc2\x59\xf0"
3889                                "\x64\xfb\x92\x06\x9d\x34\xcb\x3f"
3890                                "\xd6\x6d\x04\x78\x0f\xa6\x1a\xb1"
3891                                "\x48\xdf\x53\xea\x81\x18\x8c\x23"
3892                                "\xba\x2e\xc5\x5c\xf3\x67\xfe\x95"
3893                                "\x09\xa0\x37\xce\x42\xd9\x70\x07"
3894                                "\x7b\x12\xa9\x1d\xb4\x4b\xe2\x56"
3895                                "\xed\x84\x1b\x8f\x26\xbd\x31\xc8"
3896                                "\x5f\xf6\x6a\x01\x98\x0c\xa3\x3a"
3897                                "\xd1\x45\xdc\x73\x0a\x7e\x15\xac"
3898                                "\x20\xb7\x4e\xe5\x59\xf0\x87\x1e"
3899                                "\x92\x29\xc0\x34\xcb\x62\xf9\x6d"
3900                                "\x04\x9b\x0f\xa6\x3d\xd4\x48\xdf"
3901                                "\x76\x0d\x81\x18\xaf\x23\xba\x51"
3902                                "\xe8\x5c\xf3\x8a\x21\x95\x2c\xc3"
3903                                "\x37\xce\x65\xfc\x70\x07\x9e\x12"
3904                                "\xa9\x40\xd7\x4b\xe2\x79\x10\x84"
3905                                "\x1b\xb2\x26\xbd\x54\xeb\x5f\xf6"
3906                                "\x8d\x01\x98\x2f\xc6\x3a\xd1\x68"
3907                                "\xff\x73\x0a\xa1\x15\xac\x43\xda"
3908                                "\x4e\xe5\x7c\x13\x87\x1e\xb5\x29"
3909                                "\xc0\x57\xee\x62\xf9\x90\x04\x9b"
3910                                "\x32\xc9\x3d\xd4\x6b\x02\x76\x0d"
3911                                "\xa4\x18\xaf\x46\xdd\x51\xe8\x7f"
3912                                "\x16\x8a\x21\xb8\x2c\xc3\x5a\xf1"
3913                                "\x65\xfc\x93\x07\x9e\x35\xcc\x40"
3914                                "\xd7\x6e\x05\x79\x10\xa7\x1b\xb2"
3915                                "\x49\xe0\x54\xeb\x82\x19\x8d\x24"
3916                                "\xbb\x2f\xc6\x5d\xf4\x68\xff\x96"
3917                                "\x0a\xa1\x38\xcf\x43\xda\x71\x08"
3918                                "\x7c\x13\xaa\x1e\xb5\x4c\xe3\x57"
3919                                "\xee\x85\x1c\x90\x27\xbe\x32\xc9"
3920                                "\x60\xf7\x6b\x02\x99\x0d\xa4\x3b"
3921                                "\xd2\x46\xdd\x74\x0b\x7f\x16\xad"
3922                                "\x21\xb8\x4f\xe6\x5a\xf1\x88\x1f"
3923                                "\x93\x2a\xc1\x35\xcc\x63\xfa\x6e"
3924                                "\x05\x9c\x10\xa7\x3e\xd5\x49\xe0"
3925                                "\x77\x0e\x82\x19\xb0\x24\xbb\x52"
3926                                "\xe9\x5d\xf4\x8b\x22\x96\x2d\xc4"
3927                                "\x38\xcf\x66\xfd\x71\x08\x9f\x13"
3928                                "\xaa\x41\xd8\x4c\xe3\x7a\x11\x85"
3929                                "\x1c\xb3\x27\xbe\x55\xec\x60\xf7"
3930                                "\x8e\x02\x99\x30\xc7\x3b\xd2\x69"
3931                                "\x00\x74\x0b\xa2\x16\xad\x44\xdb"
3932                                "\x4f\xe6\x7d\x14\x88\x1f\xb6\x2a"
3933                                "\xc1\x58\xef\x63\xfa\x91\x05\x9c"
3934                                "\x33\xca\x3e\xd5\x6c\x03\x77\x0e"
3935                                "\xa5\x19\xb0\x47\xde\x52\xe9\x80"
3936                                "\x17\x8b\x22\xb9\x2d\xc4\x5b\xf2"
3937                                "\x66\xfd\x94\x08\x9f\x36\xcd\x41"
3938                                "\xd8\x6f\x06\x7a\x11\xa8\x1c\xb3"
3939                                "\x4a\xe1\x55\xec\x83\x1a\x8e\x25"
3940                                "\xbc\x30\xc7\x5e\xf5\x69\x00\x97"
3941                                "\x0b\xa2\x39\xd0\x44\xdb\x72\x09"
3942                                "\x7d\x14\xab\x1f\xb6\x4d\xe4\x58"
3943                                "\xef\x86\x1d\x91\x28\xbf\x33\xca"
3944                                "\x61\xf8\x6c\x03\x9a\x0e\xa5\x3c"
3945                                "\xd3\x47\xde\x75\x0c\x80\x17\xae"
3946                                "\x22\xb9\x50\xe7\x5b\xf2\x89\x20"
3947                                "\x94\x2b\xc2\x36\xcd\x64\xfb\x6f"
3948                                "\x06\x9d\x11\xa8\x3f\xd6\x4a\xe1"
3949                                "\x78\x0f\x83\x1a\xb1\x25\xbc\x53"
3950                                "\xea\x5e\xf5\x8c\x00\x97\x2e\xc5"
3951                                "\x39\xd0\x67\xfe\x72\x09\xa0\x14"
3952                                "\xab\x42\xd9\x4d\xe4\x7b\x12\x86"
3953                                "\x1d\xb4\x28\xbf\x56\xed\x61\xf8"
3954                                "\x8f\x03\x9a\x31\xc8\x3c\xd3\x6a"
3955                                "\x01\x75\x0c\xa3\x17\xae\x45\xdc"
3956                                "\x50\xe7\x7e\x15\x89\x20\xb7\x2b"
3957                                "\xc2\x59\xf0\x64\xfb\x92\x06\x9d"
3958                                "\x34\xcb\x3f\xd6\x6d\x04\x78\x0f"
3959                                "\xa6\x1a\xb1\x48\xdf\x53\xea\x81"
3960                                "\x18\x8c\x23\xba\x2e\xc5\x5c\xf3"
3961                                "\x67\xfe\x95\x09\xa0\x37\xce\x42"
3962                                "\xd9\x70\x07\x7b\x12\xa9\x1d\xb4"
3963                                "\x4b\xe2\x56\xed\x84\x1b\x8f\x26"
3964                                "\xbd\x31\xc8\x5f\xf6\x6a\x01\x98",
3965                .psize = 2048,
3966                .digest         = (u8 *)(u16 []){ 0x23ca },
3967        }
3968};
3969
3970/*
3971 * Streebog test vectors from RFC 6986 and GOST R 34.11-2012
3972 */
3973static const struct hash_testvec streebog256_tv_template[] = {
3974        { /* M1 */
3975                .plaintext = "012345678901234567890123456789012345678901234567890123456789012",
3976                .psize = 63,
3977                .digest =
3978                        "\x9d\x15\x1e\xef\xd8\x59\x0b\x89"
3979                        "\xda\xa6\xba\x6c\xb7\x4a\xf9\x27"
3980                        "\x5d\xd0\x51\x02\x6b\xb1\x49\xa4"
3981                        "\x52\xfd\x84\xe5\xe5\x7b\x55\x00",
3982        },
3983        { /* M2 */
3984                .plaintext =
3985                        "\xd1\xe5\x20\xe2\xe5\xf2\xf0\xe8"
3986                        "\x2c\x20\xd1\xf2\xf0\xe8\xe1\xee"
3987                        "\xe6\xe8\x20\xe2\xed\xf3\xf6\xe8"
3988                        "\x2c\x20\xe2\xe5\xfe\xf2\xfa\x20"
3989                        "\xf1\x20\xec\xee\xf0\xff\x20\xf1"
3990                        "\xf2\xf0\xe5\xeb\xe0\xec\xe8\x20"
3991                        "\xed\xe0\x20\xf5\xf0\xe0\xe1\xf0"
3992                        "\xfb\xff\x20\xef\xeb\xfa\xea\xfb"
3993                        "\x20\xc8\xe3\xee\xf0\xe5\xe2\xfb",
3994                .psize = 72,
3995                .digest =
3996                        "\x9d\xd2\xfe\x4e\x90\x40\x9e\x5d"
3997                        "\xa8\x7f\x53\x97\x6d\x74\x05\xb0"
3998                        "\xc0\xca\xc6\x28\xfc\x66\x9a\x74"
3999                        "\x1d\x50\x06\x3c\x55\x7e\x8f\x50",
4000        },
4001};
4002
4003static const struct hash_testvec streebog512_tv_template[] = {
4004        { /* M1 */
4005                .plaintext = "012345678901234567890123456789012345678901234567890123456789012",
4006                .psize = 63,
4007                .digest =
4008                        "\x1b\x54\xd0\x1a\x4a\xf5\xb9\xd5"
4009                        "\xcc\x3d\x86\xd6\x8d\x28\x54\x62"
4010                        "\xb1\x9a\xbc\x24\x75\x22\x2f\x35"
4011                        "\xc0\x85\x12\x2b\xe4\xba\x1f\xfa"
4012                        "\x00\xad\x30\xf8\x76\x7b\x3a\x82"
4013                        "\x38\x4c\x65\x74\xf0\x24\xc3\x11"
4014                        "\xe2\xa4\x81\x33\x2b\x08\xef\x7f"
4015                        "\x41\x79\x78\x91\xc1\x64\x6f\x48",
4016        },
4017        { /* M2 */
4018                .plaintext =
4019                        "\xd1\xe5\x20\xe2\xe5\xf2\xf0\xe8"
4020                        "\x2c\x20\xd1\xf2\xf0\xe8\xe1\xee"
4021                        "\xe6\xe8\x20\xe2\xed\xf3\xf6\xe8"
4022                        "\x2c\x20\xe2\xe5\xfe\xf2\xfa\x20"
4023                        "\xf1\x20\xec\xee\xf0\xff\x20\xf1"
4024                        "\xf2\xf0\xe5\xeb\xe0\xec\xe8\x20"
4025                        "\xed\xe0\x20\xf5\xf0\xe0\xe1\xf0"
4026                        "\xfb\xff\x20\xef\xeb\xfa\xea\xfb"
4027                        "\x20\xc8\xe3\xee\xf0\xe5\xe2\xfb",
4028                .psize = 72,
4029                .digest =
4030                        "\x1e\x88\xe6\x22\x26\xbf\xca\x6f"
4031                        "\x99\x94\xf1\xf2\xd5\x15\x69\xe0"
4032                        "\xda\xf8\x47\x5a\x3b\x0f\xe6\x1a"
4033                        "\x53\x00\xee\xe4\x6d\x96\x13\x76"
4034                        "\x03\x5f\xe8\x35\x49\xad\xa2\xb8"
4035                        "\x62\x0f\xcd\x7c\x49\x6c\xe5\xb3"
4036                        "\x3f\x0c\xb9\xdd\xdc\x2b\x64\x60"
4037                        "\x14\x3b\x03\xda\xba\xc9\xfb\x28",
4038        },
4039};
4040
4041/*
4042 * Two HMAC-Streebog test vectors from RFC 7836 and R 50.1.113-2016 A
4043 */
4044static const struct hash_testvec hmac_streebog256_tv_template[] = {
4045        {
4046                .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
4047                        "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4048                        "\x10\x11\x12\x13\x14\x15\x16\x17"
4049                        "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4050                .ksize  = 32,
4051                .plaintext =
4052                        "\x01\x26\xbd\xb8\x78\x00\xaf\x21"
4053                        "\x43\x41\x45\x65\x63\x78\x01\x00",
4054                .psize  = 16,
4055                .digest =
4056                        "\xa1\xaa\x5f\x7d\xe4\x02\xd7\xb3"
4057                        "\xd3\x23\xf2\x99\x1c\x8d\x45\x34"
4058                        "\x01\x31\x37\x01\x0a\x83\x75\x4f"
4059                        "\xd0\xaf\x6d\x7c\xd4\x92\x2e\xd9",
4060        },
4061};
4062
4063static const struct hash_testvec hmac_streebog512_tv_template[] = {
4064        {
4065                .key =  "\x00\x01\x02\x03\x04\x05\x06\x07"
4066                        "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
4067                        "\x10\x11\x12\x13\x14\x15\x16\x17"
4068                        "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
4069                .ksize  = 32,
4070                .plaintext =
4071                        "\x01\x26\xbd\xb8\x78\x00\xaf\x21"
4072                        "\x43\x41\x45\x65\x63\x78\x01\x00",
4073                .psize  = 16,
4074                .digest =
4075                        "\xa5\x9b\xab\x22\xec\xae\x19\xc6"
4076                        "\x5f\xbd\xe6\xe5\xf4\xe9\xf5\xd8"
4077                        "\x54\x9d\x31\xf0\x37\xf9\xdf\x9b"
4078                        "\x90\x55\x00\xe1\x71\x92\x3a\x77"
4079                        "\x3d\x5f\x15\x30\xf2\xed\x7e\x96"
4080                        "\x4c\xb2\xee\xdc\x29\xe9\xad\x2f"
4081                        "\x3a\xfe\x93\xb2\x81\x4f\x79\xf5"
4082                        "\x00\x0f\xfc\x03\x66\xc2\x51\xe6",
4083        },
4084};
4085
4086/*
4087 * SM2 test vectors.
4088 */
4089static const struct akcipher_testvec sm2_tv_template[] = {
4090        { /* Generated from openssl */
4091        .key =
4092        "\x04"
4093        "\x8e\xa0\x33\x69\x91\x7e\x3d\xec\xad\x8e\xf0\x45\x5e\x13\x3e\x68"
4094        "\x5b\x8c\xab\x5c\xc6\xc8\x50\xdf\x91\x00\xe0\x24\x73\x4d\x31\xf2"
4095        "\x2e\xc0\xd5\x6b\xee\xda\x98\x93\xec\xd8\x36\xaa\xb9\xcf\x63\x82"
4096        "\xef\xa7\x1a\x03\xed\x16\xba\x74\xb8\x8b\xf9\xe5\x70\x39\xa4\x70",
4097        .key_len = 65,
4098        .param_len = 0,
4099        .c =
4100        "\x30\x45"
4101        "\x02\x20"
4102        "\x70\xab\xb6\x7d\xd6\x54\x80\x64\x42\x7e\x2d\x05\x08\x36\xc9\x96"
4103        "\x25\xc2\xbb\xff\x08\xe5\x43\x15\x5e\xf3\x06\xd9\x2b\x2f\x0a\x9f"
4104        "\x02\x21"
4105        "\x00"
4106        "\xbf\x21\x5f\x7e\x5d\x3f\x1a\x4d\x8f\x84\xc2\xe9\xa6\x4c\xa4\x18"
4107        "\xb2\xb8\x46\xf4\x32\x96\xfa\x57\xc6\x29\xd4\x89\xae\xcc\xda\xdb",
4108        .c_size = 71,
4109        .algo = OID_SM2_with_SM3,
4110        .m =
4111        "\x47\xa7\xbf\xd3\xda\xc4\x79\xee\xda\x8b\x4f\xe8\x40\x94\xd4\x32"
4112        "\x8f\xf1\xcd\x68\x4d\xbd\x9b\x1d\xe0\xd8\x9a\x5d\xad\x85\x47\x5c",
4113        .m_size = 32,
4114        .public_key_vec = true,
4115        .siggen_sigver_test = true,
4116        },
4117        { /* From libgcrypt */
4118        .key =
4119        "\x04"
4120        "\x87\x59\x38\x9a\x34\xaa\xad\x07\xec\xf4\xe0\xc8\xc2\x65\x0a\x44"
4121        "\x59\xc8\xd9\x26\xee\x23\x78\x32\x4e\x02\x61\xc5\x25\x38\xcb\x47"
4122        "\x75\x28\x10\x6b\x1e\x0b\x7c\x8d\xd5\xff\x29\xa9\xc8\x6a\x89\x06"
4123        "\x56\x56\xeb\x33\x15\x4b\xc0\x55\x60\x91\xef\x8a\xc9\xd1\x7d\x78",
4124        .key_len = 65,
4125        .param_len = 0,
4126        .c =
4127        "\x30\x44"
4128        "\x02\x20"
4129        "\xd9\xec\xef\xe8\x5f\xee\x3c\x59\x57\x8e\x5b\xab\xb3\x02\xe1\x42"
4130        "\x4b\x67\x2c\x0b\x26\xb6\x51\x2c\x3e\xfc\xc6\x49\xec\xfe\x89\xe5"
4131        "\x02\x20"
4132        "\x43\x45\xd0\xa5\xff\xe5\x13\x27\x26\xd0\xec\x37\xad\x24\x1e\x9a"
4133        "\x71\x9a\xa4\x89\xb0\x7e\x0f\xc4\xbb\x2d\x50\xd0\xe5\x7f\x7a\x68",
4134        .c_size = 70,
4135        .algo = OID_SM2_with_SM3,
4136        .m =
4137        "\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff\x00"
4138        "\x12\x34\x56\x78\x9a\xbc\xde\xf0\x12\x34\x56\x78\x9a\xbc\xde\xf0",
4139        .m_size = 32,
4140        .public_key_vec = true,
4141        .siggen_sigver_test = true,
4142        },
4143};
4144
4145/* Example vectors below taken from
4146 * http://www.oscca.gov.cn/UpFile/20101222141857786.pdf
4147 *
4148 * The rest taken from
4149 * https://github.com/adamws/oscca-sm3
4150 */
4151static const struct hash_testvec sm3_tv_template[] = {
4152        {
4153                .plaintext = "",
4154                .psize = 0,
4155                .digest = (u8 *)(u8 []) {
4156                        0x1A, 0xB2, 0x1D, 0x83, 0x55, 0xCF, 0xA1, 0x7F,
4157                        0x8e, 0x61, 0x19, 0x48, 0x31, 0xE8, 0x1A, 0x8F,
4158                        0x22, 0xBE, 0xC8, 0xC7, 0x28, 0xFE, 0xFB, 0x74,
4159                        0x7E, 0xD0, 0x35, 0xEB, 0x50, 0x82, 0xAA, 0x2B }
4160        }, {
4161                .plaintext = "a",
4162                .psize = 1,
4163                .digest = (u8 *)(u8 []) {
4164                        0x62, 0x34, 0x76, 0xAC, 0x18, 0xF6, 0x5A, 0x29,
4165                        0x09, 0xE4, 0x3C, 0x7F, 0xEC, 0x61, 0xB4, 0x9C,
4166                        0x7E, 0x76, 0x4A, 0x91, 0xA1, 0x8C, 0xCB, 0x82,
4167                        0xF1, 0x91, 0x7A, 0x29, 0xC8, 0x6C, 0x5E, 0x88 }
4168        }, {
4169                /* A.1. Example 1 */
4170                .plaintext = "abc",
4171                .psize = 3,
4172                .digest = (u8 *)(u8 []) {
4173                        0x66, 0xC7, 0xF0, 0xF4, 0x62, 0xEE, 0xED, 0xD9,
4174                        0xD1, 0xF2, 0xD4, 0x6B, 0xDC, 0x10, 0xE4, 0xE2,
4175                        0x41, 0x67, 0xC4, 0x87, 0x5C, 0xF2, 0xF7, 0xA2,
4176                        0x29, 0x7D, 0xA0, 0x2B, 0x8F, 0x4B, 0xA8, 0xE0 }
4177        }, {
4178                .plaintext = "abcdefghijklmnopqrstuvwxyz",
4179                .psize = 26,
4180                .digest = (u8 *)(u8 []) {
4181                        0xB8, 0x0F, 0xE9, 0x7A, 0x4D, 0xA2, 0x4A, 0xFC,
4182                        0x27, 0x75, 0x64, 0xF6, 0x6A, 0x35, 0x9E, 0xF4,
4183                        0x40, 0x46, 0x2A, 0xD2, 0x8D, 0xCC, 0x6D, 0x63,
4184                        0xAD, 0xB2, 0x4D, 0x5C, 0x20, 0xA6, 0x15, 0x95 }
4185        }, {
4186                /* A.1. Example 2 */
4187                .plaintext = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdab"
4188                             "cdabcdabcdabcdabcd",
4189                .psize = 64,
4190                .digest = (u8 *)(u8 []) {
4191                        0xDE, 0xBE, 0x9F, 0xF9, 0x22, 0x75, 0xB8, 0xA1,
4192                        0x38, 0x60, 0x48, 0x89, 0xC1, 0x8E, 0x5A, 0x4D,
4193                        0x6F, 0xDB, 0x70, 0xE5, 0x38, 0x7E, 0x57, 0x65,
4194                        0x29, 0x3D, 0xCB, 0xA3, 0x9C, 0x0C, 0x57, 0x32 }
4195        }, {
4196                .plaintext = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4197                             "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4198                             "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4199                             "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4200                             "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4201                             "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"
4202                             "abcdabcdabcdabcdabcdabcdabcdabcd",
4203                .psize = 256,
4204                .digest = (u8 *)(u8 []) {
4205                        0xB9, 0x65, 0x76, 0x4C, 0x8B, 0xEB, 0xB0, 0x91,
4206                        0xC7, 0x60, 0x2B, 0x74, 0xAF, 0xD3, 0x4E, 0xEF,
4207                        0xB5, 0x31, 0xDC, 0xCB, 0x4E, 0x00, 0x76, 0xD9,
4208                        0xB7, 0xCD, 0x81, 0x31, 0x99, 0xB4, 0x59, 0x71 }
4209        }
4210};
4211
4212/* Example vectors below taken from
4213 * GM/T 0042-2015 Appendix D.3
4214 */
4215static const struct hash_testvec hmac_sm3_tv_template[] = {
4216        {
4217                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
4218                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
4219                          "\x11\x12\x13\x14\x15\x16\x17\x18"
4220                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
4221                .ksize  = 32,
4222                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
4223                             "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4224                .psize  = 112,
4225                .digest = "\xca\x05\xe1\x44\xed\x05\xd1\x85"
4226                          "\x78\x40\xd1\xf3\x18\xa4\xa8\x66"
4227                          "\x9e\x55\x9f\xc8\x39\x1f\x41\x44"
4228                          "\x85\xbf\xdf\x7b\xb4\x08\x96\x3a",
4229        }, {
4230                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
4231                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
4232                          "\x11\x12\x13\x14\x15\x16\x17\x18"
4233                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
4234                          "\x21\x22\x23\x24\x25",
4235                .ksize  = 37,
4236                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
4237                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
4238                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
4239                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
4240                .psize  = 50,
4241                .digest = "\x22\x0b\xf5\x79\xde\xd5\x55\x39"
4242                          "\x3f\x01\x59\xf6\x6c\x99\x87\x78"
4243                          "\x22\xa3\xec\xf6\x10\xd1\x55\x21"
4244                          "\x54\xb4\x1d\x44\xb9\x4d\xb3\xae",
4245        }, {
4246                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4247                          "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
4248                         "\x0b\x0b\x0b\x0b\x0b\x0b",
4249                .ksize  = 32,
4250                .plaintext = "Hi There",
4251                .psize  = 8,
4252                .digest = "\xc0\xba\x18\xc6\x8b\x90\xc8\x8b"
4253                          "\xc0\x7d\xe7\x94\xbf\xc7\xd2\xc8"
4254                          "\xd1\x9e\xc3\x1e\xd8\x77\x3b\xc2"
4255                          "\xb3\x90\xc9\x60\x4e\x0b\xe1\x1e",
4256        }, {
4257                .key    = "Jefe",
4258                .ksize  = 4,
4259                .plaintext = "what do ya want for nothing?",
4260                .psize  = 28,
4261                .digest = "\x2e\x87\xf1\xd1\x68\x62\xe6\xd9"
4262                          "\x64\xb5\x0a\x52\x00\xbf\x2b\x10"
4263                          "\xb7\x64\xfa\xa9\x68\x0a\x29\x6a"
4264                          "\x24\x05\xf2\x4b\xec\x39\xf8\x82",
4265        },
4266};
4267
4268/*
4269 * SHA1 test vectors from FIPS PUB 180-1
4270 * Long vector from CAVS 5.0
4271 */
4272static const struct hash_testvec sha1_tv_template[] = {
4273        {
4274                .plaintext = "",
4275                .psize  = 0,
4276                .digest = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55"
4277                          "\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09",
4278        }, {
4279                .plaintext = "abc",
4280                .psize  = 3,
4281                .digest = "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
4282                          "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
4283        }, {
4284                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4285                .psize  = 56,
4286                .digest = "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae"
4287                          "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
4288        }, {
4289                .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
4290                             "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
4291                             "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
4292                             "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
4293                             "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
4294                             "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
4295                             "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
4296                             "\x72\x28\x26\xc0\x66\x86\x9e\xda"
4297                             "\xcd\x73\xb2\x54\x80\x35\x18\x58"
4298                             "\x13\xe2\x26\x34\xa9\xda\x44\x00"
4299                             "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
4300                             "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
4301                             "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
4302                             "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
4303                             "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
4304                             "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
4305                             "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
4306                             "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
4307                             "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
4308                             "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
4309                             "\x5a\x90\x11",
4310                .psize  = 163,
4311                .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
4312                          "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
4313        }, {
4314                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
4315                .psize  = 64,
4316                .digest = "\xc8\x71\xf6\x9a\x63\xcc\xa9\x84\x84\x82"
4317                          "\x64\xe7\x79\x95\x5d\xd7\x19\x41\x7c\x91",
4318        }, {
4319                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4320                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4321                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4322                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4323                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4324                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4325                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4326                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4327                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4328                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4329                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4330                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4331                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4332                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4333                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4334                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4335                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4336                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4337                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4338                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4339                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4340                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4341                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4342                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4343                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4344                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4345                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4346                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4347                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4348                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4349                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4350                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4351                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4352                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4353                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4354                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4355                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4356                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4357                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4358                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4359                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4360                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4361                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4362                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4363                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4364                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4365                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4366                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4367                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4368                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4369                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4370                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4371                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4372                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4373                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4374                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4375                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4376                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4377                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4378                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4379                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4380                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4381                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4382                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4383                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4384                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4385                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4386                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4387                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4388                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4389                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4390                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4391                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4392                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4393                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4394                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4395                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4396                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4397                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4398                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4399                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4400                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4401                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4402                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4403                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4404                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4405                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4406                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4407                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4408                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4409                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4410                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4411                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4412                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4413                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4414                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4415                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4416                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4417                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4418                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4419                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4420                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4421                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4422                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4423                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4424                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4425                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4426                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4427                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4428                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4429                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4430                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4431                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4432                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4433                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4434                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4435                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4436                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4437                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4438                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4439                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4440                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4441                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4442                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4443                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4444                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4445                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4446                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4447                .psize     = 1023,
4448                .digest    = "\xb8\xe3\x54\xed\xc5\xfc\xef\xa4"
4449                             "\x55\x73\x4a\x81\x99\xe4\x47\x2a"
4450                             "\x30\xd6\xc9\x85",
4451        }
4452};
4453
4454
4455/*
4456 * SHA224 test vectors from FIPS PUB 180-2
4457 */
4458static const struct hash_testvec sha224_tv_template[] = {
4459        {
4460                .plaintext = "",
4461                .psize  = 0,
4462                .digest = "\xd1\x4a\x02\x8c\x2a\x3a\x2b\xc9"
4463                          "\x47\x61\x02\xbb\x28\x82\x34\xc4"
4464                          "\x15\xa2\xb0\x1f\x82\x8e\xa6\x2a"
4465                          "\xc5\xb3\xe4\x2f",
4466        }, {
4467                .plaintext = "abc",
4468                .psize  = 3,
4469                .digest = "\x23\x09\x7D\x22\x34\x05\xD8\x22"
4470                          "\x86\x42\xA4\x77\xBD\xA2\x55\xB3"
4471                          "\x2A\xAD\xBC\xE4\xBD\xA0\xB3\xF7"
4472                          "\xE3\x6C\x9D\xA7",
4473        }, {
4474                .plaintext =
4475                "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4476                .psize  = 56,
4477                .digest = "\x75\x38\x8B\x16\x51\x27\x76\xCC"
4478                          "\x5D\xBA\x5D\xA1\xFD\x89\x01\x50"
4479                          "\xB0\xC6\x45\x5C\xB4\xF5\x8B\x19"
4480                          "\x52\x52\x25\x25",
4481        }, {
4482                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
4483                .psize  = 64,
4484                .digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01"
4485                          "\x42\xfd\x10\x92\xaa\x4e\x04\x08"
4486                          "\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c"
4487                          "\xef\x3b\xcb\x0e",
4488        }, {
4489                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4490                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4491                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4492                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4493                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4494                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4495                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4496                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4497                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4498                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4499                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4500                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4501                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4502                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4503                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4504                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4505                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4506                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4507                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4508                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4509                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4510                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4511                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4512                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4513                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4514                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4515                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4516                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4517                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4518                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4519                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4520                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4521                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4522                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4523                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4524                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4525                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4526                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4527                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4528                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4529                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4530                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4531                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4532                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4533                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4534                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4535                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4536                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4537                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4538                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4539                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4540                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4541                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4542                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4543                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4544                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4545                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4546                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4547                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4548                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4549                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4550                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4551                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4552                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4553                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4554                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4555                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4556                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4557                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4558                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4559                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4560                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4561                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4562                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4563                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4564                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4565                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4566                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4567                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4568                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4569                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4570                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4571                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4572                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4573                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4574                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4575                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4576                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4577                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4578                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4579                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4580                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4581                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4582                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4583                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4584                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4585                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4586                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4587                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4588                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4589                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4590                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4591                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4592                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4593                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4594                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4595                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4596                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4597                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4598                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4599                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4600                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4601                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4602                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4603                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4604                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4605                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4606                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4607                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4608                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4609                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4610                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4611                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4612                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4613                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4614                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4615                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4616                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4617                .psize     = 1023,
4618                .digest    = "\x98\x43\x07\x63\x75\xe0\xa7\x1c"
4619                             "\x78\xb1\x8b\xfd\x04\xf5\x2d\x91"
4620                             "\x20\x48\xa4\x28\xff\x55\xb1\xd3"
4621                             "\xe6\xf9\x4f\xcc",
4622        }
4623};
4624
4625/*
4626 * SHA256 test vectors from NIST
4627 */
4628static const struct hash_testvec sha256_tv_template[] = {
4629        {
4630                .plaintext = "",
4631                .psize  = 0,
4632                .digest = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14"
4633                          "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
4634                          "\x27\xae\x41\xe4\x64\x9b\x93\x4c"
4635                          "\xa4\x95\x99\x1b\x78\x52\xb8\x55",
4636        }, {
4637                .plaintext = "abc",
4638                .psize  = 3,
4639                .digest = "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
4640                          "\x41\x41\x40\xde\x5d\xae\x22\x23"
4641                          "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
4642                          "\xb4\x10\xff\x61\xf2\x00\x15\xad",
4643        }, {
4644                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4645                .psize  = 56,
4646                .digest = "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
4647                          "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
4648                          "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
4649                          "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
4650        }, {
4651                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
4652                .psize  = 64,
4653                .digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4"
4654                          "\x2c\x32\x29\x32\x19\xbb\xfb\xfa"
4655                          "\xd6\xff\x94\xa3\x72\x91\x85\x66"
4656                          "\x3b\xa7\x87\x77\x58\xa3\x40\x3a",
4657        }, {
4658                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4659                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4660                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4661                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4662                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4663                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4664                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4665                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4666                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4667                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4668                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4669                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4670                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4671                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4672                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4673                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4674                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4675                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4676                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4677                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4678                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4679                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4680                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4681                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4682                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4683                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4684                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4685                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4686                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4687                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4688                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4689                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4690                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4691                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4692                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4693                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4694                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4695                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4696                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4697                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4698                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4699                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4700                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4701                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4702                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4703                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4704                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4705                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4706                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4707                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4708                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4709                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4710                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4711                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4712                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4713                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4714                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4715                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4716                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4717                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4718                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4719                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4720                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4721                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4722                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4723                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4724                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4725                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4726                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4727                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4728                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4729                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4730                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4731                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4732                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4733                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4734                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4735                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4736                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4737                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4738                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4739                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4740                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4741                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4742                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4743                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4744                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4745                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4746                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4747                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4748                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4749                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4750                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4751                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4752                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4753                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4754                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4755                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4756                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4757                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4758                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4759                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4760                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4761                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4762                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4763                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4764                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4765                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4766                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4767                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4768                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4769                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4770                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4771                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4772                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4773                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4774                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4775                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4776                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4777                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4778                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4779                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4780                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4781                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4782                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4783                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4784                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4785                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4786                .psize     = 1023,
4787                .digest    = "\xc5\xce\x0c\xca\x01\x4f\x53\x3a"
4788                             "\x32\x32\x17\xcc\xd4\x6a\x71\xa9"
4789                             "\xf3\xed\x50\x10\x64\x8e\x06\xbe"
4790                             "\x9b\x4a\xa6\xbb\x05\x89\x59\x51",
4791        }
4792};
4793
4794/*
4795 * SHA384 test vectors from NIST and kerneli
4796 */
4797static const struct hash_testvec sha384_tv_template[] = {
4798        {
4799                .plaintext = "",
4800                .psize  = 0,
4801                .digest = "\x38\xb0\x60\xa7\x51\xac\x96\x38"
4802                          "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a"
4803                          "\x21\xfd\xb7\x11\x14\xbe\x07\x43"
4804                          "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda"
4805                          "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb"
4806                          "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b",
4807        }, {
4808                .plaintext= "abc",
4809                .psize  = 3,
4810                .digest = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
4811                          "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
4812                          "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
4813                          "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
4814                          "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
4815                          "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
4816        }, {
4817                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
4818                .psize  = 56,
4819                .digest = "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
4820                          "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
4821                          "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
4822                          "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
4823                          "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
4824                          "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
4825        }, {
4826                .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
4827                           "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
4828                .psize  = 112,
4829                .digest = "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
4830                          "\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
4831                          "\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
4832                          "\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
4833                          "\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
4834                          "\x66\xc3\xe9\xfa\x91\x74\x60\x39",
4835        }, {
4836                .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
4837                           "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
4838                .psize  = 104,
4839                .digest = "\x3d\x20\x89\x73\xab\x35\x08\xdb"
4840                          "\xbd\x7e\x2c\x28\x62\xba\x29\x0a"
4841                          "\xd3\x01\x0e\x49\x78\xc1\x98\xdc"
4842                          "\x4d\x8f\xd0\x14\xe5\x82\x82\x3a"
4843                          "\x89\xe1\x6f\x9b\x2a\x7b\xbc\x1a"
4844                          "\xc9\x38\xe2\xd1\x99\xe8\xbe\xa4",
4845        }, {
4846                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
4847                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
4848                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
4849                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
4850                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
4851                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
4852                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
4853                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
4854                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
4855                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
4856                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
4857                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
4858                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
4859                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
4860                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
4861                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
4862                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
4863                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
4864                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
4865                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
4866                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
4867                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
4868                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
4869                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
4870                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
4871                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
4872                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
4873                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
4874                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
4875                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
4876                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
4877                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
4878                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
4879                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
4880                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
4881                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
4882                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
4883                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
4884                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
4885                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
4886                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
4887                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
4888                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
4889                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
4890                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
4891                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
4892                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
4893                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
4894                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
4895                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
4896                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
4897                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
4898                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
4899                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
4900                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
4901                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
4902                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
4903                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
4904                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
4905                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
4906                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
4907                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
4908                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
4909                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
4910                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
4911                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
4912                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
4913                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
4914                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
4915                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
4916                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
4917                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
4918                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
4919                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
4920                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
4921                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
4922                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
4923                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
4924                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
4925                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
4926                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
4927                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
4928                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
4929                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
4930                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
4931                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
4932                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
4933                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
4934                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
4935                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
4936                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
4937                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
4938                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
4939                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
4940                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
4941                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
4942                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
4943                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
4944                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
4945                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
4946                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
4947                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
4948                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
4949                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
4950                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
4951                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
4952                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
4953                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
4954                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
4955                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
4956                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
4957                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
4958                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
4959                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
4960                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
4961                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
4962                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
4963                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
4964                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
4965                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
4966                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
4967                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
4968                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
4969                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
4970                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
4971                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
4972                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
4973                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
4974                .psize     = 1023,
4975                .digest    = "\x4d\x97\x23\xc8\xea\x7a\x7c\x15"
4976                             "\xb8\xff\x97\x9c\xf5\x13\x4f\x31"
4977                             "\xde\x67\xf7\x24\x73\xcd\x70\x1c"
4978                             "\x03\x4a\xba\x8a\x87\x49\xfe\xdc"
4979                             "\x75\x29\x62\x83\xae\x3f\x17\xab"
4980                             "\xfd\x10\x4d\x8e\x17\x1c\x1f\xca",
4981        }
4982};
4983
4984/*
4985 * SHA512 test vectors from NIST and kerneli
4986 */
4987static const struct hash_testvec sha512_tv_template[] = {
4988        {
4989                .plaintext = "",
4990                .psize  = 0,
4991                .digest = "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd"
4992                          "\xf1\x54\x28\x50\xd6\x6d\x80\x07"
4993                          "\xd6\x20\xe4\x05\x0b\x57\x15\xdc"
4994                          "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
4995                          "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0"
4996                          "\xff\x83\x18\xd2\x87\x7e\xec\x2f"
4997                          "\x63\xb9\x31\xbd\x47\x41\x7a\x81"
4998                          "\xa5\x38\x32\x7a\xf9\x27\xda\x3e",
4999        }, {
5000                .plaintext = "abc",
5001                .psize  = 3,
5002                .digest = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
5003                          "\xcc\x41\x73\x49\xae\x20\x41\x31"
5004                          "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
5005                          "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
5006                          "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
5007                          "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
5008                          "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
5009                          "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
5010        }, {
5011                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
5012                .psize  = 56,
5013                .digest = "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
5014                          "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
5015                          "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
5016                          "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
5017                          "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
5018                          "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
5019                          "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
5020                          "\x54\xec\x63\x12\x38\xca\x34\x45",
5021        }, {
5022                .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
5023                           "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
5024                .psize  = 112,
5025                .digest = "\x8e\x95\x9b\x75\xda\xe3\x13\xda"
5026                          "\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
5027                          "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1"
5028                          "\x72\x99\xae\xad\xb6\x88\x90\x18"
5029                          "\x50\x1d\x28\x9e\x49\x00\xf7\xe4"
5030                          "\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
5031                          "\xc7\xd3\x29\xee\xb6\xdd\x26\x54"
5032                          "\x5e\x96\xe5\x5b\x87\x4b\xe9\x09",
5033        }, {
5034                .plaintext = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd"
5035                           "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
5036                .psize  = 104,
5037                .digest = "\x93\x0d\x0c\xef\xcb\x30\xff\x11"
5038                          "\x33\xb6\x89\x81\x21\xf1\xcf\x3d"
5039                          "\x27\x57\x8a\xfc\xaf\xe8\x67\x7c"
5040                          "\x52\x57\xcf\x06\x99\x11\xf7\x5d"
5041                          "\x8f\x58\x31\xb5\x6e\xbf\xda\x67"
5042                          "\xb2\x78\xe6\x6d\xff\x8b\x84\xfe"
5043                          "\x2b\x28\x70\xf7\x42\xa5\x80\xd8"
5044                          "\xed\xb4\x19\x87\x23\x28\x50\xc9",
5045        }, {
5046                .plaintext = "\x08\x9f\x13\xaa\x41\xd8\x4c\xe3"
5047                             "\x7a\x11\x85\x1c\xb3\x27\xbe\x55"
5048                             "\xec\x60\xf7\x8e\x02\x99\x30\xc7"
5049                             "\x3b\xd2\x69\x00\x74\x0b\xa2\x16"
5050                             "\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
5051                             "\x1f\xb6\x2a\xc1\x58\xef\x63\xfa"
5052                             "\x91\x05\x9c\x33\xca\x3e\xd5\x6c"
5053                             "\x03\x77\x0e\xa5\x19\xb0\x47\xde"
5054                             "\x52\xe9\x80\x17\x8b\x22\xb9\x2d"
5055                             "\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
5056                             "\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
5057                             "\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
5058                             "\x1a\x8e\x25\xbc\x30\xc7\x5e\xf5"
5059                             "\x69\x00\x97\x0b\xa2\x39\xd0\x44"
5060                             "\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
5061                             "\x4d\xe4\x58\xef\x86\x1d\x91\x28"
5062                             "\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
5063                             "\x0e\xa5\x3c\xd3\x47\xde\x75\x0c"
5064                             "\x80\x17\xae\x22\xb9\x50\xe7\x5b"
5065                             "\xf2\x89\x20\x94\x2b\xc2\x36\xcd"
5066                             "\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
5067                             "\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
5068                             "\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
5069                             "\x97\x2e\xc5\x39\xd0\x67\xfe\x72"
5070                             "\x09\xa0\x14\xab\x42\xd9\x4d\xe4"
5071                             "\x7b\x12\x86\x1d\xb4\x28\xbf\x56"
5072                             "\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
5073                             "\x3c\xd3\x6a\x01\x75\x0c\xa3\x17"
5074                             "\xae\x45\xdc\x50\xe7\x7e\x15\x89"
5075                             "\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
5076                             "\x92\x06\x9d\x34\xcb\x3f\xd6\x6d"
5077                             "\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
5078                             "\x53\xea\x81\x18\x8c\x23\xba\x2e"
5079                             "\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
5080                             "\x37\xce\x42\xd9\x70\x07\x7b\x12"
5081                             "\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
5082                             "\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
5083                             "\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
5084                             "\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
5085                             "\x4e\xe5\x59\xf0\x87\x1e\x92\x29"
5086                             "\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
5087                             "\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
5088                             "\x81\x18\xaf\x23\xba\x51\xe8\x5c"
5089                             "\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
5090                             "\x65\xfc\x70\x07\x9e\x12\xa9\x40"
5091                             "\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
5092                             "\x26\xbd\x54\xeb\x5f\xf6\x8d\x01"
5093                             "\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
5094                             "\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
5095                             "\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
5096                             "\xee\x62\xf9\x90\x04\x9b\x32\xc9"
5097                             "\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
5098                             "\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
5099                             "\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
5100                             "\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
5101                             "\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
5102                             "\x54\xeb\x82\x19\x8d\x24\xbb\x2f"
5103                             "\xc6\x5d\xf4\x68\xff\x96\x0a\xa1"
5104                             "\x38\xcf\x43\xda\x71\x08\x7c\x13"
5105                             "\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
5106                             "\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
5107                             "\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
5108                             "\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
5109                             "\x4f\xe6\x5a\xf1\x88\x1f\x93\x2a"
5110                             "\xc1\x35\xcc\x63\xfa\x6e\x05\x9c"
5111                             "\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
5112                             "\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
5113                             "\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
5114                             "\x66\xfd\x71\x08\x9f\x13\xaa\x41"
5115                             "\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
5116                             "\x27\xbe\x55\xec\x60\xf7\x8e\x02"
5117                             "\x99\x30\xc7\x3b\xd2\x69\x00\x74"
5118                             "\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
5119                             "\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
5120                             "\xef\x63\xfa\x91\x05\x9c\x33\xca"
5121                             "\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
5122                             "\xb0\x47\xde\x52\xe9\x80\x17\x8b"
5123                             "\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
5124                             "\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
5125                             "\x06\x7a\x11\xa8\x1c\xb3\x4a\xe1"
5126                             "\x55\xec\x83\x1a\x8e\x25\xbc\x30"
5127                             "\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
5128                             "\x39\xd0\x44\xdb\x72\x09\x7d\x14"
5129                             "\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
5130                             "\x1d\x91\x28\xbf\x33\xca\x61\xf8"
5131                             "\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
5132                             "\xde\x75\x0c\x80\x17\xae\x22\xb9"
5133                             "\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
5134                             "\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
5135                             "\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
5136                             "\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
5137                             "\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
5138                             "\x67\xfe\x72\x09\xa0\x14\xab\x42"
5139                             "\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
5140                             "\x28\xbf\x56\xed\x61\xf8\x8f\x03"
5141                             "\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
5142                             "\x0c\xa3\x17\xae\x45\xdc\x50\xe7"
5143                             "\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
5144                             "\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
5145                             "\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
5146                             "\xb1\x48\xdf\x53\xea\x81\x18\x8c"
5147                             "\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
5148                             "\x95\x09\xa0\x37\xce\x42\xd9\x70"
5149                             "\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
5150                             "\x56\xed\x84\x1b\x8f\x26\xbd\x31"
5151                             "\xc8\x5f\xf6\x6a\x01\x98\x0c\xa3"
5152                             "\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
5153                             "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
5154                             "\x1e\x92\x29\xc0\x34\xcb\x62\xf9"
5155                             "\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
5156                             "\xdf\x76\x0d\x81\x18\xaf\x23\xba"
5157                             "\x51\xe8\x5c\xf3\x8a\x21\x95\x2c"
5158                             "\xc3\x37\xce\x65\xfc\x70\x07\x9e"
5159                             "\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
5160                             "\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
5161                             "\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
5162                             "\x68\xff\x73\x0a\xa1\x15\xac\x43"
5163                             "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
5164                             "\x29\xc0\x57\xee\x62\xf9\x90\x04"
5165                             "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
5166                             "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
5167                             "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
5168                             "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
5169                             "\x40\xd7\x6e\x05\x79\x10\xa7\x1b"
5170                             "\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
5171                             "\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
5172                             "\x96\x0a\xa1\x38\xcf\x43\xda\x71"
5173                             "\x08\x7c\x13\xaa\x1e\xb5\x4c",
5174                .psize     = 1023,
5175                .digest    = "\x76\xc9\xd4\x91\x7a\x5f\x0f\xaa"
5176                             "\x13\x39\xf3\x01\x7a\xfa\xe5\x41"
5177                             "\x5f\x0b\xf8\xeb\x32\xfc\xbf\xb0"
5178                             "\xfa\x8c\xcd\x17\x83\xe2\xfa\xeb"
5179                             "\x1c\x19\xde\xe2\x75\xdc\x34\x64"
5180                             "\x5f\x35\x9c\x61\x2f\x10\xf9\xec"
5181                             "\x59\xca\x9d\xcc\x25\x0c\x43\xba"
5182                             "\x85\xa8\xf8\xfe\xb5\x24\xb2\xee",
5183        }
5184};
5185
5186
5187/*
5188 * WHIRLPOOL test vectors from Whirlpool package
5189 * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
5190 * submission
5191 */
5192static const struct hash_testvec wp512_tv_template[] = {
5193        {
5194                .plaintext = "",
5195                .psize  = 0,
5196                .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
5197                          "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
5198                          "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
5199                          "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
5200                          "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
5201                          "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57"
5202                          "\xEA\x89\x64\xE5\x9B\x63\xD9\x37"
5203                          "\x08\xB1\x38\xCC\x42\xA6\x6E\xB3",
5204
5205
5206        }, {
5207                .plaintext = "a",
5208                .psize  = 1,
5209                .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
5210                          "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
5211                          "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
5212                          "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
5213                          "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
5214                          "\x3A\x42\x39\x1A\x39\x14\x5A\x59"
5215                          "\x1A\x92\x20\x0D\x56\x01\x95\xE5"
5216                          "\x3B\x47\x85\x84\xFD\xAE\x23\x1A",
5217        }, {
5218                .plaintext = "abc",
5219                .psize  = 3,
5220                .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
5221                          "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
5222                          "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
5223                          "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
5224                          "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
5225                          "\x7D\x0E\x34\x95\x71\x14\xCB\xD6"
5226                          "\xC7\x97\xFC\x9D\x95\xD8\xB5\x82"
5227                          "\xD2\x25\x29\x20\x76\xD4\xEE\xF5",
5228        }, {
5229                .plaintext = "message digest",
5230                .psize  = 14,
5231                .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
5232                          "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
5233                          "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
5234                          "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
5235                          "\x84\x21\x55\x76\x59\xEF\x55\xC1"
5236                          "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6"
5237                          "\x92\xED\x92\x00\x52\x83\x8F\x33"
5238                          "\x62\xE8\x6D\xBD\x37\xA8\x90\x3E",
5239        }, {
5240                .plaintext = "abcdefghijklmnopqrstuvwxyz",
5241                .psize  = 26,
5242                .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
5243                          "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
5244                          "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
5245                          "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
5246                          "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
5247                          "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6"
5248                          "\xF6\x8F\x67\x3E\x72\x07\x86\x5D"
5249                          "\x5D\x98\x19\xA3\xDB\xA4\xEB\x3B",
5250        }, {
5251                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5252                           "abcdefghijklmnopqrstuvwxyz0123456789",
5253                .psize  = 62,
5254                .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
5255                          "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
5256                          "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
5257                          "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
5258                          "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
5259                          "\xB7\xCB\x57\x21\x1B\x92\x81\xA6"
5260                          "\x55\x17\xCC\x87\x9D\x7B\x96\x21"
5261                          "\x42\xC6\x5F\x5A\x7A\xF0\x14\x67",
5262        }, {
5263                .plaintext = "1234567890123456789012345678901234567890"
5264                           "1234567890123456789012345678901234567890",
5265                .psize  = 80,
5266                .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
5267                          "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
5268                          "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
5269                          "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
5270                          "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
5271                          "\x38\xCD\x04\x7B\x26\x81\xA5\x1A"
5272                          "\x2C\x60\x48\x1E\x88\xC5\xA2\x0B"
5273                          "\x2C\x2A\x80\xCF\x3A\x9A\x08\x3B",
5274        }, {
5275                .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
5276                .psize  = 32,
5277                .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
5278                          "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
5279                          "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
5280                          "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
5281                          "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
5282                          "\x7B\x94\x76\x39\xFE\x05\x0B\x56"
5283                          "\x93\x9B\xAA\xA0\xAD\xFF\x9A\xE6"
5284                          "\x74\x5B\x7B\x18\x1C\x3B\xE3\xFD",
5285        },
5286};
5287
5288static const struct hash_testvec wp384_tv_template[] = {
5289        {
5290                .plaintext = "",
5291                .psize  = 0,
5292                .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
5293                          "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
5294                          "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
5295                          "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
5296                          "\x3E\x83\xBE\x69\x8B\x28\x8F\xEB"
5297                          "\xCF\x88\xE3\xE0\x3C\x4F\x07\x57",
5298
5299
5300        }, {
5301                .plaintext = "a",
5302                .psize  = 1,
5303                .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
5304                          "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
5305                          "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
5306                          "\x73\xC4\x50\x01\xD0\x08\x7B\x42"
5307                          "\xD1\x1B\xC6\x45\x41\x3A\xEF\xF6"
5308                          "\x3A\x42\x39\x1A\x39\x14\x5A\x59",
5309        }, {
5310                .plaintext = "abc",
5311                .psize  = 3,
5312                .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
5313                          "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
5314                          "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
5315                          "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C"
5316                          "\x71\x81\xEE\xBD\xB6\xC5\x7E\x27"
5317                          "\x7D\x0E\x34\x95\x71\x14\xCB\xD6",
5318        }, {
5319                .plaintext = "message digest",
5320                .psize  = 14,
5321                .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
5322                          "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
5323                          "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
5324                          "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B"
5325                          "\x84\x21\x55\x76\x59\xEF\x55\xC1"
5326                          "\x06\xB4\xB5\x2A\xC5\xA4\xAA\xA6",
5327        }, {
5328                .plaintext = "abcdefghijklmnopqrstuvwxyz",
5329                .psize  = 26,
5330                .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
5331                          "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
5332                          "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
5333                          "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B"
5334                          "\x08\xBF\x2A\x92\x51\xC3\x0B\x6A"
5335                          "\x0B\x8A\xAE\x86\x17\x7A\xB4\xA6",
5336        }, {
5337                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5338                           "abcdefghijklmnopqrstuvwxyz0123456789",
5339                .psize  = 62,
5340                .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
5341                          "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
5342                          "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
5343                          "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E"
5344                          "\x08\xEB\xA2\x66\x29\x12\x9D\x8F"
5345                          "\xB7\xCB\x57\x21\x1B\x92\x81\xA6",
5346        }, {
5347                .plaintext = "1234567890123456789012345678901234567890"
5348                           "1234567890123456789012345678901234567890",
5349                .psize  = 80,
5350                .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
5351                          "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
5352                          "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
5353                          "\x54\x9C\x4A\xFA\xDB\x60\x14\x29"
5354                          "\x4D\x5B\xD8\xDF\x2A\x6C\x44\xE5"
5355                          "\x38\xCD\x04\x7B\x26\x81\xA5\x1A",
5356        }, {
5357                .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
5358                .psize  = 32,
5359                .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
5360                          "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
5361                          "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
5362                          "\x07\xC5\x62\xF9\x88\xE9\x5C\x69"
5363                          "\x16\xBD\xC8\x03\x1B\xC5\xBE\x1B"
5364                          "\x7B\x94\x76\x39\xFE\x05\x0B\x56",
5365        },
5366};
5367
5368static const struct hash_testvec wp256_tv_template[] = {
5369        {
5370                .plaintext = "",
5371                .psize  = 0,
5372                .digest = "\x19\xFA\x61\xD7\x55\x22\xA4\x66"
5373                          "\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
5374                          "\xC5\x30\x23\x21\x30\xD4\x07\xF8"
5375                          "\x9A\xFE\xE0\x96\x49\x97\xF7\xA7",
5376
5377
5378        }, {
5379                .plaintext = "a",
5380                .psize  = 1,
5381                .digest = "\x8A\xCA\x26\x02\x79\x2A\xEC\x6F"
5382                          "\x11\xA6\x72\x06\x53\x1F\xB7\xD7"
5383                          "\xF0\xDF\xF5\x94\x13\x14\x5E\x69"
5384                          "\x73\xC4\x50\x01\xD0\x08\x7B\x42",
5385        }, {
5386                .plaintext = "abc",
5387                .psize  = 3,
5388                .digest = "\x4E\x24\x48\xA4\xC6\xF4\x86\xBB"
5389                          "\x16\xB6\x56\x2C\x73\xB4\x02\x0B"
5390                          "\xF3\x04\x3E\x3A\x73\x1B\xCE\x72"
5391                          "\x1A\xE1\xB3\x03\xD9\x7E\x6D\x4C",
5392        }, {
5393                .plaintext = "message digest",
5394                .psize  = 14,
5395                .digest = "\x37\x8C\x84\xA4\x12\x6E\x2D\xC6"
5396                          "\xE5\x6D\xCC\x74\x58\x37\x7A\xAC"
5397                          "\x83\x8D\x00\x03\x22\x30\xF5\x3C"
5398                          "\xE1\xF5\x70\x0C\x0F\xFB\x4D\x3B",
5399        }, {
5400                .plaintext = "abcdefghijklmnopqrstuvwxyz",
5401                .psize  = 26,
5402                .digest = "\xF1\xD7\x54\x66\x26\x36\xFF\xE9"
5403                          "\x2C\x82\xEB\xB9\x21\x2A\x48\x4A"
5404                          "\x8D\x38\x63\x1E\xAD\x42\x38\xF5"
5405                          "\x44\x2E\xE1\x3B\x80\x54\xE4\x1B",
5406        }, {
5407                .plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5408                           "abcdefghijklmnopqrstuvwxyz0123456789",
5409                .psize  = 62,
5410                .digest = "\xDC\x37\xE0\x08\xCF\x9E\xE6\x9B"
5411                          "\xF1\x1F\x00\xED\x9A\xBA\x26\x90"
5412                          "\x1D\xD7\xC2\x8C\xDE\xC0\x66\xCC"
5413                          "\x6A\xF4\x2E\x40\xF8\x2F\x3A\x1E",
5414        }, {
5415                .plaintext = "1234567890123456789012345678901234567890"
5416                           "1234567890123456789012345678901234567890",
5417                .psize  = 80,
5418                .digest = "\x46\x6E\xF1\x8B\xAB\xB0\x15\x4D"
5419                          "\x25\xB9\xD3\x8A\x64\x14\xF5\xC0"
5420                          "\x87\x84\x37\x2B\xCC\xB2\x04\xD6"
5421                          "\x54\x9C\x4A\xFA\xDB\x60\x14\x29",
5422        }, {
5423                .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
5424                .psize  = 32,
5425                .digest = "\x2A\x98\x7E\xA4\x0F\x91\x70\x61"
5426                          "\xF5\xD6\xF0\xA0\xE4\x64\x4F\x48"
5427                          "\x8A\x7A\x5A\x52\xDE\xEE\x65\x62"
5428                          "\x07\xC5\x62\xF9\x88\xE9\x5C\x69",
5429        },
5430};
5431
5432static const struct hash_testvec ghash_tv_template[] =
5433{
5434        {
5435                .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03"
5436                          "\xff\xca\xff\x95\xf8\x30\xf0\x61",
5437                .ksize  = 16,
5438                .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
5439                             "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
5440                .psize  = 16,
5441                .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
5442                          "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
5443        }, {
5444                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5445                          "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5446                .ksize  = 16,
5447                .plaintext = "what do ya want for nothing?",
5448                .psize  = 28,
5449                .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce"
5450                          "\x0d\x61\x06\x27\x66\x51\xd5\xe2",
5451        }, {
5452                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5453                          "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5454                .ksize  = 16,
5455                .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5456                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5457                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5458                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5459                .psize  = 50,
5460                .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96"
5461                          "\xe1\x96\xe1\x96\xe1\x96\xe1\x96",
5462        }, {
5463                .key    = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
5464                          "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
5465                .ksize  = 16,
5466                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5467                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5468                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5469                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5470                .psize  = 50,
5471                .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2"
5472                          "\x49\xed\x6e\x32\x7a\xa9\xbe\x08",
5473        }, {
5474                .key    = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
5475                          "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
5476                .ksize  = 16,
5477                .plaintext = "Test With Truncation",
5478                .psize  = 20,
5479                .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28"
5480                          "\x23\xf7\x93\xf7\x19\xf5\x96\xd9",
5481        }, {
5482                .key    = "\x0a\x1b\x2c\x3d\x4e\x5f\x64\x71"
5483                        "\x82\x93\xa4\xb5\xc6\xd7\xe8\xf9",
5484                .ksize  = 16,
5485                .plaintext = "\x56\x6f\x72\x20\x6c\x61\x75\x74"
5486                        "\x65\x72\x20\x4c\x61\x75\x73\x63"
5487                        "\x68\x65\x6e\x20\x75\x6e\x64\x20"
5488                        "\x53\x74\x61\x75\x6e\x65\x6e\x20"
5489                        "\x73\x65\x69\x20\x73\x74\x69\x6c"
5490                        "\x6c\x2c\x0a\x64\x75\x20\x6d\x65"
5491                        "\x69\x6e\x20\x74\x69\x65\x66\x74"
5492                        "\x69\x65\x66\x65\x73\x20\x4c\x65"
5493                        "\x62\x65\x6e\x3b\x0a\x64\x61\x73"
5494                        "\x73\x20\x64\x75\x20\x77\x65\x69"
5495                        "\xc3\x9f\x74\x20\x77\x61\x73\x20"
5496                        "\x64\x65\x72\x20\x57\x69\x6e\x64"
5497                        "\x20\x64\x69\x72\x20\x77\x69\x6c"
5498                        "\x6c\x2c\x0a\x65\x68\x20\x6e\x6f"
5499                        "\x63\x68\x20\x64\x69\x65\x20\x42"
5500                        "\x69\x72\x6b\x65\x6e\x20\x62\x65"
5501                        "\x62\x65\x6e\x2e\x0a\x0a\x55\x6e"
5502                        "\x64\x20\x77\x65\x6e\x6e\x20\x64"
5503                        "\x69\x72\x20\x65\x69\x6e\x6d\x61"
5504                        "\x6c\x20\x64\x61\x73\x20\x53\x63"
5505                        "\x68\x77\x65\x69\x67\x65\x6e\x20"
5506                        "\x73\x70\x72\x61\x63\x68\x2c\x0a"
5507                        "\x6c\x61\x73\x73\x20\x64\x65\x69"
5508                        "\x6e\x65\x20\x53\x69\x6e\x6e\x65"
5509                        "\x20\x62\x65\x73\x69\x65\x67\x65"
5510                        "\x6e\x2e\x0a\x4a\x65\x64\x65\x6d"
5511                        "\x20\x48\x61\x75\x63\x68\x65\x20"
5512                        "\x67\x69\x62\x74\x20\x64\x69\x63"
5513                        "\x68\x2c\x20\x67\x69\x62\x20\x6e"
5514                        "\x61\x63\x68\x2c\x0a\x65\x72\x20"
5515                        "\x77\x69\x72\x64\x20\x64\x69\x63"
5516                        "\x68\x20\x6c\x69\x65\x62\x65\x6e"
5517                        "\x20\x75\x6e\x64\x20\x77\x69\x65"
5518                        "\x67\x65\x6e\x2e\x0a\x0a\x55\x6e"
5519                        "\x64\x20\x64\x61\x6e\x6e\x20\x6d"
5520                        "\x65\x69\x6e\x65\x20\x53\x65\x65"
5521                        "\x6c\x65\x20\x73\x65\x69\x74\x20"
5522                        "\x77\x65\x69\x74\x2c\x20\x73\x65"
5523                        "\x69\x20\x77\x65\x69\x74\x2c\x0a"
5524                        "\x64\x61\x73\x73\x20\x64\x69\x72"
5525                        "\x20\x64\x61\x73\x20\x4c\x65\x62"
5526                        "\x65\x6e\x20\x67\x65\x6c\x69\x6e"
5527                        "\x67\x65\x2c\x0a\x62\x72\x65\x69"
5528                        "\x74\x65\x20\x64\x69\x63\x68\x20"
5529                        "\x77\x69\x65\x20\x65\x69\x6e\x20"
5530                        "\x46\x65\x69\x65\x72\x6b\x6c\x65"
5531                        "\x69\x64\x0a\xc3\xbc\x62\x65\x72"
5532                        "\x20\x64\x69\x65\x20\x73\x69\x6e"
5533                        "\x6e\x65\x6e\x64\x65\x6e\x20\x44"
5534                        "\x69\x6e\x67\x65\x2e\x2e\x2e\x0a",
5535                .psize  = 400,
5536                .digest = "\xad\xb1\xc1\xe9\x56\x70\x31\x1d"
5537                        "\xbb\x5b\xdf\x5e\x70\x72\x1a\x57",
5538        },
5539};
5540
5541/*
5542 * HMAC-MD5 test vectors from RFC2202
5543 * (These need to be fixed to not use strlen).
5544 */
5545static const struct hash_testvec hmac_md5_tv_template[] =
5546{
5547        {
5548                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5549                .ksize  = 16,
5550                .plaintext = "Hi There",
5551                .psize  = 8,
5552                .digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c"
5553                          "\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d",
5554        }, {
5555                .key    = "Jefe",
5556                .ksize  = 4,
5557                .plaintext = "what do ya want for nothing?",
5558                .psize  = 28,
5559                .digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03"
5560                          "\xea\xa8\x6e\x31\x0a\x5d\xb7\x38",
5561        }, {
5562                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5563                .ksize  = 16,
5564                .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5565                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5566                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5567                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5568                .psize  = 50,
5569                .digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88"
5570                          "\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6",
5571        }, {
5572                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5573                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5574                          "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5575                .ksize  = 25,
5576                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5577                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5578                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5579                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5580                .psize  = 50,
5581                .digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea"
5582                          "\x3a\x75\x16\x47\x46\xff\xaa\x79",
5583        }, {
5584                .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5585                .ksize  = 16,
5586                .plaintext = "Test With Truncation",
5587                .psize  = 20,
5588                .digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00"
5589                          "\xf9\xba\xb9\x95\x69\x0e\xfd\x4c",
5590        }, {
5591                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5592                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5593                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5594                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5595                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5596                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5597                        "\xaa\xaa",
5598                .ksize  = 80,
5599                .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5600                .psize  = 54,
5601                .digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f"
5602                          "\x0b\x62\xe6\xce\x61\xb9\xd0\xcd",
5603        }, {
5604                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5605                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5606                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5607                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5608                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5609                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5610                        "\xaa\xaa",
5611                .ksize  = 80,
5612                .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5613                           "Block-Size Data",
5614                .psize  = 73,
5615                .digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee"
5616                          "\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e",
5617        },
5618};
5619
5620/*
5621 * HMAC-RIPEMD160 test vectors from RFC2286
5622 */
5623static const struct hash_testvec hmac_rmd160_tv_template[] = {
5624        {
5625                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5626                .ksize  = 20,
5627                .plaintext = "Hi There",
5628                .psize  = 8,
5629                .digest = "\x24\xcb\x4b\xd6\x7d\x20\xfc\x1a\x5d\x2e"
5630                          "\xd7\x73\x2d\xcc\x39\x37\x7f\x0a\x56\x68",
5631        }, {
5632                .key    = "Jefe",
5633                .ksize  = 4,
5634                .plaintext = "what do ya want for nothing?",
5635                .psize  = 28,
5636                .digest = "\xdd\xa6\xc0\x21\x3a\x48\x5a\x9e\x24\xf4"
5637                          "\x74\x20\x64\xa7\xf0\x33\xb4\x3c\x40\x69",
5638        }, {
5639                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5640                .ksize  = 20,
5641                .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5642                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5643                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5644                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5645                .psize  = 50,
5646                .digest = "\xb0\xb1\x05\x36\x0d\xe7\x59\x96\x0a\xb4"
5647                          "\xf3\x52\x98\xe1\x16\xe2\x95\xd8\xe7\xc1",
5648        }, {
5649                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5650                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5651                          "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5652                .ksize  = 25,
5653                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5654                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5655                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5656                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5657                .psize  = 50,
5658                .digest = "\xd5\xca\x86\x2f\x4d\x21\xd5\xe6\x10\xe1"
5659                          "\x8b\x4c\xf1\xbe\xb9\x7a\x43\x65\xec\xf4",
5660        }, {
5661                .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5662                .ksize  = 20,
5663                .plaintext = "Test With Truncation",
5664                .psize  = 20,
5665                .digest = "\x76\x19\x69\x39\x78\xf9\x1d\x90\x53\x9a"
5666                          "\xe7\x86\x50\x0f\xf3\xd8\xe0\x51\x8e\x39",
5667        }, {
5668                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5669                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5670                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5671                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5672                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5673                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5674                        "\xaa\xaa",
5675                .ksize  = 80,
5676                .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5677                .psize  = 54,
5678                .digest = "\x64\x66\xca\x07\xac\x5e\xac\x29\xe1\xbd"
5679                          "\x52\x3e\x5a\xda\x76\x05\xb7\x91\xfd\x8b",
5680        }, {
5681                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5682                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5683                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5684                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5685                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5686                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5687                        "\xaa\xaa",
5688                .ksize  = 80,
5689                .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5690                           "Block-Size Data",
5691                .psize  = 73,
5692                .digest = "\x69\xea\x60\x79\x8d\x71\x61\x6c\xce\x5f"
5693                          "\xd0\x87\x1e\x23\x75\x4c\xd7\x5d\x5a\x0a",
5694        },
5695};
5696
5697/*
5698 * HMAC-SHA1 test vectors from RFC2202
5699 */
5700static const struct hash_testvec hmac_sha1_tv_template[] = {
5701        {
5702                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
5703                .ksize  = 20,
5704                .plaintext = "Hi There",
5705                .psize  = 8,
5706                .digest = "\xb6\x17\x31\x86\x55\x05\x72\x64"
5707                          "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
5708                          "\x46\xbe",
5709        }, {
5710                .key    = "Jefe",
5711                .ksize  = 4,
5712                .plaintext = "what do ya want for nothing?",
5713                .psize  = 28,
5714                .digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74"
5715                          "\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79",
5716        }, {
5717                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5718                .ksize  = 20,
5719                .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5720                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5721                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5722                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5723                .psize  = 50,
5724                .digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3"
5725                          "\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3",
5726        }, {
5727                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5728                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5729                          "\x11\x12\x13\x14\x15\x16\x17\x18\x19",
5730                .ksize  = 25,
5731                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5732                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5733                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5734                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5735                .psize  = 50,
5736                .digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84"
5737                          "\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda",
5738        }, {
5739                .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
5740                .ksize  = 20,
5741                .plaintext = "Test With Truncation",
5742                .psize  = 20,
5743                .digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2"
5744                          "\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04",
5745        }, {
5746                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5747                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5748                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5749                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5750                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5751                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5752                        "\xaa\xaa",
5753                .ksize  = 80,
5754                .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5755                .psize  = 54,
5756                .digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70"
5757                          "\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12",
5758        }, {
5759                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5760                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5761                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5762                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5763                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5764                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5765                        "\xaa\xaa",
5766                .ksize  = 80,
5767                .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
5768                           "Block-Size Data",
5769                .psize  = 73,
5770                .digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b"
5771                          "\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91",
5772        },
5773};
5774
5775
5776/*
5777 * SHA224 HMAC test vectors from RFC4231
5778 */
5779static const struct hash_testvec hmac_sha224_tv_template[] = {
5780        {
5781                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5782                        "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5783                        "\x0b\x0b\x0b\x0b",
5784                .ksize  = 20,
5785                /*  ("Hi There") */
5786                .plaintext = "\x48\x69\x20\x54\x68\x65\x72\x65",
5787                .psize  = 8,
5788                .digest = "\x89\x6f\xb1\x12\x8a\xbb\xdf\x19"
5789                        "\x68\x32\x10\x7c\xd4\x9d\xf3\x3f"
5790                        "\x47\xb4\xb1\x16\x99\x12\xba\x4f"
5791                        "\x53\x68\x4b\x22",
5792        }, {
5793                .key    = "Jefe",
5794                .ksize  = 4,
5795                /* ("what do ya want for nothing?") */
5796                .plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
5797                        "\x79\x61\x20\x77\x61\x6e\x74\x20"
5798                        "\x66\x6f\x72\x20\x6e\x6f\x74\x68"
5799                        "\x69\x6e\x67\x3f",
5800                .psize  = 28,
5801                .digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
5802                        "\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
5803                        "\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
5804                        "\x8f\xd0\x5e\x44",
5805        }, {
5806                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5807                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5808                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5809                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5810                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5811                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5812                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5813                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5814                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5815                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5816                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5817                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5818                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5819                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5820                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5821                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5822                        "\xaa\xaa\xaa",
5823                .ksize  = 131,
5824                /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
5825                .plaintext = "\x54\x65\x73\x74\x20\x55\x73\x69"
5826                        "\x6e\x67\x20\x4c\x61\x72\x67\x65"
5827                        "\x72\x20\x54\x68\x61\x6e\x20\x42"
5828                        "\x6c\x6f\x63\x6b\x2d\x53\x69\x7a"
5829                        "\x65\x20\x4b\x65\x79\x20\x2d\x20"
5830                        "\x48\x61\x73\x68\x20\x4b\x65\x79"
5831                        "\x20\x46\x69\x72\x73\x74",
5832                .psize  = 54,
5833                .digest = "\x95\xe9\xa0\xdb\x96\x20\x95\xad"
5834                        "\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
5835                        "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27"
5836                        "\x3f\xa6\x87\x0e",
5837        }, {
5838                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5839                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5840                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5841                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5842                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5843                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5844                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5845                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5846                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5847                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5848                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5849                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5850                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5851                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5852                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5853                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5854                        "\xaa\xaa\xaa",
5855                .ksize  = 131,
5856                /* ("This is a test using a larger than block-size key and a")
5857                (" larger than block-size data. The key needs to be")
5858                        (" hashed before being used by the HMAC algorithm.") */
5859                .plaintext = "\x54\x68\x69\x73\x20\x69\x73\x20"
5860                        "\x61\x20\x74\x65\x73\x74\x20\x75"
5861                        "\x73\x69\x6e\x67\x20\x61\x20\x6c"
5862                        "\x61\x72\x67\x65\x72\x20\x74\x68"
5863                        "\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
5864                        "\x2d\x73\x69\x7a\x65\x20\x6b\x65"
5865                        "\x79\x20\x61\x6e\x64\x20\x61\x20"
5866                        "\x6c\x61\x72\x67\x65\x72\x20\x74"
5867                        "\x68\x61\x6e\x20\x62\x6c\x6f\x63"
5868                        "\x6b\x2d\x73\x69\x7a\x65\x20\x64"
5869                        "\x61\x74\x61\x2e\x20\x54\x68\x65"
5870                        "\x20\x6b\x65\x79\x20\x6e\x65\x65"
5871                        "\x64\x73\x20\x74\x6f\x20\x62\x65"
5872                        "\x20\x68\x61\x73\x68\x65\x64\x20"
5873                        "\x62\x65\x66\x6f\x72\x65\x20\x62"
5874                        "\x65\x69\x6e\x67\x20\x75\x73\x65"
5875                        "\x64\x20\x62\x79\x20\x74\x68\x65"
5876                        "\x20\x48\x4d\x41\x43\x20\x61\x6c"
5877                        "\x67\x6f\x72\x69\x74\x68\x6d\x2e",
5878                .psize  = 152,
5879                .digest = "\x3a\x85\x41\x66\xac\x5d\x9f\x02"
5880                        "\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
5881                        "\x94\x67\x70\xdb\x9c\x2b\x95\xc9"
5882                        "\xf6\xf5\x65\xd1",
5883        },
5884};
5885
5886/*
5887 * HMAC-SHA256 test vectors from
5888 * draft-ietf-ipsec-ciph-sha-256-01.txt
5889 */
5890static const struct hash_testvec hmac_sha256_tv_template[] = {
5891        {
5892                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5893                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5894                          "\x11\x12\x13\x14\x15\x16\x17\x18"
5895                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5896                .ksize  = 32,
5897                .plaintext = "abc",
5898                .psize  = 3,
5899                .digest = "\xa2\x1b\x1f\x5d\x4c\xf4\xf7\x3a"
5900                          "\x4d\xd9\x39\x75\x0f\x7a\x06\x6a"
5901                          "\x7f\x98\xcc\x13\x1c\xb1\x6a\x66"
5902                          "\x92\x75\x90\x21\xcf\xab\x81\x81",
5903        }, {
5904                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5905                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5906                          "\x11\x12\x13\x14\x15\x16\x17\x18"
5907                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5908                .ksize  = 32,
5909                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
5910                .psize  = 56,
5911                .digest = "\x10\x4f\xdc\x12\x57\x32\x8f\x08"
5912                          "\x18\x4b\xa7\x31\x31\xc5\x3c\xae"
5913                          "\xe6\x98\xe3\x61\x19\x42\x11\x49"
5914                          "\xea\x8c\x71\x24\x56\x69\x7d\x30",
5915        }, {
5916                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5917                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5918                          "\x11\x12\x13\x14\x15\x16\x17\x18"
5919                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20",
5920                .ksize  = 32,
5921                .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
5922                           "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
5923                .psize  = 112,
5924                .digest = "\x47\x03\x05\xfc\x7e\x40\xfe\x34"
5925                          "\xd3\xee\xb3\xe7\x73\xd9\x5a\xab"
5926                          "\x73\xac\xf0\xfd\x06\x04\x47\xa5"
5927                          "\xeb\x45\x95\xbf\x33\xa9\xd1\xa3",
5928        }, {
5929                .key    = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5930                        "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
5931                        "\x0b\x0b\x0b\x0b\x0b\x0b",
5932                .ksize  = 32,
5933                .plaintext = "Hi There",
5934                .psize  = 8,
5935                .digest = "\x19\x8a\x60\x7e\xb4\x4b\xfb\xc6"
5936                          "\x99\x03\xa0\xf1\xcf\x2b\xbd\xc5"
5937                          "\xba\x0a\xa3\xf3\xd9\xae\x3c\x1c"
5938                          "\x7a\x3b\x16\x96\xa0\xb6\x8c\xf7",
5939        }, {
5940                .key    = "Jefe",
5941                .ksize  = 4,
5942                .plaintext = "what do ya want for nothing?",
5943                .psize  = 28,
5944                .digest = "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e"
5945                          "\x6a\x04\x24\x26\x08\x95\x75\xc7"
5946                          "\x5a\x00\x3f\x08\x9d\x27\x39\x83"
5947                          "\x9d\xec\x58\xb9\x64\xec\x38\x43",
5948        }, {
5949                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5950                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5951                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
5952                .ksize  = 32,
5953                .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5954                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5955                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
5956                        "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
5957                .psize  = 50,
5958                .digest = "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
5959                          "\x91\xe5\x3a\xba\x30\x92\xf9\x62"
5960                          "\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
5961                          "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
5962        }, {
5963                .key    = "\x01\x02\x03\x04\x05\x06\x07\x08"
5964                          "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
5965                          "\x11\x12\x13\x14\x15\x16\x17\x18"
5966                          "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
5967                          "\x21\x22\x23\x24\x25",
5968                .ksize  = 37,
5969                .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5970                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5971                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
5972                        "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
5973                .psize  = 50,
5974                .digest = "\xd4\x63\x3c\x17\xf6\xfb\x8d\x74"
5975                          "\x4c\x66\xde\xe0\xf8\xf0\x74\x55"
5976                          "\x6e\xc4\xaf\x55\xef\x07\x99\x85"
5977                          "\x41\x46\x8e\xb4\x9b\xd2\xe9\x17",
5978        }, {
5979                .key    = "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
5980                        "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
5981                        "\x0c\x0c\x0c\x0c\x0c\x0c",
5982                .ksize  = 32,
5983                .plaintext = "Test With Truncation",
5984                .psize  = 20,
5985                .digest = "\x75\x46\xaf\x01\x84\x1f\xc0\x9b"
5986                          "\x1a\xb9\xc3\x74\x9a\x5f\x1c\x17"
5987                          "\xd4\xf5\x89\x66\x8a\x58\x7b\x27"
5988                          "\x00\xa9\xc9\x7c\x11\x93\xcf\x42",
5989        }, {
5990                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5991                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5992                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5993                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5994                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5995                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
5996                        "\xaa\xaa",
5997                .ksize  = 80,
5998                .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
5999                .psize  = 54,
6000                .digest = "\x69\x53\x02\x5e\xd9\x6f\x0c\x09"
6001                          "\xf8\x0a\x96\xf7\x8e\x65\x38\xdb"
6002                          "\xe2\xe7\xb8\x20\xe3\xdd\x97\x0e"
6003                          "\x7d\xdd\x39\x09\x1b\x32\x35\x2f",
6004        }, {
6005                .key    = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6006                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6007                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6008                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6009                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6010                        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
6011                        "\xaa\xaa",
6012                .ksize  = 80,
6013                .plaintext = "Test Using Larger Than Block-Size Key and Larger Than "
6014                           "One Block-Size Data",
6015                .psize  = 73,
6016                .digest = "\x63\x55\xac\x22\xe8\x90\xd0\xa3"
6017                          "\xc8\x48\x1a\x5c\xa4\x82\x5b\xc8"
6018                          "\x84\xd3\xe7\xa1\xff\x98\xa2\xfc"
6019                          "\x2a\xc7\xd8\xe0\x64\xc3\xb2\xe6",
6020        },
6021};
6022
6023static const struct hash_testvec aes_cmac128_tv_template[] = {
6024        { /* From NIST Special Publication 800-38B, AES-128 */
6025                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6026                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6027                .plaintext      = zeroed_string,
6028                .digest         = "\xbb\x1d\x69\x29\xe9\x59\x37\x28"
6029                                  "\x7f\xa3\x7d\x12\x9b\x75\x67\x46",
6030                .psize          = 0,
6031                .ksize          = 16,
6032        }, {
6033                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6034                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6035                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6036                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
6037                .digest         = "\x07\x0a\x16\xb4\x6b\x4d\x41\x44"
6038                                  "\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c",
6039                .psize          = 16,
6040                .ksize          = 16,
6041        }, {
6042                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6043                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6044                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6045                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6046                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6047                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6048                                  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11",
6049                .digest         = "\xdf\xa6\x67\x47\xde\x9a\xe6\x30"
6050                                  "\x30\xca\x32\x61\x14\x97\xc8\x27",
6051                .psize          = 40,
6052                .ksize          = 16,
6053        }, {
6054                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6055                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6056                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6057                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6058                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6059                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6060                                  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6061                                  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6062                                  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6063                                  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6064                .digest         = "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92"
6065                                  "\xfc\x49\x74\x17\x79\x36\x3c\xfe",
6066                .psize          = 64,
6067                .ksize          = 16,
6068        }, { /* From NIST Special Publication 800-38B, AES-256 */
6069                .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
6070                                  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
6071                                  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
6072                                  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
6073                .plaintext      = zeroed_string,
6074                .digest         = "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e"
6075                                  "\xfc\x6b\x55\x1f\x46\x67\xd9\x83",
6076                .psize          = 0,
6077                .ksize          = 32,
6078        }, {
6079                .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
6080                                  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
6081                                  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
6082                                  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
6083                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6084                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6085                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6086                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6087                                  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6088                                  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6089                                  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6090                                  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
6091                .digest         = "\xe1\x99\x21\x90\x54\x9f\x6e\xd5"
6092                                  "\x69\x6a\x2c\x05\x6c\x31\x54\x10",
6093                .psize          = 64,
6094                .ksize          = 32,
6095        }
6096};
6097
6098static const struct hash_testvec aes_cbcmac_tv_template[] = {
6099        {
6100                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6101                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6102                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6103                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
6104                .digest         = "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60"
6105                                  "\xa8\x9e\xca\xf3\x24\x66\xef\x97",
6106                .psize          = 16,
6107                .ksize          = 16,
6108        }, {
6109                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6110                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6111                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6112                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6113                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6114                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6115                                  "\x30",
6116                .digest         = "\x9d\x0d\xd0\x63\xfb\xcb\x24\x43"
6117                                  "\xf8\xf2\x76\x03\xac\x39\xb0\x9d",
6118                .psize          = 33,
6119                .ksize          = 16,
6120        }, {
6121                .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
6122                                  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
6123                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6124                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6125                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6126                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6127                                  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6128                                  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6129                                  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6130                                  "\xad\x2b\x41\x7b\xe6\x6c\x37",
6131                .digest         = "\xc0\x71\x73\xb8\xa0\x2c\x11\x7c"
6132                                  "\xaf\xdc\xb2\xf8\x89\x32\xa3\x3a",
6133                .psize          = 63,
6134                .ksize          = 16,
6135        }, {
6136                .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
6137                                  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
6138                                  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
6139                                  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
6140                .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
6141                                  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
6142                                  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
6143                                  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
6144                                  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
6145                                  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
6146                                  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
6147                                  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10"
6148                                  "\x1c",
6149                .digest         = "\x6a\x4e\xdb\x21\x47\x51\xdf\x4f"
6150                                  "\xa8\x4d\x4c\x10\x3b\x72\x7d\xd6",
6151                .psize          = 65,
6152                .ksize          = 32,
6153        }
6154};
6155
6156static const struct hash_testvec des3_ede_cmac64_tv_template[] = {
6157/*
6158 * From NIST Special Publication 800-38B, Three Key TDEA
6159 * Corrected test vectors from:
6160 *  http://csrc.nist.gov/publications/nistpubs/800-38B/Updated_CMAC_Examples.pdf
6161 */
6162        {
6163                .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
6164                                  "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
6165                                  "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
6166                .plaintext      = zeroed_string,
6167                .