Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-flexiantxendom0-3.2.10.git] / crypto / testmgr.h
index 9963b18..36e5a8e 100644 (file)
@@ -6,6 +6,15 @@
  * Copyright (c) 2007 Nokia Siemens Networks
  * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
  *
+ * Updated RFC4106 AES-GCM testing. Some test vectors were taken from
+ * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
+ * gcm/gcm-test-vectors.tar.gz
+ *     Authors: Aidan O'Mahony (aidan.o.mahony@intel.com)
+ *              Adrian Hoban <adrian.hoban@intel.com>
+ *              Gabriele Paoloni <gabriele.paoloni@intel.com>
+ *              Tadeusz Struk (tadeusz.struk@intel.com)
+ *     Copyright (c) 2010, Intel Corporation.
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -442,8 +451,9 @@ static struct hash_testvec rmd320_tv_template[] = {
 
 /*
  * SHA1 test vectors  from from FIPS PUB 180-1
+ * Long vector from CAVS 5.0
  */
-#define SHA1_TEST_VECTORS      2
+#define SHA1_TEST_VECTORS      3
 
 static struct hash_testvec sha1_tv_template[] = {
        {
@@ -458,6 +468,33 @@ static struct hash_testvec sha1_tv_template[] = {
                          "\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1",
                .np     = 2,
                .tap    = { 28, 28 }
+       }, {
+               .plaintext = "\xec\x29\x56\x12\x44\xed\xe7\x06"
+                            "\xb6\xeb\x30\xa1\xc3\x71\xd7\x44"
+                            "\x50\xa1\x05\xc3\xf9\x73\x5f\x7f"
+                            "\xa9\xfe\x38\xcf\x67\xf3\x04\xa5"
+                            "\x73\x6a\x10\x6e\x92\xe1\x71\x39"
+                            "\xa6\x81\x3b\x1c\x81\xa4\xf3\xd3"
+                            "\xfb\x95\x46\xab\x42\x96\xfa\x9f"
+                            "\x72\x28\x26\xc0\x66\x86\x9e\xda"
+                            "\xcd\x73\xb2\x54\x80\x35\x18\x58"
+                            "\x13\xe2\x26\x34\xa9\xda\x44\x00"
+                            "\x0d\x95\xa2\x81\xff\x9f\x26\x4e"
+                            "\xcc\xe0\xa9\x31\x22\x21\x62\xd0"
+                            "\x21\xcc\xa2\x8d\xb5\xf3\xc2\xaa"
+                            "\x24\x94\x5a\xb1\xe3\x1c\xb4\x13"
+                            "\xae\x29\x81\x0f\xd7\x94\xca\xd5"
+                            "\xdf\xaf\x29\xec\x43\xcb\x38\xd1"
+                            "\x98\xfe\x4a\xe1\xda\x23\x59\x78"
+                            "\x02\x21\x40\x5b\xd6\x71\x2a\x53"
+                            "\x05\xda\x4b\x1b\x73\x7f\xce\x7c"
+                            "\xd2\x1c\x0e\xb7\x72\x8d\x08\x23"
+                            "\x5a\x90\x11",
+               .psize  = 163,
+               .digest = "\x97\x01\x11\xc4\xe7\x7b\xcc\x88\xcc\x20"
+                         "\x45\x9c\x02\xb6\x9b\x4a\xa8\xf5\x82\x17",
+               .np     = 4,
+               .tap    = { 63, 64, 31, 5 }
        }
 };
 
@@ -1003,6 +1040,21 @@ static struct hash_testvec tgr128_tv_template[] = {
        },
 };
 
+#define GHASH_TEST_VECTORS 1
+
+static struct hash_testvec ghash_tv_template[] =
+{
+       {
+
+               .key    = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61",
+               .ksize  = 16,
+               .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
+               .psize  = 16,
+               .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
+                         "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
+       },
+};
+
 /*
  * HMAC-MD5 test vectors from RFC2202
  * (These need to be fixed to not use strlen).
@@ -1654,17 +1706,73 @@ static struct hash_testvec aes_xcbc128_tv_template[] = {
        }
 };
 
-#define VMAC_AES_TEST_VECTORS  1
-static char vmac_string[128] = {'\x01', '\x01', '\x01', '\x01',
+#define VMAC_AES_TEST_VECTORS  8
+static char vmac_string1[128] = {'\x01', '\x01', '\x01', '\x01',
                                '\x02', '\x03', '\x02', '\x02',
                                '\x02', '\x04', '\x01', '\x07',
                                '\x04', '\x01', '\x04', '\x03',};
+static char vmac_string2[128] = {'a', 'b', 'c',};
+static char vmac_string3[128] = {'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               'a', 'b', 'c', 'a', 'b', 'c',
+                               };
+
 static struct hash_testvec aes_vmac128_tv_template[] = {
        {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .plaintext = NULL,
+               .digest = "\x07\x58\x80\x35\x77\xa4\x7b\x54",
+               .psize  = 0,
+               .ksize  = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .plaintext = vmac_string1,
+               .digest = "\xce\xf5\x3c\xd3\xae\x68\x8c\xa1",
+               .psize  = 128,
+               .ksize  = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .plaintext = vmac_string2,
+               .digest = "\xc9\x27\xb0\x73\x81\xbd\x14\x2d",
+               .psize  = 128,
+               .ksize  = 16,
+       }, {
                .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .plaintext = vmac_string,
-               .digest = "\xcb\xd7\x8a\xfd\xb7\x33\x79\xe7",
+               .plaintext = vmac_string3,
+               .digest = "\x8d\x1a\x95\x8c\x98\x47\x0b\x19",
+               .psize  = 128,
+               .ksize  = 16,
+       }, {
+               .key    = "abcdefghijklmnop",
+               .plaintext = NULL,
+               .digest = "\x3b\x89\xa1\x26\x9e\x55\x8f\x84",
+               .psize  = 0,
+               .ksize  = 16,
+       }, {
+               .key    = "abcdefghijklmnop",
+               .plaintext = vmac_string1,
+               .digest = "\xab\x5e\xab\xb0\xf6\x8d\x74\xc2",
+               .psize  = 128,
+               .ksize  = 16,
+       }, {
+               .key    = "abcdefghijklmnop",
+               .plaintext = vmac_string2,
+               .digest = "\x11\x15\x68\x42\x3d\x7b\x09\xdf",
+               .psize  = 128,
+               .ksize  = 16,
+       }, {
+               .key    = "abcdefghijklmnop",
+               .plaintext = vmac_string3,
+               .digest = "\x8b\x32\x8f\xe1\xed\x8f\xfa\xd4",
                .psize  = 128,
                .ksize  = 16,
        },
@@ -2283,10 +2391,12 @@ static struct cipher_testvec des3_ede_cbc_dec_tv_template[] = {
 /*
  * Blowfish test vectors.
  */
-#define BF_ENC_TEST_VECTORS    6
-#define BF_DEC_TEST_VECTORS    6
-#define BF_CBC_ENC_TEST_VECTORS        1
-#define BF_CBC_DEC_TEST_VECTORS        1
+#define BF_ENC_TEST_VECTORS    7
+#define BF_DEC_TEST_VECTORS    7
+#define BF_CBC_ENC_TEST_VECTORS        2
+#define BF_CBC_DEC_TEST_VECTORS        2
+#define BF_CTR_ENC_TEST_VECTORS        2
+#define BF_CTR_DEC_TEST_VECTORS        2
 
 static struct cipher_testvec bf_enc_tv_template[] = {
        { /* DES test vectors from OpenSSL */
@@ -2340,6 +2450,24 @@ static struct cipher_testvec bf_enc_tv_template[] = {
                .ilen   = 8,
                .result = "\xc0\x45\x04\x01\x2e\x4e\x1f\x53",
                .rlen   = 8,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .ilen   = 40,
+               .result = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
+                         "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
+                         "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
+                         "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
+                         "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
+               .rlen   = 40,
        },
 };
 
@@ -2395,6 +2523,24 @@ static struct cipher_testvec bf_dec_tv_template[] = {
                .ilen   = 8,
                .result = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .rlen   = 8,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .input  = "\x96\x87\x3D\x0C\x7B\xFB\xBD\x1F"
+                         "\xE3\xC1\x99\x6D\x39\xD4\xC2\x7D"
+                         "\xD7\x87\xA1\xF2\xDF\x51\x71\x26"
+                         "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
+                         "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
+               .ilen   = 40,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .rlen   = 40,
        },
 };
 
@@ -2414,6 +2560,25 @@ static struct cipher_testvec bf_cbc_enc_tv_template[] = {
                          "\x58\xde\xb9\xe7\x15\x46\x16\xd9"
                          "\x59\xf1\x65\x2b\xd5\xff\x92\xcc",
                .rlen   = 32,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .ilen   = 40,
+               .result = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
+                         "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
+                         "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
+                         "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
+                         "\x01\x9C\x93\x63\x51\x60\x82\xD2",
+               .rlen   = 40,
        },
 };
 
@@ -2433,16 +2598,129 @@ static struct cipher_testvec bf_cbc_dec_tv_template[] = {
                          "\x68\x65\x20\x74\x69\x6d\x65\x20"
                          "\x66\x6f\x72\x20\x00\x00\x00\x00",
                .rlen   = 32,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\xB4\xFE\xA5\xBB\x3D\x2C\x27\x06"
+                         "\x06\x2B\x3A\x92\xB2\xF5\x5E\x62"
+                         "\x84\xCD\xF7\x66\x7E\x41\x6C\x8E"
+                         "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
+                         "\x01\x9C\x93\x63\x51\x60\x82\xD2",
+               .ilen   = 40,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .rlen   = 40,
+       },
+};
+
+static struct cipher_testvec bf_ctr_enc_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .ilen   = 40,
+               .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
+                         "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
+                         "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
+                         "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
+                         "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
+               .rlen   = 40,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B",
+               .ilen   = 43,
+               .result = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
+                         "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
+                         "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
+                         "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
+                         "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
+                         "\x3D\xA7\xE9",
+               .rlen   = 43,
+       },
+};
+
+static struct cipher_testvec bf_ctr_dec_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
+                         "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
+                         "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
+                         "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
+                         "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC",
+               .ilen   = 40,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
+               .rlen   = 40,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
+               .input  = "\xC7\xA3\xDF\xB9\x05\xF4\x9E\x8D"
+                         "\x9E\xDF\x38\x18\x83\x07\xEF\xC1"
+                         "\x93\x3C\xAA\xAA\xFE\x06\x42\xCC"
+                         "\x0D\x70\x86\x5A\x44\xAD\x85\x17"
+                         "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
+                         "\x3D\xA7\xE9",
+               .ilen   = 43,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B",
+               .rlen   = 43,
        },
 };
 
 /*
  * Twofish test vectors.
  */
-#define TF_ENC_TEST_VECTORS            3
-#define TF_DEC_TEST_VECTORS            3
-#define TF_CBC_ENC_TEST_VECTORS                4
-#define TF_CBC_DEC_TEST_VECTORS                4
+#define TF_ENC_TEST_VECTORS            4
+#define TF_DEC_TEST_VECTORS            4
+#define TF_CBC_ENC_TEST_VECTORS                5
+#define TF_CBC_DEC_TEST_VECTORS                5
+#define TF_CTR_ENC_TEST_VECTORS                2
+#define TF_CTR_DEC_TEST_VECTORS                2
+#define TF_LRW_ENC_TEST_VECTORS                8
+#define TF_LRW_DEC_TEST_VECTORS                8
+#define TF_XTS_ENC_TEST_VECTORS                5
+#define TF_XTS_DEC_TEST_VECTORS                5
 
 static struct cipher_testvec tf_enc_tv_template[] = {
        {
@@ -2474,6 +2752,30 @@ static struct cipher_testvec tf_enc_tv_template[] = {
                .result = "\x37\x52\x7b\xe0\x05\x23\x34\xb8"
                          "\x9f\x0c\xfc\xca\xe8\x7c\xfa\x20",
                .rlen   = 16,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
+                         "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
+                         "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
+                         "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
+               .klen   = 32,
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .ilen   = 64,
+               .result = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
+                         "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
+                         "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
+                         "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
+                         "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
+                         "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
+                         "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
+                         "\x89\xF6\x82\xF0\xD3\xDB\x06\x02",
+               .rlen   = 64,
        },
 };
 
@@ -2507,6 +2809,30 @@ static struct cipher_testvec tf_dec_tv_template[] = {
                .ilen   = 16,
                .result = zeroed_string,
                .rlen   = 16,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
+                         "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
+                         "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
+                         "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
+               .klen   = 32,
+               .input  = "\x88\xCB\x1E\xC2\xAF\x8A\x97\xFF"
+                         "\xF6\x90\x46\x9C\x4A\x0F\x08\xDC"
+                         "\xDE\xAB\xAD\xFA\xFC\xA8\xC2\x3D"
+                         "\xE0\xE4\x8B\x3F\xD5\xA3\xF7\x14"
+                         "\x34\x9E\xB6\x08\xB2\xDD\xA8\xF5"
+                         "\xDF\xFA\xC7\xE8\x09\x50\x76\x08"
+                         "\xA2\xB6\x6A\x59\xC0\x2B\x6D\x05"
+                         "\x89\xF6\x82\xF0\xD3\xDB\x06\x02",
+               .ilen   = 64,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .rlen   = 64,
        },
 };
 
@@ -2553,6 +2879,32 @@ static struct cipher_testvec tf_cbc_enc_tv_template[] = {
                          "\x05\xef\x8c\x61\xa8\x11\x58\x26"
                          "\x34\xba\x5c\xb7\x10\x6a\xa6\x41",
                .rlen   = 48,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .ilen   = 64,
+               .result = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
+                         "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
+                         "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
+                         "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
+                         "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
+                         "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
+                         "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
+                         "\xB1\xD3\x44\x65\xDF\xE7\x63\x38",
+               .rlen   = 64,
        },
 };
 
@@ -2599,493 +2951,3390 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = {
                .ilen   = 48,
                .result = zeroed_string,
                .rlen   = 48,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xC8\xFF\xF2\x53\xA6\x27\x09\xD1"
+                         "\x33\x38\xC2\xC0\x0C\x14\x7E\xB5"
+                         "\x26\x1B\x05\x0C\x05\x12\x3F\xC0"
+                         "\xF9\x1C\x02\x28\x40\x96\x6F\xD0"
+                         "\x3D\x32\xDF\xDA\x56\x00\x6E\xEE"
+                         "\x5B\x2A\x72\x9D\xC2\x4D\x19\xBC"
+                         "\x8C\x53\xFA\x87\x6F\xDD\x81\xA3"
+                         "\xB1\xD3\x44\x65\xDF\xE7\x63\x38",
+               .ilen   = 64,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .rlen   = 64,
        },
 };
 
-/*
- * Serpent test vectors.  These are backwards because Serpent writes
- * octet sequences in right-to-left mode.
- */
-#define SERPENT_ENC_TEST_VECTORS       4
-#define SERPENT_DEC_TEST_VECTORS       4
-
-#define TNEPRES_ENC_TEST_VECTORS       4
-#define TNEPRES_DEC_TEST_VECTORS       4
-
-static struct cipher_testvec serpent_enc_tv_template[] = {
-       {
-               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .ilen   = 16,
-               .result = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
-                         "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
-               .rlen   = 16,
-       }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .klen   = 16,
-               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .ilen   = 16,
-               .result = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
-                         "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
-               .rlen   = 16,
-       }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+static struct cipher_testvec tf_ctr_enc_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
                .klen   = 32,
-               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .ilen   = 16,
-               .result = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
-                         "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
-               .rlen   = 16,
-       }, {
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
-               .klen   = 16,
-               .input  = zeroed_string,
-               .ilen   = 16,
-               .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
-                         "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
-               .rlen   = 16,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .ilen   = 64,
+               .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
+                         "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
+                         "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
+                         "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
+                         "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
+                         "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
+                         "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
+                         "\x01\x41\x21\x12\x38\xAB\x52\x4F",
+               .rlen   = 64,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE",
+               .ilen   = 67,
+               .result = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
+                         "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
+                         "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
+                         "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
+                         "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
+                         "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
+                         "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
+                         "\x01\x41\x21\x12\x38\xAB\x52\x4F"
+                         "\xA8\x57\x20",
+               .rlen   = 67,
        },
 };
 
-static struct cipher_testvec tnepres_enc_tv_template[] = {
-       { /* KeySize=128, PT=0, I=1 */
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 16,
-               .ilen   = 16,
-               .result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05"
-                         "\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd",
-               .rlen   = 16,
-       }, { /* KeySize=192, PT=0, I=1 */
-               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 24,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .ilen   = 16,
-               .result = "\xe7\x8e\x54\x02\xc7\x19\x55\x68"
-                         "\xac\x36\x78\xf7\xa3\xf6\x0c\x66",
-               .rlen   = 16,
-       }, { /* KeySize=256, PT=0, I=1 */
-               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+static struct cipher_testvec tf_ctr_dec_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
                .klen   = 32,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .ilen   = 16,
-               .result = "\xab\xed\x96\xe7\x66\xbf\x28\xcb"
-                         "\xc0\xeb\xd2\x1a\x82\xef\x08\x19",
-               .rlen   = 16,
-       }, { /* KeySize=256, I=257 */
-               .key    = "\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18"
-                         "\x17\x16\x15\x14\x13\x12\x11\x10"
-                         "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
-                         "\x07\x06\x05\x04\x03\x02\x01\x00",
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
+                         "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
+                         "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
+                         "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
+                         "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
+                         "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
+                         "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
+                         "\x01\x41\x21\x12\x38\xAB\x52\x4F",
+               .ilen   = 64,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C",
+               .rlen   = 64,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
                .klen   = 32,
-               .input  = "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
-                         "\x07\x06\x05\x04\x03\x02\x01\x00",
-               .ilen   = 16,
-               .result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b"
-                         "\xb8\x32\xe4\x33\xf8\x9f\x26\xde",
-               .rlen   = 16,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
+                         "\x70\x9E\xC5\x4B\xC9\xD4\xA1\x30"
+                         "\x26\x9B\x89\xA1\xEE\x43\xE0\x52"
+                         "\x55\x17\x4E\xC7\x0E\x33\x1F\xF1"
+                         "\x9F\x8D\x40\x9F\x24\xFD\x92\xA0"
+                         "\xBC\x8F\x35\xDD\x67\x38\xD8\xAA"
+                         "\xCF\xF8\x48\xCA\xFB\xE4\x5C\x60"
+                         "\x01\x41\x21\x12\x38\xAB\x52\x4F"
+                         "\xA8\x57\x20",
+               .ilen   = 67,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE",
+               .rlen   = 67,
        },
 };
 
-
-static struct cipher_testvec serpent_dec_tv_template[] = {
+static struct cipher_testvec tf_lrw_enc_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
        {
-               .input  = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
-                         "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .result = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
+                         "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .klen   = 16,
-               .input  = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
-                         "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .result = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
+                         "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
                .klen   = 32,
-               .input  = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
-                         "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .result = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
+                         "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
-               .klen   = 16,
-               .input  = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
-                         "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = zeroed_string,
+               .result = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
+                         "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
                .rlen   = 16,
-       },
-};
-
-static struct cipher_testvec tnepres_dec_tv_template[] = {
-       {
-               .input  = "\x41\xcc\x6b\x31\x59\x31\x45\x97"
-                         "\x6d\x6f\xbb\x38\x4b\x37\x21\x28",
+       }, {
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .result = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
+                         "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .klen   = 16,
-               .input  = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47"
-                         "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e",
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .result = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
+                         "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .klen   = 32,
-               .input  = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49"
-                         "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee",
-               .ilen   = 16,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .rlen   = 16,
-       }, { /* KeySize=128, I=121 */
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
-               .klen   = 16,
-               .input  = "\x3d\xda\xbf\xc0\x06\xda\xab\x06"
-                         "\x46\x2a\xf4\xef\x81\x54\x4e\x26",
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = zeroed_string,
+               .result = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
+                         "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
                .rlen   = 16,
+       }, {
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .ilen   = 512,
+               .result = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
+                         "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
+                         "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
+                         "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
+                         "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
+                         "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
+                         "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
+                         "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
+                         "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
+                         "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
+                         "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
+                         "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
+                         "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
+                         "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
+                         "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
+                         "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
+                         "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
+                         "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
+                         "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
+                         "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
+                         "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
+                         "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
+                         "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
+                         "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
+                         "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
+                         "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
+                         "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
+                         "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
+                         "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
+                         "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
+                         "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
+                         "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
+                         "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
+                         "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
+                         "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
+                         "\x3e\xae\x71\x90\x07\x70\x1c\x38"
+                         "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
+                         "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
+                         "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
+                         "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
+                         "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
+                         "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
+                         "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
+                         "\x93\x51\x1d\x3d\x62\x59\x83\x82"
+                         "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
+                         "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
+                         "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
+                         "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
+                         "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
+                         "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
+                         "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
+                         "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
+                         "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
+                         "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
+                         "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
+                         "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
+                         "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
+                         "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
+                         "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
+                         "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
+                         "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
+                         "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
+                         "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
+                         "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
+               .rlen   = 512,
        },
 };
 
-
-/* Cast6 test vectors from RFC 2612 */
-#define CAST6_ENC_TEST_VECTORS 3
-#define CAST6_DEC_TEST_VECTORS  3
-
-static struct cipher_testvec cast6_enc_tv_template[] = {
+static struct cipher_testvec tf_lrw_dec_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
+       /* same as enc vectors with input and result reversed */
        {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
-               .klen   = 16,
-               .input  = zeroed_string,
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\xa1\x6c\x50\x69\x26\xa4\xef\x7b"
+                         "\x7c\xc6\x91\xeb\x72\xdd\x9b\xee",
                .ilen   = 16,
-               .result = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
-                         "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
-                         "\xba\xc7\x7a\x77\x17\x94\x28\x63",
-               .klen   = 24,
-               .input  = zeroed_string,
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
+                         "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
                .ilen   = 16,
-               .result = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
-                         "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
-                         "\x8d\x7c\x47\xce\x26\x49\x08\x46"
-                         "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
                .klen   = 32,
-               .input  = zeroed_string,
-               .ilen   = 16,
-               .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
-                         "\xc9\x87\x01\x36\x55\x33\x17\xfa",
-               .rlen   = 16,
-       },
-};
-
-static struct cipher_testvec cast6_dec_tv_template[] = {
-       {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
-               .klen   = 16,
-               .input  = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
-                         "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
+                         "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
                .ilen   = 16,
-               .result = zeroed_string,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
-                         "\xba\xc7\x7a\x77\x17\x94\x28\x63",
-               .klen   = 24,
-               .input  = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
-                         "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
+                         "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
                .ilen   = 16,
-               .result = zeroed_string,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
-                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
-                         "\x8d\x7c\x47\xce\x26\x49\x08\x46"
-                         "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
-               .klen   = 32,
-               .input  = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
-                         "\xc9\x87\x01\x36\x55\x33\x17\xfa",
-               .ilen   = 16,
-               .result = zeroed_string,
-               .rlen   = 16,
-       },
-};
-
-
-/*
- * AES test vectors.
- */
-#define AES_ENC_TEST_VECTORS 3
-#define AES_DEC_TEST_VECTORS 3
-#define AES_CBC_ENC_TEST_VECTORS 4
-#define AES_CBC_DEC_TEST_VECTORS 4
-#define AES_LRW_ENC_TEST_VECTORS 8
-#define AES_LRW_DEC_TEST_VECTORS 8
-#define AES_XTS_ENC_TEST_VECTORS 4
-#define AES_XTS_DEC_TEST_VECTORS 4
-#define AES_CTR_ENC_TEST_VECTORS 3
-#define AES_CTR_DEC_TEST_VECTORS 3
-#define AES_CTR_3686_ENC_TEST_VECTORS 7
-#define AES_CTR_3686_DEC_TEST_VECTORS 6
-#define AES_GCM_ENC_TEST_VECTORS 9
-#define AES_GCM_DEC_TEST_VECTORS 8
-#define AES_CCM_ENC_TEST_VECTORS 7
-#define AES_CCM_DEC_TEST_VECTORS 7
-#define AES_CCM_4309_ENC_TEST_VECTORS 7
-#define AES_CCM_4309_DEC_TEST_VECTORS 10
-
-static struct cipher_testvec aes_enc_tv_template[] = {
-       { /* From FIPS-197 */
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .klen   = 16,
-               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
+                         "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
                .ilen   = 16,
-               .result = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
-                         "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17",
-               .klen   = 24,
-               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
+                         "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
                .ilen   = 16,
-               .result = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
-                         "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .klen   = 32,
-               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
+                         "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
                .ilen   = 16,
-               .result = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
-                         "\xea\xfc\x49\x90\x4b\x49\x60\x89",
-               .rlen   = 16,
-       },
-};
-
-static struct cipher_testvec aes_dec_tv_template[] = {
-       { /* From FIPS-197 */
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .klen   = 16,
-               .input  = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
-                         "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
-               .ilen   = 16,
-               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
-               .rlen   = 16,
-       }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17",
-               .klen   = 24,
-               .input  = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
-                         "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
-               .ilen   = 16,
-               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .klen   = 32,
-               .input  = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
-                         "\xea\xfc\x49\x90\x4b\x49\x60\x89",
-               .ilen   = 16,
-               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
-               .rlen   = 16,
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x38\xeb\xaf\x12\x43\x1a\x89"
+                         "\x62\xa2\x36\xe5\xcf\x77\x1e\xd9"
+                         "\x08\xc3\x0d\xdd\x95\xab\x19\x96"
+                         "\x27\x52\x41\xc3\xca\xfb\xf6\xee"
+                         "\x40\x2d\xdf\xdd\x00\x0c\xb9\x0a"
+                         "\x3a\xf0\xc0\xd1\xda\x63\x9e\x45"
+                         "\x42\xe9\x29\xc0\xb4\x07\xb4\x31"
+                         "\x66\x77\x72\xb5\xb6\xb3\x57\x46"
+                         "\x34\x9a\xfe\x03\xaf\x6b\x36\x07"
+                         "\x63\x8e\xc2\x5d\xa6\x0f\xb6\x7d"
+                         "\xfb\x6d\x82\x51\xb6\x98\xd0\x71"
+                         "\xe7\x10\x7a\xdf\xb2\xbd\xf1\x1d"
+                         "\x72\x2b\x54\x13\xe3\x6d\x79\x37"
+                         "\xa9\x39\x2c\xdf\x21\xab\x87\xd5"
+                         "\xee\xef\x9a\x12\x50\x39\x2e\x1b"
+                         "\x7d\xe6\x6a\x27\x48\xb9\xe7\xac"
+                         "\xaa\xcd\x79\x5f\xf2\xf3\xa0\x08"
+                         "\x6f\x2c\xf4\x0e\xd1\xb8\x89\x25"
+                         "\x31\x9d\xef\xb1\x1d\x27\x55\x04"
+                         "\xc9\x8c\xb7\x68\xdc\xb6\x67\x8a"
+                         "\xdb\xcf\x22\xf2\x3b\x6f\xce\xbb"
+                         "\x26\xbe\x4f\x27\x04\x42\xd1\x44"
+                         "\x4c\x08\xa3\x95\x4c\x7f\x1a\xaf"
+                         "\x1d\x28\x14\xfd\xb1\x1a\x34\x18"
+                         "\xf5\x1e\x28\x69\x95\x6a\x5a\xba"
+                         "\x8e\xb2\x58\x1d\x28\x17\x13\x3d"
+                         "\x38\x7d\x14\x8d\xab\x5d\xf9\xe8"
+                         "\x3c\x0f\x2b\x0d\x2b\x08\xb4\x4b"
+                         "\x6b\x0d\xc8\xa7\x84\xc2\x3a\x1a"
+                         "\xb7\xbd\xda\x92\x29\xb8\x5b\x5a"
+                         "\x63\xa5\x99\x82\x09\x72\x8f\xc6"
+                         "\xa4\x62\x24\x69\x8c\x2d\x26\x00"
+                         "\x99\x83\x91\xd6\xc6\xcf\x57\x67"
+                         "\x38\xea\xf2\xfc\x29\xe0\x73\x39"
+                         "\xf9\x13\x94\x6d\xe2\x58\x28\x75"
+                         "\x3e\xae\x71\x90\x07\x70\x1c\x38"
+                         "\x5b\x4c\x1e\xb5\xa5\x3b\x20\xef"
+                         "\xb1\x4c\x3e\x1a\x72\x62\xbb\x22"
+                         "\x82\x09\xe3\x18\x3f\x4f\x48\xfc"
+                         "\xdd\xac\xfc\xb6\x09\xdb\xd2\x7b"
+                         "\xd6\xb7\x7e\x41\x2f\x14\xf5\x0e"
+                         "\xc3\xac\x4a\xed\xe7\x82\xef\x31"
+                         "\x1f\x1a\x51\x1e\x29\x60\xc8\x98"
+                         "\x93\x51\x1d\x3d\x62\x59\x83\x82"
+                         "\x0c\xf1\xd7\x8d\xac\x33\x44\x81"
+                         "\x3c\x59\xb7\xd4\x5b\x65\x82\xc4"
+                         "\xec\xdc\x24\xfd\x0e\x1a\x79\x94"
+                         "\x34\xb0\x62\xfa\x98\x49\x26\x1f"
+                         "\xf4\x9e\x40\x44\x5b\x1f\xf8\xbe"
+                         "\x36\xff\xc6\xc6\x9d\xf2\xd6\xcc"
+                         "\x63\x93\x29\xb9\x0b\x6d\xd7\x6c"
+                         "\xdb\xf6\x21\x80\xf7\x5a\x37\x15"
+                         "\x0c\xe3\x36\xc8\x74\x75\x20\x91"
+                         "\xdf\x52\x2d\x0c\xe7\x45\xff\x46"
+                         "\xb3\xf4\xec\xc2\xbd\xd3\x37\xb6"
+                         "\x26\xa2\x5d\x7d\x61\xbf\x10\x46"
+                         "\x57\x8d\x05\x96\x70\x0b\xd6\x41"
+                         "\x5c\xe9\xd3\x54\x81\x39\x3a\xdd"
+                         "\x5f\x92\x81\x6e\x35\x03\xd4\x72"
+                         "\x3d\x5a\xe7\xb9\x3b\x0c\x84\x23"
+                         "\x45\x5d\xec\x72\xc1\x52\xef\x2e"
+                         "\x81\x00\xd3\xfe\x4c\x3c\x05\x61"
+                         "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
+                         "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
+               .ilen   = 512,
+               .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .rlen   = 512,
        },
 };
 
