crypto: testmgr - add new serpent test vectors
Jussi Kivilinna [Mon, 17 Oct 2011 21:02:53 +0000 (00:02 +0300)]
Add new serpent tests for serpent_sse2 x86_64/i586 8-way/4-way code paths.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

crypto/tcrypt.c
crypto/testmgr.c
crypto/testmgr.h

index 0c4e80f..ac9e4d2 100644 (file)
@@ -793,6 +793,8 @@ static int do_test(int m)
 
        case 9:
                ret += tcrypt_test("ecb(serpent)");
+               ret += tcrypt_test("cbc(serpent)");
+               ret += tcrypt_test("ctr(serpent)");
                break;
 
        case 10:
index e91c1eb..49436b9 100644 (file)
@@ -1675,6 +1675,21 @@ static const struct alg_test_desc alg_test_descs[] = {
                        }
                }
        }, {
+               .alg = "cbc(serpent)",
+               .test = alg_test_skcipher,
+               .suite = {
+                       .cipher = {
+                               .enc = {
+                                       .vecs = serpent_cbc_enc_tv_template,
+                                       .count = SERPENT_CBC_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = serpent_cbc_dec_tv_template,
+                                       .count = SERPENT_CBC_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
                .alg = "cbc(twofish)",
                .test = alg_test_skcipher,
                .suite = {
@@ -1771,6 +1786,21 @@ static const struct alg_test_desc alg_test_descs[] = {
                        }
                }
        }, {
+               .alg = "ctr(serpent)",
+               .test = alg_test_skcipher,
+               .suite = {
+                       .cipher = {
+                               .enc = {
+                                       .vecs = serpent_ctr_enc_tv_template,
+                                       .count = SERPENT_CTR_ENC_TEST_VECTORS
+                               },
+                               .dec = {
+                                       .vecs = serpent_ctr_dec_tv_template,
+                                       .count = SERPENT_CTR_DEC_TEST_VECTORS
+                               }
+                       }
+               }
+       }, {
                .alg = "ctr(twofish)",
                .test = alg_test_skcipher,
                .suite = {
index 37b4d8f..ed4aec9 100644 (file)
@@ -3096,12 +3096,18 @@ static struct cipher_testvec tf_ctr_dec_tv_template[] = {
  * 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 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
+
 static struct cipher_testvec serpent_enc_tv_template[] = {
        {
                .input  = "\x00\x01\x02\x03\x04\x05\x06\x07"
@@ -3140,6 +3146,50 @@ static struct cipher_testvec serpent_enc_tv_template[] = {
                .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,
        },
 };
 
@@ -3231,6 +3281,50 @@ static struct cipher_testvec serpent_dec_tv_template[] = {
                .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,
        },
 };
 
@@ -3275,6 +3369,301 @@ static struct cipher_testvec tnepres_dec_tv_template[] = {
        },
 };
 
+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,
+       },
+};
 
 /* Cast6 test vectors from RFC 2612 */
 #define CAST6_ENC_TEST_VECTORS 3