]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - crypto/testmgr.h
crypto: testmgr - add xts(twofish) test vectors
[linux-2.6.git] / crypto / testmgr.h
index c1c709b57ddbbda8d9a88cee8cf9297279f203fe..43e84d32b341ff58b12d3f80a3924a2296b56f5a 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,6 +1706,78 @@ static struct hash_testvec aes_xcbc128_tv_template[] = {
        }
 };
 
+#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_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,
+       },
+};
+
 /*
  * SHA384 HMAC test vectors from RFC4231
  */
@@ -2267,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 */
@@ -2324,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,
        },
 };
 
@@ -2379,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,
        },
 };
 
@@ -2398,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,
        },
 };
 
@@ -2417,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[] = {
        {
@@ -2458,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,
        },
 };
 
@@ -2491,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,
        },
 };
 
@@ -2537,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,
        },
 };
 
@@ -2583,192 +2951,3085 @@ 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",
+               .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 = "\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,
+       },
+};
+
+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    = "\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 = "\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  = "\xab\x72\x0a\xad\x3b\x0c\xf0\xc9"
+                         "\x42\x2f\xf1\xae\xf1\x3c\xb1\xbd",
+               .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  = "\x85\xa7\x56\x67\x08\xfa\x42\xe1"
+                         "\x22\xe6\x82\xfc\xd9\xb4\xd7\xd4",
+               .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  = "\xd2\xaf\x69\x35\x24\x1d\x0e\x1c"
+                         "\x84\x8b\x05\xe4\xa2\x2f\x16\xf5",
+               .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  = "\x4a\x23\x56\xd7\xff\x90\xd0\x9a"
+                         "\x0d\x7c\x26\xfc\xf0\xf0\xf6\xe4",
+               .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  = "\x30\xaf\x26\x05\x9d\x5d\x0a\x58"
+                         "\xe2\xe7\xce\x8a\xb2\x56\x6d\x76",
+               .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  = "\xdf\xcf\xdc\xd2\xe1\xcf\x86\x75"
+                         "\x17\x66\x5e\x0c\x14\xa1\x3d\x40",
+               .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  = "\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 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    = "\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    = "\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 = "\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    = "\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 = "\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",
+       }, { /* 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 = zeroed_string,
+               .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
@@ -2852,12 +6113,18 @@ static struct cipher_testvec cast6_dec_tv_template[] = {
 #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 7
-#define AES_CTR_DEC_TEST_VECTORS 6
+#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
@@ -3796,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,
        }
 };
 
@@ -3993,11 +7404,314 @@ 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,
+
        }
 };
 
 
 static struct cipher_testvec aes_ctr_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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .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 = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
+                         "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
+                         "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
+                         "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
+                         "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
+                         "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
+                         "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
+                         "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
+               .rlen   = 64,
+       }, {
+               .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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .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 = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
+                         "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
+                         "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
+                         "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
+                         "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
+                         "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
+                         "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
+                         "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
+               .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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .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 = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
+                         "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
+                         "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
+                         "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
+                         "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
+                         "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
+                         "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
+                         "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
+               .rlen   = 64,
+       }
+};
+
+static struct cipher_testvec aes_ctr_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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .input  = "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
+                         "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
+                         "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
+                         "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
+                         "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
+                         "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
+                         "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
+                         "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
+               .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,
+       }, {
+               .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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .input  = "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
+                         "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
+                         "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
+                         "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
+                         "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
+                         "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
+                         "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
+                         "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
+               .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,
+       }, {
+               .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     = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
+                         "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+               .input  = "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
+                         "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
+                         "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
+                         "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
+                         "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
+                         "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
+                         "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
+                         "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
+               .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 cipher_testvec aes_ctr_rfc3686_enc_tv_template[] = {
        { /* From RFC 3686 */
                .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
                          "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
@@ -5129,7 +8843,7 @@ static struct cipher_testvec aes_ctr_enc_tv_template[] = {
        },
 };
 
-static struct cipher_testvec aes_ctr_dec_tv_template[] = {
+static struct cipher_testvec aes_ctr_rfc3686_dec_tv_template[] = {
        { /* From RFC 3686 */
                .key    = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
                          "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
@@ -5220,6 +8934,64 @@ static struct cipher_testvec aes_ctr_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,
@@ -5582,6 +9354,356 @@ static struct aead_testvec aes_gcm_dec_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"