-static struct cipher_testvec aes_cbc_enc_tv_template[] = {
-       { /* From RFC 3602 */
-               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
-                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
-               .klen   = 16,
-               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
-                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-               .input  = "Single block msg",
-               .ilen   = 16,
-               .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
-                         "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
-               .rlen   = 16,
+static struct cipher_testvec tf_xts_enc_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
+{
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 32,
+               .result = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
+                         "\x30\x74\xe4\x44\x52\x77\x97\x43"
+                         "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
+                         "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
+               .rlen   = 32,
        }, {
-               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
-                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-               .klen   = 16,
-               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
-                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .ilen   = 32,
-               .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
-                         "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
-                         "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
-                         "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
-               .rlen   = 32,
-       }, { /* From NIST SP800-38A */
-               .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
-                         "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
-                         "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-               .klen   = 24,
-               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
-                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
-                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
-                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
-                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
-                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
-                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
-                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
-               .ilen   = 64,
-               .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
-                         "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
-                         "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
-                         "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
-                         "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
-                         "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
-                         "\x08\xb0\xe2\x79\x88\x59\x88\x81"
-                         "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
-               .rlen   = 64,
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\x57\x0e\x8f\xe5\x2a\x35\x61\x4f"
+                         "\x32\xd3\xbd\x36\x05\x15\x44\x2c"
+                         "\x58\x06\xf7\xf8\x00\xa8\xb6\xd5"
+                         "\xc6\x28\x92\xdb\xd8\x34\xa2\xe9",
+               .rlen   = 32,
        }, {
-               .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
-                         "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
-                         "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
-                         "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
                .klen   = 32,
-               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
-                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
-                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
-                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
-                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
-                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
-                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
-                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
-               .ilen   = 64,
-               .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
-                         "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
-                         "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
-                         "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
-                         "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
-                         "\xa5\x30\xe2\x63\x04\x23\x14\x61"
-                         "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
-                         "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
-               .rlen   = 64,
-       },
-};
-
-static struct cipher_testvec aes_cbc_dec_tv_template[] = {
-       { /* From RFC 3602 */
-               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
-                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
-               .klen   = 16,
-               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
-                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-               .input  = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
-                         "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
-               .ilen   = 16,
-               .result = "Single block msg",
-               .rlen   = 16,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\x96\x45\x8f\x8d\x7a\x75\xb1\xde"
+                         "\x40\x0c\x89\x56\xf6\x4d\xa7\x07"
+                         "\x38\xbb\x5b\xe9\xcd\x84\xae\xb2"
+                         "\x7b\x6a\x62\xf4\x8c\xb5\x37\xea",
+               .rlen   = 32,
        }, {
-               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
-                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-               .klen   = 16,
-               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
-                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-               .input  = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
-                         "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
-                         "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
-                         "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
-               .ilen   = 32,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
                          "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .rlen   = 32,
-       }, { /* From NIST SP800-38A */
-               .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
-                         "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
-                         "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-               .klen   = 24,
-               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
-               .input  = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
-                         "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
-                         "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
-                         "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
-                         "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
-                         "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
-                         "\x08\xb0\xe2\x79\x88\x59\x88\x81"
-                         "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
-               .ilen   = 64,
-               .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
-                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
-                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
-                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
-                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\xa9\x78\xae\x1e\xea\xa2\x44\x4c"
+                         "\xa2\x7a\x64\x1f\xaf\x46\xc1\xe0"
+                         "\x6c\xb2\xf3\x92\x9a\xd6\x7d\x58"
+                         "\xb8\x2d\xb9\x5d\x58\x07\x66\x50"
+                         "\xea\x35\x35\x8c\xb2\x46\x61\x06"
+                         "\x5d\x65\xfc\x57\x8f\x69\x74\xab"
+                         "\x8a\x06\x69\xb5\x6c\xda\x66\xc7"
+                         "\x52\x90\xbb\x8e\x6d\x8b\xb5\xa2"
+                         "\x78\x1d\xc2\xa9\xc2\x73\x00\xc3"
+                         "\x32\x36\x7c\x97\x6b\x4e\x8a\x50"
+                         "\xe4\x91\x83\x96\x8f\xf4\x94\x1a"
+                         "\xa6\x27\xe1\x33\xcb\x91\xc6\x5f"
+                         "\x94\x75\xbc\xd7\x3e\x3e\x6f\x9e"
+                         "\xa9\x31\x80\x5e\xe5\xdb\xc8\x53"
+                         "\x01\x73\x68\x32\x25\x19\xfa\xfb"
+                         "\xe4\xcf\xb9\x3e\xa2\xa0\x8f\x31"
+                         "\xbf\x54\x06\x93\xa8\xb1\x0f\xb6"
+                         "\x7c\x3c\xde\x6f\x0f\xfb\x0c\x11"
+                         "\x39\x80\x39\x09\x97\x65\xf2\x83"
+                         "\xae\xe6\xa1\x6f\x47\xb8\x49\xde"
+                         "\x99\x36\x20\x7d\x97\x3b\xec\xfa"
+                         "\xb4\x33\x6e\x7a\xc7\x46\x84\x49"
+                         "\x91\xcd\xe1\x57\x0d\xed\x40\x08"
+                         "\x13\xf1\x4e\x3e\xa4\xa4\x5c\xe6"
+                         "\xd2\x0c\x20\x8f\x3e\xdf\x3f\x47"
+                         "\x9a\x2f\xde\x6d\x66\xc9\x99\x4a"
+                         "\x2d\x9e\x9d\x4b\x1a\x27\xa2\x12"
+                         "\x99\xf0\xf8\xb1\xb6\xf6\x57\xc3"
+                         "\xca\x1c\xa3\x8e\xed\x39\x28\xb5"
+                         "\x10\x1b\x4b\x08\x42\x00\x4a\xd3"
+                         "\xad\x5a\xc6\x8e\xc8\xbb\x95\xc4"
+                         "\x4b\xaa\xfe\xd5\x42\xa8\xa3\x6d"
+                         "\x3c\xf3\x34\x91\x2d\xb4\xdd\x20"
+                         "\x0c\x90\x6d\xa3\x9b\x66\x9d\x24"
+                         "\x02\xa6\xa9\x3f\x3f\x58\x5d\x47"
+                         "\x24\x65\x63\x7e\xbd\x8c\xe6\x52"
+                         "\x7d\xef\x33\x53\x63\xec\xaa\x0b"
+                         "\x64\x15\xa9\xa6\x1f\x10\x00\x38"
+                         "\x35\xa8\xe7\xbe\x23\x70\x22\xe0"
+                         "\xd3\xb9\xe6\xfd\xe6\xaa\x03\x50"
+                         "\xf3\x3c\x27\x36\x8b\xcc\xfe\x9c"
+                         "\x9c\xa3\xb3\xe7\x68\x9b\xa2\x71"
+                         "\xe0\x07\xd9\x1f\x68\x1f\xac\x5e"
+                         "\x7a\x74\x85\xa9\x6a\x90\xab\x2c"
+                         "\x38\x51\xbc\x1f\x43\x4a\x56\x1c"
+                         "\xf8\x47\x03\x4e\x67\xa8\x1f\x99"
+                         "\x04\x39\x73\x32\xb2\x86\x79\xe7"
+                         "\x14\x28\x70\xb8\xe2\x7d\x69\x85"
+                         "\xb6\x0f\xc5\xd0\xd0\x01\x5c\xe6"
+                         "\x09\x0f\x75\xf7\xb6\x81\xd2\x11"
+                         "\x20\x9c\xa1\xee\x11\x44\x79\xd0"
+                         "\xb2\x34\x77\xda\x10\x9a\x6f\x6f"
+                         "\xef\x7c\xd9\xdc\x35\xb7\x61\xdd"
+                         "\xf1\xa4\xc6\x1c\xbf\x05\x22\xac"
+                         "\xfe\x2f\x85\x00\x44\xdf\x33\x16"
+                         "\x35\xb6\xa3\xd3\x70\xdf\x69\x35"
+                         "\x6a\xc7\xb4\x99\x45\x27\xc8\x8e"
+                         "\x5a\x14\x30\xd0\x55\x3e\x4f\x64"
+                         "\x0d\x38\xe3\xdf\x8b\xa8\x93\x26"
+                         "\x75\xae\xf6\xb5\x23\x0b\x17\x31"
+                         "\xbf\x27\xb8\xb5\x94\x31\xa7\x8f"
+                         "\x43\xc4\x46\x24\x22\x4f\x8f\x7e"
+                         "\xe5\xf4\x6d\x1e\x0e\x18\x7a\xbb"
+                         "\xa6\x8f\xfb\x49\x49\xd8\x7e\x5a",
+               .rlen   = 512,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\xd7\x4b\x93\x7d\x13\xa2\xa2\xe1"
+                         "\x35\x39\x71\x88\x76\x1e\xc9\xea"
+                         "\x86\xad\xf3\x14\x48\x3d\x5e\xe9"
+                         "\xe9\x2d\xb2\x56\x59\x35\x9d\xec"
+                         "\x84\xfa\x7e\x9d\x6d\x33\x36\x8f"
+                         "\xce\xf4\xa9\x21\x0b\x5f\x96\xec"
+                         "\xcb\xf9\x57\x68\x33\x88\x39\xbf"
+                         "\x2f\xbb\x59\x03\xbd\x66\x8b\x11"
+                         "\x11\x65\x51\x2e\xb8\x67\x05\xd1"
+                         "\x27\x11\x5c\xd4\xcc\x97\xc2\xb3"
+                         "\xa9\x55\xaf\x07\x56\xd1\xdc\xf5"
+                         "\x85\xdc\x46\xe6\xf0\x24\xeb\x93"
+                         "\x4d\xf0\x9b\xf5\x73\x1c\xda\x03"
+                         "\x22\xc8\x3a\x4f\xb4\x19\x91\x09"
+                         "\x54\x0b\xf6\xfe\x17\x3d\x1a\x53"
+                         "\x72\x60\x79\xcb\x0e\x32\x8a\x77"
+                         "\xd5\xed\xdb\x33\xd7\x62\x16\x69"
+                         "\x63\xe0\xab\xb5\xf6\x9c\x5f\x3d"
+                         "\x69\x35\x61\x86\xf8\x86\xb9\x89"
+                         "\x6e\x59\x35\xac\xf6\x6b\x33\xa0"
+                         "\xea\xef\x96\x62\xd8\xa9\xcf\x56"
+                         "\xbf\xdb\x8a\xfd\xa1\x82\x77\x73"
+                         "\x3d\x94\x4a\x49\x42\x6d\x08\x60"
+                         "\xa1\xea\xab\xb6\x88\x13\x94\xb8"
+                         "\x51\x98\xdb\x35\x85\xdf\xf6\xb9"
+                         "\x8f\xcd\xdf\x80\xd3\x40\x2d\x72"
+                         "\xb8\xb2\x6c\x02\x43\x35\x22\x2a"
+                         "\x31\xed\xcd\x16\x19\xdf\x62\x0f"
+                         "\x29\xcf\x87\x04\xec\x02\x4f\xe4"
+                         "\xa2\xed\x73\xc6\x69\xd3\x7e\x89"
+                         "\x0b\x76\x10\x7c\xd6\xf9\x6a\x25"
+                         "\xed\xcc\x60\x5d\x61\x20\xc1\x97"
+                         "\x56\x91\x57\x28\xbe\x71\x0d\xcd"
+                         "\xde\xc4\x9e\x55\x91\xbe\xd1\x28"
+                         "\x9b\x90\xeb\x73\xf3\x68\x51\xc6"
+                         "\xdf\x82\xcc\xd8\x1f\xce\x5b\x27"
+                         "\xc0\x60\x5e\x33\xd6\xa7\x20\xea"
+                         "\xb2\x54\xc7\x5d\x6a\x3b\x67\x47"
+                         "\xcf\xa0\xe3\xab\x86\xaf\xc1\x42"
+                         "\xe6\xb0\x23\x4a\xaf\x53\xdf\xa0"
+                         "\xad\x12\x32\x31\x03\xf7\x21\xbe"
+                         "\x2d\xd5\x82\x42\xb6\x4a\x3d\xcd"
+                         "\xd8\x81\x77\xa9\x49\x98\x6c\x09"
+                         "\xc5\xa3\x61\x12\x62\x85\x6b\xcd"
+                         "\xb3\xf4\x20\x0c\x41\xc4\x05\x37"
+                         "\x46\x5f\xeb\x71\x8b\xf1\xaf\x6e"
+                         "\xba\xf3\x50\x2e\xfe\xa8\x37\xeb"
+                         "\xe8\x8c\x4f\xa4\x0c\xf1\x31\xc8"
+                         "\x6e\x71\x4f\xa5\xd7\x97\x73\xe0"
+                         "\x93\x4a\x2f\xda\x7b\xe0\x20\x54"
+                         "\x1f\x8d\x85\x79\x0b\x7b\x5e\x75"
+                         "\xb9\x07\x67\xcc\xc8\xe7\x21\x15"
+                         "\xa7\xc8\x98\xff\x4b\x80\x1c\x12"
+                         "\xa8\x54\xe1\x38\x52\xe6\x74\x81"
+                         "\x97\x47\xa1\x41\x0e\xc0\x50\xe3"
+                         "\x55\x0e\xc3\xa7\x70\x77\xce\x07"
+                         "\xed\x8c\x88\xe6\xa1\x5b\x14\xec"
+                         "\xe6\xde\x06\x6d\x74\xc5\xd9\xfa"
+                         "\xe5\x2f\x5a\xff\xc8\x05\xee\x27"
+                         "\x35\x61\xbf\x0b\x19\x78\x9b\xd2"
+                         "\x04\xc7\x05\xb1\x79\xb4\xff\x5f"
+                         "\xf3\xea\x67\x52\x78\xc2\xce\x70"
+                         "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97"
+                         "\x37\x30\xe1\x91\x8d\xb3\x2a\xff",
+               .rlen   = 512,
+       },
+};
+
+static struct cipher_testvec tf_xts_dec_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
+       /* same as enc vectors with input and result reversed */
+       {
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
+                         "\x30\x74\xe4\x44\x52\x77\x97\x43"
+                         "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
+                         "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
+               .ilen   = 32,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .rlen   = 32,
+       }, {
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x57\x0e\x8f\xe5\x2a\x35\x61\x4f"
+                         "\x32\xd3\xbd\x36\x05\x15\x44\x2c"
+                         "\x58\x06\xf7\xf8\x00\xa8\xb6\xd5"
+                         "\xc6\x28\x92\xdb\xd8\x34\xa2\xe9",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
+       }, {
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x96\x45\x8f\x8d\x7a\x75\xb1\xde"
+                         "\x40\x0c\x89\x56\xf6\x4d\xa7\x07"
+                         "\x38\xbb\x5b\xe9\xcd\x84\xae\xb2"
+                         "\x7b\x6a\x62\xf4\x8c\xb5\x37\xea",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xa9\x78\xae\x1e\xea\xa2\x44\x4c"
+                         "\xa2\x7a\x64\x1f\xaf\x46\xc1\xe0"
+                         "\x6c\xb2\xf3\x92\x9a\xd6\x7d\x58"
+                         "\xb8\x2d\xb9\x5d\x58\x07\x66\x50"
+                         "\xea\x35\x35\x8c\xb2\x46\x61\x06"
+                         "\x5d\x65\xfc\x57\x8f\x69\x74\xab"
+                         "\x8a\x06\x69\xb5\x6c\xda\x66\xc7"
+                         "\x52\x90\xbb\x8e\x6d\x8b\xb5\xa2"
+                         "\x78\x1d\xc2\xa9\xc2\x73\x00\xc3"
+                         "\x32\x36\x7c\x97\x6b\x4e\x8a\x50"
+                         "\xe4\x91\x83\x96\x8f\xf4\x94\x1a"
+                         "\xa6\x27\xe1\x33\xcb\x91\xc6\x5f"
+                         "\x94\x75\xbc\xd7\x3e\x3e\x6f\x9e"
+                         "\xa9\x31\x80\x5e\xe5\xdb\xc8\x53"
+                         "\x01\x73\x68\x32\x25\x19\xfa\xfb"
+                         "\xe4\xcf\xb9\x3e\xa2\xa0\x8f\x31"
+                         "\xbf\x54\x06\x93\xa8\xb1\x0f\xb6"
+                         "\x7c\x3c\xde\x6f\x0f\xfb\x0c\x11"
+                         "\x39\x80\x39\x09\x97\x65\xf2\x83"
+                         "\xae\xe6\xa1\x6f\x47\xb8\x49\xde"
+                         "\x99\x36\x20\x7d\x97\x3b\xec\xfa"
+                         "\xb4\x33\x6e\x7a\xc7\x46\x84\x49"
+                         "\x91\xcd\xe1\x57\x0d\xed\x40\x08"
+                         "\x13\xf1\x4e\x3e\xa4\xa4\x5c\xe6"
+                         "\xd2\x0c\x20\x8f\x3e\xdf\x3f\x47"
+                         "\x9a\x2f\xde\x6d\x66\xc9\x99\x4a"
+                         "\x2d\x9e\x9d\x4b\x1a\x27\xa2\x12"
+                         "\x99\xf0\xf8\xb1\xb6\xf6\x57\xc3"
+                         "\xca\x1c\xa3\x8e\xed\x39\x28\xb5"
+                         "\x10\x1b\x4b\x08\x42\x00\x4a\xd3"
+                         "\xad\x5a\xc6\x8e\xc8\xbb\x95\xc4"
+                         "\x4b\xaa\xfe\xd5\x42\xa8\xa3\x6d"
+                         "\x3c\xf3\x34\x91\x2d\xb4\xdd\x20"
+                         "\x0c\x90\x6d\xa3\x9b\x66\x9d\x24"
+                         "\x02\xa6\xa9\x3f\x3f\x58\x5d\x47"
+                         "\x24\x65\x63\x7e\xbd\x8c\xe6\x52"
+                         "\x7d\xef\x33\x53\x63\xec\xaa\x0b"
+                         "\x64\x15\xa9\xa6\x1f\x10\x00\x38"
+                         "\x35\xa8\xe7\xbe\x23\x70\x22\xe0"
+                         "\xd3\xb9\xe6\xfd\xe6\xaa\x03\x50"
+                         "\xf3\x3c\x27\x36\x8b\xcc\xfe\x9c"
+                         "\x9c\xa3\xb3\xe7\x68\x9b\xa2\x71"
+                         "\xe0\x07\xd9\x1f\x68\x1f\xac\x5e"
+                         "\x7a\x74\x85\xa9\x6a\x90\xab\x2c"
+                         "\x38\x51\xbc\x1f\x43\x4a\x56\x1c"
+                         "\xf8\x47\x03\x4e\x67\xa8\x1f\x99"
+                         "\x04\x39\x73\x32\xb2\x86\x79\xe7"
+                         "\x14\x28\x70\xb8\xe2\x7d\x69\x85"
+                         "\xb6\x0f\xc5\xd0\xd0\x01\x5c\xe6"
+                         "\x09\x0f\x75\xf7\xb6\x81\xd2\x11"
+                         "\x20\x9c\xa1\xee\x11\x44\x79\xd0"
+                         "\xb2\x34\x77\xda\x10\x9a\x6f\x6f"
+                         "\xef\x7c\xd9\xdc\x35\xb7\x61\xdd"
+                         "\xf1\xa4\xc6\x1c\xbf\x05\x22\xac"
+                         "\xfe\x2f\x85\x00\x44\xdf\x33\x16"
+                         "\x35\xb6\xa3\xd3\x70\xdf\x69\x35"
+                         "\x6a\xc7\xb4\x99\x45\x27\xc8\x8e"
+                         "\x5a\x14\x30\xd0\x55\x3e\x4f\x64"
+                         "\x0d\x38\xe3\xdf\x8b\xa8\x93\x26"
+                         "\x75\xae\xf6\xb5\x23\x0b\x17\x31"
+                         "\xbf\x27\xb8\xb5\x94\x31\xa7\x8f"
+                         "\x43\xc4\x46\x24\x22\x4f\x8f\x7e"
+                         "\xe5\xf4\x6d\x1e\x0e\x18\x7a\xbb"
+                         "\xa6\x8f\xfb\x49\x49\xd8\x7e\x5a",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xd7\x4b\x93\x7d\x13\xa2\xa2\xe1"
+                         "\x35\x39\x71\x88\x76\x1e\xc9\xea"
+                         "\x86\xad\xf3\x14\x48\x3d\x5e\xe9"
+                         "\xe9\x2d\xb2\x56\x59\x35\x9d\xec"
+                         "\x84\xfa\x7e\x9d\x6d\x33\x36\x8f"
+                         "\xce\xf4\xa9\x21\x0b\x5f\x96\xec"
+                         "\xcb\xf9\x57\x68\x33\x88\x39\xbf"
+                         "\x2f\xbb\x59\x03\xbd\x66\x8b\x11"
+                         "\x11\x65\x51\x2e\xb8\x67\x05\xd1"
+                         "\x27\x11\x5c\xd4\xcc\x97\xc2\xb3"
+                         "\xa9\x55\xaf\x07\x56\xd1\xdc\xf5"
+                         "\x85\xdc\x46\xe6\xf0\x24\xeb\x93"
+                         "\x4d\xf0\x9b\xf5\x73\x1c\xda\x03"
+                         "\x22\xc8\x3a\x4f\xb4\x19\x91\x09"
+                         "\x54\x0b\xf6\xfe\x17\x3d\x1a\x53"
+                         "\x72\x60\x79\xcb\x0e\x32\x8a\x77"
+                         "\xd5\xed\xdb\x33\xd7\x62\x16\x69"
+                         "\x63\xe0\xab\xb5\xf6\x9c\x5f\x3d"
+                         "\x69\x35\x61\x86\xf8\x86\xb9\x89"
+                         "\x6e\x59\x35\xac\xf6\x6b\x33\xa0"
+                         "\xea\xef\x96\x62\xd8\xa9\xcf\x56"
+                         "\xbf\xdb\x8a\xfd\xa1\x82\x77\x73"
+                         "\x3d\x94\x4a\x49\x42\x6d\x08\x60"
+                         "\xa1\xea\xab\xb6\x88\x13\x94\xb8"
+                         "\x51\x98\xdb\x35\x85\xdf\xf6\xb9"
+                         "\x8f\xcd\xdf\x80\xd3\x40\x2d\x72"
+                         "\xb8\xb2\x6c\x02\x43\x35\x22\x2a"
+                         "\x31\xed\xcd\x16\x19\xdf\x62\x0f"
+                         "\x29\xcf\x87\x04\xec\x02\x4f\xe4"
+                         "\xa2\xed\x73\xc6\x69\xd3\x7e\x89"
+                         "\x0b\x76\x10\x7c\xd6\xf9\x6a\x25"
+                         "\xed\xcc\x60\x5d\x61\x20\xc1\x97"
+                         "\x56\x91\x57\x28\xbe\x71\x0d\xcd"
+                         "\xde\xc4\x9e\x55\x91\xbe\xd1\x28"
+                         "\x9b\x90\xeb\x73\xf3\x68\x51\xc6"
+                         "\xdf\x82\xcc\xd8\x1f\xce\x5b\x27"
+                         "\xc0\x60\x5e\x33\xd6\xa7\x20\xea"
+                         "\xb2\x54\xc7\x5d\x6a\x3b\x67\x47"
+                         "\xcf\xa0\xe3\xab\x86\xaf\xc1\x42"
+                         "\xe6\xb0\x23\x4a\xaf\x53\xdf\xa0"
+                         "\xad\x12\x32\x31\x03\xf7\x21\xbe"
+                         "\x2d\xd5\x82\x42\xb6\x4a\x3d\xcd"
+                         "\xd8\x81\x77\xa9\x49\x98\x6c\x09"
+                         "\xc5\xa3\x61\x12\x62\x85\x6b\xcd"
+                         "\xb3\xf4\x20\x0c\x41\xc4\x05\x37"
+                         "\x46\x5f\xeb\x71\x8b\xf1\xaf\x6e"
+                         "\xba\xf3\x50\x2e\xfe\xa8\x37\xeb"
+                         "\xe8\x8c\x4f\xa4\x0c\xf1\x31\xc8"
+                         "\x6e\x71\x4f\xa5\xd7\x97\x73\xe0"
+                         "\x93\x4a\x2f\xda\x7b\xe0\x20\x54"
+                         "\x1f\x8d\x85\x79\x0b\x7b\x5e\x75"
+                         "\xb9\x07\x67\xcc\xc8\xe7\x21\x15"
+                         "\xa7\xc8\x98\xff\x4b\x80\x1c\x12"
+                         "\xa8\x54\xe1\x38\x52\xe6\x74\x81"
+                         "\x97\x47\xa1\x41\x0e\xc0\x50\xe3"
+                         "\x55\x0e\xc3\xa7\x70\x77\xce\x07"
+                         "\xed\x8c\x88\xe6\xa1\x5b\x14\xec"
+                         "\xe6\xde\x06\x6d\x74\xc5\xd9\xfa"
+                         "\xe5\x2f\x5a\xff\xc8\x05\xee\x27"
+                         "\x35\x61\xbf\x0b\x19\x78\x9b\xd2"
+                         "\x04\xc7\x05\xb1\x79\xb4\xff\x5f"
+                         "\xf3\xea\x67\x52\x78\xc2\xce\x70"
+                         "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97"
+                         "\x37\x30\xe1\x91\x8d\xb3\x2a\xff",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
+       },
+};
+
+/*
+ * Serpent test vectors.  These are backwards because Serpent writes
+ * octet sequences in right-to-left mode.
+ */
+#define SERPENT_ENC_TEST_VECTORS       5
+#define SERPENT_DEC_TEST_VECTORS       5
+
+#define TNEPRES_ENC_TEST_VECTORS       4
+#define TNEPRES_DEC_TEST_VECTORS       4
+
+#define SERPENT_CBC_ENC_TEST_VECTORS   1
+#define SERPENT_CBC_DEC_TEST_VECTORS   1
+
+#define SERPENT_CTR_ENC_TEST_VECTORS   2
+#define SERPENT_CTR_DEC_TEST_VECTORS   2
+
+#define SERPENT_LRW_ENC_TEST_VECTORS   8
+#define SERPENT_LRW_DEC_TEST_VECTORS   8
+
+#define SERPENT_XTS_ENC_TEST_VECTORS   5
+#define SERPENT_XTS_DEC_TEST_VECTORS   5
+
+static struct cipher_testvec serpent_enc_tv_template[] = {
+       {
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .ilen   = 16,
+               .result = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
+                         "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .klen   = 16,
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .ilen   = 16,
+               .result = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
+                         "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .klen   = 32,
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .ilen   = 16,
+               .result = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
+                         "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
+               .klen   = 16,
+               .input  = zeroed_string,
+               .ilen   = 16,
+               .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
+                         "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
+               .rlen   = 16,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .ilen   = 144,
+               .result = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
+                         "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
+                         "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
+                         "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
+                         "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
+                         "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
+                         "\x99\x34\x89\x5B\x54\xE9\x12\x13"
+                         "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
+                         "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
+                         "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
+                         "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
+                         "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
+                         "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
+                         "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
+                         "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
+                         "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
+                         "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
+                         "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
+               .rlen   = 144,
+       },
+};
+
+static struct cipher_testvec tnepres_enc_tv_template[] = {
+       { /* KeySize=128, PT=0, I=1 */
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 16,
+               .ilen   = 16,
+               .result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05"
+                         "\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd",
+               .rlen   = 16,
+       }, { /* KeySize=192, PT=0, I=1 */
+               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 24,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 16,
+               .result = "\xe7\x8e\x54\x02\xc7\x19\x55\x68"
+                         "\xac\x36\x78\xf7\xa3\xf6\x0c\x66",
+               .rlen   = 16,
+       }, { /* KeySize=256, PT=0, I=1 */
+               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 16,
+               .result = "\xab\xed\x96\xe7\x66\xbf\x28\xcb"
+                         "\xc0\xeb\xd2\x1a\x82\xef\x08\x19",
+               .rlen   = 16,
+       }, { /* KeySize=256, I=257 */
+               .key    = "\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18"
+                         "\x17\x16\x15\x14\x13\x12\x11\x10"
+                         "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
+                         "\x07\x06\x05\x04\x03\x02\x01\x00",
+               .klen   = 32,
+               .input  = "\x0f\x0e\x0d\x0c\x0b\x0a\x09\x08"
+                         "\x07\x06\x05\x04\x03\x02\x01\x00",
+               .ilen   = 16,
+               .result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b"
+                         "\xb8\x32\xe4\x33\xf8\x9f\x26\xde",
+               .rlen   = 16,
+       },
+};
+
+
+static struct cipher_testvec serpent_dec_tv_template[] = {
+       {
+               .input  = "\x12\x07\xfc\xce\x9b\xd0\xd6\x47"
+                         "\x6a\xe9\x8f\xbe\xd1\x43\xa0\xe2",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .klen   = 16,
+               .input  = "\x4c\x7d\x8a\x32\x80\x72\xa2\x2c"
+                         "\x82\x3e\x4a\x1f\x3a\xcd\xa1\x6d",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .klen   = 32,
+               .input  = "\xde\x26\x9f\xf8\x33\xe4\x32\xb8"
+                         "\x5b\x2e\x88\xd2\x70\x1c\xe7\x5c",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
+               .klen   = 16,
+               .input  = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
+                         "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
+               .ilen   = 16,
+               .result = zeroed_string,
+               .rlen   = 16,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .input  = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
+                         "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
+                         "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
+                         "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
+                         "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
+                         "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
+                         "\x99\x34\x89\x5B\x54\xE9\x12\x13"
+                         "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
+                         "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
+                         "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
+                         "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
+                         "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
+                         "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
+                         "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
+                         "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
+                         "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
+                         "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
+                         "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
+               .ilen   = 144,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .rlen   = 144,
+       },
+};
+
+static struct cipher_testvec tnepres_dec_tv_template[] = {
+       {
+               .input  = "\x41\xcc\x6b\x31\x59\x31\x45\x97"
+                         "\x6d\x6f\xbb\x38\x4b\x37\x21\x28",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .klen   = 16,
+               .input  = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47"
+                         "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .klen   = 32,
+               .input  = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49"
+                         "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee",
+               .ilen   = 16,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .rlen   = 16,
+       }, { /* KeySize=128, I=121 */
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80",
+               .klen   = 16,
+               .input  = "\x3d\xda\xbf\xc0\x06\xda\xab\x06"
+                         "\x46\x2a\xf4\xef\x81\x54\x4e\x26",
+               .ilen   = 16,
+               .result = zeroed_string,
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec serpent_cbc_enc_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .ilen   = 144,
+               .result = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
+                         "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
+                         "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
+                         "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
+                         "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
+                         "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
+                         "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
+                         "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
+                         "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
+                         "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
+                         "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
+                         "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
+                         "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
+                         "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
+                         "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
+                         "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
+                         "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
+                         "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
+               .rlen   = 144,
+       },
+};
+
+static struct cipher_testvec serpent_cbc_dec_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
+                         "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
+                         "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
+                         "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
+                         "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
+                         "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
+                         "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
+                         "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
+                         "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
+                         "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
+                         "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
+                         "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
+                         "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
+                         "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
+                         "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
+                         "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
+                         "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
+                         "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
+               .ilen   = 144,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .rlen   = 144,
+       },
+};
+
+static struct cipher_testvec serpent_ctr_enc_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .ilen   = 144,
+               .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
+                         "\x37\x69\xE3\x3A\x22\x85\x48\x46"
+                         "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
+                         "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
+                         "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
+                         "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
+                         "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
+                         "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
+                         "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
+                         "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
+                         "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
+                         "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
+                         "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
+                         "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
+                         "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
+                         "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
+                         "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
+                         "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
+               .rlen   = 144,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
+                         "\xF1\x65\xFC",
+               .ilen   = 147,
+               .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
+                         "\x37\x69\xE3\x3A\x22\x85\x48\x46"
+                         "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
+                         "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
+                         "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
+                         "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
+                         "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
+                         "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
+                         "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
+                         "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
+                         "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
+                         "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
+                         "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
+                         "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
+                         "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
+                         "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
+                         "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
+                         "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
+                         "\xE6\xD0\x97",
+               .rlen   = 147,
+       },
+};
+
+static struct cipher_testvec serpent_ctr_dec_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
+                         "\x37\x69\xE3\x3A\x22\x85\x48\x46"
+                         "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
+                         "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
+                         "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
+                         "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
+                         "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
+                         "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
+                         "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
+                         "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
+                         "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
+                         "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
+                         "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
+                         "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
+                         "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
+                         "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
+                         "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
+                         "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
+               .ilen   = 144,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
+               .rlen   = 144,
+       }, { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
+                         "\x37\x69\xE3\x3A\x22\x85\x48\x46"
+                         "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
+                         "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
+                         "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
+                         "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
+                         "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
+                         "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
+                         "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
+                         "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
+                         "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
+                         "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
+                         "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
+                         "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
+                         "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
+                         "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
+                         "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
+                         "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
+                         "\xE6\xD0\x97",
+               .ilen   = 147,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
+                         "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
+                         "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
+                         "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
+                         "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
+                         "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
+                         "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
+                         "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
+                         "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
+                         "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
+                         "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
+                         "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
+                         "\xF1\x65\xFC",
+               .rlen   = 147,
+       },
+};
+
+static struct cipher_testvec serpent_lrw_enc_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
+       {
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
+                         "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
+               .rlen   = 16,
+       }, {
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
+                         "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
+               .rlen   = 16,
+       }, {
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
+                         "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
+               .rlen   = 16,
+       }, {
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
+                         "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
+               .rlen   = 16,
+       }, {
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
+                         "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
+               .rlen   = 16,
+       }, {
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
+                         "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
+               .rlen   = 16,
+       }, {
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
+                         "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
+               .rlen   = 16,
+       }, {
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .ilen   = 512,
+               .result = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
+                         "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
+                         "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
+                         "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
+                         "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
+                         "\xce\xab\xda\x33\x30\x20\x12\xfa"
+                         "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
+                         "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
+                         "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
+                         "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
+                         "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
+                         "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
+                         "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
+                         "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
+                         "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
+                         "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
+                         "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
+                         "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
+                         "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
+                         "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
+                         "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
+                         "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
+                         "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
+                         "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
+                         "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
+                         "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
+                         "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
+                         "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
+                         "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
+                         "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
+                         "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
+                         "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
+                         "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
+                         "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
+                         "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
+                         "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
+                         "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
+                         "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
+                         "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
+                         "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
+                         "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
+                         "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
+                         "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
+                         "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
+                         "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
+                         "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
+                         "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
+                         "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
+                         "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
+                         "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
+                         "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
+                         "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
+                         "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
+                         "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
+                         "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
+                         "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
+                         "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
+                         "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
+                         "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
+                         "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
+                         "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
+                         "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
+                         "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
+                         "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
+               .rlen   = 512,
+       },
+};
+
+static struct cipher_testvec serpent_lrw_dec_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
+       /* same as enc vectors with input and result reversed */
+       {
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79"
+                         "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\xfd\xb2\x66\x98\x80\x96\x55\xad"
+                         "\x08\x94\x54\x9c\x21\x7c\x69\xe3",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34"
+                         "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc"
+                         "\x5d\x45\x95\x30\x8f\xff\x2f\x1b",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f"
+                         "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c"
+                         "\x2e\x18\xe6\x99\xcd\xd3\x15\x68",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6"
+                         "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
+       }, {
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74"
+                         "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d"
+                         "\x82\xec\xf1\x5f\x03\x6d\x02\x58"
+                         "\x90\x67\xfc\xdd\x8d\xe1\x38\x08"
+                         "\x7b\xc9\x9b\x4b\x04\x09\x50\x15"
+                         "\xce\xab\xda\x33\x30\x20\x12\xfa"
+                         "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9"
+                         "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c"
+                         "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22"
+                         "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b"
+                         "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5"
+                         "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5"
+                         "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b"
+                         "\x89\x58\x7c\x9a\xae\x26\xe8\xb7"
+                         "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d"
+                         "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47"
+                         "\x5f\x03\x8b\xdd\x94\xd1\xee\x12"
+                         "\xa7\x83\x80\xf2\xc1\x15\x74\x4f"
+                         "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f"
+                         "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52"
+                         "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98"
+                         "\x04\xd6\xdd\x4c\x00\x64\xd9\x54"
+                         "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8"
+                         "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b"
+                         "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9"
+                         "\x04\xc3\x6f\x17\x66\xa9\x1f\x59"
+                         "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b"
+                         "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43"
+                         "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb"
+                         "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49"
+                         "\xb3\xac\x5d\xcf\x31\xa0\x27\x26"
+                         "\x21\xbe\x94\x2e\x19\xea\xf4\xee"
+                         "\xb5\x13\x89\xf7\x94\x0b\xef\x59"
+                         "\x44\xc5\x78\x8b\x3c\x3b\x71\x20"
+                         "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2"
+                         "\xb4\x11\x0e\x2c\x61\xa1\x52\x46"
+                         "\x18\x11\x16\xc6\x86\x44\xa7\xaf"
+                         "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b"
+                         "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea"
+                         "\x3f\x0e\x90\xd6\x8f\x83\x30\x64"
+                         "\xb5\x51\x2d\x08\x3c\xcd\x99\x36"
+                         "\x96\xd4\xb1\xb5\x48\x30\xca\x48"
+                         "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d"
+                         "\x12\x33\x2f\xc0\xe8\xda\xec\x8a"
+                         "\xe1\x88\x72\x63\xde\x20\xa3\xe1"
+                         "\x8e\xac\x84\x37\x35\xf5\xf7\x3f"
+                         "\x00\x02\x0e\xe4\xc1\x53\x68\x3f"
+                         "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d"
+                         "\x7c\x83\xd0\xbd\xaa\x97\x35\x36"
+                         "\x98\x88\x59\x5d\xe7\x24\xe3\x90"
+                         "\x9d\x30\x47\xa7\xc3\x60\x35\xf4"
+                         "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b"
+                         "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d"
+                         "\x49\x5a\x3c\x8a\xa3\x01\xae\x25"
+                         "\x42\xab\xd2\x87\x1b\x35\xd6\xd2"
+                         "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39"
+                         "\x1c\x58\xa2\xb4\xd0\x78\x55\x72"
+                         "\x76\x59\xea\xd9\xd7\x6e\x63\x8b"
+                         "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68"
+                         "\x86\x28\xd1\xbb\x54\x8d\x66\xad"
+                         "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd"
+                         "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a"
+                         "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
+                         "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
+               .ilen   = 512,
+               .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .rlen   = 512,
+       },
+};
+
+static struct cipher_testvec serpent_xts_enc_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
+       {
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 32,
+               .result = "\xe1\x08\xb8\x1d\x2c\xf5\x33\x64"
+                         "\xc8\x12\x04\xc7\xb3\x70\xe8\xc4"
+                         "\x6a\x31\xc5\xf3\x00\xca\xb9\x16"
+                         "\xde\xe2\x77\x66\xf7\xfe\x62\x08",
+               .rlen   = 32,
+       }, {
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\x1a\x0a\x09\x5f\xcd\x07\x07\x98"
+                         "\x41\x86\x12\xaf\xb3\xd7\x68\x13"
+                         "\xed\x81\xcd\x06\x87\x43\x1a\xbb"
+                         "\x13\x3d\xd6\x1e\x2b\xe1\x77\xbe",
+               .rlen   = 32,
+       }, {
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\xf9\x9b\x28\xb8\x5c\xaf\x8c\x61"
+                         "\xb6\x1c\x81\x8f\x2c\x87\x60\x89"
+                         "\x0d\x8d\x7a\xe8\x60\x48\xcc\x86"
+                         "\xc1\x68\x45\xaa\x00\xe9\x24\xc5",
+               .rlen   = 32,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\xfe\x47\x4a\xc8\x60\x7e\xb4\x8b"
+                         "\x0d\x10\xf4\xb0\x0d\xba\xf8\x53"
+                         "\x65\x6e\x38\x4b\xdb\xaa\xb1\x9e"
+                         "\x28\xca\xb0\x22\xb3\x85\x75\xf4"
+                         "\x00\x5c\x75\x14\x06\xd6\x25\x82"
+                         "\xe6\xcb\x08\xf7\x29\x90\x23\x8e"
+                         "\xa4\x68\x57\xe4\xf0\xd8\x32\xf3"
+                         "\x80\x51\x67\xb5\x0b\x85\x69\xe8"
+                         "\x19\xfe\xc4\xc7\x3e\xea\x90\xd3"
+                         "\x8f\xa3\xf2\x0a\xac\x17\x4b\xa0"
+                         "\x63\x5a\x16\x0f\xf0\xce\x66\x1f"
+                         "\x2c\x21\x07\xf1\xa4\x03\xa3\x44"
+                         "\x41\x61\x87\x5d\x6b\xb3\xef\xd4"
+                         "\xfc\xaa\x32\x7e\x55\x58\x04\x41"
+                         "\xc9\x07\x33\xc6\xa2\x68\xd6\x5a"
+                         "\x55\x79\x4b\x6f\xcf\x89\xb9\x19"
+                         "\xe5\x54\x13\x15\xb2\x1a\xfa\x15"
+                         "\xc2\xf0\x06\x59\xfa\xa0\x25\x05"
+                         "\x58\xfa\x43\x91\x16\x85\x40\xbb"
+                         "\x0d\x34\x4d\xc5\x1e\x20\xd5\x08"
+                         "\xcd\x22\x22\x41\x11\x9f\x6c\x7c"
+                         "\x8d\x57\xc9\xba\x57\xe8\x2c\xf7"
+                         "\xa0\x42\xa8\xde\xfc\xa3\xca\x98"
+                         "\x4b\x43\xb1\xce\x4b\xbf\x01\x67"
+                         "\x6e\x29\x60\xbd\x10\x14\x84\x82"
+                         "\x83\x82\x0c\x63\x73\x92\x02\x7c"
+                         "\x55\x37\x20\x80\x17\x51\xc8\xbc"
+                         "\x46\x02\xcb\x38\x07\x6d\xe2\x85"
+                         "\xaa\x29\xaf\x24\x58\x0d\xf0\x75"
+                         "\x08\x0a\xa5\x34\x25\x16\xf3\x74"
+                         "\xa7\x0b\x97\xbe\xc1\xa9\xdc\x29"
+                         "\x1a\x0a\x56\xc1\x1a\x91\x97\x8c"
+                         "\x0b\xc7\x16\xed\x5a\x22\xa6\x2e"
+                         "\x8c\x2b\x4f\x54\x76\x47\x53\x8e"
+                         "\xe8\x00\xec\x92\xb9\x55\xe6\xa2"
+                         "\xf3\xe2\x4f\x6a\x66\x60\xd0\x87"
+                         "\xe6\xd1\xcc\xe3\x6a\xc5\x2d\x21"
+                         "\xcc\x9d\x6a\xb6\x75\xaa\xe2\x19"
+                         "\x21\x9f\xa1\x5e\x4c\xfd\x72\xf9"
+                         "\x94\x4e\x63\xc7\xae\xfc\xed\x47"
+                         "\xe2\xfe\x7a\x63\x77\xfe\x97\x82"
+                         "\xb1\x10\x6e\x36\x1d\xe1\xc4\x80"
+                         "\xec\x69\x41\xec\xa7\x8a\xe0\x2f"
+                         "\xe3\x49\x26\xa2\x41\xb2\x08\x0f"
+                         "\x28\xb4\xa7\x39\xa1\x99\x2d\x1e"
+                         "\x43\x42\x35\xd0\xcf\xec\x77\x67"
+                         "\xb2\x3b\x9e\x1c\x35\xde\x4f\x5e"
+                         "\x73\x3f\x5d\x6f\x07\x4b\x2e\x50"
+                         "\xab\x6c\x6b\xff\xea\x00\x67\xaa"
+                         "\x0e\x82\x32\xdd\x3d\xb5\xe5\x76"
+                         "\x2b\x77\x3f\xbe\x12\x75\xfb\x92"
+                         "\xc6\x89\x67\x4d\xca\xf7\xd4\x50"
+                         "\xc0\x74\x47\xcc\xd9\x0a\xd4\xc6"
+                         "\x3b\x17\x2e\xe3\x35\xbb\x53\xb5"
+                         "\x86\xad\x51\xcc\xd5\x96\xb8\xdc"
+                         "\x03\x57\xe6\x98\x52\x2f\x61\x62"
+                         "\xc4\x5c\x9c\x36\x71\x07\xfb\x94"
+                         "\xe3\x02\xc4\x2b\x08\x75\xc7\x35"
+                         "\xfb\x2e\x88\x7b\xbb\x67\x00\xe1"
+                         "\xc9\xdd\x99\xb2\x13\x53\x1a\x4e"
+                         "\x76\x87\x19\x04\x1a\x2f\x38\x3e"
+                         "\xef\x91\x64\x1d\x18\x07\x4e\x31"
+                         "\x88\x21\x7c\xb0\xa5\x12\x4c\x3c"
+                         "\xb0\x20\xbd\xda\xdf\xf9\x7c\xdd",
+               .rlen   = 512,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\x2b\xc9\xb4\x6b\x10\x94\xa9\x32"
+                         "\xaa\xb0\x20\xc6\x44\x3d\x74\x1f"
+                         "\x75\x01\xa7\xf6\xf5\xf7\x62\x1b"
+                         "\x80\x1b\x82\xcb\x01\x59\x91\x7f"
+                         "\x80\x3a\x98\xf0\xd2\xca\xc4\xc3"
+                         "\x34\xfd\xe6\x11\xf9\x33\x45\x12"
+                         "\x48\xc5\x8c\x25\xf1\xc5\xc5\x23"
+                         "\xd3\x44\xb4\x73\xd5\x04\xc0\xb7"
+                         "\xca\x2f\xf5\xcd\xc5\xb4\xdd\xb0"
+                         "\xf4\x60\xe8\xfb\xc6\x9c\xc5\x78"
+                         "\xcd\xec\x7d\xdc\x19\x9c\x72\x64"
+                         "\x63\x0b\x38\x2e\x76\xdd\x2d\x36"
+                         "\x49\xb0\x1d\xea\x78\x9e\x00\xca"
+                         "\x20\xcc\x1b\x1e\x98\x74\xab\xed"
+                         "\x79\xf7\xd0\x6c\xd8\x93\x80\x29"
+                         "\xac\xa5\x5e\x34\xa9\xab\xa0\x55"
+                         "\x9a\xea\xaa\x95\x4d\x7b\xfe\x46"
+                         "\x26\x8a\xfd\x88\xa2\xa8\xa6\xae"
+                         "\x25\x42\x17\xbf\x76\x8f\x1c\x3d"
+                         "\xec\x9a\xda\x64\x96\xb5\x61\xff"
+                         "\x99\xeb\x12\x96\x85\x82\x9d\xd5"
+                         "\x81\x85\x14\xa8\x59\xac\x8c\x94"
+                         "\xbb\x3b\x85\x2b\xdf\xb3\x0c\xba"
+                         "\x82\xc6\x4d\xca\x86\xea\x53\x28"
+                         "\x4c\xe0\x4e\x31\xe3\x73\x2f\x79"
+                         "\x9d\x42\xe1\x03\xe3\x8b\xc4\xff"
+                         "\x05\xca\x81\x7b\xda\xa2\xde\x63"
+                         "\x3a\x10\xbe\xc2\xac\x32\xc4\x05"
+                         "\x47\x7e\xef\x67\xe2\x5f\x5b\xae"
+                         "\xed\xf1\x70\x34\x16\x9a\x07\x7b"
+                         "\xf2\x25\x2b\xb0\xf8\x3c\x15\x9a"
+                         "\xa6\x59\x55\x5f\xc1\xf4\x1e\xcd"
+                         "\x93\x1f\x06\xba\xd4\x9a\x22\x69"
+                         "\xfa\x8e\x95\x0d\xf3\x23\x59\x2c"
+                         "\xfe\x00\xba\xf0\x0e\xbc\x6d\xd6"
+                         "\x62\xf0\x7a\x0e\x83\x3e\xdb\x32"
+                         "\xfd\x43\x7d\xda\x42\x51\x87\x43"
+                         "\x9d\xf9\xef\xf4\x30\x97\xf8\x09"
+                         "\x88\xfc\x3f\x93\x70\xc1\x4a\xec"
+                         "\x27\x5f\x11\xac\x71\xc7\x48\x46"
+                         "\x2f\xf9\xdf\x8d\x9f\xf7\x2e\x56"
+                         "\x0d\x4e\xb0\x32\x76\xce\x86\x81"
+                         "\xcd\xdf\xe4\x00\xbf\xfd\x5f\x24"
+                         "\xaf\xf7\x9a\xde\xff\x18\xac\x14"
+                         "\x90\xc5\x01\x39\x34\x0f\x24\xf3"
+                         "\x13\x2f\x5e\x4f\x30\x9a\x36\x40"
+                         "\xec\xea\xbc\xcd\x9e\x0e\x5b\x23"
+                         "\x50\x88\x97\x40\x69\xb1\x37\xf5"
+                         "\xc3\x15\xf9\x3f\xb7\x79\x64\xe8"
+                         "\x7b\x10\x20\xb9\x2b\x46\x83\x5b"
+                         "\xd8\x39\xfc\xe4\xfa\x88\x52\xf2"
+                         "\x72\xb0\x97\x4e\x89\xb3\x48\x00"
+                         "\xc1\x16\x73\x50\x77\xba\xa6\x65"
+                         "\x20\x2d\xb0\x02\x27\x89\xda\x99"
+                         "\x45\xfb\xe9\xd3\x1d\x39\x2f\xd6"
+                         "\x2a\xda\x09\x12\x11\xaf\xe6\x57"
+                         "\x01\x04\x8a\xff\x86\x8b\xac\xf8"
+                         "\xee\xe4\x1c\x98\x5b\xcf\x6b\x76"
+                         "\xa3\x0e\x33\x74\x40\x18\x39\x72"
+                         "\x66\x50\x31\xfd\x70\xdf\xe8\x51"
+                         "\x96\x21\x36\xb2\x9b\xfa\x85\xd1"
+                         "\x30\x05\xc8\x92\x98\x80\xff\x7a"
+                         "\xaf\x43\x0b\xc5\x20\x41\x92\x20"
+                         "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1",
+               .rlen   = 512,
+       },
+};
+
+static struct cipher_testvec serpent_xts_dec_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
+       /* same as enc vectors with input and result reversed */
+       {
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xe1\x08\xb8\x1d\x2c\xf5\x33\x64"
+                         "\xc8\x12\x04\xc7\xb3\x70\xe8\xc4"
+                         "\x6a\x31\xc5\xf3\x00\xca\xb9\x16"
+                         "\xde\xe2\x77\x66\xf7\xfe\x62\x08",
+               .ilen   = 32,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .rlen   = 32,
+       }, {
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x1a\x0a\x09\x5f\xcd\x07\x07\x98"
+                         "\x41\x86\x12\xaf\xb3\xd7\x68\x13"
+                         "\xed\x81\xcd\x06\x87\x43\x1a\xbb"
+                         "\x13\x3d\xd6\x1e\x2b\xe1\x77\xbe",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
+       }, {
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xf9\x9b\x28\xb8\x5c\xaf\x8c\x61"
+                         "\xb6\x1c\x81\x8f\x2c\x87\x60\x89"
+                         "\x0d\x8d\x7a\xe8\x60\x48\xcc\x86"
+                         "\xc1\x68\x45\xaa\x00\xe9\x24\xc5",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xfe\x47\x4a\xc8\x60\x7e\xb4\x8b"
+                         "\x0d\x10\xf4\xb0\x0d\xba\xf8\x53"
+                         "\x65\x6e\x38\x4b\xdb\xaa\xb1\x9e"
+                         "\x28\xca\xb0\x22\xb3\x85\x75\xf4"
+                         "\x00\x5c\x75\x14\x06\xd6\x25\x82"
+                         "\xe6\xcb\x08\xf7\x29\x90\x23\x8e"
+                         "\xa4\x68\x57\xe4\xf0\xd8\x32\xf3"
+                         "\x80\x51\x67\xb5\x0b\x85\x69\xe8"
+                         "\x19\xfe\xc4\xc7\x3e\xea\x90\xd3"
+                         "\x8f\xa3\xf2\x0a\xac\x17\x4b\xa0"
+                         "\x63\x5a\x16\x0f\xf0\xce\x66\x1f"
+                         "\x2c\x21\x07\xf1\xa4\x03\xa3\x44"
+                         "\x41\x61\x87\x5d\x6b\xb3\xef\xd4"
+                         "\xfc\xaa\x32\x7e\x55\x58\x04\x41"
+                         "\xc9\x07\x33\xc6\xa2\x68\xd6\x5a"
+                         "\x55\x79\x4b\x6f\xcf\x89\xb9\x19"
+                         "\xe5\x54\x13\x15\xb2\x1a\xfa\x15"
+                         "\xc2\xf0\x06\x59\xfa\xa0\x25\x05"
+                         "\x58\xfa\x43\x91\x16\x85\x40\xbb"
+                         "\x0d\x34\x4d\xc5\x1e\x20\xd5\x08"
+                         "\xcd\x22\x22\x41\x11\x9f\x6c\x7c"
+                         "\x8d\x57\xc9\xba\x57\xe8\x2c\xf7"
+                         "\xa0\x42\xa8\xde\xfc\xa3\xca\x98"
+                         "\x4b\x43\xb1\xce\x4b\xbf\x01\x67"
+                         "\x6e\x29\x60\xbd\x10\x14\x84\x82"
+                         "\x83\x82\x0c\x63\x73\x92\x02\x7c"
+                         "\x55\x37\x20\x80\x17\x51\xc8\xbc"
+                         "\x46\x02\xcb\x38\x07\x6d\xe2\x85"
+                         "\xaa\x29\xaf\x24\x58\x0d\xf0\x75"
+                         "\x08\x0a\xa5\x34\x25\x16\xf3\x74"
+                         "\xa7\x0b\x97\xbe\xc1\xa9\xdc\x29"
+                         "\x1a\x0a\x56\xc1\x1a\x91\x97\x8c"
+                         "\x0b\xc7\x16\xed\x5a\x22\xa6\x2e"
+                         "\x8c\x2b\x4f\x54\x76\x47\x53\x8e"
+                         "\xe8\x00\xec\x92\xb9\x55\xe6\xa2"
+                         "\xf3\xe2\x4f\x6a\x66\x60\xd0\x87"
+                         "\xe6\xd1\xcc\xe3\x6a\xc5\x2d\x21"
+                         "\xcc\x9d\x6a\xb6\x75\xaa\xe2\x19"
+                         "\x21\x9f\xa1\x5e\x4c\xfd\x72\xf9"
+                         "\x94\x4e\x63\xc7\xae\xfc\xed\x47"
+                         "\xe2\xfe\x7a\x63\x77\xfe\x97\x82"
+                         "\xb1\x10\x6e\x36\x1d\xe1\xc4\x80"
+                         "\xec\x69\x41\xec\xa7\x8a\xe0\x2f"
+                         "\xe3\x49\x26\xa2\x41\xb2\x08\x0f"
+                         "\x28\xb4\xa7\x39\xa1\x99\x2d\x1e"
+                         "\x43\x42\x35\xd0\xcf\xec\x77\x67"
+                         "\xb2\x3b\x9e\x1c\x35\xde\x4f\x5e"
+                         "\x73\x3f\x5d\x6f\x07\x4b\x2e\x50"
+                         "\xab\x6c\x6b\xff\xea\x00\x67\xaa"
+                         "\x0e\x82\x32\xdd\x3d\xb5\xe5\x76"
+                         "\x2b\x77\x3f\xbe\x12\x75\xfb\x92"
+                         "\xc6\x89\x67\x4d\xca\xf7\xd4\x50"
+                         "\xc0\x74\x47\xcc\xd9\x0a\xd4\xc6"
+                         "\x3b\x17\x2e\xe3\x35\xbb\x53\xb5"
+                         "\x86\xad\x51\xcc\xd5\x96\xb8\xdc"
+                         "\x03\x57\xe6\x98\x52\x2f\x61\x62"
+                         "\xc4\x5c\x9c\x36\x71\x07\xfb\x94"
+                         "\xe3\x02\xc4\x2b\x08\x75\xc7\x35"
+                         "\xfb\x2e\x88\x7b\xbb\x67\x00\xe1"
+                         "\xc9\xdd\x99\xb2\x13\x53\x1a\x4e"
+                         "\x76\x87\x19\x04\x1a\x2f\x38\x3e"
+                         "\xef\x91\x64\x1d\x18\x07\x4e\x31"
+                         "\x88\x21\x7c\xb0\xa5\x12\x4c\x3c"
+                         "\xb0\x20\xbd\xda\xdf\xf9\x7c\xdd",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x2b\xc9\xb4\x6b\x10\x94\xa9\x32"
+                         "\xaa\xb0\x20\xc6\x44\x3d\x74\x1f"
+                         "\x75\x01\xa7\xf6\xf5\xf7\x62\x1b"
+                         "\x80\x1b\x82\xcb\x01\x59\x91\x7f"
+                         "\x80\x3a\x98\xf0\xd2\xca\xc4\xc3"
+                         "\x34\xfd\xe6\x11\xf9\x33\x45\x12"
+                         "\x48\xc5\x8c\x25\xf1\xc5\xc5\x23"
+                         "\xd3\x44\xb4\x73\xd5\x04\xc0\xb7"
+                         "\xca\x2f\xf5\xcd\xc5\xb4\xdd\xb0"
+                         "\xf4\x60\xe8\xfb\xc6\x9c\xc5\x78"
+                         "\xcd\xec\x7d\xdc\x19\x9c\x72\x64"
+                         "\x63\x0b\x38\x2e\x76\xdd\x2d\x36"
+                         "\x49\xb0\x1d\xea\x78\x9e\x00\xca"
+                         "\x20\xcc\x1b\x1e\x98\x74\xab\xed"
+                         "\x79\xf7\xd0\x6c\xd8\x93\x80\x29"
+                         "\xac\xa5\x5e\x34\xa9\xab\xa0\x55"
+                         "\x9a\xea\xaa\x95\x4d\x7b\xfe\x46"
+                         "\x26\x8a\xfd\x88\xa2\xa8\xa6\xae"
+                         "\x25\x42\x17\xbf\x76\x8f\x1c\x3d"
+                         "\xec\x9a\xda\x64\x96\xb5\x61\xff"
+                         "\x99\xeb\x12\x96\x85\x82\x9d\xd5"
+                         "\x81\x85\x14\xa8\x59\xac\x8c\x94"
+                         "\xbb\x3b\x85\x2b\xdf\xb3\x0c\xba"
+                         "\x82\xc6\x4d\xca\x86\xea\x53\x28"
+                         "\x4c\xe0\x4e\x31\xe3\x73\x2f\x79"
+                         "\x9d\x42\xe1\x03\xe3\x8b\xc4\xff"
+                         "\x05\xca\x81\x7b\xda\xa2\xde\x63"
+                         "\x3a\x10\xbe\xc2\xac\x32\xc4\x05"
+                         "\x47\x7e\xef\x67\xe2\x5f\x5b\xae"
+                         "\xed\xf1\x70\x34\x16\x9a\x07\x7b"
+                         "\xf2\x25\x2b\xb0\xf8\x3c\x15\x9a"
+                         "\xa6\x59\x55\x5f\xc1\xf4\x1e\xcd"
+                         "\x93\x1f\x06\xba\xd4\x9a\x22\x69"
+                         "\xfa\x8e\x95\x0d\xf3\x23\x59\x2c"
+                         "\xfe\x00\xba\xf0\x0e\xbc\x6d\xd6"
+                         "\x62\xf0\x7a\x0e\x83\x3e\xdb\x32"
+                         "\xfd\x43\x7d\xda\x42\x51\x87\x43"
+                         "\x9d\xf9\xef\xf4\x30\x97\xf8\x09"
+                         "\x88\xfc\x3f\x93\x70\xc1\x4a\xec"
+                         "\x27\x5f\x11\xac\x71\xc7\x48\x46"
+                         "\x2f\xf9\xdf\x8d\x9f\xf7\x2e\x56"
+                         "\x0d\x4e\xb0\x32\x76\xce\x86\x81"
+                         "\xcd\xdf\xe4\x00\xbf\xfd\x5f\x24"
+                         "\xaf\xf7\x9a\xde\xff\x18\xac\x14"
+                         "\x90\xc5\x01\x39\x34\x0f\x24\xf3"
+                         "\x13\x2f\x5e\x4f\x30\x9a\x36\x40"
+                         "\xec\xea\xbc\xcd\x9e\x0e\x5b\x23"
+                         "\x50\x88\x97\x40\x69\xb1\x37\xf5"
+                         "\xc3\x15\xf9\x3f\xb7\x79\x64\xe8"
+                         "\x7b\x10\x20\xb9\x2b\x46\x83\x5b"
+                         "\xd8\x39\xfc\xe4\xfa\x88\x52\xf2"
+                         "\x72\xb0\x97\x4e\x89\xb3\x48\x00"
+                         "\xc1\x16\x73\x50\x77\xba\xa6\x65"
+                         "\x20\x2d\xb0\x02\x27\x89\xda\x99"
+                         "\x45\xfb\xe9\xd3\x1d\x39\x2f\xd6"
+                         "\x2a\xda\x09\x12\x11\xaf\xe6\x57"
+                         "\x01\x04\x8a\xff\x86\x8b\xac\xf8"
+                         "\xee\xe4\x1c\x98\x5b\xcf\x6b\x76"
+                         "\xa3\x0e\x33\x74\x40\x18\x39\x72"
+                         "\x66\x50\x31\xfd\x70\xdf\xe8\x51"
+                         "\x96\x21\x36\xb2\x9b\xfa\x85\xd1"
+                         "\x30\x05\xc8\x92\x98\x80\xff\x7a"
+                         "\xaf\x43\x0b\xc5\x20\x41\x92\x20"
+                         "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
+       },
+};
+
+/* Cast6 test vectors from RFC 2612 */
+#define CAST6_ENC_TEST_VECTORS 3
+#define CAST6_DEC_TEST_VECTORS  3
+
+static struct cipher_testvec cast6_enc_tv_template[] = {
+       {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
+               .klen   = 16,
+               .input  = zeroed_string,
+               .ilen   = 16,
+               .result = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
+                         "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
+               .rlen   = 16,
+       }, {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
+                         "\xba\xc7\x7a\x77\x17\x94\x28\x63",
+               .klen   = 24,
+               .input  = zeroed_string,
+               .ilen   = 16,
+               .result = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
+                         "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
+               .rlen   = 16,
+       }, {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
+                         "\x8d\x7c\x47\xce\x26\x49\x08\x46"
+                         "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
+               .klen   = 32,
+               .input  = zeroed_string,
+               .ilen   = 16,
+               .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
+                         "\xc9\x87\x01\x36\x55\x33\x17\xfa",
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec cast6_dec_tv_template[] = {
+       {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\x0a\xf7\x56\x47\xf2\x9f\x61\x5d",
+               .klen   = 16,
+               .input  = "\xc8\x42\xa0\x89\x72\xb4\x3d\x20"
+                         "\x83\x6c\x91\xd1\xb7\x53\x0f\x6b",
+               .ilen   = 16,
+               .result = zeroed_string,
+               .rlen   = 16,
+       }, {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
+                         "\xba\xc7\x7a\x77\x17\x94\x28\x63",
+               .klen   = 24,
+               .input  = "\x1b\x38\x6c\x02\x10\xdc\xad\xcb"
+                         "\xdd\x0e\x41\xaa\x08\xa7\xa7\xe8",
+               .ilen   = 16,
+               .result = zeroed_string,
+               .rlen   = 16,
+       }, {
+               .key    = "\x23\x42\xbb\x9e\xfa\x38\x54\x2c"
+                         "\xbe\xd0\xac\x83\x94\x0a\xc2\x98"
+                         "\x8d\x7c\x47\xce\x26\x49\x08\x46"
+                         "\x1c\xc1\xb5\x13\x7a\xe6\xb6\x04",
+               .klen   = 32,
+               .input  = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
+                         "\xc9\x87\x01\x36\x55\x33\x17\xfa",
+               .ilen   = 16,
+               .result = zeroed_string,
+               .rlen   = 16,
+       },
+};
+
+
+/*
+ * AES test vectors.
+ */
+#define AES_ENC_TEST_VECTORS 3
+#define AES_DEC_TEST_VECTORS 3
+#define AES_CBC_ENC_TEST_VECTORS 4
+#define AES_CBC_DEC_TEST_VECTORS 4
+#define AES_LRW_ENC_TEST_VECTORS 8
+#define AES_LRW_DEC_TEST_VECTORS 8
+#define AES_XTS_ENC_TEST_VECTORS 5
+#define AES_XTS_DEC_TEST_VECTORS 5
+#define AES_CTR_ENC_TEST_VECTORS 3
+#define AES_CTR_DEC_TEST_VECTORS 3
+#define AES_OFB_ENC_TEST_VECTORS 1
+#define AES_OFB_DEC_TEST_VECTORS 1
+#define AES_CTR_3686_ENC_TEST_VECTORS 7
+#define AES_CTR_3686_DEC_TEST_VECTORS 6
+#define AES_GCM_ENC_TEST_VECTORS 9
+#define AES_GCM_DEC_TEST_VECTORS 8
+#define AES_GCM_4106_ENC_TEST_VECTORS 7
+#define AES_GCM_4106_DEC_TEST_VECTORS 7
+#define AES_CCM_ENC_TEST_VECTORS 7
+#define AES_CCM_DEC_TEST_VECTORS 7
+#define AES_CCM_4309_ENC_TEST_VECTORS 7
+#define AES_CCM_4309_DEC_TEST_VECTORS 10
+
+static struct cipher_testvec aes_enc_tv_template[] = {
+       { /* From FIPS-197 */
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .klen   = 16,
+               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .ilen   = 16,
+               .result = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
+                         "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17",
+               .klen   = 24,
+               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .ilen   = 16,
+               .result = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
+                         "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .klen   = 32,
+               .input  = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .ilen   = 16,
+               .result = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
+                         "\xea\xfc\x49\x90\x4b\x49\x60\x89",
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec aes_dec_tv_template[] = {
+       { /* From FIPS-197 */
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .klen   = 16,
+               .input  = "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
+                         "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
+               .ilen   = 16,
+               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17",
+               .klen   = 24,
+               .input  = "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
+                         "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
+               .ilen   = 16,
+               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .rlen   = 16,
+       }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .klen   = 32,
+               .input  = "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
+                         "\xea\xfc\x49\x90\x4b\x49\x60\x89",
+               .ilen   = 16,
+               .result = "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec aes_cbc_enc_tv_template[] = {
+       { /* From RFC 3602 */
+               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
+                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
+               .klen   = 16,
+               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+               .input  = "Single block msg",
+               .ilen   = 16,
+               .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+                         "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
+               .rlen   = 16,
+       }, {
+               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
+               .klen   = 16,
+               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .ilen   = 32,
+               .result = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
+                         "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+                         "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+                         "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
+               .rlen   = 32,
+       }, { /* From NIST SP800-38A */
+               .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+                         "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+                         "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
+               .klen   = 24,
+               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .ilen   = 64,
+               .result = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
+                         "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
+                         "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
+                         "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
+                         "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
+                         "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+                         "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+                         "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
+               .rlen   = 64,
+       }, {
+               .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+                         "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+                         "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+                         "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
+               .klen   = 32,
+               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .input  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .ilen   = 64,
+               .result = "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
+                         "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
+                         "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
+                         "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
+                         "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
+                         "\xa5\x30\xe2\x63\x04\x23\x14\x61"
+                         "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
+                         "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
+               .rlen   = 64,
+       },
+};
+
+static struct cipher_testvec aes_cbc_dec_tv_template[] = {
+       { /* From RFC 3602 */
+               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
+                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
+               .klen   = 16,
+               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+               .input  = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+                         "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
+               .ilen   = 16,
+               .result = "Single block msg",
+               .rlen   = 16,
+       }, {
+               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
+               .klen   = 16,
+               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+               .input  = "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
+                         "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+                         "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+                         "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1",
+               .ilen   = 32,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .rlen   = 32,
+       }, { /* From NIST SP800-38A */
+               .key    = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+                         "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+                         "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
+               .klen   = 24,
+               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .input  = "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
+                         "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
+                         "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
+                         "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
+                         "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
+                         "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+                         "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+                         "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
+               .ilen   = 64,
+               .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
                          "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
                          "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
                          "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
@@ -3814,6 +7063,150 @@ static struct cipher_testvec aes_xts_enc_tv_template[] = {
                          "\x0a\x28\x2d\xf9\x20\x14\x7b\xea"
                          "\xbe\x42\x1e\xe5\x31\x9d\x05\x68",
                .rlen   = 512,
+       }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
+                         "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
+                         "\xea\x00\x80\x3f\x5e\x48\x23\x57"
+                         "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
+                         "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
+                         "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
+                         "\x68\x0a\x86\xac\x35\xad\xfc\x33"
+                         "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
+                         "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
+                         "\xb1\x08\xfd\x10\x98\xba\xec\x70"
+                         "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
+                         "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
+                         "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
+                         "\xae\xba\x12\x29\x61\xd0\x3a\x75"
+                         "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
+                         "\x00\x02\x08\x87\x89\x14\x29\xca"
+                         "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
+                         "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
+                         "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
+                         "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
+                         "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
+                         "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
+                         "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
+                         "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
+                         "\x93\xec\x05\xc5\x2e\x04\x93\xef"
+                         "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
+                         "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
+                         "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
+                         "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
+                         "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
+                         "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
+                         "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
+                         "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
+                         "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
+                         "\xbc\x48\x14\x57\x77\x8f\x61\x60"
+                         "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
+                         "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
+                         "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
+                         "\xf4\xc3\x33\xec\x44\x23\x88\x51"
+                         "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
+                         "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
+                         "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
+                         "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
+                         "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
+                         "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
+                         "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
+                         "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
+                         "\x92\x5f\xed\xc4\xae\x74\xff\xac"
+                         "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
+                         "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
+                         "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
+                         "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
+                         "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
+                         "\x94\x30\x54\xff\x84\x01\x14\x93"
+                         "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
+                         "\x53\x76\x44\x1a\x77\xed\x43\x85"
+                         "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
+                         "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
+                         "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
+                         "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
+                         "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
+                         "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
+                         "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
+                         "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
+               .rlen   = 512,
        }
 };
 
@@ -4011,6 +7404,151 @@ static struct cipher_testvec aes_xts_dec_tv_template[] = {
                          "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
                          "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
                .rlen   = 512,
+       }, { /* XTS-AES 10, XTS-AES-256, data unit 512 bytes */
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
+                         "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
+                         "\xea\x00\x80\x3f\x5e\x48\x23\x57"
+                         "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
+                         "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
+                         "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
+                         "\x68\x0a\x86\xac\x35\xad\xfc\x33"
+                         "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
+                         "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
+                         "\xb1\x08\xfd\x10\x98\xba\xec\x70"
+                         "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
+                         "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
+                         "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
+                         "\xae\xba\x12\x29\x61\xd0\x3a\x75"
+                         "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
+                         "\x00\x02\x08\x87\x89\x14\x29\xca"
+                         "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
+                         "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
+                         "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
+                         "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
+                         "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
+                         "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
+                         "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
+                         "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
+                         "\x93\xec\x05\xc5\x2e\x04\x93\xef"
+                         "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
+                         "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
+                         "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
+                         "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
+                         "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
+                         "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
+                         "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
+                         "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
+                         "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
+                         "\xbc\x48\x14\x57\x77\x8f\x61\x60"
+                         "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
+                         "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
+                         "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
+                         "\xf4\xc3\x33\xec\x44\x23\x88\x51"
+                         "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
+                         "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
+                         "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
+                         "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
+                         "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
+                         "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
+                         "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
+                         "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
+                         "\x92\x5f\xed\xc4\xae\x74\xff\xac"
+                         "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
+                         "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
+                         "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
+                         "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
+                         "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
+                         "\x94\x30\x54\xff\x84\x01\x14\x93"
+                         "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
+                         "\x53\x76\x44\x1a\x77\xed\x43\x85"
+                         "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
+                         "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
+                         "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
+                         "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
+                         "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
+                         "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
+                         "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
+                         "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
+
        }
 };
 
@@ -5396,6 +8934,64 @@ static struct cipher_testvec aes_ctr_rfc3686_dec_tv_template[] = {
        },
 };
 
+static struct cipher_testvec aes_ofb_enc_tv_template[] = {
+        /* From NIST Special Publication 800-38A, Appendix F.5 */
+       {
+               .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                         "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .klen   = 16,
+               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
+                         "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .input = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .ilen   = 64,
+               .result = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
+                         "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
+                         "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
+                         "\x3c\x52\xda\xc5\x4e\xd8\x25"
+                         "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
+                         "\x44\xf7\xa8\x22\x60\xed\xcc"
+                         "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
+                         "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
+               .rlen   = 64,
+       }
+};
+
+static struct cipher_testvec aes_ofb_dec_tv_template[] = {
+        /* From NIST Special Publication 800-38A, Appendix F.5 */
+       {
+               .key    = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                         "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .klen   = 16,
+               .iv     = "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
+                         "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+               .input = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
+                         "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
+                         "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5"
+                         "\x3c\x52\xda\xc5\x4e\xd8\x25"
+                         "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43"
+                         "\x44\xf7\xa8\x22\x60\xed\xcc"
+                         "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
+                         "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
+               .ilen   = 64,
+               .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                         "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                         "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                         "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                         "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                         "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                         "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                         "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .rlen   = 64,
+       }
+};
+
 static struct aead_testvec aes_gcm_enc_tv_template[] = {
        { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */
                .key    = zeroed_string,
@@ -5758,7 +9354,486 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = {
        }
 };
 
-static struct aead_testvec aes_ccm_enc_tv_template[] = {
+static struct aead_testvec aes_gcm_rfc4106_enc_tv_template[] = {
+        { /* Generated using Crypto++ */
+               .key    = zeroed_string,
+               .klen   = 20,
+                .iv     = zeroed_string,
+                .input  = zeroed_string,
+                .ilen   = 16,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+               .result = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
+                          "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
+                          "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
+                          "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
+               .rlen   = 32,
+        },{
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+                .input  = zeroed_string,
+                .ilen   = 16,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+               .result = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
+                          "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
+                          "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
+                          "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
+               .rlen   = 32,
+
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = zeroed_string,
+                .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .ilen   = 16,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+               .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
+                          "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
+                          "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
+                          "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
+               .rlen   = 32,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = zeroed_string,
+                .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .ilen   = 16,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+               .result = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
+                          "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
+                          "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
+                          "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
+               .rlen   = 32,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+                .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .ilen   = 16,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+               .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
+                          "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
+                          "\x64\x50\xF9\x32\x13\xFB\x74\x61"
+                          "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
+               .rlen   = 32,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+                .input  = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .ilen   = 64,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+               .result = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
+                          "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
+                          "\x98\x14\xA1\x42\x37\x80\xFD\x90"
+                          "\x68\x12\x01\xA8\x91\x89\xB9\x83"
+                          "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
+                          "\x94\x5F\x18\x12\xBA\x27\x09\x39"
+                          "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
+                          "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
+                          "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
+                          "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
+               .rlen   = 80,
+        }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
+                          "\x00\x00\x00\x00",
+                .input  = "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff",
+                .ilen   = 192,
+                .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+                          "\xaa\xaa\xaa\xaa",
+                .alen   = 12,
+               .result = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
+                         "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
+                         "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
+                         "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
+                         "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
+                         "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
+                         "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
+                         "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
+                         "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
+                         "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
+                         "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
+                         "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
+                         "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
+                         "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
+                         "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
+                         "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
+                         "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
+                         "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
+                         "\x7E\x13\x06\x82\x08\x17\xA4\x35"
+                         "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
+                         "\xA3\x05\x38\x95\x20\x1A\x47\x04"
+                         "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
+                         "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
+                         "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
+                         "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
+                         "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
+               .rlen   = 208,
+       }
+};
+
+static struct aead_testvec aes_gcm_rfc4106_dec_tv_template[] = {
+        { /* Generated using Crypto++ */
+               .key    = zeroed_string,
+               .klen   = 20,
+                .iv     = zeroed_string,
+               .input  = "\x03\x88\xDA\xCE\x60\xB6\xA3\x92"
+                          "\xF3\x28\xC2\xB9\x71\xB2\xFE\x78"
+                          "\x97\xFE\x4C\x23\x37\x42\x01\xE0"
+                          "\x81\x9F\x8D\xC5\xD7\x41\xA0\x1B",
+               .ilen   = 32,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+                .result = zeroed_string,
+                .rlen   = 16,
+
+        },{
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+               .input  = "\xC0\x0D\x8B\x42\x0F\x8F\x34\x18"
+                          "\x88\xB1\xC5\xBC\xC5\xB6\xD6\x28"
+                          "\x6A\x9D\xDF\x11\x5E\xFE\x5E\x9D"
+                          "\x2F\x70\x44\x92\xF7\xF2\xE3\xEF",
+               .ilen   = 32,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+                .result = zeroed_string,
+                .rlen   = 16,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = zeroed_string,
+               .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
+                          "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
+                          "\x0B\x8F\x88\x69\x17\xE6\xB4\x3C"
+                          "\xB1\x68\xFD\x14\x52\x64\x61\xB2",
+               .ilen   = 32,
+                .assoc  = zeroed_string,
+                .alen   = 8,
+                .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .rlen   = 16,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = zeroed_string,
+               .input  = "\x4B\xB1\xB5\xE3\x25\x71\x70\xDE"
+                          "\x7F\xC9\x9C\xA5\x14\x19\xF2\xAC"
+                          "\x90\x92\xB7\xE3\x5F\xA3\x9A\x63"
+                          "\x7E\xD7\x1F\xD8\xD3\x7C\x4B\xF5",
+               .ilen   = 32,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+                .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .rlen   = 16,
+
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+               .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
+                          "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
+                          "\x64\x50\xF9\x32\x13\xFB\x74\x61"
+                          "\xF4\xED\x52\xD3\xC5\x10\x55\x3C",
+               .ilen   = 32,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+                .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .rlen   = 16,
+        }, {
+               .key    = "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
+                         "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x00\x00\x00\x00\x00\x01"
+                          "\x00\x00\x00\x00",
+               .input  = "\xC1\x0C\x8A\x43\x0E\x8E\x35\x19"
+                          "\x89\xB0\xC4\xBD\xC4\xB7\xD7\x29"
+                          "\x98\x14\xA1\x42\x37\x80\xFD\x90"
+                          "\x68\x12\x01\xA8\x91\x89\xB9\x83"
+                          "\x5B\x11\x77\x12\x9B\xFF\x24\x89"
+                          "\x94\x5F\x18\x12\xBA\x27\x09\x39"
+                          "\x99\x96\x76\x42\x15\x1C\xCD\xCB"
+                          "\xDC\xD3\xDA\x65\x73\xAF\x80\xCD"
+                          "\xD2\xB6\xC2\x4A\x76\xC2\x92\x85"
+                          "\xBD\xCF\x62\x98\x58\x14\xE5\xBD",
+               .ilen   = 80,
+                .assoc  = "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .alen   = 8,
+                .result = "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01"
+                          "\x01\x01\x01\x01\x01\x01\x01\x01",
+                .rlen   = 64,
+        }, {
+               .key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                          "\x00\x00\x00\x00",
+               .klen   = 20,
+                .iv     = "\x00\x00\x45\x67\x89\xab\xcd\xef"
+                          "\x00\x00\x00\x00",
+               .input  = "\xC1\x76\x33\x85\xE2\x9B\x5F\xDE"
+                         "\xDE\x89\x3D\x42\xE7\xC9\x69\x8A"
+                         "\x44\x6D\xC3\x88\x46\x2E\xC2\x01"
+                         "\x5E\xF6\x0C\x39\xF0\xC4\xA5\x82"
+                         "\xCD\xE8\x31\xCC\x0A\x4C\xE4\x44"
+                         "\x41\xA9\x82\x6F\x22\xA1\x23\x1A"
+                         "\xA8\xE3\x16\xFD\x31\x5C\x27\x31"
+                         "\xF1\x7F\x01\x63\xA3\xAF\x70\xA1"
+                         "\xCF\x07\x57\x41\x67\xD0\xC4\x42"
+                         "\xDB\x18\xC6\x4C\x4C\xE0\x3D\x9F"
+                         "\x05\x07\xFB\x13\x7D\x4A\xCA\x5B"
+                         "\xF0\xBF\x64\x7E\x05\xB1\x72\xEE"
+                         "\x7C\x3B\xD4\xCD\x14\x03\xB2\x2C"
+                         "\xD3\xA9\xEE\xFA\x17\xFC\x9C\xDF"
+                         "\xC7\x75\x40\xFF\xAE\xAD\x1E\x59"
+                         "\x2F\x30\x24\xFB\xAD\x6B\x10\xFA"
+                         "\x6C\x9F\x5B\xE7\x25\xD5\xD0\x25"
+                         "\xAC\x4A\x4B\xDA\xFC\x7A\x85\x1B"
+                         "\x7E\x13\x06\x82\x08\x17\xA4\x35"
+                         "\xEC\xC5\x8D\x63\x96\x81\x0A\x8F"
+                         "\xA3\x05\x38\x95\x20\x1A\x47\x04"
+                         "\x6F\x6D\xDA\x8F\xEF\xC1\x76\x35"
+                         "\x6B\xC7\x4D\x0F\x94\x12\xCA\x3E"
+                         "\x2E\xD5\x03\x2E\x86\x7E\xAA\x3B"
+                         "\x37\x08\x1C\xCF\xBA\x5D\x71\x46"
+                         "\x80\x72\xB0\x4C\x82\x0D\x60\x3C",
+               .ilen   = 208,
+                .assoc  = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+                          "\xaa\xaa\xaa\xaa",
+                .alen   = 12,
+                .result = "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff"
+                          "\xff\xff\xff\xff\xff\xff\xff\xff",
+                .rlen   = 192,
+
+       }
+};
+
+static struct aead_testvec aes_ccm_enc_tv_template[] = {
+       { /* From RFC 3610 */
+               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
+               .klen   = 16,
+               .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
+               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
+               .alen   = 8,
+               .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e",
+               .ilen   = 23,
+               .result = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
+                         "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
+                         "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
+                         "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
+               .rlen   = 31,
+       }, {
+               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
+               .klen   = 16,
+               .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
+               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b",
+               .alen   = 12,
+               .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
+                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
+                         "\x1c\x1d\x1e\x1f",
+               .ilen   = 20,
+               .result = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
+                         "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
+                         "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
+                         "\x7d\x9c\x2d\x93",
+               .rlen   = 28,
+       }, {
+               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
+               .klen   = 16,
+               .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
+               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
+               .alen   = 8,
+               .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20",
+               .ilen   = 25,
+               .result = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
+                         "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
+                         "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
+                         "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
+                         "\x7e\x5f\x4e",
+               .rlen   = 35,
+       }, {
+               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
+               .klen   = 16,
+               .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
+               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b",
+               .alen   = 12,
+               .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
+                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
+                         "\x1c\x1d\x1e",
+               .ilen   = 19,
+               .result = "\x07\x34\x25\x94\x15\x77\x85\x15"
+                         "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
+                         "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
+                         "\x4d\x99\x99\x88\xdd",
+               .rlen   = 29,
+       }, {
+               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
+                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
+               .klen   = 16,
+               .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
+                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
+               .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
+               .alen   = 8,
+               .input  = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
+                         "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
+                         "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
+               .ilen   = 24,
+               .result = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
+                         "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
+                         "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
+                         "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
+               .rlen   = 32,
+       }, {
+               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
+                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
+               .klen   = 16,
+               .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
+                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
+               .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
+                         "\x20\xea\x60\xc0",
+               .alen   = 12,
+               .input  = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
+                         "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
+                         "\x3a\x80\x3b\xa8\x7f",
+               .ilen   = 21,
+               .result = "\x00\x97\x69\xec\xab\xdf\x48\x62"
+                         "\x55\x94\xc5\x92\x51\xe6\x03\x57"
+                         "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
+                         "\x5a\xe0\x70\x45\x51",
+               .rlen   = 29,
+       }, {
+               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
+                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
+               .klen   = 16,
+               .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
+                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
+               .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
+               .alen   = 8,
+               .input  = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
+                         "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
+                         "\x98\x09\xd6\x7d\xbe\xdd\x18",
+               .ilen   = 23,
+               .result = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
+                         "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
+                         "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
+                         "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
+                         "\xba",
+               .rlen   = 33,
+       },
+};
+
+static struct aead_testvec aes_ccm_dec_tv_template[] = {
        { /* From RFC 3610 */
                .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
                          "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
@@ -5767,15 +9842,15 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                          "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
                .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
                .alen   = 8,
-               .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e",
-               .ilen   = 23,
-               .result = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
+               .input  = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
                          "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
                          "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
                          "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
-               .rlen   = 31,
+               .ilen   = 31,
+               .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e",
+               .rlen   = 23,
        }, {
                .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
                          "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
@@ -5785,15 +9860,15 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b",
                .alen   = 12,
-               .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
-                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
-                         "\x1c\x1d\x1e\x1f",
-               .ilen   = 20,
-               .result = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
+               .input  = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
                          "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
                          "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
                          "\x7d\x9c\x2d\x93",
-               .rlen   = 28,
+               .ilen   = 28,
+               .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
+                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
+                         "\x1c\x1d\x1e\x1f",
+               .rlen   = 20,
        }, {
                .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
                          "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
@@ -5802,17 +9877,17 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                          "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
                .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
                .alen   = 8,
-               .input  = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-                         "\x20",
-               .ilen   = 25,
-               .result = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
+               .input  = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
                          "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
                          "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
                          "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
                          "\x7e\x5f\x4e",
-               .rlen   = 35,
+               .ilen   = 35,
+               .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20",
+               .rlen   = 25,
        }, {
                .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
                          "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
@@ -5822,15 +9897,15 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b",
                .alen   = 12,
-               .input  = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
-                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
-                         "\x1c\x1d\x1e",
-               .ilen   = 19,
-               .result = "\x07\x34\x25\x94\x15\x77\x85\x15"
+               .input  = "\x07\x34\x25\x94\x15\x77\x85\x15"
                          "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
                          "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
                          "\x4d\x99\x99\x88\xdd",
-               .rlen   = 29,
+               .ilen   = 29,
+               .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
+                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
+                         "\x1c\x1d\x1e",
+               .rlen   = 19,
        }, {
                .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
                          "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
@@ -5839,15 +9914,15 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                          "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
                .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
                .alen   = 8,
-               .input  = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
-                         "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
-                         "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
-               .ilen   = 24,
-               .result = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
+               .input  = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
                          "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
                          "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
                          "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
-               .rlen   = 32,
+               .ilen   = 32,
+               .result = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
+                         "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
+                         "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
+               .rlen   = 24,
        }, {
                .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
                          "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
@@ -5857,15 +9932,15 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
                          "\x20\xea\x60\xc0",
                .alen   = 12,
-               .input  = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
-                         "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
-                         "\x3a\x80\x3b\xa8\x7f",
-               .ilen   = 21,
-               .result = "\x00\x97\x69\xec\xab\xdf\x48\x62"
+               .input  = "\x00\x97\x69\xec\xab\xdf\x48\x62"
                          "\x55\x94\xc5\x92\x51\xe6\x03\x57"
                          "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
                          "\x5a\xe0\x70\x45\x51",
-               .rlen   = 29,
+               .ilen   = 29,
+               .result = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
+                         "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
+                         "\x3a\x80\x3b\xa8\x7f",
+               .rlen   = 21,
        }, {
                .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
                          "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
@@ -5874,913 +9949,1179 @@ static struct aead_testvec aes_ccm_enc_tv_template[] = {
                          "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
                .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
                .alen   = 8,
-               .input  = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
-                         "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
-                         "\x98\x09\xd6\x7d\xbe\xdd\x18",
-               .ilen   = 23,
-               .result = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
+               .input  = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
                          "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
                          "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
                          "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
                          "\xba",
-               .rlen   = 33,
+               .ilen   = 33,
+               .result = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
+                         "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
+                         "\x98\x09\xd6\x7d\xbe\xdd\x18",
+               .rlen   = 23,
+       },
+};
+
+/*
+ * rfc4309 refers to section 8 of rfc3610 for test vectors, but they all
+ * use a 13-byte nonce, we only support an 11-byte nonce. Similarly, all of
+ * Special Publication 800-38C's test vectors also use nonce lengths our
+ * implementation doesn't support. The following are taken from fips cavs
+ * fax files on hand at Red Hat.
+ *
+ * nb: actual key lengths are (klen - 3), the last 3 bytes are actually
+ * part of the nonce which combine w/the iv, but need to be input this way.
+ */
+static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[] = {
+       {
+               .key    = "\x83\xac\x54\x66\xc2\xeb\xe5\x05"
+                         "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e"
+                         "\x96\xac\x59",
+               .klen   = 19,
+               .iv     = "\x30\x07\xa1\xe2\xa2\xc7\x55\x24",
+               .alen   = 0,
+               .input  = "\x19\xc8\x81\xf6\xe9\x86\xff\x93"
+                         "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e"
+                         "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c"
+                         "\x35\x2e\xad\xe0\x62\xf9\x91\xa1",
+               .ilen   = 32,
+               .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8"
+                         "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1"
+                         "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a"
+                         "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32"
+                         "\xda\x24\xea\xd9\xa1\x39\x98\xfd"
+                         "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8",
+               .rlen   = 48,
+       }, {
+               .key    = "\x1e\x2c\x7e\x01\x41\x9a\xef\xc0"
+                         "\x0d\x58\x96\x6e\x5c\xa2\x4b\xd3"
+                         "\x4f\xa3\x19",
+               .klen   = 19,
+               .iv     = "\xd3\x01\x5a\xd8\x30\x60\x15\x56",
+               .assoc  = "\xda\xe6\x28\x9c\x45\x2d\xfd\x63"
+                         "\x5e\xda\x4c\xb6\xe6\xfc\xf9\xb7"
+                         "\x0c\x56\xcb\xe4\xe0\x05\x7a\xe1"
+                         "\x0a\x63\x09\x78\xbc\x2c\x55\xde",
+               .alen   = 32,
+               .input  = "\x87\xa3\x36\xfd\x96\xb3\x93\x78"
+                         "\xa9\x28\x63\xba\x12\xa3\x14\x85"
+                         "\x57\x1e\x06\xc9\x7b\x21\xef\x76"
+                         "\x7f\x38\x7e\x8e\x29\xa4\x3e\x7e",
+               .ilen   = 32,
+               .result = "\x8a\x1e\x11\xf0\x02\x6b\xe2\x19"
+                         "\xfc\x70\xc4\x6d\x8e\xb7\x99\xab"
+                         "\xc5\x4b\xa2\xac\xd3\xf3\x48\xff"
+                         "\x3b\xb5\xce\x53\xef\xde\xbb\x02"
+                         "\xa9\x86\x15\x6c\x13\xfe\xda\x0a"
+                         "\x22\xb8\x29\x3d\xd8\x39\x9a\x23",
+               .rlen   = 48,
+       }, {
+               .key    = "\xf4\x6b\xc2\x75\x62\xfe\xb4\xe1"
+                         "\xa3\xf0\xff\xdd\x4e\x4b\x12\x75"
+                         "\x53\x14\x73\x66\x8d\x88\xf6\x80"
+                         "\xa0\x20\x35",
+               .klen   = 27,
+               .iv     = "\x26\xf2\x21\x8d\x50\x20\xda\xe2",
+               .assoc  = "\x5b\x9e\x13\x67\x02\x5e\xef\xc1"
+                         "\x6c\xf9\xd7\x1e\x52\x8f\x7a\x47"
+                         "\xe9\xd4\xcf\x20\x14\x6e\xf0\x2d"
+                         "\xd8\x9e\x2b\x56\x10\x23\x56\xe7",
+               .alen   = 32,
+               .ilen   = 0,
+               .result = "\x36\xea\x7a\x70\x08\xdc\x6a\xbc"
+                         "\xad\x0c\x7a\x63\xf6\x61\xfd\x9b",
+               .rlen   = 16,
+       }, {
+               .key    = "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42"
+                         "\xef\x7a\xd3\xce\xfc\x84\x60\x62"
+                         "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01"
+                         "\xd6\x3c\x8c",
+               .klen   = 27,
+               .iv     = "\x86\x84\xb6\xcd\xef\x09\x2e\x94",
+               .assoc  = "\x02\x65\x78\x3c\xe9\x21\x30\x91"
+                         "\xb1\xb9\xda\x76\x9a\x78\x6d\x95"
+                         "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c"
+                         "\xe3\x00\x73\x69\x84\x69\x87\x79",
+               .alen   = 32,
+               .input  = "\x9f\xd2\x02\x4b\x52\x49\x31\x3c"
+                         "\x43\x69\x3a\x2d\x8e\x70\xad\x7e"
+                         "\xe0\xe5\x46\x09\x80\x89\x13\xb2"
+                         "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b",
+               .ilen   = 32,
+               .result = "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62"
+                         "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f"
+                         "\x9b\x6a\x09\x70\xc1\x51\x83\xc2"
+                         "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e"
+                         "\xc7\x79\x11\x58\xe5\x6b\x20\x40"
+                         "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1",
+               .rlen   = 48,
+       }, {
+               .key    = "\xe0\x8d\x99\x71\x60\xd7\x97\x1a"
+                         "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a"
+                         "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e"
+                         "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b"
+                         "\x1e\x29\x91",
+               .klen   = 35,
+               .iv     = "\xad\x8e\xc1\x53\x0a\xcf\x2d\xbe",
+               .assoc  = "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b"
+                         "\x78\x2b\x94\x02\x29\x0f\x42\x27"
+                         "\x6b\x75\xcb\x98\x34\x08\x7e\x79"
+                         "\xe4\x3e\x49\x0d\x84\x8b\x22\x87",
+               .alen   = 32,
+               .input  = "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f"
+                         "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66"
+                         "\xbf\x17\x99\x62\x4a\x39\x27\x1f"
+                         "\x1d\xdc\x24\xae\x19\x2f\x98\x4c",
+               .ilen   = 32,
+               .result = "\x19\xb8\x61\x33\x45\x2b\x43\x96"
+                         "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6"
+                         "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f"
+                         "\xf0\x62\x17\x34\xf2\x1e\x8d\x75"
+                         "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d",
+               .rlen   = 40,
+       }, {
+               .key    = "\x7c\xc8\x18\x3b\x8d\x99\xe0\x7c"
+                         "\x45\x41\xb8\xbd\x5c\xa7\xc2\x32"
+                         "\x8a\xb8\x02\x59\xa4\xfe\xa9\x2c"
+                         "\x09\x75\x9a\x9b\x3c\x9b\x27\x39"
+                         "\xf9\xd9\x4e",
+               .klen   = 35,
+               .iv     = "\x63\xb5\x3d\x9d\x43\xf6\x1e\x50",
+               .assoc  = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b"
+                         "\x13\x02\x01\x0c\x83\x4c\x96\x35"
+                         "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94"
+                         "\xb0\x39\x36\xe6\x8f\x57\xe0\x13",
+               .alen   = 32,
+               .input  = "\x3b\x6c\x29\x36\xb6\xef\x07\xa6"
+                         "\x83\x72\x07\x4f\xcf\xfa\x66\x89"
+                         "\x5f\xca\xb1\xba\xd5\x8f\x2c\x27"
+                         "\x30\xdb\x75\x09\x93\xd4\x65\xe4",
+               .ilen   = 32,
+               .result = "\xb0\x88\x5a\x33\xaa\xe5\xc7\x1d"
+                         "\x85\x23\xc7\xc6\x2f\xf4\x1e\x3d"
+                         "\xcc\x63\x44\x25\x07\x78\x4f\x9e"
+                         "\x96\xb8\x88\xeb\xbc\x48\x1f\x06"
+                         "\x39\xaf\x39\xac\xd8\x4a\x80\x39"
+                         "\x7b\x72\x8a\xf7",
+               .rlen   = 44,
+       }, {
+               .key    = "\xab\xd0\xe9\x33\x07\x26\xe5\x83"
+                         "\x8c\x76\x95\xd4\xb6\xdc\xf3\x46"
+                         "\xf9\x8f\xad\xe3\x02\x13\x83\x77"
+                         "\x3f\xb0\xf1\xa1\xa1\x22\x0f\x2b"
+                         "\x24\xa7\x8b",
+               .klen   = 35,
+               .iv     = "\x07\xcb\xcc\x0e\xe6\x33\xbf\xf5",
+               .assoc  = "\xd4\xdb\x30\x1d\x03\xfe\xfd\x5f"
+                         "\x87\xd4\x8c\xb6\xb6\xf1\x7a\x5d"
+                         "\xab\x90\x65\x8d\x8e\xca\x4d\x4f"
+                         "\x16\x0c\x40\x90\x4b\xc7\x36\x73",
+               .alen   = 32,
+               .input  = "\xf5\xc6\x7d\x48\xc1\xb7\xe6\x92"
+                         "\x97\x5a\xca\xc4\xa9\x6d\xf9\x3d"
+                         "\x6c\xde\xbc\xf1\x90\xea\x6a\xb2"
+                         "\x35\x86\x36\xaf\x5c\xfe\x4b\x3a",
+               .ilen   = 32,
+               .result = "\x83\x6f\x40\x87\x72\xcf\xc1\x13"
+                         "\xef\xbb\x80\x21\x04\x6c\x58\x09"
+                         "\x07\x1b\xfc\xdf\xc0\x3f\x5b\xc7"
+                         "\xe0\x79\xa8\x6e\x71\x7c\x3f\xcf"
+                         "\x5c\xda\xb2\x33\xe5\x13\xe2\x0d"
+                         "\x74\xd1\xef\xb5\x0f\x3a\xb5\xf8",
+               .rlen   = 48,
        },
 };
 
-static struct aead_testvec aes_ccm_dec_tv_template[] = {
-       { /* From RFC 3610 */
-               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
-                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
-               .klen   = 16,
-               .iv     = "\x01\x00\x00\x00\x03\x02\x01\x00"
-                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
-               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
-               .alen   = 8,
-               .input  = "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
-                         "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
-                         "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
-                         "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
-               .ilen   = 31,
-               .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e",
-               .rlen   = 23,
+static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = {
+       {
+               .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
+                         "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
+                         "\xc6\xfb\x7d",
+               .klen   = 19,
+               .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
+               .alen   = 0,
+               .input  = "\xd5\xe8\x93\x9f\xc7\x89\x2e\x2b",
+               .ilen   = 8,
+               .result = "\x00",
+               .rlen   = 0,
+               .novrfy = 1,
        }, {
-               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
-                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
-               .klen   = 16,
-               .iv     = "\x01\x00\x00\x00\x07\x06\x05\x04"
-                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
-               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b",
-               .alen   = 12,
-               .input  = "\xdc\xf1\xfb\x7b\x5d\x9e\x23\xfb"
-                         "\x9d\x4e\x13\x12\x53\x65\x8a\xd8"
-                         "\x6e\xbd\xca\x3e\x51\xe8\x3f\x07"
-                         "\x7d\x9c\x2d\x93",
-               .ilen   = 28,
-               .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
-                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
-                         "\x1c\x1d\x1e\x1f",
-               .rlen   = 20,
+               .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
+                         "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
+                         "\xaf\x94\x87",
+               .klen   = 19,
+               .iv     = "\x78\x35\x82\x81\x7f\x88\x94\x68",
+               .alen   = 0,
+               .input  = "\x41\x3c\xb8\x87\x73\xcb\xf3\xf3",
+               .ilen   = 8,
+               .result = "\x00",
+               .rlen   = 0,
        }, {
-               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
-                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
-               .klen   = 16,
-               .iv     = "\x01\x00\x00\x00\x0b\x0a\x09\x08"
-                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
-               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07",
-               .alen   = 8,
-               .input  = "\x82\x53\x1a\x60\xcc\x24\x94\x5a"
-                         "\x4b\x82\x79\x18\x1a\xb5\xc8\x4d"
-                         "\xf2\x1c\xe7\xf9\xb7\x3f\x42\xe1"
-                         "\x97\xea\x9c\x07\xe5\x6b\x5e\xb1"
-                         "\x7e\x5f\x4e",
-               .ilen   = 35,
-               .result = "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-                         "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-                         "\x20",
-               .rlen   = 25,
+               .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
+                         "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
+                         "\xc6\xfb\x7d",
+               .klen   = 19,
+               .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
+               .assoc  = "\xf3\x94\x87\x78\x35\x82\x81\x7f"
+                         "\x88\x94\x68\xb1\x78\x6b\x2b\xd6"
+                         "\x04\x1f\x4e\xed\x78\xd5\x33\x66"
+                         "\xd8\x94\x99\x91\x81\x54\x62\x57",
+               .alen   = 32,
+               .input  = "\xf0\x7c\x29\x02\xae\x1c\x2f\x55"
+                         "\xd0\xd1\x3d\x1a\xa3\x6d\xe4\x0a"
+                         "\x86\xb0\x87\x6b\x62\x33\x8c\x34"
+                         "\xce\xab\x57\xcc\x79\x0b\xe0\x6f"
+                         "\x5c\x3e\x48\x1f\x6c\x46\xf7\x51"
+                         "\x8b\x84\x83\x2a\xc1\x05\xb8\xc5",
+               .ilen   = 48,
+               .result = "\x50\x82\x3e\x07\xe2\x1e\xb6\xfb"
+                         "\x33\xe4\x73\xce\xd2\xfb\x95\x79"
+                         "\xe8\xb4\xb5\x77\x11\x10\x62\x6f"
+                         "\x6a\x82\xd1\x13\xec\xf5\xd0\x48",
+               .rlen   = 32,
+               .novrfy = 1,
        }, {
-               .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
-                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
-               .klen   = 16,
-               .iv     = "\x01\x00\x00\x00\x0c\x0b\x0a\x09"
-                         "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
-               .assoc  = "\x00\x01\x02\x03\x04\x05\x06\x07"
-                         "\x08\x09\x0a\x0b",
-               .alen   = 12,
-               .input  = "\x07\x34\x25\x94\x15\x77\x85\x15"
-                         "\x2b\x07\x40\x98\x33\x0a\xbb\x14"
-                         "\x1b\x94\x7b\x56\x6a\xa9\x40\x6b"
-                         "\x4d\x99\x99\x88\xdd",
-               .ilen   = 29,
-               .result = "\x0c\x0d\x0e\x0f\x10\x11\x12\x13"
-                         "\x14\x15\x16\x17\x18\x19\x1a\x1b"
-                         "\x1c\x1d\x1e",
-               .rlen   = 19,
+               .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
+                         "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
+                         "\x05\xe0\xc9",
+               .klen   = 19,
+               .iv     = "\x0f\xed\x34\xea\x97\xd4\x3b\xdf",
+               .assoc  = "\x49\x5c\x50\x1f\x1d\x94\xcc\x81"
+                         "\xba\xb7\xb6\x03\xaf\xa5\xc1\xa1"
+                         "\xd8\x5c\x42\x68\xe0\x6c\xda\x89"
+                         "\x05\xac\x56\xac\x1b\x2a\xd3\x86",
+               .alen   = 32,
+               .input  = "\x39\xbe\x7d\x15\x62\x77\xf3\x3c"
+                         "\xad\x83\x52\x6d\x71\x03\x25\x1c"
+                         "\xed\x81\x3a\x9a\x16\x7d\x19\x80"
+                         "\x72\x04\x72\xd0\xf6\xff\x05\x0f"
+                         "\xb7\x14\x30\x00\x32\x9e\xa0\xa6"
+                         "\x9e\x5a\x18\xa1\xb8\xfe\xdb\xd3",
+               .ilen   = 48,
+               .result = "\x75\x05\xbe\xc2\xd9\x1e\xde\x60"
+                         "\x47\x3d\x8c\x7d\xbd\xb5\xd9\xb7"
+                         "\xf2\xae\x61\x05\x8f\x82\x24\x3f"
+                         "\x9c\x67\x91\xe1\x38\x4f\xe4\x0c",
+               .rlen   = 32,
        }, {
-               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
-                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
-               .klen   = 16,
-               .iv     = "\x01\x00\x33\x56\x8e\xf7\xb2\x63"
-                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
-               .assoc  = "\x63\x01\x8f\x76\xdc\x8a\x1b\xcb",
-               .alen   = 8,
-               .input  = "\x4c\xcb\x1e\x7c\xa9\x81\xbe\xfa"
-                         "\xa0\x72\x6c\x55\xd3\x78\x06\x12"
-                         "\x98\xc8\x5c\x92\x81\x4a\xbc\x33"
-                         "\xc5\x2e\xe8\x1d\x7d\x77\xc0\x8a",
-               .ilen   = 32,
-               .result = "\x90\x20\xea\x6f\x91\xbd\xd8\x5a"
-                         "\xfa\x00\x39\xba\x4b\xaf\xf9\xbf"
-                         "\xb7\x9c\x70\x28\x94\x9c\xd0\xec",
-               .rlen   = 24,
+               .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
+                         "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
+                         "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
+                         "\xee\x49\x83",
+               .klen   = 27,
+               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
+               .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
+                         "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
+                         "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
+                         "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
+               .alen   = 32,
+               .input  = "\x71\x99\xfa\xf4\x44\x12\x68\x9b",
+               .ilen   = 8,
+               .result = "\x00",
+               .rlen   = 0,
+       }, {
+               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
+                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
+                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
+                         "\xee\x49\x83",
+               .klen   = 27,
+               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
+               .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
+                         "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
+                         "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
+                         "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
+               .alen   = 32,
+               .input  = "\xfb\xe5\x5d\x34\xbe\xe5\xe8\xe7"
+                         "\x5a\xef\x2f\xbf\x1f\x7f\xd4\xb2"
+                         "\x66\xca\x61\x1e\x96\x7a\x61\xb3"
+                         "\x1c\x16\x45\x52\xba\x04\x9c\x9f"
+                         "\xb1\xd2\x40\xbc\x52\x7c\x6f\xb1",
+               .ilen   = 40,
+               .result = "\x85\x34\x66\x42\xc8\x92\x0f\x36"
+                         "\x58\xe0\x6b\x91\x3c\x98\x5c\xbb"
+                         "\x0a\x85\xcc\x02\xad\x7a\x96\xe9"
+                         "\x65\x43\xa4\xc3\x0f\xdc\x55\x81",
+               .rlen   = 32,
+       }, {
+               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
+                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
+                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
+                         "\xd1\xfc\x57",
+               .klen   = 27,
+               .iv     = "\x9c\xfe\xb8\x9c\xad\x71\xaa\x1f",
+               .assoc  = "\x86\x67\xa5\xa9\x14\x5f\x0d\xc6"
+                         "\xff\x14\xc7\x44\xbf\x6c\x3a\xc3"
+                         "\xff\xb6\x81\xbd\xe2\xd5\x06\xc7"
+                         "\x3c\xa1\x52\x13\x03\x8a\x23\x3a",
+               .alen   = 32,
+               .input  = "\x3f\x66\xb0\x9d\xe5\x4b\x38\x00"
+                         "\xc6\x0e\x6e\xe5\xd6\x98\xa6\x37"
+                         "\x8c\x26\x33\xc6\xb2\xa2\x17\xfa"
+                         "\x64\x19\xc0\x30\xd7\xfc\x14\x6b"
+                         "\xe3\x33\xc2\x04\xb0\x37\xbe\x3f"
+                         "\xa9\xb4\x2d\x68\x03\xa3\x44\xef",
+               .ilen   = 48,
+               .result = "\x02\x87\x4d\x28\x80\x6e\xb2\xed"
+                         "\x99\x2a\xa8\xca\x04\x25\x45\x90"
+                         "\x1d\xdd\x5a\xd9\xe4\xdb\x9c\x9c"
+                         "\x49\xe9\x01\xfe\xa7\x80\x6d\x6b",
+               .rlen   = 32,
+               .novrfy = 1,
+       }, {
+               .key    = "\xa4\x4b\x54\x29\x0a\xb8\x6d\x01"
+                         "\x5b\x80\x2a\xcf\x25\xc4\xb7\x5c"
+                         "\x20\x2c\xad\x30\xc2\x2b\x41\xfb"
+                         "\x0e\x85\xbc\x33\xad\x0f\x2b\xff"
+                         "\xee\x49\x83",
+               .klen   = 35,
+               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
+               .alen   = 0,
+               .input  = "\x1f\xb8\x8f\xa3\xdd\x54\x00\xf2",
+               .ilen   = 8,
+               .result = "\x00",
+               .rlen   = 0,
        }, {
-               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
-                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
-               .klen   = 16,
-               .iv     = "\x01\x00\xd5\x60\x91\x2d\x3f\x70"
-                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
-               .assoc  = "\xcd\x90\x44\xd2\xb7\x1f\xdb\x81"
-                         "\x20\xea\x60\xc0",
-               .alen   = 12,
-               .input  = "\x00\x97\x69\xec\xab\xdf\x48\x62"
-                         "\x55\x94\xc5\x92\x51\xe6\x03\x57"
-                         "\x22\x67\x5e\x04\xc8\x47\x09\x9e"
-                         "\x5a\xe0\x70\x45\x51",
-               .ilen   = 29,
-               .result = "\x64\x35\xac\xba\xfb\x11\xa8\x2e"
-                         "\x2f\x07\x1d\x7c\xa4\xa5\xeb\xd9"
-                         "\x3a\x80\x3b\xa8\x7f",
-               .rlen   = 21,
+               .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
+                         "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
+                         "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
+                         "\xae\x8f\x11\x4c\xc2\x9c\x4a\xbb"
+                         "\x85\x34\x66",
+               .klen   = 35,
+               .iv     = "\x42\xc8\x92\x0f\x36\x58\xe0\x6b",
+               .alen   = 0,
+               .input  = "\x48\x01\x5e\x02\x24\x04\x66\x47"
+                         "\xa1\xea\x6f\xaf\xe8\xfc\xfb\xdd"
+                         "\xa5\xa9\x87\x8d\x84\xee\x2e\x77"
+                         "\xbb\x86\xb9\xf5\x5c\x6c\xff\xf6"
+                         "\x72\xc3\x8e\xf7\x70\xb1\xb2\x07"
+                         "\xbc\xa8\xa3\xbd\x83\x7c\x1d\x2a",
+               .ilen   = 48,
+               .result = "\xdc\x56\xf2\x71\xb0\xb1\xa0\x6c"
+                         "\xf0\x97\x3a\xfb\x6d\xe7\x32\x99"
+                         "\x3e\xaf\x70\x5e\xb2\x4d\xea\x39"
+                         "\x89\xd4\x75\x7a\x63\xb1\xda\x93",
+               .rlen   = 32,
+               .novrfy = 1,
        }, {
-               .key    = "\xd7\x82\x8d\x13\xb2\xb0\xbd\xc3"
-                         "\x25\xa7\x62\x36\xdf\x93\xcc\x6b",
-               .klen   = 16,
-               .iv     = "\x01\x00\x42\xff\xf8\xf1\x95\x1c"
-                         "\x3c\x96\x96\x76\x6c\xfa\x00\x00",
-               .assoc  = "\xd8\x5b\xc7\xe6\x9f\x94\x4f\xb8",
-               .alen   = 8,
-               .input  = "\xbc\x21\x8d\xaa\x94\x74\x27\xb6"
-                         "\xdb\x38\x6a\x99\xac\x1a\xef\x23"
-                         "\xad\xe0\xb5\x29\x39\xcb\x6a\x63"
-                         "\x7c\xf9\xbe\xc2\x40\x88\x97\xc6"
-                         "\xba",
-               .ilen   = 33,
-               .result = "\x8a\x19\xb9\x50\xbc\xf7\x1a\x01"
-                         "\x8e\x5e\x67\x01\xc9\x17\x87\x65"
-                         "\x98\x09\xd6\x7d\xbe\xdd\x18",
-               .rlen   = 23,
+               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
+                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
+                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
+                         "\x0d\x1a\x53\x3b\xb5\xe3\xf8\x8b"
+                         "\xcf\x76\x3f",
+               .klen   = 35,
+               .iv     = "\xd9\x95\x75\x8f\x44\x89\x40\x7b",
+               .assoc  = "\x8f\x86\x6c\x4d\x1d\xc5\x39\x88"
+                         "\xc8\xf3\x5c\x52\x10\x63\x6f\x2b"
+                         "\x8a\x2a\xc5\x6f\x30\x23\x58\x7b"
+                         "\xfb\x36\x03\x11\xb4\xd9\xf2\xfe",
+               .alen   = 32,
+               .input  = "\x48\x58\xd6\xf3\xad\x63\x58\xbf"
+                         "\xae\xc7\x5e\xae\x83\x8f\x7b\xe4"
+                         "\x78\x5c\x4c\x67\x71\x89\x94\xbf"
+                         "\x47\xf1\x63\x7e\x1c\x59\xbd\xc5"
+                         "\x7f\x44\x0a\x0c\x01\x18\x07\x92"
+                         "\xe1\xd3\x51\xce\x32\x6d\x0c\x5b",
+               .ilen   = 48,
+               .result = "\xc2\x54\xc8\xde\x78\x87\x77\x40"
+                         "\x49\x71\xe4\xb7\xe7\xcb\x76\x61"
+                         "\x0a\x41\xb9\xe9\xc0\x76\x54\xab"
+                         "\x04\x49\x3b\x19\x93\x57\x25\x5d",
+               .rlen   = 32,
        },
 };
 
 /*
- * rfc4309 refers to section 8 of rfc3610 for test vectors, but they all
- * use a 13-byte nonce, we only support an 11-byte nonce. Similarly, all of
- * Special Publication 800-38C's test vectors also use nonce lengths our
- * implementation doesn't support. The following are taken from fips cavs
- * fax files on hand at Red Hat.
- *
- * nb: actual key lengths are (klen - 3), the last 3 bytes are actually
- * part of the nonce which combine w/the iv, but need to be input this way.
+ * ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode)
+ * test vectors, taken from Appendix B.2.9 and B.2.10:
+ *     http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf
+ * Only AES-128 is supported at this time.
  */
-static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[] = {
+#define ANSI_CPRNG_AES_TEST_VECTORS    6
+
+static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
        {
-               .key    = "\x83\xac\x54\x66\xc2\xeb\xe5\x05"
-                         "\x2e\x01\xd1\xfc\x5d\x82\x66\x2e"
-                         "\x96\xac\x59",
-               .klen   = 19,
-               .iv     = "\x30\x07\xa1\xe2\xa2\xc7\x55\x24",
-               .alen   = 0,
-               .input  = "\x19\xc8\x81\xf6\xe9\x86\xff\x93"
-                         "\x0b\x78\x67\xe5\xbb\xb7\xfc\x6e"
-                         "\x83\x77\xb3\xa6\x0c\x8c\x9f\x9c"
-                         "\x35\x2e\xad\xe0\x62\xf9\x91\xa1",
-               .ilen   = 32,
-               .result = "\xab\x6f\xe1\x69\x1d\x19\x99\xa8"
-                         "\x92\xa0\xc4\x6f\x7e\xe2\x8b\xb1"
-                         "\x70\xbb\x8c\xa6\x4c\x6e\x97\x8a"
-                         "\x57\x2b\xbe\x5d\x98\xa6\xb1\x32"
-                         "\xda\x24\xea\xd9\xa1\x39\x98\xfd"
-                         "\xa4\xbe\xd9\xf2\x1a\x6d\x22\xa8",
-               .rlen   = 48,
+               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
+                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .klen   = 16,
+               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
+                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xf9",
+               .dtlen  = 16,
+               .v      = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .vlen   = 16,
+               .result = "\x59\x53\x1e\xd1\x3b\xb0\xc0\x55"
+                         "\x84\x79\x66\x85\xc1\x2f\x76\x41",
+               .rlen   = 16,
+               .loops  = 1,
        }, {
-               .key    = "\x1e\x2c\x7e\x01\x41\x9a\xef\xc0"
-                         "\x0d\x58\x96\x6e\x5c\xa2\x4b\xd3"
-                         "\x4f\xa3\x19",
-               .klen   = 19,
-               .iv     = "\xd3\x01\x5a\xd8\x30\x60\x15\x56",
-               .assoc  = "\xda\xe6\x28\x9c\x45\x2d\xfd\x63"
-                         "\x5e\xda\x4c\xb6\xe6\xfc\xf9\xb7"
-                         "\x0c\x56\xcb\xe4\xe0\x05\x7a\xe1"
-                         "\x0a\x63\x09\x78\xbc\x2c\x55\xde",
-               .alen   = 32,
-               .input  = "\x87\xa3\x36\xfd\x96\xb3\x93\x78"
-                         "\xa9\x28\x63\xba\x12\xa3\x14\x85"
-                         "\x57\x1e\x06\xc9\x7b\x21\xef\x76"
-                         "\x7f\x38\x7e\x8e\x29\xa4\x3e\x7e",
-               .ilen   = 32,
-               .result = "\x8a\x1e\x11\xf0\x02\x6b\xe2\x19"
-                         "\xfc\x70\xc4\x6d\x8e\xb7\x99\xab"
-                         "\xc5\x4b\xa2\xac\xd3\xf3\x48\xff"
-                         "\x3b\xb5\xce\x53\xef\xde\xbb\x02"
-                         "\xa9\x86\x15\x6c\x13\xfe\xda\x0a"
-                         "\x22\xb8\x29\x3d\xd8\x39\x9a\x23",
-               .rlen   = 48,
+               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
+                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .klen   = 16,
+               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
+                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfa",
+               .dtlen  = 16,
+               .v      = "\xc0\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .vlen   = 16,
+               .result = "\x7c\x22\x2c\xf4\xca\x8f\xa2\x4c"
+                         "\x1c\x9c\xb6\x41\xa9\xf3\x22\x0d",
+               .rlen   = 16,
+               .loops  = 1,
        }, {
-               .key    = "\xf4\x6b\xc2\x75\x62\xfe\xb4\xe1"
-                         "\xa3\xf0\xff\xdd\x4e\x4b\x12\x75"
-                         "\x53\x14\x73\x66\x8d\x88\xf6\x80"
-                         "\xa0\x20\x35",
-               .klen   = 27,
-               .iv     = "\x26\xf2\x21\x8d\x50\x20\xda\xe2",
-               .assoc  = "\x5b\x9e\x13\x67\x02\x5e\xef\xc1"
-                         "\x6c\xf9\xd7\x1e\x52\x8f\x7a\x47"
-                         "\xe9\xd4\xcf\x20\x14\x6e\xf0\x2d"
-                         "\xd8\x9e\x2b\x56\x10\x23\x56\xe7",
-               .alen   = 32,
-               .ilen   = 0,
-               .result = "\x36\xea\x7a\x70\x08\xdc\x6a\xbc"
-                         "\xad\x0c\x7a\x63\xf6\x61\xfd\x9b",
+               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
+                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .klen   = 16,
+               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
+                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfb",
+               .dtlen  = 16,
+               .v      = "\xe0\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .vlen   = 16,
+               .result = "\x8a\xaa\x00\x39\x66\x67\x5b\xe5"
+                         "\x29\x14\x28\x81\xa9\x4d\x4e\xc7",
                .rlen   = 16,
+               .loops  = 1,
        }, {
-               .key    = "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42"
-                         "\xef\x7a\xd3\xce\xfc\x84\x60\x62"
-                         "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01"
-                         "\xd6\x3c\x8c",
-               .klen   = 27,
-               .iv     = "\x86\x84\xb6\xcd\xef\x09\x2e\x94",
-               .assoc  = "\x02\x65\x78\x3c\xe9\x21\x30\x91"
-                         "\xb1\xb9\xda\x76\x9a\x78\x6d\x95"
-                         "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c"
-                         "\xe3\x00\x73\x69\x84\x69\x87\x79",
-               .alen   = 32,
-               .input  = "\x9f\xd2\x02\x4b\x52\x49\x31\x3c"
-                         "\x43\x69\x3a\x2d\x8e\x70\xad\x7e"
-                         "\xe0\xe5\x46\x09\x80\x89\x13\xb2"
-                         "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b",
-               .ilen   = 32,
-               .result = "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62"
-                         "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f"
-                         "\x9b\x6a\x09\x70\xc1\x51\x83\xc2"
-                         "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e"
-                         "\xc7\x79\x11\x58\xe5\x6b\x20\x40"
-                         "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1",
-               .rlen   = 48,
+               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
+                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .klen   = 16,
+               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
+                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfc",
+               .dtlen  = 16,
+               .v      = "\xf0\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .vlen   = 16,
+               .result = "\x88\xdd\xa4\x56\x30\x24\x23\xe5"
+                         "\xf6\x9d\xa5\x7e\x7b\x95\xc7\x3a",
+               .rlen   = 16,
+               .loops  = 1,
+       }, {
+               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
+                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .klen   = 16,
+               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
+                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfd",
+               .dtlen  = 16,
+               .v      = "\xf8\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .vlen   = 16,
+               .result = "\x05\x25\x92\x46\x61\x79\xd2\xcb"
+                         "\x78\xc4\x0b\x14\x0a\x5a\x9a\xc8",
+               .rlen   = 16,
+               .loops  = 1,
+       }, {    /* Monte Carlo Test */
+               .key    = "\x9f\x5b\x51\x20\x0b\xf3\x34\xb5"
+                         "\xd8\x2b\xe8\xc3\x72\x55\xc8\x48",
+               .klen   = 16,
+               .dt     = "\x63\x76\xbb\xe5\x29\x02\xba\x3b"
+                         "\x67\xc9\x25\xfa\x70\x1f\x11\xac",
+               .dtlen  = 16,
+               .v      = "\x57\x2c\x8e\x76\x87\x26\x47\x97"
+                         "\x7e\x74\xfb\xdd\xc4\x95\x01\xd1",
+               .vlen   = 16,
+               .result = "\x48\xe9\xbd\x0d\x06\xee\x18\xfb"
+                         "\xe4\x57\x90\xd5\xc3\xfc\x9b\x73",
+               .rlen   = 16,
+               .loops  = 10000,
+       },
+};
+
+/* Cast5 test vectors from RFC 2144 */
+#define CAST5_ENC_TEST_VECTORS 3
+#define CAST5_DEC_TEST_VECTORS 3
+
+static struct cipher_testvec cast5_enc_tv_template[] = {
+       {
+               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
+                         "\x23\x45\x67\x89\x34\x56\x78\x9a",
+               .klen   = 16,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .ilen   = 8,
+               .result = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
+               .rlen   = 8,
        }, {
-               .key    = "\xe0\x8d\x99\x71\x60\xd7\x97\x1a"
-                         "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a"
-                         "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e"
-                         "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b"
-                         "\x1e\x29\x91",
-               .klen   = 35,
-               .iv     = "\xad\x8e\xc1\x53\x0a\xcf\x2d\xbe",
-               .assoc  = "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b"
-                         "\x78\x2b\x94\x02\x29\x0f\x42\x27"
-                         "\x6b\x75\xcb\x98\x34\x08\x7e\x79"
-                         "\xe4\x3e\x49\x0d\x84\x8b\x22\x87",
-               .alen   = 32,
-               .input  = "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f"
-                         "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66"
-                         "\xbf\x17\x99\x62\x4a\x39\x27\x1f"
-                         "\x1d\xdc\x24\xae\x19\x2f\x98\x4c",
-               .ilen   = 32,
-               .result = "\x19\xb8\x61\x33\x45\x2b\x43\x96"
-                         "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6"
-                         "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f"
-                         "\xf0\x62\x17\x34\xf2\x1e\x8d\x75"
-                         "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d",
-               .rlen   = 40,
+               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
+                         "\x23\x45",
+               .klen   = 10,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .ilen   = 8,
+               .result = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
+               .rlen   = 8,
        }, {
-               .key    = "\x7c\xc8\x18\x3b\x8d\x99\xe0\x7c"
-                         "\x45\x41\xb8\xbd\x5c\xa7\xc2\x32"
-                         "\x8a\xb8\x02\x59\xa4\xfe\xa9\x2c"
-                         "\x09\x75\x9a\x9b\x3c\x9b\x27\x39"
-                         "\xf9\xd9\x4e",
-               .klen   = 35,
-               .iv     = "\x63\xb5\x3d\x9d\x43\xf6\x1e\x50",
-               .assoc  = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b"
-                         "\x13\x02\x01\x0c\x83\x4c\x96\x35"
-                         "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94"
-                         "\xb0\x39\x36\xe6\x8f\x57\xe0\x13",
-               .alen   = 32,
-               .input  = "\x3b\x6c\x29\x36\xb6\xef\x07\xa6"
-                         "\x83\x72\x07\x4f\xcf\xfa\x66\x89"
-                         "\x5f\xca\xb1\xba\xd5\x8f\x2c\x27"
-                         "\x30\xdb\x75\x09\x93\xd4\x65\xe4",
-               .ilen   = 32,
-               .result = "\xb0\x88\x5a\x33\xaa\xe5\xc7\x1d"
-                         "\x85\x23\xc7\xc6\x2f\xf4\x1e\x3d"
-                         "\xcc\x63\x44\x25\x07\x78\x4f\x9e"
-                         "\x96\xb8\x88\xeb\xbc\x48\x1f\x06"
-                         "\x39\xaf\x39\xac\xd8\x4a\x80\x39"
-                         "\x7b\x72\x8a\xf7",
-               .rlen   = 44,
+               .key    = "\x01\x23\x45\x67\x12",
+               .klen   = 5,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .ilen   = 8,
+               .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
+               .rlen   = 8,
+       },
+};
+
+static struct cipher_testvec cast5_dec_tv_template[] = {
+       {
+               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
+                         "\x23\x45\x67\x89\x34\x56\x78\x9a",
+               .klen   = 16,
+               .input  = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
+               .ilen   = 8,
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .rlen   = 8,
        }, {
-               .key    = "\xab\xd0\xe9\x33\x07\x26\xe5\x83"
-                         "\x8c\x76\x95\xd4\xb6\xdc\xf3\x46"
-                         "\xf9\x8f\xad\xe3\x02\x13\x83\x77"
-                         "\x3f\xb0\xf1\xa1\xa1\x22\x0f\x2b"
-                         "\x24\xa7\x8b",
-               .klen   = 35,
-               .iv     = "\x07\xcb\xcc\x0e\xe6\x33\xbf\xf5",
-               .assoc  = "\xd4\xdb\x30\x1d\x03\xfe\xfd\x5f"
-                         "\x87\xd4\x8c\xb6\xb6\xf1\x7a\x5d"
-                         "\xab\x90\x65\x8d\x8e\xca\x4d\x4f"
-                         "\x16\x0c\x40\x90\x4b\xc7\x36\x73",
-               .alen   = 32,
-               .input  = "\xf5\xc6\x7d\x48\xc1\xb7\xe6\x92"
-                         "\x97\x5a\xca\xc4\xa9\x6d\xf9\x3d"
-                         "\x6c\xde\xbc\xf1\x90\xea\x6a\xb2"
-                         "\x35\x86\x36\xaf\x5c\xfe\x4b\x3a",
-               .ilen   = 32,
-               .result = "\x83\x6f\x40\x87\x72\xcf\xc1\x13"
-                         "\xef\xbb\x80\x21\x04\x6c\x58\x09"
-                         "\x07\x1b\xfc\xdf\xc0\x3f\x5b\xc7"
-                         "\xe0\x79\xa8\x6e\x71\x7c\x3f\xcf"
-                         "\x5c\xda\xb2\x33\xe5\x13\xe2\x0d"
-                         "\x74\xd1\xef\xb5\x0f\x3a\xb5\xf8",
-               .rlen   = 48,
+               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
+                         "\x23\x45",
+               .klen   = 10,
+               .input  = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
+               .ilen   = 8,
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .rlen   = 8,
+       }, {
+               .key    = "\x01\x23\x45\x67\x12",
+               .klen   = 5,
+               .input  = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
+               .ilen   = 8,
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .rlen   = 8,
        },
 };
 
-static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = {
+/*
+ * ARC4 test vectors from OpenSSL
+ */
+#define ARC4_ENC_TEST_VECTORS  7
+#define ARC4_DEC_TEST_VECTORS  7
+
+static struct cipher_testvec arc4_enc_tv_template[] = {
        {
-               .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
-                         "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
-                         "\xc6\xfb\x7d",
-               .klen   = 19,
-               .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
-               .alen   = 0,
-               .input  = "\xd5\xe8\x93\x9f\xc7\x89\x2e\x2b",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
                .ilen   = 8,
-               .result = "\x00",
-               .rlen   = 0,
-               .novrfy = 1,
+               .result = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
+               .rlen   = 8,
        }, {
-               .key    = "\xab\x2f\x8a\x74\xb7\x1c\xd2\xb1"
-                         "\xff\x80\x2e\x48\x7d\x82\xf8\xb9"
-                         "\xaf\x94\x87",
-               .klen   = 19,
-               .iv     = "\x78\x35\x82\x81\x7f\x88\x94\x68",
-               .alen   = 0,
-               .input  = "\x41\x3c\xb8\x87\x73\xcb\xf3\xf3",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .ilen   = 8,
-               .result = "\x00",
-               .rlen   = 0,
+               .result = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
+               .rlen   = 8,
        }, {
-               .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
-                         "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
-                         "\xc6\xfb\x7d",
-               .klen   = 19,
-               .iv     = "\x80\x0d\x13\xab\xd8\xa6\xb2\xd8",
-               .assoc  = "\xf3\x94\x87\x78\x35\x82\x81\x7f"
-                         "\x88\x94\x68\xb1\x78\x6b\x2b\xd6"
-                         "\x04\x1f\x4e\xed\x78\xd5\x33\x66"
-                         "\xd8\x94\x99\x91\x81\x54\x62\x57",
-               .alen   = 32,
-               .input  = "\xf0\x7c\x29\x02\xae\x1c\x2f\x55"
-                         "\xd0\xd1\x3d\x1a\xa3\x6d\xe4\x0a"
-                         "\x86\xb0\x87\x6b\x62\x33\x8c\x34"
-                         "\xce\xab\x57\xcc\x79\x0b\xe0\x6f"
-                         "\x5c\x3e\x48\x1f\x6c\x46\xf7\x51"
-                         "\x8b\x84\x83\x2a\xc1\x05\xb8\xc5",
-               .ilen   = 48,
-               .result = "\x50\x82\x3e\x07\xe2\x1e\xb6\xfb"
-                         "\x33\xe4\x73\xce\xd2\xfb\x95\x79"
-                         "\xe8\xb4\xb5\x77\x11\x10\x62\x6f"
-                         "\x6a\x82\xd1\x13\xec\xf5\xd0\x48",
-               .rlen   = 32,
-               .novrfy = 1,
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 8,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 8,
+               .result = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
+               .rlen   = 8,
        }, {
-               .key    = "\x61\x0e\x8c\xae\xe3\x23\xb6\x38"
-                         "\x76\x1c\xf6\x3a\x67\xa3\x9c\xd8"
-                         "\x05\xe0\xc9",
-               .klen   = 19,
-               .iv     = "\x0f\xed\x34\xea\x97\xd4\x3b\xdf",
-               .assoc  = "\x49\x5c\x50\x1f\x1d\x94\xcc\x81"
-                         "\xba\xb7\xb6\x03\xaf\xa5\xc1\xa1"
-                         "\xd8\x5c\x42\x68\xe0\x6c\xda\x89"
-                         "\x05\xac\x56\xac\x1b\x2a\xd3\x86",
-               .alen   = 32,
-               .input  = "\x39\xbe\x7d\x15\x62\x77\xf3\x3c"
-                         "\xad\x83\x52\x6d\x71\x03\x25\x1c"
-                         "\xed\x81\x3a\x9a\x16\x7d\x19\x80"
-                         "\x72\x04\x72\xd0\xf6\xff\x05\x0f"
-                         "\xb7\x14\x30\x00\x32\x9e\xa0\xa6"
-                         "\x9e\x5a\x18\xa1\xb8\xfe\xdb\xd3",
-               .ilen   = 48,
-               .result = "\x75\x05\xbe\xc2\xd9\x1e\xde\x60"
-                         "\x47\x3d\x8c\x7d\xbd\xb5\xd9\xb7"
-                         "\xf2\xae\x61\x05\x8f\x82\x24\x3f"
-                         "\x9c\x67\x91\xe1\x38\x4f\xe4\x0c",
-               .rlen   = 32,
+               .key    = "\xef\x01\x23\x45",
+               .klen   = 4,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00",
+               .ilen   = 20,
+               .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
+                         "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
+                         "\x36\xb6\x78\x58",
+               .rlen   = 20,
+       }, {
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78",
+               .ilen   = 28,
+               .result = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
+                         "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
+                         "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
+                         "\x40\x01\x1e\xcf",
+               .rlen   = 28,
+       }, {
+               .key    = "\xef\x01\x23\x45",
+               .klen   = 4,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00",
+               .ilen   = 10,
+               .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
+                         "\xbd\x61",
+               .rlen   = 10,
+       }, {
+               .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
+                       "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 16,
+               .input  = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
+               .ilen   = 8,
+               .result = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
+               .rlen   = 8,
+       },
+};
+
+static struct cipher_testvec arc4_dec_tv_template[] = {
+       {
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
+               .ilen   = 8,
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .rlen   = 8,
        }, {
-               .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
-                         "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
-                         "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
-                         "\xee\x49\x83",
-               .klen   = 27,
-               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
-               .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
-                         "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
-                         "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
-                         "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
-               .alen   = 32,
-               .input  = "\x71\x99\xfa\xf4\x44\x12\x68\x9b",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
                .ilen   = 8,
-               .result = "\x00",
-               .rlen   = 0,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .rlen   = 8,
        }, {
-               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
-                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
-                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
-                         "\xee\x49\x83",
-               .klen   = 27,
-               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
-               .assoc  = "\x44\xa6\x2c\x05\xe9\xe1\x43\xb1"
-                         "\x58\x7c\xf2\x5c\x6d\x39\x0a\x64"
-                         "\xa4\xf0\x13\x05\xd1\x77\x99\x67"
-                         "\x11\xc4\xc6\xdb\x00\x56\x36\x61",
-               .alen   = 32,
-               .input  = "\xfb\xe5\x5d\x34\xbe\xe5\xe8\xe7"
-                         "\x5a\xef\x2f\xbf\x1f\x7f\xd4\xb2"
-                         "\x66\xca\x61\x1e\x96\x7a\x61\xb3"
-                         "\x1c\x16\x45\x52\xba\x04\x9c\x9f"
-                         "\xb1\xd2\x40\xbc\x52\x7c\x6f\xb1",
-               .ilen   = 40,
-               .result = "\x85\x34\x66\x42\xc8\x92\x0f\x36"
-                         "\x58\xe0\x6b\x91\x3c\x98\x5c\xbb"
-                         "\x0a\x85\xcc\x02\xad\x7a\x96\xe9"
-                         "\x65\x43\xa4\xc3\x0f\xdc\x55\x81",
-               .rlen   = 32,
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 8,
+               .input  = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
+               .ilen   = 8,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .rlen   = 8,
        }, {
-               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
-                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
-                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
-                         "\xd1\xfc\x57",
-               .klen   = 27,
-               .iv     = "\x9c\xfe\xb8\x9c\xad\x71\xaa\x1f",
-               .assoc  = "\x86\x67\xa5\xa9\x14\x5f\x0d\xc6"
-                         "\xff\x14\xc7\x44\xbf\x6c\x3a\xc3"
-                         "\xff\xb6\x81\xbd\xe2\xd5\x06\xc7"
-                         "\x3c\xa1\x52\x13\x03\x8a\x23\x3a",
-               .alen   = 32,
-               .input  = "\x3f\x66\xb0\x9d\xe5\x4b\x38\x00"
-                         "\xc6\x0e\x6e\xe5\xd6\x98\xa6\x37"
-                         "\x8c\x26\x33\xc6\xb2\xa2\x17\xfa"
-                         "\x64\x19\xc0\x30\xd7\xfc\x14\x6b"
-                         "\xe3\x33\xc2\x04\xb0\x37\xbe\x3f"
-                         "\xa9\xb4\x2d\x68\x03\xa3\x44\xef",
-               .ilen   = 48,
-               .result = "\x02\x87\x4d\x28\x80\x6e\xb2\xed"
-                         "\x99\x2a\xa8\xca\x04\x25\x45\x90"
-                         "\x1d\xdd\x5a\xd9\xe4\xdb\x9c\x9c"
-                         "\x49\xe9\x01\xfe\xa7\x80\x6d\x6b",
-               .rlen   = 32,
-               .novrfy = 1,
+               .key    = "\xef\x01\x23\x45",
+               .klen   = 4,
+               .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
+                         "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
+                         "\x36\xb6\x78\x58",
+               .ilen   = 20,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00",
+               .rlen   = 20,
        }, {
-               .key    = "\xa4\x4b\x54\x29\x0a\xb8\x6d\x01"
-                         "\x5b\x80\x2a\xcf\x25\xc4\xb7\x5c"
-                         "\x20\x2c\xad\x30\xc2\x2b\x41\xfb"
-                         "\x0e\x85\xbc\x33\xad\x0f\x2b\xff"
-                         "\xee\x49\x83",
-               .klen   = 35,
-               .iv     = "\xe9\xa9\xff\xe9\x57\xba\xfd\x9e",
-               .alen   = 0,
-               .input  = "\x1f\xb8\x8f\xa3\xdd\x54\x00\xf2",
-               .ilen   = 8,
-               .result = "\x00",
-               .rlen   = 0,
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .klen   = 8,
+               .input  = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
+                         "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
+                         "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
+                         "\x40\x01\x1e\xcf",
+               .ilen   = 28,
+               .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
+                         "\x12\x34\x56\x78",
+               .rlen   = 28,
        }, {
-               .key    = "\x39\xbb\xa7\xbe\x59\x97\x9e\x73"
-                         "\xa2\xbc\x6b\x98\xd7\x75\x7f\xe3"
-                         "\xa4\x48\x93\x39\x26\x71\x4a\xc6"
-                         "\xae\x8f\x11\x4c\xc2\x9c\x4a\xbb"
-                         "\x85\x34\x66",
-               .klen   = 35,
-               .iv     = "\x42\xc8\x92\x0f\x36\x58\xe0\x6b",
-               .alen   = 0,
-               .input  = "\x48\x01\x5e\x02\x24\x04\x66\x47"
-                         "\xa1\xea\x6f\xaf\xe8\xfc\xfb\xdd"
-                         "\xa5\xa9\x87\x8d\x84\xee\x2e\x77"
-                         "\xbb\x86\xb9\xf5\x5c\x6c\xff\xf6"
-                         "\x72\xc3\x8e\xf7\x70\xb1\xb2\x07"
-                         "\xbc\xa8\xa3\xbd\x83\x7c\x1d\x2a",
-               .ilen   = 48,
-               .result = "\xdc\x56\xf2\x71\xb0\xb1\xa0\x6c"
-                         "\xf0\x97\x3a\xfb\x6d\xe7\x32\x99"
-                         "\x3e\xaf\x70\x5e\xb2\x4d\xea\x39"
-                         "\x89\xd4\x75\x7a\x63\xb1\xda\x93",
-               .rlen   = 32,
-               .novrfy = 1,
+               .key    = "\xef\x01\x23\x45",
+               .klen   = 4,
+               .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
+                         "\xbd\x61",
+               .ilen   = 10,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00",
+               .rlen   = 10,
        }, {
-               .key    = "\x58\x5d\xa0\x96\x65\x1a\x04\xd7"
-                         "\x96\xe5\xc5\x68\xaa\x95\x35\xe0"
-                         "\x29\xa0\xba\x9e\x48\x78\xd1\xba"
-                         "\x0d\x1a\x53\x3b\xb5\xe3\xf8\x8b"
-                         "\xcf\x76\x3f",
-               .klen   = 35,
-               .iv     = "\xd9\x95\x75\x8f\x44\x89\x40\x7b",
-               .assoc  = "\x8f\x86\x6c\x4d\x1d\xc5\x39\x88"
-                         "\xc8\xf3\x5c\x52\x10\x63\x6f\x2b"
-                         "\x8a\x2a\xc5\x6f\x30\x23\x58\x7b"
-                         "\xfb\x36\x03\x11\xb4\xd9\xf2\xfe",
-               .alen   = 32,
-               .input  = "\x48\x58\xd6\xf3\xad\x63\x58\xbf"
-                         "\xae\xc7\x5e\xae\x83\x8f\x7b\xe4"
-                         "\x78\x5c\x4c\x67\x71\x89\x94\xbf"
-                         "\x47\xf1\x63\x7e\x1c\x59\xbd\xc5"
-                         "\x7f\x44\x0a\x0c\x01\x18\x07\x92"
-                         "\xe1\xd3\x51\xce\x32\x6d\x0c\x5b",
-               .ilen   = 48,
-               .result = "\xc2\x54\xc8\xde\x78\x87\x77\x40"
-                         "\x49\x71\xe4\xb7\xe7\xcb\x76\x61"
-                         "\x0a\x41\xb9\xe9\xc0\x76\x54\xab"
-                         "\x04\x49\x3b\x19\x93\x57\x25\x5d",
-               .rlen   = 32,
+               .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
+                       "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 16,
+               .input  = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
+               .ilen   = 8,
+               .result = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
+               .rlen   = 8,
        },
 };
 
 /*
- * ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode)
- * test vectors, taken from Appendix B.2.9 and B.2.10:
- *     http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf
- * Only AES-128 is supported at this time.
+ * TEA test vectors
  */
-#define ANSI_CPRNG_AES_TEST_VECTORS    6
+#define TEA_ENC_TEST_VECTORS   4
+#define TEA_DEC_TEST_VECTORS   4
 
-static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
+static struct cipher_testvec tea_enc_tv_template[] = {
        {
-               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
-                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .key    = zeroed_string,
                .klen   = 16,
-               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
-                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xf9",
-               .dtlen  = 16,
-               .v      = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .vlen   = 16,
-               .result = "\x59\x53\x1e\xd1\x3b\xb0\xc0\x55"
-                         "\x84\x79\x66\x85\xc1\x2f\x76\x41",
-               .rlen   = 16,
-               .loops  = 1,
+               .input  = zeroed_string,
+               .ilen   = 8,
+               .result = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
+               .rlen   = 8,
        }, {
-               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
-                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
+                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
                .klen   = 16,
-               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
-                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfa",
-               .dtlen  = 16,
-               .v      = "\xc0\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .vlen   = 16,
-               .result = "\x7c\x22\x2c\xf4\xca\x8f\xa2\x4c"
-                         "\x1c\x9c\xb6\x41\xa9\xf3\x22\x0d",
+               .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
+               .ilen   = 8,
+               .result = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
+               .rlen   = 8,
+       }, {
+               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
+                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
+               .klen   = 16,
+               .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
+                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .ilen   = 16,
+               .result = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
+                         "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
                .rlen   = 16,
-               .loops  = 1,
        }, {
-               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
-                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
+                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
+               .klen   = 16,
+               .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
+                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
+                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
+                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .ilen   = 32,
+               .result = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
+                         "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
+                         "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
+                         "\x07\x89\x73\xc2\x45\x92\xc6\x90",
+               .rlen   = 32,
+       }
+};
+
+static struct cipher_testvec tea_dec_tv_template[] = {
+       {
+               .key    = zeroed_string,
+               .klen   = 16,
+               .input  = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
+               .ilen   = 8,
+               .result = zeroed_string,
+               .rlen   = 8,
+       }, {
+               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
+                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
                .klen   = 16,
-               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
-                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfb",
-               .dtlen  = 16,
-               .v      = "\xe0\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .vlen   = 16,
-               .result = "\x8a\xaa\x00\x39\x66\x67\x5b\xe5"
-                         "\x29\x14\x28\x81\xa9\x4d\x4e\xc7",
-               .rlen   = 16,
-               .loops  = 1,
+               .input  = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
+               .ilen   = 8,
+               .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
+               .rlen   = 8,
        }, {
-               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
-                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
+               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
+                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
                .klen   = 16,
-               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
-                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfc",
-               .dtlen  = 16,
-               .v      = "\xf0\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .vlen   = 16,
-               .result = "\x88\xdd\xa4\x56\x30\x24\x23\xe5"
-                         "\xf6\x9d\xa5\x7e\x7b\x95\xc7\x3a",
+               .input  = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
+                         "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
+               .ilen   = 16,
+               .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
+                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
                .rlen   = 16,
-               .loops  = 1,
        }, {
-               .key    = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
-                         "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
-               .klen   = 16,
-               .dt     = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
-                         "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfd",
-               .dtlen  = 16,
-               .v      = "\xf8\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .vlen   = 16,
-               .result = "\x05\x25\x92\x46\x61\x79\xd2\xcb"
-                         "\x78\xc4\x0b\x14\x0a\x5a\x9a\xc8",
-               .rlen   = 16,
-               .loops  = 1,
-       }, {    /* Monte Carlo Test */
-               .key    = "\x9f\x5b\x51\x20\x0b\xf3\x34\xb5"
-                         "\xd8\x2b\xe8\xc3\x72\x55\xc8\x48",
+               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
+                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
                .klen   = 16,
-               .dt     = "\x63\x76\xbb\xe5\x29\x02\xba\x3b"
-                         "\x67\xc9\x25\xfa\x70\x1f\x11\xac",
-               .dtlen  = 16,
-               .v      = "\x57\x2c\x8e\x76\x87\x26\x47\x97"
-                         "\x7e\x74\xfb\xdd\xc4\x95\x01\xd1",
-               .vlen   = 16,
-               .result = "\x48\xe9\xbd\x0d\x06\xee\x18\xfb"
-                         "\xe4\x57\x90\xd5\xc3\xfc\x9b\x73",
-               .rlen   = 16,
-               .loops  = 10000,
-       },
+               .input  = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
+                         "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
+                         "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
+                         "\x07\x89\x73\xc2\x45\x92\xc6\x90",
+               .ilen   = 32,
+               .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
+                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
+                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
+                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .rlen   = 32,
+       }
 };
 
-/* Cast5 test vectors from RFC 2144 */
-#define CAST5_ENC_TEST_VECTORS 3
-#define CAST5_DEC_TEST_VECTORS 3
+/*
+ * XTEA test vectors
+ */
+#define XTEA_ENC_TEST_VECTORS  4
+#define XTEA_DEC_TEST_VECTORS  4
 
-static struct cipher_testvec cast5_enc_tv_template[] = {
+static struct cipher_testvec xtea_enc_tv_template[] = {
        {
-               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
-                         "\x23\x45\x67\x89\x34\x56\x78\x9a",
+               .key    = zeroed_string,
                .klen   = 16,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .input  = zeroed_string,
                .ilen   = 8,
-               .result = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
+               .result = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
-                         "\x23\x45",
-               .klen   = 10,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
+                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
+               .klen   = 16,
+               .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
                .ilen   = 8,
-               .result = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
+               .result = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x12",
-               .klen   = 5,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .ilen   = 8,
-               .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
-               .rlen   = 8,
-       },
+               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
+                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
+               .klen   = 16,
+               .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
+                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .ilen   = 16,
+               .result = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
+                         "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
+               .rlen   = 16,
+       }, {
+               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
+                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
+               .klen   = 16,
+               .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
+                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
+                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
+                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .ilen   = 32,
+               .result = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
+                         "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
+                         "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
+                         "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
+               .rlen   = 32,
+       }
 };
 
-static struct cipher_testvec cast5_dec_tv_template[] = {
+static struct cipher_testvec xtea_dec_tv_template[] = {
        {
-               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
-                         "\x23\x45\x67\x89\x34\x56\x78\x9a",
+               .key    = zeroed_string,
                .klen   = 16,
-               .input  = "\x23\x8b\x4f\xe5\x84\x7e\x44\xb2",
+               .input  = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
                .ilen   = 8,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .result = zeroed_string,
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x12\x34\x56\x78"
-                         "\x23\x45",
-               .klen   = 10,
-               .input  = "\xeb\x6a\x71\x1a\x2c\x02\x27\x1b",
+               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
+                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
+               .klen   = 16,
+               .input  = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
                .ilen   = 8,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x12",
-               .klen   = 5,
-               .input  = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
-               .ilen   = 8,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .rlen   = 8,
-       },
+               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
+                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
+               .klen   = 16,
+               .input  = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
+                         "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
+               .ilen   = 16,
+               .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
+                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .rlen   = 16,
+       }, {
+               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
+                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
+               .klen   = 16,
+               .input  = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
+                         "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
+                         "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
+                         "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
+               .ilen   = 32,
+               .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
+                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
+                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
+                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .rlen   = 32,
+       }
 };
 
 /*
- * ARC4 test vectors from OpenSSL
+ * KHAZAD test vectors.
  */
-#define ARC4_ENC_TEST_VECTORS  7
-#define ARC4_DEC_TEST_VECTORS  7
+#define KHAZAD_ENC_TEST_VECTORS 5
+#define KHAZAD_DEC_TEST_VECTORS 5
 
-static struct cipher_testvec arc4_enc_tv_template[] = {
+static struct cipher_testvec khazad_enc_tv_template[] = {
        {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 16,
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .ilen   = 8,
-               .result = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
+               .result = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
+                         "\x38\x38\x38\x38\x38\x38\x38\x38",
+               .klen   = 16,
+               .input  = "\x38\x38\x38\x38\x38\x38\x38\x38",
                .ilen   = 8,
-               .result = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
+               .result = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
                .rlen   = 8,
        }, {
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 8,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
+                       "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
+               .klen   = 16,
+               .input  = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
                .ilen   = 8,
-               .result = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
+               .result = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
                .rlen   = 8,
        }, {
-               .key    = "\xef\x01\x23\x45",
-               .klen   = 4,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00",
-               .ilen   = 20,
-               .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
-                         "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
-                         "\x36\xb6\x78\x58",
-               .rlen   = 20,
-       }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78",
-               .ilen   = 28,
-               .result = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
-                         "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
-                         "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
-                         "\x40\x01\x1e\xcf",
-               .rlen   = 28,
-       }, {
-               .key    = "\xef\x01\x23\x45",
-               .klen   = 4,
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00",
-               .ilen   = 10,
-               .result = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
-                         "\xbd\x61",
-               .rlen   = 10,
-       }, {
-               .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
                .klen   = 16,
-               .input  = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
+               .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
                .ilen   = 8,
-               .result = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
+               .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
                .rlen   = 8,
+       }, {
+               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .klen   = 16,
+               .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .ilen   = 16,
+               .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
+                       "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
+               .rlen   = 16,
        },
 };
 
-static struct cipher_testvec arc4_dec_tv_template[] = {
+static struct cipher_testvec khazad_dec_tv_template[] = {
        {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x75\xb7\x87\x80\x99\xe0\xc5\x96",
+               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 16,
+               .input  = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
                .ilen   = 8,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .rlen   = 8,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x74\x94\xc2\xe7\x10\x4b\x08\x79",
+               .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
+                         "\x38\x38\x38\x38\x38\x38\x38\x38",
+               .klen   = 16,
+               .input  = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
                .ilen   = 8,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .result = "\x38\x38\x38\x38\x38\x38\x38\x38",
                .rlen   = 8,
        }, {
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 8,
-               .input  = "\xde\x18\x89\x41\xa3\x37\x5d\x3a",
+               .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
+                       "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
+               .klen   = 16,
+               .input  = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
                .ilen   = 8,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .result = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
                .rlen   = 8,
        }, {
-               .key    = "\xef\x01\x23\x45",
-               .klen   = 4,
-               .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
-                         "\xbd\x61\x5a\x11\x62\xe1\xc7\xba"
-                         "\x36\xb6\x78\x58",
-               .ilen   = 20,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00",
-               .rlen   = 20,
-       }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef",
-               .klen   = 8,
-               .input  = "\x66\xa0\x94\x9f\x8a\xf7\xd6\x89"
-                         "\x1f\x7f\x83\x2b\xa8\x33\xc0\x0c"
-                         "\x89\x2e\xbe\x30\x14\x3c\xe2\x87"
-                         "\x40\x01\x1e\xcf",
-               .ilen   = 28,
-               .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"
-                         "\x12\x34\x56\x78",
-               .rlen   = 28,
-       }, {
-               .key    = "\xef\x01\x23\x45",
-               .klen   = 4,
-               .input  = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf"
-                         "\xbd\x61",
-               .ilen   = 10,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00",
-               .rlen   = 10,
-       }, {
-               .key    = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
                .klen   = 16,
-               .input  = "\x69\x72\x36\x59\x1B\x52\x42\xB1",
+               .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
                .ilen   = 8,
-               .result = "\x01\x23\x45\x67\x89\xAB\xCD\xEF",
+               .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
                .rlen   = 8,
+       }, {
+               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .klen   = 16,
+               .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
+                       "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
+               .ilen   = 16,
+               .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
+                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .rlen   = 16,
        },
 };
 
 /*
- * TEA test vectors
+ * Anubis test vectors.
  */
-#define TEA_ENC_TEST_VECTORS   4
-#define TEA_DEC_TEST_VECTORS   4
 
-static struct cipher_testvec tea_enc_tv_template[] = {
+#define ANUBIS_ENC_TEST_VECTORS                        5
+#define ANUBIS_DEC_TEST_VECTORS                        5
+#define ANUBIS_CBC_ENC_TEST_VECTORS            2
+#define ANUBIS_CBC_DEC_TEST_VECTORS            2
+
+static struct cipher_testvec anubis_enc_tv_template[] = {
        {
-               .key    = zeroed_string,
+               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
                .klen   = 16,
-               .input  = zeroed_string,
-               .ilen   = 8,
-               .result = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
-               .rlen   = 8,
+               .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
+               .ilen   = 16,
+               .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
+                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
+               .rlen   = 16,
        }, {
-               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
-                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
-               .klen   = 16,
-               .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
-               .ilen   = 8,
-               .result = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
-               .rlen   = 8,
+
+               .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03",
+               .klen   = 20,
+               .input  = "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03\x03\x03\x03\x03",
+               .ilen   = 16,
+               .result = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
+                         "\x87\x41\x6f\x82\x0a\x98\x64\xae",
+               .rlen   = 16,
        }, {
-               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
-                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
+               .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24",
+               .klen   = 28,
+               .input  = "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24",
+               .ilen   = 16,
+               .result = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
+                         "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
+               .rlen   = 16,
+       }, {
+               .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .klen   = 32,
+               .input  = "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .ilen   = 16,
+               .result = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
+                       "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
+               .rlen   = 16,
+       }, {
+               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .klen   = 40,
+               .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .ilen   = 16,
+               .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
+                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec anubis_dec_tv_template[] = {
+       {
+               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
                .klen   = 16,
-               .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
-                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
+                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
                .ilen   = 16,
-               .result = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
-                         "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
+               .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
                .rlen   = 16,
        }, {
-               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
-                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
+
+               .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03",
+               .klen   = 20,
+               .input  = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
+                         "\x87\x41\x6f\x82\x0a\x98\x64\xae",
+               .ilen   = 16,
+               .result = "\x03\x03\x03\x03\x03\x03\x03\x03"
+                         "\x03\x03\x03\x03\x03\x03\x03\x03",
+               .rlen   = 16,
+       }, {
+               .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24",
+               .klen   = 28,
+               .input  = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
+                         "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
+               .ilen   = 16,
+               .result = "\x24\x24\x24\x24\x24\x24\x24\x24"
+                         "\x24\x24\x24\x24\x24\x24\x24\x24",
+               .rlen   = 16,
+       }, {
+               .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .klen   = 32,
+               .input  = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
+                       "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
+               .ilen   = 16,
+               .result = "\x25\x25\x25\x25\x25\x25\x25\x25"
+                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .rlen   = 16,
+       }, {
+               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
+                        "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
+               .klen   = 40,
+               .ilen   = 16,
+               .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .rlen   = 16,
+       },
+};
+
+static struct cipher_testvec anubis_cbc_enc_tv_template[] = {
+       {
+               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
                .klen   = 16,
-               .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
-                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
-                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
-                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
+               .ilen   = 32,
+               .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
+                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
+                         "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
+                         "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
+               .rlen   = 32,
+       }, {
+               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .klen   = 40,
+               .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
                .ilen   = 32,
-               .result = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
-                         "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
-                         "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
-                         "\x07\x89\x73\xc2\x45\x92\xc6\x90",
+               .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
+                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
+                         "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
+                         "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
                .rlen   = 32,
-       }
+       },
 };
 
-static struct cipher_testvec tea_dec_tv_template[] = {
+static struct cipher_testvec anubis_cbc_dec_tv_template[] = {
        {
-               .key    = zeroed_string,
-               .klen   = 16,
-               .input  = "\x0a\x3a\xea\x41\x40\xa9\xba\x94",
-               .ilen   = 8,
-               .result = zeroed_string,
-               .rlen   = 8,
-       }, {
-               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
-                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
-               .klen   = 16,
-               .input  = "\x77\x5d\x2a\x6a\xf6\xce\x92\x09",
-               .ilen   = 8,
-               .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
-               .rlen   = 8,
-       }, {
-               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
-                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
+               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
                .klen   = 16,
-               .input  = "\xbe\x7a\xbb\x81\x95\x2d\x1f\x1e"
-                         "\xdd\x89\xa1\x25\x04\x21\xdf\x95",
-               .ilen   = 16,
-               .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
-                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
-               .rlen   = 16,
+               .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
+                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
+                         "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
+                         "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
+               .ilen   = 32,
+               .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
+                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
+               .rlen   = 32,
        }, {
-               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
-                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
-               .klen   = 16,
-               .input  = "\xe0\x4d\x5d\x3c\xb7\x8c\x36\x47"
-                         "\x94\x18\x95\x91\xa9\xfc\x49\xf8"
-                         "\x44\xd1\x2d\xc2\x99\xb8\x08\x2a"
-                         "\x07\x89\x73\xc2\x45\x92\xc6\x90",
+               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .klen   = 40,
+               .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
+                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
+                         "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
+                         "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
                .ilen   = 32,
-               .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
-                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
-                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
-                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
+               .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35"
+                         "\x35\x35\x35\x35\x35\x35\x35\x35",
                .rlen   = 32,
-       }
+       },
 };
 
 /*
- * XTEA test vectors
+ * XETA test vectors
  */
-#define XTEA_ENC_TEST_VECTORS  4
-#define XTEA_DEC_TEST_VECTORS  4
+#define XETA_ENC_TEST_VECTORS  4
+#define XETA_DEC_TEST_VECTORS  4
 
-static struct cipher_testvec xtea_enc_tv_template[] = {
+static struct cipher_testvec xeta_enc_tv_template[] = {
        {
                .key    = zeroed_string,
                .klen   = 16,
                .input  = zeroed_string,
                .ilen   = 8,
-               .result = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
+               .result = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
                .rlen   = 8,
        }, {
                .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
@@ -6788,7 +11129,7 @@ static struct cipher_testvec xtea_enc_tv_template[] = {
                .klen   = 16,
                .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
                .ilen   = 8,
-               .result = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
+               .result = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
                .rlen   = 8,
        }, {
                .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
@@ -6797,8 +11138,8 @@ static struct cipher_testvec xtea_enc_tv_template[] = {
                .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
                          "\x65\x73\x74\x5f\x76\x65\x63\x74",
                .ilen   = 16,
-               .result = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
-                         "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
+               .result = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
+                         "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
                .rlen   = 16,
        }, {
                .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
@@ -6809,19 +11150,19 @@ static struct cipher_testvec xtea_enc_tv_template[] = {
                          "\x79\x6f\x75\x21\x21\x21\x20\x72"
                          "\x65\x61\x6c\x6c\x79\x21\x21\x21",
                .ilen   = 32,
-               .result = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
-                         "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
-                         "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
-                         "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
+               .result = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
+                         "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
+                         "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
+                         "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
                .rlen   = 32,
        }
 };
 
-static struct cipher_testvec xtea_dec_tv_template[] = {
+static struct cipher_testvec xeta_dec_tv_template[] = {
        {
                .key    = zeroed_string,
                .klen   = 16,
-               .input  = "\xd8\xd4\xe9\xde\xd9\x1e\x13\xf7",
+               .input  = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
                .ilen   = 8,
                .result = zeroed_string,
                .rlen   = 8,
@@ -6829,7 +11170,7 @@ static struct cipher_testvec xtea_dec_tv_template[] = {
                .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
                          "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
                .klen   = 16,
-               .input  = "\x94\xeb\xc8\x96\x84\x6a\x49\xa8",
+               .input  = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
                .ilen   = 8,
                .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
                .rlen   = 8,
@@ -6837,8 +11178,8 @@ static struct cipher_testvec xtea_dec_tv_template[] = {
                .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
                          "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
                .klen   = 16,
-               .input  = "\x3e\xce\xae\x22\x60\x56\xa8\x9d"
-                         "\x77\x4d\xd4\xb4\x87\x24\xe3\x9a",
+               .input  = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
+                         "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
                .ilen   = 16,
                .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
                          "\x65\x73\x74\x5f\x76\x65\x63\x74",
@@ -6847,10 +11188,10 @@ static struct cipher_testvec xtea_dec_tv_template[] = {
                .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
                          "\x5d\x04\x16\x36\x15\x72\x63\x2f",
                .klen   = 16,
-               .input  = "\x99\x81\x9f\x5d\x6f\x4b\x31\x3a"
-                         "\x86\xff\x6f\xd0\xe3\x87\x70\x07"
-                         "\x4d\xb8\xcf\xf3\x99\x50\xb3\xd4"
-                         "\x73\xa2\xfa\xc9\x16\x59\x5d\x81",
+               .input  = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
+                         "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
+                         "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
+                         "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
                .ilen   = 32,
                .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
                          "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
@@ -6861,669 +11202,1649 @@ static struct cipher_testvec xtea_dec_tv_template[] = {
 };
 
 /*
- * KHAZAD test vectors.
+ * FCrypt test vectors
  */
-#define KHAZAD_ENC_TEST_VECTORS 5
-#define KHAZAD_DEC_TEST_VECTORS 5
+#define FCRYPT_ENC_TEST_VECTORS        ARRAY_SIZE(fcrypt_pcbc_enc_tv_template)
+#define FCRYPT_DEC_TEST_VECTORS        ARRAY_SIZE(fcrypt_pcbc_dec_tv_template)
 
-static struct cipher_testvec khazad_enc_tv_template[] = {
-       {
-               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 16,
+static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = {
+       { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 8,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .ilen   = 8,
-               .result = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
-               .rlen   = 8,
-       }, {
-               .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
-                         "\x38\x38\x38\x38\x38\x38\x38\x38",
-               .klen   = 16,
-               .input  = "\x38\x38\x38\x38\x38\x38\x38\x38",
-               .ilen   = 8,
-               .result = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
-               .rlen   = 8,
-       }, {
-               .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
-                       "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
-               .klen   = 16,
-               .input  = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
-               .ilen   = 8,
-               .result = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
+               .result = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
                .rlen   = 8,
        }, {
-               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .klen   = 16,
-               .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
+               .klen   = 8,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
                .ilen   = 8,
-               .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
+               .result = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
                .rlen   = 8,
+       }, { /* From Arla */
+               .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .klen   = 8,
+               .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .ilen   = 48,
+               .result = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
+                         "\xee\xac\x98\x62\x44\x51\xe4\x84"
+                         "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
+                         "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
+                         "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
+                         "\xf8\x91\x3c\xac\x44\x22\x92\xef",
+               .rlen   = 48,
        }, {
-               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .klen   = 16,
-               .input  = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .ilen   = 16,
-               .result = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
-                       "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
-               .rlen   = 16,
-       },
+               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .klen   = 8,
+               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .ilen   = 48,
+               .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
+                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
+                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
+                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
+                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
+                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
+               .rlen   = 48,
+       }, { /* split-page version */
+               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .klen   = 8,
+               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .ilen   = 48,
+               .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
+                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
+                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
+                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
+                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
+                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
+               .rlen   = 48,
+               .np     = 2,
+               .tap    = { 20, 28 },
+       }
 };
 
-static struct cipher_testvec khazad_dec_tv_template[] = {
-       {
-               .key    = "\x80\x00\x00\x00\x00\x00\x00\x00"
-                         "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 16,
-               .input  = "\x49\xa4\xce\x32\xac\x19\x0e\x3f",
-               .ilen   = 8,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .rlen   = 8,
-       }, {
-               .key    = "\x38\x38\x38\x38\x38\x38\x38\x38"
-                         "\x38\x38\x38\x38\x38\x38\x38\x38",
-               .klen   = 16,
-               .input  = "\x7e\x82\x12\xa1\xd9\x5b\xe4\xf9",
-               .ilen   = 8,
-               .result = "\x38\x38\x38\x38\x38\x38\x38\x38",
-               .rlen   = 8,
-       }, {
-               .key    = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2"
-                       "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
-               .klen   = 16,
-               .input  = "\xaa\xbe\xc1\x95\xc5\x94\x1a\x9c",
+static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = {
+       { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 8,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
                .ilen   = 8,
-               .result = "\xa2\xa2\xa2\xa2\xa2\xa2\xa2\xa2",
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
                .rlen   = 8,
        }, {
-               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .klen   = 16,
-               .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
+               .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
+               .klen   = 8,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
                .ilen   = 8,
-               .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
+               .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
                .rlen   = 8,
+       }, { /* From Arla */
+               .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .klen   = 8,
+               .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .input  = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
+                         "\xee\xac\x98\x62\x44\x51\xe4\x84"
+                         "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
+                         "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
+                         "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
+                         "\xf8\x91\x3c\xac\x44\x22\x92\xef",
+               .ilen   = 48,
+               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .rlen   = 48,
        }, {
-               .key    = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .klen   = 16,
-               .input  = "\x04\x74\xf5\x70\x50\x16\xd3\xb8"
-                       "\x04\x74\xf5\x70\x50\x16\xd3\xb8",
-               .ilen   = 16,
-               .result = "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f"
-                       "\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f",
-               .rlen   = 16,
-       },
+               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .klen   = 8,
+               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
+                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
+                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
+                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
+                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
+                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
+               .ilen   = 48,
+               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .rlen   = 48,
+       }, { /* split-page version */
+               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .klen   = 8,
+               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
+               .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
+                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
+                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
+                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
+                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
+                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
+               .ilen   = 48,
+               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
+               .rlen   = 48,
+               .np     = 2,
+               .tap    = { 20, 28 },
+       }
 };
 
 /*
- * Anubis test vectors.
+ * CAMELLIA test vectors.
  */
+#define CAMELLIA_ENC_TEST_VECTORS 4
+#define CAMELLIA_DEC_TEST_VECTORS 4
+#define CAMELLIA_CBC_ENC_TEST_VECTORS 3
+#define CAMELLIA_CBC_DEC_TEST_VECTORS 3
+#define CAMELLIA_CTR_ENC_TEST_VECTORS 2
+#define CAMELLIA_CTR_DEC_TEST_VECTORS 2
+#define CAMELLIA_LRW_ENC_TEST_VECTORS 8
+#define CAMELLIA_LRW_DEC_TEST_VECTORS 8
+#define CAMELLIA_XTS_ENC_TEST_VECTORS 5
+#define CAMELLIA_XTS_DEC_TEST_VECTORS 5
 
-#define ANUBIS_ENC_TEST_VECTORS                        5
-#define ANUBIS_DEC_TEST_VECTORS                        5
-#define ANUBIS_CBC_ENC_TEST_VECTORS            2
-#define ANUBIS_CBC_DEC_TEST_VECTORS            2
-
-static struct cipher_testvec anubis_enc_tv_template[] = {
+static struct cipher_testvec camellia_enc_tv_template[] = {
        {
-               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .klen   = 16,
-               .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .ilen   = 16,
-               .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
-                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
+               .result = "\x67\x67\x31\x38\x54\x96\x69\x73"
+                         "\x08\x57\x06\x56\x48\xea\xbe\x43",
                .rlen   = 16,
        }, {
-
-               .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03",
-               .klen   = 20,
-               .input  = "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03\x03\x03\x03\x03",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
+                         "\x00\x11\x22\x33\x44\x55\x66\x77",
+               .klen   = 24,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .ilen   = 16,
-               .result = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
-                         "\x87\x41\x6f\x82\x0a\x98\x64\xae",
+               .result = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
+                         "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
                .rlen   = 16,
        }, {
-               .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24",
-               .klen   = 28,
-               .input  = "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
+                         "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .klen   = 32,
+               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .ilen   = 16,
-               .result = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
-                         "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
+               .result = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
+                         "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
                .rlen   = 16,
-       }, {
-               .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+       },
+       { /* Generated with Crypto++ */
+               .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
+                         "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
+                         "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
+                         "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
                .klen   = 32,
-               .input  = "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .ilen   = 48,
+               .result = "\xED\xCD\xDB\xB8\x68\xCE\xBD\xEA"
+                         "\x9D\x9D\xCD\x9F\x4F\xFC\x4D\xB7"
+                         "\xA5\xFF\x6F\x43\x0F\xBA\x32\x04"
+                         "\xB3\xC2\xB9\x03\xAA\x91\x56\x29"
+                         "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9"
+                         "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A",
+               .rlen   = 48,
+       },
+};
+
+static struct cipher_testvec camellia_dec_tv_template[] = {
+       {
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .klen   = 16,
+               .input  = "\x67\x67\x31\x38\x54\x96\x69\x73"
+                         "\x08\x57\x06\x56\x48\xea\xbe\x43",
                .ilen   = 16,
-               .result = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
-                       "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .rlen   = 16,
        }, {
-               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
-               .klen   = 40,
-               .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
+                         "\x00\x11\x22\x33\x44\x55\x66\x77",
+               .klen   = 24,
+               .input  = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
+                         "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
                .ilen   = 16,
-               .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
-                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
                .rlen   = 16,
+       }, {
+               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
+                         "\x00\x11\x22\x33\x44\x55\x66\x77"
+                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .klen   = 32,
+               .input  = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
+                         "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
+               .ilen   = 16,
+               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
+                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
+               .rlen   = 16,
+       },
+       { /* Generated with Crypto++ */
+               .key    = "\x3F\x85\x62\x3F\x1C\xF9\xD6\x1C"
+                         "\xF9\xD6\xB3\x90\x6D\x4A\x90\x6D"
+                         "\x4A\x27\x04\xE1\x27\x04\xE1\xBE"
+                         "\x9B\x78\xBE\x9B\x78\x55\x32\x0F",
+               .klen   = 32,
+               .input  = "\xED\xCD\xDB\xB8\x68\xCE\xBD\xEA"
+                         "\x9D\x9D\xCD\x9F\x4F\xFC\x4D\xB7"
+                         "\xA5\xFF\x6F\x43\x0F\xBA\x32\x04"
+                         "\xB3\xC2\xB9\x03\xAA\x91\x56\x29"
+                         "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9"
+                         "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A",
+               .ilen   = 48,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .rlen   = 48,
+       },
+};
+
+static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
+       {
+               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
+                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
+               .klen   = 16,
+               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+               .input  = "Single block msg",
+               .ilen   = 16,
+               .result = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
+                         "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
+               .rlen   = 16,
+       }, {
+               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
+               .klen   = 16,
+               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .ilen   = 32,
+               .result = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
+                         "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
+                         "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
+                         "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
+               .rlen   = 32,
+       },
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .ilen   = 48,
+               .result = "\xCD\x3E\x2A\x3B\x3E\x94\xC5\x77"
+                         "\xBA\xBB\x5B\xB1\xDE\x7B\xA4\x40"
+                         "\x88\x39\xE3\xFD\x94\x4B\x25\x58"
+                         "\xE1\x4B\xC4\x18\x7A\xFD\x17\x2B"
+                         "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27"
+                         "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01",
+               .rlen   = 48,
+       },
+};
+
+static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
+       {
+               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
+                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
+               .klen   = 16,
+               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+               .input  = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
+                         "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
+               .ilen   = 16,
+               .result = "Single block msg",
+               .rlen   = 16,
+       }, {
+               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
+               .klen   = 16,
+               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+               .input = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
+                         "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
+                         "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
+                         "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
+               .ilen   = 32,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+               .rlen   = 32,
+       },
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xCD\x3E\x2A\x3B\x3E\x94\xC5\x77"
+                         "\xBA\xBB\x5B\xB1\xDE\x7B\xA4\x40"
+                         "\x88\x39\xE3\xFD\x94\x4B\x25\x58"
+                         "\xE1\x4B\xC4\x18\x7A\xFD\x17\x2B"
+                         "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27"
+                         "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01",
+               .ilen   = 48,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .rlen   = 48,
+       },
+};
+
+static struct cipher_testvec camellia_ctr_enc_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .ilen   = 48,
+               .result = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
+                         "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
+                         "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
+                         "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
+                         "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
+                         "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C",
+               .rlen   = 48,
+       },
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D",
+               .ilen   = 51,
+               .result = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
+                         "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
+                         "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
+                         "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
+                         "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
+                         "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C"
+                         "\x1E\x43\xEF",
+               .rlen   = 51,
+       },
+};
+
+static struct cipher_testvec camellia_ctr_dec_tv_template[] = {
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
+                         "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
+                         "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
+                         "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
+                         "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
+                         "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C",
+               .ilen   = 48,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
+               .rlen   = 48,
        },
+       { /* Generated with Crypto++ */
+               .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
+                         "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
+                         "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
+                         "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
+               .klen   = 32,
+               .iv     = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
+                         "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
+               .input  = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
+                         "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
+                         "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
+                         "\xC9\x28\x74\xA6\x6B\xC7\x95\xA6"
+                         "\x6C\x77\xF7\x2F\xDF\xC7\xBB\x85"
+                         "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C"
+                         "\x1E\x43\xEF",
+               .ilen   = 51,
+               .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
+                         "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
+                         "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
+                         "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
+                         "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
+                         "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
+                         "\xDF\x76\x0D",
+               .rlen   = 51,
+       },
+
 };
 
-static struct cipher_testvec anubis_dec_tv_template[] = {
+static struct cipher_testvec camellia_lrw_enc_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
        {
-               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .klen   = 16,
-               .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
-                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90",
-               .ilen   = 16,
-               .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .rlen   = 16,
-       }, {
-
-               .key    = "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03",
-               .klen   = 20,
-               .input  = "\xdb\xf1\x42\xf4\xd1\x8a\xc7\x49"
-                         "\x87\x41\x6f\x82\x0a\x98\x64\xae",
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x03\x03\x03\x03\x03\x03\x03\x03"
-                         "\x03\x03\x03\x03\x03\x03\x03\x03",
+               .result = "\x92\x68\x19\xd7\xb7\x5b\x0a\x31"
+                         "\x97\xcc\x72\xbe\x99\x17\xeb\x3e",
                .rlen   = 16,
        }, {
-               .key    = "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24",
-               .klen   = 28,
-               .input  = "\xfd\x1b\x4a\xe3\xbf\xf0\xad\x3d"
-                         "\x06\xd3\x61\x27\xfd\x13\x9e\xde",
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x24\x24\x24\x24\x24\x24\x24\x24"
-                         "\x24\x24\x24\x24\x24\x24\x24\x24",
+               .result = "\x73\x09\xb7\x50\xb6\x77\x30\x50"
+                         "\x5c\x8a\x9c\x26\x77\x9d\xfc\x4a",
                .rlen   = 16,
        }, {
-               .key    = "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
                .klen   = 32,
-               .input  = "\x1a\x91\xfb\x2b\xb7\x78\x6b\xc4"
-                       "\x17\xd9\xff\x40\x3b\x0e\xe5\xfe",
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x25\x25\x25\x25\x25\x25\x25\x25"
-                         "\x25\x25\x25\x25\x25\x25\x25\x25",
+               .result = "\x90\xae\x83\xe0\x22\xb9\x60\x91"
+                         "\xfa\xa9\xb7\x98\xe3\xed\x87\x01",
                .rlen   = 16,
        }, {
-               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
-               .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
-                        "\x9e\xc6\x84\x0f\x17\x21\x07\xee",
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
                .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .result = "\x99\xe9\x6e\xd4\xc9\x21\xa5\xf0"
+                         "\xd8\x83\xef\xd9\x07\x16\x5f\x35",
                .rlen   = 16,
-       },
-};
-
-static struct cipher_testvec anubis_cbc_enc_tv_template[] = {
-       {
-               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .klen   = 16,
-               .input  = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .ilen   = 32,
-               .result = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
-                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
-                         "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
-                         "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
-               .rlen   = 32,
-       }, {
-               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
-               .klen   = 40,
-               .input  = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
-               .ilen   = 32,
-               .result = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
-                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
-                         "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
-                         "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
-               .rlen   = 32,
-       },
-};
-
-static struct cipher_testvec anubis_cbc_dec_tv_template[] = {
-       {
-               .key    = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .klen   = 16,
-               .input  = "\x6d\xc5\xda\xa2\x26\x7d\x62\x6f"
-                         "\x08\xb7\x52\x8e\x6e\x6e\x86\x90"
-                         "\x86\xd8\xb5\x6f\x98\x5e\x8a\x66"
-                         "\x4f\x1f\x78\xa1\xbb\x37\xf1\xbe",
-               .ilen   = 32,
-               .result = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"
-                         "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
-               .rlen   = 32,
        }, {
-               .key    = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
                .klen   = 40,
-               .input = "\xa5\x2c\x85\x6f\x9c\xba\xa0\x97"
-                         "\x9e\xc6\x84\x0f\x17\x21\x07\xee"
-                         "\xa2\xbc\x06\x98\xc6\x4b\xda\x75"
-                         "\x2e\xaa\xbe\x58\xce\x01\x5b\xc7",
-               .ilen   = 32,
-               .result = "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35"
-                         "\x35\x35\x35\x35\x35\x35\x35\x35",
-               .rlen   = 32,
-       },
-};
-
-/*
- * XETA test vectors
- */
-#define XETA_ENC_TEST_VECTORS  4
-#define XETA_DEC_TEST_VECTORS  4
-
-static struct cipher_testvec xeta_enc_tv_template[] = {
-       {
-               .key    = zeroed_string,
-               .klen   = 16,
-               .input  = zeroed_string,
-               .ilen   = 8,
-               .result = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
-               .rlen   = 8,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x42\x88\xf4\xcb\x21\x11\x6d\x8e"
+                         "\xde\x1a\xf2\x29\xf1\x4a\xe0\x15",
+               .rlen   = 16,
        }, {
-               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
-                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
-               .klen   = 16,
-               .input  = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
-               .ilen   = 8,
-               .result = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
-               .rlen   = 8,
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .ilen   = 16,
+               .result = "\x40\xaa\x34\x86\x4a\x8f\x78\xb9"
+                         "\xdb\xdb\x0f\x3d\x48\x70\xbe\x8d",
+               .rlen   = 16,
        }, {
-               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
-                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
-               .klen   = 16,
-               .input  = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
-                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .ilen   = 16,
-               .result = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
-                         "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
+               .result = "\x04\xab\x28\x37\x31\x7a\x26\xab"
+                         "\xa1\x70\x1b\x9c\xe7\xdd\x83\xff",
                .rlen   = 16,
        }, {
-               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
-                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
-               .klen   = 16,
-               .input  = "\x54\x65\x61\x20\x69\x73\x20\x67"
-                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
-                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
-                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
-               .ilen   = 32,
-               .result = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
-                         "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
-                         "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
-                         "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
-               .rlen   = 32,
-       }
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .ilen   = 512,
+               .result = "\x90\x69\x8e\xf2\x14\x86\x59\xf9"
+                         "\xec\xe7\xfa\x3f\x48\x9d\x7f\x96"
+                         "\x67\x76\xac\x2c\xd2\x63\x18\x93"
+                         "\x13\xf8\xf1\xf6\x71\x77\xb3\xee"
+                         "\x93\xb2\xcc\xf3\x26\xc1\x16\x4f"
+                         "\xd4\xe8\x43\xc1\x68\xa3\x3e\x06"
+                         "\x38\x51\xff\xa8\xb9\xa4\xeb\xb1"
+                         "\x62\xdd\x78\x81\xea\x1d\xef\x04"
+                         "\x1d\x07\xc1\x67\xc8\xd6\x77\xa1"
+                         "\x84\x95\xf4\x9a\xd9\xbc\x2d\xe2"
+                         "\xf6\x80\xfc\x91\x2a\xbc\x42\xa0"
+                         "\x40\x41\x69\xaa\x71\xc0\x37\xec"
+                         "\x39\xf3\xf2\xec\x82\xc3\x88\x79"
+                         "\xbc\xc3\xaa\xb7\xcf\x6a\x72\x80"
+                         "\x4c\xf4\x84\x8f\x13\x9e\x94\x5c"
+                         "\xe5\xb2\x91\xbb\x92\x51\x4d\xf1"
+                         "\xd6\x0d\x71\x6b\x7a\xc2\x2f\x12"
+                         "\x6f\x75\xc7\x80\x99\x50\x84\xcf"
+                         "\xa8\xeb\xd6\xe1\x1c\x59\x81\x7e"
+                         "\xb9\xb3\xde\x7a\x93\x14\x12\xa2"
+                         "\xf7\x43\xb3\x9d\x1a\x87\x65\x91"
+                         "\x42\x08\x40\x82\x06\x1c\x2d\x55"
+                         "\x6e\x48\xd5\x74\x07\x6e\x9d\x80"
+                         "\xeb\xb4\x97\xa1\x36\xdf\xfa\x74"
+                         "\x79\x7f\x5a\x75\xe7\x71\xc8\x8c"
+                         "\x7e\xf8\x3a\x77\xcd\x32\x05\xf9"
+                         "\x3d\xd4\xe9\xa2\xbb\xc4\x8b\x83"
+                         "\x42\x5c\x82\xfa\xe9\x4b\x96\x3b"
+                         "\x7f\x89\x8b\xf9\xf1\x87\xda\xf0"
+                         "\x87\xef\x13\x5d\xf0\xe2\xc5\xc1"
+                         "\xed\x14\xa9\x57\x19\x63\x40\x04"
+                         "\x24\xeb\x6e\x19\xd1\x3d\x70\x78"
+                         "\xeb\xda\x55\x70\x2c\x4f\x41\x5b"
+                         "\x56\x9f\x1a\xd3\xac\xf1\xc0\xc3"
+                         "\x21\xec\xd7\xd2\x55\x32\x7c\x2e"
+                         "\x3c\x48\x8e\xb4\x85\x35\x47\xfe"
+                         "\xe2\x88\x79\x98\x6a\xc9\x8d\xff"
+                         "\xe9\x89\x6e\xb8\xe2\x97\x00\xbd"
+                         "\xa4\x8f\xba\xd0\x8c\xcb\x79\x99"
+                         "\xb3\xb2\xb2\x7a\xc3\xb7\xef\x75"
+                         "\x23\x52\x76\xc3\x50\x6e\x66\xf8"
+                         "\xa2\xe2\xce\xba\x40\x21\x3f\xc9"
+                         "\x0a\x32\x7f\xf7\x08\x8c\x66\xcf"
+                         "\xd3\xdf\x57\x59\x83\xb8\xe1\x85"
+                         "\xd6\x8f\xfb\x48\x1f\x3a\xc4\x2f"
+                         "\xb4\x2d\x58\xab\xd8\x7f\x5e\x3a"
+                         "\xbc\x62\x3e\xe2\x6a\x52\x0d\x76"
+                         "\x2f\x1c\x1a\x30\xed\x95\x2a\x44"
+                         "\x35\xa5\x83\x04\x84\x01\x99\x56"
+                         "\xb7\xe3\x10\x96\xfa\xdc\x19\xdd"
+                         "\xe2\x7f\xcb\xa0\x49\x1b\xff\x4c"
+                         "\x73\xf6\xbb\x94\x00\xe8\xa9\x3d"
+                         "\xe2\x20\xe9\x3f\xfa\x07\x5d\x77"
+                         "\x06\xd5\x4f\x4d\x02\xb8\x40\x1b"
+                         "\x30\xed\x1a\x50\x19\xef\xc4\x2c"
+                         "\x02\xd9\xc5\xd3\x11\x33\x37\xe5"
+                         "\x2b\xa3\x95\xa6\xee\xd8\x74\x1d"
+                         "\x68\xa0\xeb\xbf\xdd\x5e\x99\x96"
+                         "\x91\xc3\x94\x24\xa5\x12\xa2\x37"
+                         "\xb3\xac\xcf\x2a\xfd\x55\x34\xfe"
+                         "\x79\x92\x3e\xe6\x1b\x49\x57\x5d"
+                         "\x93\x6c\x01\xf7\xcc\x4e\x20\xd1"
+                         "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9"
+                         "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95",
+               .rlen   = 512,
+       },
 };
 
-static struct cipher_testvec xeta_dec_tv_template[] = {
+static struct cipher_testvec camellia_lrw_dec_tv_template[] = {
+       /* Generated from AES-LRW test vectors */
+       /* same as enc vectors with input and result reversed */
        {
-               .key    = zeroed_string,
-               .klen   = 16,
-               .input  = "\xaa\x22\x96\xe5\x6c\x61\xf3\x45",
-               .ilen   = 8,
-               .result = zeroed_string,
-               .rlen   = 8,
+               .key    = "\x45\x62\xac\x25\xf8\x28\x17\x6d"
+                         "\x4c\x26\x84\x14\xb5\x68\x01\x85"
+                         "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03"
+                         "\xee\x5a\x83\x0c\xcc\x09\x4c\x87",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x92\x68\x19\xd7\xb7\x5b\x0a\x31"
+                         "\x97\xcc\x72\xbe\x99\x17\xeb\x3e",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\x2b\x02\x05\x68\x06\x14\x49\x76"
-                         "\x77\x5d\x0e\x26\x6c\x28\x78\x43",
-               .klen   = 16,
-               .input  = "\x82\x3e\xeb\x35\xdc\xdd\xd9\xc3",
-               .ilen   = 8,
-               .result = "\x74\x65\x73\x74\x20\x6d\x65\x2e",
-               .rlen   = 8,
+               .key    = "\x59\x70\x47\x14\xf5\x57\x47\x8c"
+                         "\xd7\x79\xe8\x0f\x54\x88\x79\x44"
+                         "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea"
+                         "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x02",
+               .input  = "\x73\x09\xb7\x50\xb6\x77\x30\x50"
+                         "\x5c\x8a\x9c\x26\x77\x9d\xfc\x4a",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\x09\x65\x43\x11\x66\x44\x39\x25"
-                         "\x51\x3a\x16\x10\x0a\x08\x12\x6e",
-               .klen   = 16,
-               .input  = "\xe2\x04\xdb\xf2\x89\x85\x9e\xea"
-                         "\x61\x35\xaa\xed\xb5\xcb\x71\x2c",
+               .key    = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50"
+                         "\x30\xfe\x69\xe2\x37\x7f\x98\x47"
+                         "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6"
+                         "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x90\xae\x83\xe0\x22\xb9\x60\x91"
+                         "\xfa\xa9\xb7\x98\xe3\xed\x87\x01",
                .ilen   = 16,
-               .result = "\x6c\x6f\x6e\x67\x65\x72\x5f\x74"
-                         "\x65\x73\x74\x5f\x76\x65\x63\x74",
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
                .rlen   = 16,
        }, {
-               .key    = "\x4d\x76\x32\x17\x05\x3f\x75\x2c"
-                         "\x5d\x04\x16\x36\x15\x72\x63\x2f",
-               .klen   = 16,
-               .input  = "\x0b\x03\xcd\x8a\xbe\x95\xfd\xb1"
-                         "\xc1\x44\x91\x0b\xa5\xc9\x1b\xb4"
-                         "\xa9\xda\x1e\x9e\xb1\x3e\x2a\x8f"
-                         "\xea\xa5\x6a\x85\xd1\xf4\xa8\xa5",
-               .ilen   = 32,
-               .result = "\x54\x65\x61\x20\x69\x73\x20\x67"
-                         "\x6f\x6f\x64\x20\x66\x6f\x72\x20"
-                         "\x79\x6f\x75\x21\x21\x21\x20\x72"
-                         "\x65\x61\x6c\x6c\x79\x21\x21\x21",
-               .rlen   = 32,
-       }
-};
-
-/*
- * FCrypt test vectors
- */
-#define FCRYPT_ENC_TEST_VECTORS        ARRAY_SIZE(fcrypt_pcbc_enc_tv_template)
-#define FCRYPT_DEC_TEST_VECTORS        ARRAY_SIZE(fcrypt_pcbc_dec_tv_template)
-
-static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = {
-       { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 8,
-               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .ilen   = 8,
-               .result = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
-               .rlen   = 8,
+               .key    = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15"
+                         "\x25\x83\xf7\x3c\x1f\x01\x28\x74"
+                         "\xca\xc6\xbc\x35\x4d\x4a\x65\x54"
+                         "\x90\xae\x61\xcf\x7b\xae\xbd\xcc"
+                         "\xad\xe4\x94\xc5\x4a\x29\xae\x70",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x99\xe9\x6e\xd4\xc9\x21\xa5\xf0"
+                         "\xd8\x83\xef\xd9\x07\x16\x5f\x35",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
-               .klen   = 8,
-               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .input  = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
-               .ilen   = 8,
-               .result = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
-               .rlen   = 8,
-       }, { /* From Arla */
-               .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .klen   = 8,
-               .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .ilen   = 48,
-               .result = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
-                         "\xee\xac\x98\x62\x44\x51\xe4\x84"
-                         "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
-                         "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
-                         "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
-                         "\xf8\x91\x3c\xac\x44\x22\x92\xef",
-               .rlen   = 48,
+               .key    = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff"
+                         "\xf8\x86\xce\xac\x93\xc5\xad\xc6"
+                         "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd"
+                         "\x52\x13\xb2\xb7\xf0\xff\x11\xd8"
+                         "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f",
+               .klen   = 40,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x42\x88\xf4\xcb\x21\x11\x6d\x8e"
+                         "\xde\x1a\xf2\x29\xf1\x4a\xe0\x15",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 8,
-               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .ilen   = 48,
-               .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
-                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
-                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
-                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
-                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
-                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
-               .rlen   = 48,
-       }, { /* split-page version */
-               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 8,
-               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .input  = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .ilen   = 48,
-               .result = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
-                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
-                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
-                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
-                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
-                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
-               .rlen   = 48,
-               .np     = 2,
-               .tap    = { 20, 28 },
-       }
-};
-
-static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = {
-       { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */
-               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .klen   = 8,
-               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .input  = "\x0E\x09\x00\xC7\x3E\xF7\xED\x41",
-               .ilen   = 8,
-               .result = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .rlen   = 8,
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x40\xaa\x34\x86\x4a\x8f\x78\xb9"
+                         "\xdb\xdb\x0f\x3d\x48\x70\xbe\x8d",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\x11\x44\x77\xAA\xDD\x00\x33\x66",
-               .klen   = 8,
-               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00",
-               .input  = "\xD8\xED\x78\x74\x77\xEC\x06\x80",
-               .ilen   = 8,
-               .result = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0",
-               .rlen   = 8,
-       }, { /* From Arla */
-               .key    = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .klen   = 8,
-               .iv     = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .input  = "\x00\xf0\x0e\x11\x75\xe6\x23\x82"
-                         "\xee\xac\x98\x62\x44\x51\xe4\x84"
-                         "\xc3\x59\xd8\xaa\x64\x60\xae\xf7"
-                         "\xd2\xd9\x13\x79\x72\xa3\x45\x03"
-                         "\x23\xb5\x62\xd7\x0c\xf5\x27\xd1"
-                         "\xf8\x91\x3c\xac\x44\x22\x92\xef",
-               .ilen   = 48,
-               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .rlen   = 48,
+               .key    = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d"
+                         "\xd4\x70\x98\x0b\xc7\x95\x84\xc8"
+                         "\xb2\xfb\x64\xce\x60\x97\x87\x8d"
+                         "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7"
+                         "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4"
+                         "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x02\x00\x00\x00\x00",
+               .input  = "\x04\xab\x28\x37\x31\x7a\x26\xab"
+                         "\xa1\x70\x1b\x9c\xe7\xdd\x83\xff",
+               .ilen   = 16,
+               .result = "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x41\x42\x43\x44\x45\x46",
+               .rlen   = 16,
        }, {
-               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 8,
-               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
-                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
-                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
-                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
-                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
-                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
-               .ilen   = 48,
-               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .rlen   = 48,
-       }, { /* split-page version */
-               .key    = "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 8,
-               .iv     = "\xf0\xe1\xd2\xc3\xb4\xa5\x96\x87",
-               .input  = "\xca\x90\xf5\x9d\xcb\xd4\xd2\x3c"
-                         "\x01\x88\x7f\x3e\x31\x6e\x62\x9d"
-                         "\xd8\xe0\x57\xa3\x06\x3a\x42\x58"
-                         "\x2a\x28\xfe\x72\x52\x2f\xdd\xe0"
-                         "\x19\x89\x09\x1c\x2a\x8e\x8c\x94"
-                         "\xfc\xc7\x68\xe4\x88\xaa\xde\x0f",
-               .ilen   = 48,
-               .result = "The quick brown fox jumps over the lazy dogs.\0\0",
-               .rlen   = 48,
-               .np     = 2,
-               .tap    = { 20, 28 },
-       }
+               .key    = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
+                         "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
+                         "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
+                         "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
+                         "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
+                         "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
+               .klen   = 48,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x01",
+               .input  = "\x90\x69\x8e\xf2\x14\x86\x59\xf9"
+                         "\xec\xe7\xfa\x3f\x48\x9d\x7f\x96"
+                         "\x67\x76\xac\x2c\xd2\x63\x18\x93"
+                         "\x13\xf8\xf1\xf6\x71\x77\xb3\xee"
+                         "\x93\xb2\xcc\xf3\x26\xc1\x16\x4f"
+                         "\xd4\xe8\x43\xc1\x68\xa3\x3e\x06"
+                         "\x38\x51\xff\xa8\xb9\xa4\xeb\xb1"
+                         "\x62\xdd\x78\x81\xea\x1d\xef\x04"
+                         "\x1d\x07\xc1\x67\xc8\xd6\x77\xa1"
+                         "\x84\x95\xf4\x9a\xd9\xbc\x2d\xe2"
+                         "\xf6\x80\xfc\x91\x2a\xbc\x42\xa0"
+                         "\x40\x41\x69\xaa\x71\xc0\x37\xec"
+                         "\x39\xf3\xf2\xec\x82\xc3\x88\x79"
+                         "\xbc\xc3\xaa\xb7\xcf\x6a\x72\x80"
+                         "\x4c\xf4\x84\x8f\x13\x9e\x94\x5c"
+                         "\xe5\xb2\x91\xbb\x92\x51\x4d\xf1"
+                         "\xd6\x0d\x71\x6b\x7a\xc2\x2f\x12"
+                         "\x6f\x75\xc7\x80\x99\x50\x84\xcf"
+                         "\xa8\xeb\xd6\xe1\x1c\x59\x81\x7e"
+                         "\xb9\xb3\xde\x7a\x93\x14\x12\xa2"
+                         "\xf7\x43\xb3\x9d\x1a\x87\x65\x91"
+                         "\x42\x08\x40\x82\x06\x1c\x2d\x55"
+                         "\x6e\x48\xd5\x74\x07\x6e\x9d\x80"
+                         "\xeb\xb4\x97\xa1\x36\xdf\xfa\x74"
+                         "\x79\x7f\x5a\x75\xe7\x71\xc8\x8c"
+                         "\x7e\xf8\x3a\x77\xcd\x32\x05\xf9"
+                         "\x3d\xd4\xe9\xa2\xbb\xc4\x8b\x83"
+                         "\x42\x5c\x82\xfa\xe9\x4b\x96\x3b"
+                         "\x7f\x89\x8b\xf9\xf1\x87\xda\xf0"
+                         "\x87\xef\x13\x5d\xf0\xe2\xc5\xc1"
+                         "\xed\x14\xa9\x57\x19\x63\x40\x04"
+                         "\x24\xeb\x6e\x19\xd1\x3d\x70\x78"
+                         "\xeb\xda\x55\x70\x2c\x4f\x41\x5b"
+                         "\x56\x9f\x1a\xd3\xac\xf1\xc0\xc3"
+                         "\x21\xec\xd7\xd2\x55\x32\x7c\x2e"
+                         "\x3c\x48\x8e\xb4\x85\x35\x47\xfe"
+                         "\xe2\x88\x79\x98\x6a\xc9\x8d\xff"
+                         "\xe9\x89\x6e\xb8\xe2\x97\x00\xbd"
+                         "\xa4\x8f\xba\xd0\x8c\xcb\x79\x99"
+                         "\xb3\xb2\xb2\x7a\xc3\xb7\xef\x75"
+                         "\x23\x52\x76\xc3\x50\x6e\x66\xf8"
+                         "\xa2\xe2\xce\xba\x40\x21\x3f\xc9"
+                         "\x0a\x32\x7f\xf7\x08\x8c\x66\xcf"
+                         "\xd3\xdf\x57\x59\x83\xb8\xe1\x85"
+                         "\xd6\x8f\xfb\x48\x1f\x3a\xc4\x2f"
+                         "\xb4\x2d\x58\xab\xd8\x7f\x5e\x3a"
+                         "\xbc\x62\x3e\xe2\x6a\x52\x0d\x76"
+                         "\x2f\x1c\x1a\x30\xed\x95\x2a\x44"
+                         "\x35\xa5\x83\x04\x84\x01\x99\x56"
+                         "\xb7\xe3\x10\x96\xfa\xdc\x19\xdd"
+                         "\xe2\x7f\xcb\xa0\x49\x1b\xff\x4c"
+                         "\x73\xf6\xbb\x94\x00\xe8\xa9\x3d"
+                         "\xe2\x20\xe9\x3f\xfa\x07\x5d\x77"
+                         "\x06\xd5\x4f\x4d\x02\xb8\x40\x1b"
+                         "\x30\xed\x1a\x50\x19\xef\xc4\x2c"
+                         "\x02\xd9\xc5\xd3\x11\x33\x37\xe5"
+                         "\x2b\xa3\x95\xa6\xee\xd8\x74\x1d"
+                         "\x68\xa0\xeb\xbf\xdd\x5e\x99\x96"
+                         "\x91\xc3\x94\x24\xa5\x12\xa2\x37"
+                         "\xb3\xac\xcf\x2a\xfd\x55\x34\xfe"
+                         "\x79\x92\x3e\xe6\x1b\x49\x57\x5d"
+                         "\x93\x6c\x01\xf7\xcc\x4e\x20\xd1"
+                         "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9"
+                         "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95",
+               .ilen   = 512,
+               .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
+                         "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
+                         "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
+                         "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
+                         "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
+                         "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
+                         "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
+                         "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
+                         "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
+                         "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
+                         "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
+                         "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
+                         "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
+                         "\x4c\x96\x12\xed\x7c\x92\x03\x01"
+                         "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
+                         "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
+                         "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
+                         "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
+                         "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
+                         "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
+                         "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
+                         "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
+                         "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
+                         "\x76\x12\x73\x44\x1a\x56\xd7\x72"
+                         "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
+                         "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
+                         "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
+                         "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
+                         "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
+                         "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
+                         "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
+                         "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
+                         "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
+                         "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
+                         "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
+                         "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
+                         "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
+                         "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
+                         "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
+                         "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
+                         "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
+                         "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
+                         "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
+                         "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
+                         "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
+                         "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
+                         "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
+                         "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
+                         "\x62\x73\x65\xfd\x46\x63\x25\x3d"
+                         "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
+                         "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
+                         "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
+                         "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
+                         "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
+                         "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
+                         "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
+                         "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
+                         "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
+                         "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
+                         "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
+                         "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
+                         "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
+                         "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
+                         "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
+               .rlen   = 512,
+       },
 };
 
-/*
- * CAMELLIA test vectors.
- */
-#define CAMELLIA_ENC_TEST_VECTORS 3
-#define CAMELLIA_DEC_TEST_VECTORS 3
-#define CAMELLIA_CBC_ENC_TEST_VECTORS 2
-#define CAMELLIA_CBC_DEC_TEST_VECTORS 2
-
-static struct cipher_testvec camellia_enc_tv_template[] = {
+static struct cipher_testvec camellia_xts_enc_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
        {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 16,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .ilen   = 16,
-               .result = "\x67\x67\x31\x38\x54\x96\x69\x73"
-                         "\x08\x57\x06\x56\x48\xea\xbe\x43",
-               .rlen   = 16,
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .ilen   = 32,
+               .result = "\x06\xcb\xa5\xf1\x04\x63\xb2\x41"
+                         "\xdc\xca\xfa\x09\xba\x74\xb9\x05"
+                         "\x78\xba\xa4\xf8\x67\x4d\x7e\xad"
+                         "\x20\x18\xf5\x0c\x41\x16\x2a\x61",
+               .rlen   = 32,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
-                         "\x00\x11\x22\x33\x44\x55\x66\x77",
-               .klen   = 24,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .ilen   = 16,
-               .result = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
-                         "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
-               .rlen   = 16,
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\xc2\xb9\xdc\x44\x1d\xdf\xf2\x86"
+                         "\x8d\x35\x42\x0a\xa5\x5e\x3d\x4f"
+                         "\xb5\x37\x06\xff\xbd\xd4\x91\x70"
+                         "\x80\x1f\xb2\x39\x10\x89\x44\xf5",
+               .rlen   = 32,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
-                         "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
                .klen   = 32,
-               .input  = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .ilen   = 16,
-               .result = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
-                         "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
-               .rlen   = 16,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .ilen   = 32,
+               .result = "\x52\x1f\x9d\xf5\x5a\x58\x5a\x7e"
+                         "\x9f\xd0\x8e\x02\x9c\x9a\x6a\xa7"
+                         "\xb4\x3b\xce\xe7\x17\xaa\x89\x6a"
+                         "\x35\x3c\x6b\xb5\x61\x1c\x79\x38",
+               .rlen   = 32,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\xc7\xf9\x0a\xaa\xcb\xb5\x8f\x33"
+                         "\x60\xc3\xe9\x47\x90\xb7\x50\x57"
+                         "\xa3\xad\x81\x2f\xf5\x22\x96\x02"
+                         "\xaa\x7f\xea\xac\x29\x78\xca\x2a"
+                         "\x7c\xcd\x31\x1a\x3c\x40\x0a\x73"
+                         "\x09\x66\xad\x72\x0e\x4d\x5d\x77"
+                         "\xbc\xb8\x76\x80\x37\x59\xa9\x01"
+                         "\x9e\xfb\xdb\x6c\x93\xef\xb6\x8d"
+                         "\x1e\xc1\x94\xa8\xd4\xb5\xb0\x01"
+                         "\xd5\x01\x97\x28\xcd\x7a\x1f\xe8"
+                         "\x08\xda\x76\x00\x65\xcf\x7b\x31"
+                         "\xc6\xfa\xf2\x3b\x00\xa7\x6a\x9e"
+                         "\x6c\x43\x80\x87\xe0\xbb\x4e\xe5"
+                         "\xdc\x8a\xdf\xc3\x1d\x1b\x41\x04"
+                         "\xfb\x54\xdd\x29\x27\xc2\x65\x17"
+                         "\x36\x88\xb0\x85\x8d\x73\x7e\x4b"
+                         "\x1d\x16\x8a\x52\xbc\xa6\xbc\xa4"
+                         "\x8c\xd1\x04\x16\xbf\x8c\x01\x0f"
+                         "\x7e\x6b\x59\x15\x29\xd1\x9b\xd3"
+                         "\x6c\xee\xac\xdc\x45\x58\xca\x5b"
+                         "\x70\x0e\x6a\x12\x86\x82\x79\x9f"
+                         "\x16\xd4\x9d\x67\xcd\x70\x65\x26"
+                         "\x21\x72\x1e\xa1\x94\x8a\x83\x0c"
+                         "\x92\x42\x58\x5e\xa2\xc5\x31\xf3"
+                         "\x7b\xd1\x31\xd4\x15\x80\x31\x61"
+                         "\x5c\x53\x10\xdd\xea\xc8\x83\x5c"
+                         "\x7d\xa7\x05\x66\xcc\x1e\xbb\x05"
+                         "\x47\xae\xb4\x0f\x84\xd8\xf6\xb5"
+                         "\xa1\xc6\x52\x00\x52\xe8\xdc\xd9"
+                         "\x16\x31\xb2\x47\x91\x67\xaa\x28"
+                         "\x2c\x29\x85\xa3\xf7\xf2\x24\x93"
+                         "\x23\x80\x1f\xa8\x1b\x82\x8d\xdc"
+                         "\x9f\x0b\xcd\xb4\x3c\x20\xbc\xec"
+                         "\x4f\xc7\xee\xf8\xfd\xd9\xfb\x7e"
+                         "\x3f\x0d\x23\xfa\x3f\xa7\xcc\x66"
+                         "\x1c\xfe\xa6\x86\xf6\xf7\x85\xc7"
+                         "\x43\xc1\xd4\xfc\xe4\x79\xc9\x1d"
+                         "\xf8\x89\xcd\x20\x27\x84\x5d\x5c"
+                         "\x8e\x4f\x1f\xeb\x08\x21\x4f\xa3"
+                         "\xe0\x7e\x0b\x9c\xe7\x42\xcf\xb7"
+                         "\x3f\x43\xcc\x86\x71\x34\x6a\xd9"
+                         "\x5e\xec\x8f\x36\xc9\x0a\x03\xfe"
+                         "\x18\x41\xdc\x9e\x2e\x75\x20\x3e"
+                         "\xcc\x77\xe0\x8f\xe8\x43\x37\x4c"
+                         "\xed\x1a\x5a\xb3\xfa\x43\xc9\x71"
+                         "\x9f\xc5\xce\xcf\xff\xe7\x77\x1e"
+                         "\x35\x93\xde\x6b\xc0\x6a\x7e\xa9"
+                         "\x34\xb8\x27\x74\x08\xda\xf2\x4a"
+                         "\x23\x5b\x9f\x55\x3a\x57\x82\x52"
+                         "\xea\x6d\xc3\xc7\xf2\xc8\xb5\xdc"
+                         "\xc5\xb9\xbb\xaa\xf2\x29\x9f\x49"
+                         "\x7a\xef\xfe\xdc\x9f\xc9\x28\xe2"
+                         "\x96\x0b\x35\x84\x05\x0d\xd6\x2a"
+                         "\xea\x5a\xbf\x69\xde\xee\x4f\x8f"
+                         "\x84\xb9\xcf\xa7\x57\xea\xe0\xe8"
+                         "\x96\xef\x0f\x0e\xec\xc7\xa6\x74"
+                         "\xb1\xfe\x7a\x6d\x11\xdd\x0e\x15"
+                         "\x4a\x1e\x73\x7f\x55\xea\xf6\xe1"
+                         "\x5b\xb6\x71\xda\xb0\x0c\xba\x26"
+                         "\x5c\x48\x38\x6d\x1c\x32\xb2\x7d"
+                         "\x05\x87\xc2\x1e\x7e\x2d\xd4\x33"
+                         "\xcc\x06\xdb\xe7\x82\x29\x63\xd1"
+                         "\x52\x84\x4f\xee\x27\xe8\x02\xd4"
+                         "\x34\x3c\x69\xc2\xbd\x20\xe6\x7a",
+               .rlen   = 512,
+       }, {
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .ilen   = 512,
+               .result = "\x49\xcd\xb8\xbf\x2f\x73\x37\x28"
+                         "\x9a\x7f\x6e\x57\x55\xb8\x07\x88"
+                         "\x4a\x0d\x8b\x55\x60\xed\xb6\x7b"
+                         "\xf1\x74\xac\x96\x05\x7b\x32\xca"
+                         "\xd1\x4e\xf1\x58\x29\x16\x24\x6c"
+                         "\xf2\xb3\xe4\x88\x84\xac\x4d\xee"
+                         "\x97\x07\x82\xf0\x07\x12\x38\x0a"
+                         "\x67\x62\xaf\xfd\x85\x9f\x0a\x55"
+                         "\xa5\x20\xc5\x60\xe4\x68\x53\xa4"
+                         "\x0e\x2e\x65\xe3\xe4\x0c\x30\x7c"
+                         "\x1c\x01\x4f\x55\xa9\x13\xeb\x25"
+                         "\x21\x87\xbc\xd3\xe7\x67\x4f\x38"
+                         "\xa8\x14\x25\x71\xe9\x2e\x4c\x21"
+                         "\x41\x82\x0c\x45\x39\x35\xa8\x75"
+                         "\x03\x29\x01\x84\x8c\xab\x48\xbe"
+                         "\x11\x56\x22\x67\xb7\x67\x1a\x09"
+                         "\xa1\x72\x25\x41\x3c\x39\x65\x80"
+                         "\x7d\x2f\xf8\x2c\x73\x04\x58\x9d"
+                         "\xdd\x16\x8b\x63\x70\x4e\xc5\x17"
+                         "\x21\xe0\x84\x51\x4b\x6f\x05\x52"
+                         "\xe3\x63\x34\xfa\xa4\xaf\x33\x20"
+                         "\xc1\xae\x32\xc4\xb8\x2b\xdb\x76"
+                         "\xd9\x02\x31\x2f\xa3\xc6\xd0\x7b"
+                         "\xaf\x1b\x84\xe3\x9b\xbf\xa6\xe0"
+                         "\xb8\x8a\x13\x88\x71\xf4\x11\xa5"
+                         "\xe9\xa9\x10\x33\xe0\xbe\x49\x89"
+                         "\x41\x22\xf5\x9d\x80\x3e\x3b\x76"
+                         "\x01\x16\x50\x6e\x7c\x6a\x81\xe9"
+                         "\x13\x2c\xde\xb2\x5f\x79\xba\xb2"
+                         "\xb1\x75\xae\xd2\x07\x98\x4b\x69"
+                         "\xae\x7d\x5b\x90\xc2\x6c\xe6\x98"
+                         "\xd3\x4c\xa1\xa3\x9c\xc9\x33\x6a"
+                         "\x0d\x23\xb1\x79\x25\x13\x4b\xe5"
+                         "\xaf\x93\x20\x5c\x7f\x06\x7a\x34"
+                         "\x0b\x78\xe3\x67\x26\xe0\xad\x95"
+                         "\xc5\x4e\x26\x22\xcf\x73\x77\x62"
+                         "\x3e\x10\xd7\x90\x4b\x52\x1c\xc9"
+                         "\xef\x38\x52\x18\x0e\x29\x7e\xef"
+                         "\x34\xfe\x31\x95\xc5\xbc\xa8\xe2"
+                         "\xa8\x4e\x9f\xea\xa6\xf0\xfe\x5d"
+                         "\xc5\x39\x86\xed\x2f\x6d\xa0\xfe"
+                         "\x96\xcd\x41\x10\x78\x4e\x0c\xc9"
+                         "\xc3\x6d\x0f\xb7\xe8\xe0\x62\xab"
+                         "\x8b\xf1\x21\x89\xa1\x12\xaa\xfa"
+                         "\x9d\x70\xbe\x4c\xa8\x98\x89\x01"
+                         "\xb9\xe2\x61\xde\x0c\x4a\x0b\xaa"
+                         "\x89\xf5\x14\x79\x18\x8f\x3b\x0d"
+                         "\x21\x17\xf8\x59\x15\x24\x64\x22"
+                         "\x57\x48\x80\xd5\x3d\x92\x30\x07"
+                         "\xd9\xa1\x4a\x23\x16\x43\x48\x0e"
+                         "\x2b\x2d\x1b\x87\xef\x7e\xbd\xfa"
+                         "\x49\xbc\x7e\x68\x6e\xa8\x46\x95"
+                         "\xad\x5e\xfe\x0a\xa8\xd3\x1a\x5d"
+                         "\x6b\x84\xf3\x00\xba\x52\x05\x02"
+                         "\xe3\x96\x4e\xb6\x79\x3f\x43\xd3"
+                         "\x4d\x3f\xd6\xab\x0a\xc4\x75\x2d"
+                         "\xd1\x08\xc3\x6a\xc8\x37\x29\xa0"
+                         "\xcc\x9a\x05\xdd\x5c\xe1\xff\x66"
+                         "\xf2\x7a\x1d\xf2\xaf\xa9\x48\x89"
+                         "\xf5\x21\x0f\x02\x48\x83\x74\xbf"
+                         "\x2e\xe6\x93\x7b\xa0\xf4\xb1\x2b"
+                         "\xb1\x02\x0a\x5c\x79\x19\x3b\x75"
+                         "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e"
+                         "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95",
+               .rlen   = 512,
        },
 };
 
-static struct cipher_testvec camellia_dec_tv_template[] = {
+static struct cipher_testvec camellia_xts_dec_tv_template[] = {
+       /* Generated from AES-XTS test vectors */
+       /* same as enc vectors with input and result reversed */
        {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .klen   = 16,
-               .input  = "\x67\x67\x31\x38\x54\x96\x69\x73"
-                         "\x08\x57\x06\x56\x48\xea\xbe\x43",
-               .ilen   = 16,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .rlen   = 16,
+               .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x06\xcb\xa5\xf1\x04\x63\xb2\x41"
+                         "\xdc\xca\xfa\x09\xba\x74\xb9\x05"
+                         "\x78\xba\xa4\xf8\x67\x4d\x7e\xad"
+                         "\x20\x18\xf5\x0c\x41\x16\x2a\x61",
+               .ilen   = 32,
+               .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .rlen   = 32,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
-                         "\x00\x11\x22\x33\x44\x55\x66\x77",
-               .klen   = 24,
-               .input  = "\xb4\x99\x34\x01\xb3\xe9\x96\xf8"
-                         "\x4e\xe5\xce\xe7\xd7\x9b\x09\xb9",
-               .ilen   = 16,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .rlen   = 16,
+               .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x11\x11\x11\x11\x11\x11\x11\x11"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
+               .klen   = 32,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xc2\xb9\xdc\x44\x1d\xdf\xf2\x86"
+                         "\x8d\x35\x42\x0a\xa5\x5e\x3d\x4f"
+                         "\xb5\x37\x06\xff\xbd\xd4\x91\x70"
+                         "\x80\x1f\xb2\x39\x10\x89\x44\xf5",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
        }, {
-               .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10"
-                         "\x00\x11\x22\x33\x44\x55\x66\x77"
-                         "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
+               .key    = "\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8"
+                         "\xf7\xf6\xf5\xf4\xf3\xf2\xf1\xf0"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22"
+                         "\x22\x22\x22\x22\x22\x22\x22\x22",
                .klen   = 32,
-               .input  = "\x9a\xcc\x23\x7d\xff\x16\xd7\x6c"
-                         "\x20\xef\x7c\x91\x9e\x3a\x75\x09",
-               .ilen   = 16,
-               .result = "\x01\x23\x45\x67\x89\xab\xcd\xef"
-                         "\xfe\xdc\xba\x98\x76\x54\x32\x10",
-               .rlen   = 16,
-       },
-};
-
-static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
-       {
-               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
-                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
-               .klen   = 16,
-               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
-                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-               .input  = "Single block msg",
-               .ilen   = 16,
-               .result = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
-                         "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
-               .rlen   = 16,
+               .iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x52\x1f\x9d\xf5\x5a\x58\x5a\x7e"
+                         "\x9f\xd0\x8e\x02\x9c\x9a\x6a\xa7"
+                         "\xb4\x3b\xce\xe7\x17\xaa\x89\x6a"
+                         "\x35\x3c\x6b\xb5\x61\x1c\x79\x38",
+               .ilen   = 32,
+               .result = "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44"
+                         "\x44\x44\x44\x44\x44\x44\x44\x44",
+               .rlen   = 32,
        }, {
-               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
-                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-               .klen   = 16,
-               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
-                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-               .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95",
+               .klen   = 32,
+               .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\xc7\xf9\x0a\xaa\xcb\xb5\x8f\x33"
+                         "\x60\xc3\xe9\x47\x90\xb7\x50\x57"
+                         "\xa3\xad\x81\x2f\xf5\x22\x96\x02"
+                         "\xaa\x7f\xea\xac\x29\x78\xca\x2a"
+                         "\x7c\xcd\x31\x1a\x3c\x40\x0a\x73"
+                         "\x09\x66\xad\x72\x0e\x4d\x5d\x77"
+                         "\xbc\xb8\x76\x80\x37\x59\xa9\x01"
+                         "\x9e\xfb\xdb\x6c\x93\xef\xb6\x8d"
+                         "\x1e\xc1\x94\xa8\xd4\xb5\xb0\x01"
+                         "\xd5\x01\x97\x28\xcd\x7a\x1f\xe8"
+                         "\x08\xda\x76\x00\x65\xcf\x7b\x31"
+                         "\xc6\xfa\xf2\x3b\x00\xa7\x6a\x9e"
+                         "\x6c\x43\x80\x87\xe0\xbb\x4e\xe5"
+                         "\xdc\x8a\xdf\xc3\x1d\x1b\x41\x04"
+                         "\xfb\x54\xdd\x29\x27\xc2\x65\x17"
+                         "\x36\x88\xb0\x85\x8d\x73\x7e\x4b"
+                         "\x1d\x16\x8a\x52\xbc\xa6\xbc\xa4"
+                         "\x8c\xd1\x04\x16\xbf\x8c\x01\x0f"
+                         "\x7e\x6b\x59\x15\x29\xd1\x9b\xd3"
+                         "\x6c\xee\xac\xdc\x45\x58\xca\x5b"
+                         "\x70\x0e\x6a\x12\x86\x82\x79\x9f"
+                         "\x16\xd4\x9d\x67\xcd\x70\x65\x26"
+                         "\x21\x72\x1e\xa1\x94\x8a\x83\x0c"
+                         "\x92\x42\x58\x5e\xa2\xc5\x31\xf3"
+                         "\x7b\xd1\x31\xd4\x15\x80\x31\x61"
+                         "\x5c\x53\x10\xdd\xea\xc8\x83\x5c"
+                         "\x7d\xa7\x05\x66\xcc\x1e\xbb\x05"
+                         "\x47\xae\xb4\x0f\x84\xd8\xf6\xb5"
+                         "\xa1\xc6\x52\x00\x52\xe8\xdc\xd9"
+                         "\x16\x31\xb2\x47\x91\x67\xaa\x28"
+                         "\x2c\x29\x85\xa3\xf7\xf2\x24\x93"
+                         "\x23\x80\x1f\xa8\x1b\x82\x8d\xdc"
+                         "\x9f\x0b\xcd\xb4\x3c\x20\xbc\xec"
+                         "\x4f\xc7\xee\xf8\xfd\xd9\xfb\x7e"
+                         "\x3f\x0d\x23\xfa\x3f\xa7\xcc\x66"
+                         "\x1c\xfe\xa6\x86\xf6\xf7\x85\xc7"
+                         "\x43\xc1\xd4\xfc\xe4\x79\xc9\x1d"
+                         "\xf8\x89\xcd\x20\x27\x84\x5d\x5c"
+                         "\x8e\x4f\x1f\xeb\x08\x21\x4f\xa3"
+                         "\xe0\x7e\x0b\x9c\xe7\x42\xcf\xb7"
+                         "\x3f\x43\xcc\x86\x71\x34\x6a\xd9"
+                         "\x5e\xec\x8f\x36\xc9\x0a\x03\xfe"
+                         "\x18\x41\xdc\x9e\x2e\x75\x20\x3e"
+                         "\xcc\x77\xe0\x8f\xe8\x43\x37\x4c"
+                         "\xed\x1a\x5a\xb3\xfa\x43\xc9\x71"
+                         "\x9f\xc5\xce\xcf\xff\xe7\x77\x1e"
+                         "\x35\x93\xde\x6b\xc0\x6a\x7e\xa9"
+                         "\x34\xb8\x27\x74\x08\xda\xf2\x4a"
+                         "\x23\x5b\x9f\x55\x3a\x57\x82\x52"
+                         "\xea\x6d\xc3\xc7\xf2\xc8\xb5\xdc"
+                         "\xc5\xb9\xbb\xaa\xf2\x29\x9f\x49"
+                         "\x7a\xef\xfe\xdc\x9f\xc9\x28\xe2"
+                         "\x96\x0b\x35\x84\x05\x0d\xd6\x2a"
+                         "\xea\x5a\xbf\x69\xde\xee\x4f\x8f"
+                         "\x84\xb9\xcf\xa7\x57\xea\xe0\xe8"
+                         "\x96\xef\x0f\x0e\xec\xc7\xa6\x74"
+                         "\xb1\xfe\x7a\x6d\x11\xdd\x0e\x15"
+                         "\x4a\x1e\x73\x7f\x55\xea\xf6\xe1"
+                         "\x5b\xb6\x71\xda\xb0\x0c\xba\x26"
+                         "\x5c\x48\x38\x6d\x1c\x32\xb2\x7d"
+                         "\x05\x87\xc2\x1e\x7e\x2d\xd4\x33"
+                         "\xcc\x06\xdb\xe7\x82\x29\x63\xd1"
+                         "\x52\x84\x4f\xee\x27\xe8\x02\xd4"
+                         "\x34\x3c\x69\xc2\xbd\x20\xe6\x7a",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
                          "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .ilen   = 32,
-               .result = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
-                         "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
-                         "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
-                         "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
-               .rlen   = 32,
-       },
-};
-
-static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
-       {
-               .key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
-                         "\x51\x2e\x03\xd5\x34\x12\x00\x06",
-               .klen   = 16,
-               .iv     = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
-                         "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-               .input  = "\xea\x32\x12\x76\x3b\x50\x10\xe7"
-                         "\x18\xf6\xfd\x5d\xf6\x8f\x13\x51",
-               .ilen   = 16,
-               .result = "Single block msg",
-               .rlen   = 16,
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
        }, {
-               .key    = "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
-                         "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-               .klen   = 16,
-               .iv     = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
-                         "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-               .input = "\xa5\xdf\x6e\x50\xda\x70\x6c\x01"
-                         "\x4a\xab\xf3\xf2\xd6\xfc\x6c\xfd"
-                         "\x19\xb4\x3e\x57\x1c\x02\x5e\xa0"
-                         "\x15\x78\xe0\x5e\xf2\xcb\x87\x16",
-               .ilen   = 32,
-               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+               .key    = "\x27\x18\x28\x18\x28\x45\x90\x45"
+                         "\x23\x53\x60\x28\x74\x71\x35\x26"
+                         "\x62\x49\x77\x57\x24\x70\x93\x69"
+                         "\x99\x59\x57\x49\x66\x96\x76\x27"
+                         "\x31\x41\x59\x26\x53\x58\x97\x93"
+                         "\x23\x84\x62\x64\x33\x83\x27\x95"
+                         "\x02\x88\x41\x97\x16\x93\x99\x37"
+                         "\x51\x05\x82\x09\x74\x94\x45\x92",
+               .klen   = 64,
+               .iv     = "\xff\x00\x00\x00\x00\x00\x00\x00"
+                         "\x00\x00\x00\x00\x00\x00\x00\x00",
+               .input  = "\x49\xcd\xb8\xbf\x2f\x73\x37\x28"
+                         "\x9a\x7f\x6e\x57\x55\xb8\x07\x88"
+                         "\x4a\x0d\x8b\x55\x60\xed\xb6\x7b"
+                         "\xf1\x74\xac\x96\x05\x7b\x32\xca"
+                         "\xd1\x4e\xf1\x58\x29\x16\x24\x6c"
+                         "\xf2\xb3\xe4\x88\x84\xac\x4d\xee"
+                         "\x97\x07\x82\xf0\x07\x12\x38\x0a"
+                         "\x67\x62\xaf\xfd\x85\x9f\x0a\x55"
+                         "\xa5\x20\xc5\x60\xe4\x68\x53\xa4"
+                         "\x0e\x2e\x65\xe3\xe4\x0c\x30\x7c"
+                         "\x1c\x01\x4f\x55\xa9\x13\xeb\x25"
+                         "\x21\x87\xbc\xd3\xe7\x67\x4f\x38"
+                         "\xa8\x14\x25\x71\xe9\x2e\x4c\x21"
+                         "\x41\x82\x0c\x45\x39\x35\xa8\x75"
+                         "\x03\x29\x01\x84\x8c\xab\x48\xbe"
+                         "\x11\x56\x22\x67\xb7\x67\x1a\x09"
+                         "\xa1\x72\x25\x41\x3c\x39\x65\x80"
+                         "\x7d\x2f\xf8\x2c\x73\x04\x58\x9d"
+                         "\xdd\x16\x8b\x63\x70\x4e\xc5\x17"
+                         "\x21\xe0\x84\x51\x4b\x6f\x05\x52"
+                         "\xe3\x63\x34\xfa\xa4\xaf\x33\x20"
+                         "\xc1\xae\x32\xc4\xb8\x2b\xdb\x76"
+                         "\xd9\x02\x31\x2f\xa3\xc6\xd0\x7b"
+                         "\xaf\x1b\x84\xe3\x9b\xbf\xa6\xe0"
+                         "\xb8\x8a\x13\x88\x71\xf4\x11\xa5"
+                         "\xe9\xa9\x10\x33\xe0\xbe\x49\x89"
+                         "\x41\x22\xf5\x9d\x80\x3e\x3b\x76"
+                         "\x01\x16\x50\x6e\x7c\x6a\x81\xe9"
+                         "\x13\x2c\xde\xb2\x5f\x79\xba\xb2"
+                         "\xb1\x75\xae\xd2\x07\x98\x4b\x69"
+                         "\xae\x7d\x5b\x90\xc2\x6c\xe6\x98"
+                         "\xd3\x4c\xa1\xa3\x9c\xc9\x33\x6a"
+                         "\x0d\x23\xb1\x79\x25\x13\x4b\xe5"
+                         "\xaf\x93\x20\x5c\x7f\x06\x7a\x34"
+                         "\x0b\x78\xe3\x67\x26\xe0\xad\x95"
+                         "\xc5\x4e\x26\x22\xcf\x73\x77\x62"
+                         "\x3e\x10\xd7\x90\x4b\x52\x1c\xc9"
+                         "\xef\x38\x52\x18\x0e\x29\x7e\xef"
+                         "\x34\xfe\x31\x95\xc5\xbc\xa8\xe2"
+                         "\xa8\x4e\x9f\xea\xa6\xf0\xfe\x5d"
+                         "\xc5\x39\x86\xed\x2f\x6d\xa0\xfe"
+                         "\x96\xcd\x41\x10\x78\x4e\x0c\xc9"
+                         "\xc3\x6d\x0f\xb7\xe8\xe0\x62\xab"
+                         "\x8b\xf1\x21\x89\xa1\x12\xaa\xfa"
+                         "\x9d\x70\xbe\x4c\xa8\x98\x89\x01"
+                         "\xb9\xe2\x61\xde\x0c\x4a\x0b\xaa"
+                         "\x89\xf5\x14\x79\x18\x8f\x3b\x0d"
+                         "\x21\x17\xf8\x59\x15\x24\x64\x22"
+                         "\x57\x48\x80\xd5\x3d\x92\x30\x07"
+                         "\xd9\xa1\x4a\x23\x16\x43\x48\x0e"
+                         "\x2b\x2d\x1b\x87\xef\x7e\xbd\xfa"
+                         "\x49\xbc\x7e\x68\x6e\xa8\x46\x95"
+                         "\xad\x5e\xfe\x0a\xa8\xd3\x1a\x5d"
+                         "\x6b\x84\xf3\x00\xba\x52\x05\x02"
+                         "\xe3\x96\x4e\xb6\x79\x3f\x43\xd3"
+                         "\x4d\x3f\xd6\xab\x0a\xc4\x75\x2d"
+                         "\xd1\x08\xc3\x6a\xc8\x37\x29\xa0"
+                         "\xcc\x9a\x05\xdd\x5c\xe1\xff\x66"
+                         "\xf2\x7a\x1d\xf2\xaf\xa9\x48\x89"
+                         "\xf5\x21\x0f\x02\x48\x83\x74\xbf"
+                         "\x2e\xe6\x93\x7b\xa0\xf4\xb1\x2b"
+                         "\xb1\x02\x0a\x5c\x79\x19\x3b\x75"
+                         "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e"
+                         "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95",
+               .ilen   = 512,
+               .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
                          "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
                          "\x10\x11\x12\x13\x14\x15\x16\x17"
-                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
-               .rlen   = 32,
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+                         "\x00\x01\x02\x03\x04\x05\x06\x07"
+                         "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+                         "\x10\x11\x12\x13\x14\x15\x16\x17"
+                         "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+                         "\x20\x21\x22\x23\x24\x25\x26\x27"
+                         "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+                         "\x30\x31\x32\x33\x34\x35\x36\x37"
+                         "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+                         "\x40\x41\x42\x43\x44\x45\x46\x47"
+                         "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+                         "\x50\x51\x52\x53\x54\x55\x56\x57"
+                         "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+                         "\x60\x61\x62\x63\x64\x65\x66\x67"
+                         "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+                         "\x70\x71\x72\x73\x74\x75\x76\x77"
+                         "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+                         "\x80\x81\x82\x83\x84\x85\x86\x87"
+                         "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+                         "\x90\x91\x92\x93\x94\x95\x96\x97"
+                         "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+                         "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+                         "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+                         "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+                         "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+                         "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
+                         "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+                         "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
+                         "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+                         "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
+                         "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+                         "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .rlen   = 512,
        },
 };