aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2011-10-17 17:02:53 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2011-11-08 22:42:59 -0500
commit9d25917d49d986c417c173bfde50f41f96c5b202 (patch)
treef11aa2bf478dccbbd32182fc7afa622ad00fdfb1
parent1ea6b8f48918282bdca0b32a34095504ee65bab5 (diff)
crypto: testmgr - add new serpent test vectors
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>
-rw-r--r--crypto/tcrypt.c2
-rw-r--r--crypto/testmgr.c30
-rw-r--r--crypto/testmgr.h393
3 files changed, 423 insertions, 2 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 0c4e80f34651..ac9e4d2a63b8 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -793,6 +793,8 @@ static int do_test(int m)
793 793
794 case 9: 794 case 9:
795 ret += tcrypt_test("ecb(serpent)"); 795 ret += tcrypt_test("ecb(serpent)");
796 ret += tcrypt_test("cbc(serpent)");
797 ret += tcrypt_test("ctr(serpent)");
796 break; 798 break;
797 799
798 case 10: 800 case 10:
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index e91c1eb1722a..49436b900081 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1675,6 +1675,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1675 } 1675 }
1676 } 1676 }
1677 }, { 1677 }, {
1678 .alg = "cbc(serpent)",
1679 .test = alg_test_skcipher,
1680 .suite = {
1681 .cipher = {
1682 .enc = {
1683 .vecs = serpent_cbc_enc_tv_template,
1684 .count = SERPENT_CBC_ENC_TEST_VECTORS
1685 },
1686 .dec = {
1687 .vecs = serpent_cbc_dec_tv_template,
1688 .count = SERPENT_CBC_DEC_TEST_VECTORS
1689 }
1690 }
1691 }
1692 }, {
1678 .alg = "cbc(twofish)", 1693 .alg = "cbc(twofish)",
1679 .test = alg_test_skcipher, 1694 .test = alg_test_skcipher,
1680 .suite = { 1695 .suite = {
@@ -1771,6 +1786,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1771 } 1786 }
1772 } 1787 }
1773 }, { 1788 }, {
1789 .alg = "ctr(serpent)",
1790 .test = alg_test_skcipher,
1791 .suite = {
1792 .cipher = {
1793 .enc = {
1794 .vecs = serpent_ctr_enc_tv_template,
1795 .count = SERPENT_CTR_ENC_TEST_VECTORS
1796 },
1797 .dec = {
1798 .vecs = serpent_ctr_dec_tv_template,
1799 .count = SERPENT_CTR_DEC_TEST_VECTORS
1800 }
1801 }
1802 }
1803 }, {
1774 .alg = "ctr(twofish)", 1804 .alg = "ctr(twofish)",
1775 .test = alg_test_skcipher, 1805 .test = alg_test_skcipher,
1776 .suite = { 1806 .suite = {
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 37b4d8f45447..ed4aec950faf 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -3096,12 +3096,18 @@ static struct cipher_testvec tf_ctr_dec_tv_template[] = {
3096 * Serpent test vectors. These are backwards because Serpent writes 3096 * Serpent test vectors. These are backwards because Serpent writes
3097 * octet sequences in right-to-left mode. 3097 * octet sequences in right-to-left mode.
3098 */ 3098 */
3099#define SERPENT_ENC_TEST_VECTORS 4 3099#define SERPENT_ENC_TEST_VECTORS 5
3100#define SERPENT_DEC_TEST_VECTORS 4 3100#define SERPENT_DEC_TEST_VECTORS 5
3101 3101
3102#define TNEPRES_ENC_TEST_VECTORS 4 3102#define TNEPRES_ENC_TEST_VECTORS 4
3103#define TNEPRES_DEC_TEST_VECTORS 4 3103#define TNEPRES_DEC_TEST_VECTORS 4
3104 3104
3105#define SERPENT_CBC_ENC_TEST_VECTORS 1
3106#define SERPENT_CBC_DEC_TEST_VECTORS 1
3107
3108#define SERPENT_CTR_ENC_TEST_VECTORS 2
3109#define SERPENT_CTR_DEC_TEST_VECTORS 2
3110
3105static struct cipher_testvec serpent_enc_tv_template[] = { 3111static struct cipher_testvec serpent_enc_tv_template[] = {
3106 { 3112 {
3107 .input = "\x00\x01\x02\x03\x04\x05\x06\x07" 3113 .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
@@ -3140,6 +3146,50 @@ static struct cipher_testvec serpent_enc_tv_template[] = {
3140 .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c" 3146 .result = "\xdd\xd2\x6b\x98\xa5\xff\xd8\x2c"
3141 "\x05\x34\x5a\x9d\xad\xbf\xaf\x49", 3147 "\x05\x34\x5a\x9d\xad\xbf\xaf\x49",
3142 .rlen = 16, 3148 .rlen = 16,
3149 }, { /* Generated with Crypto++ */
3150 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3151 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3152 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3153 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3154 .klen = 32,
3155 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3156 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3157 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3158 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3159 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3160 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3161 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3162 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3163 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3164 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3165 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3166 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3167 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3168 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3169 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3170 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3171 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3172 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3173 .ilen = 144,
3174 .result = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
3175 "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
3176 "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
3177 "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
3178 "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
3179 "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
3180 "\x99\x34\x89\x5B\x54\xE9\x12\x13"
3181 "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
3182 "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
3183 "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
3184 "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
3185 "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
3186 "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
3187 "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
3188 "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
3189 "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
3190 "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
3191 "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
3192 .rlen = 144,
3143 }, 3193 },
3144}; 3194};
3145 3195
@@ -3231,6 +3281,50 @@ static struct cipher_testvec serpent_dec_tv_template[] = {
3231 .ilen = 16, 3281 .ilen = 16,
3232 .result = zeroed_string, 3282 .result = zeroed_string,
3233 .rlen = 16, 3283 .rlen = 16,
3284 }, { /* Generated with Crypto++ */
3285 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3286 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3287 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3288 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3289 .klen = 32,
3290 .input = "\xFB\xB0\x5D\xDE\xC0\xFE\xFC\xEB"
3291 "\xB1\x80\x10\x43\xDE\x62\x70\xBD"
3292 "\xFA\x8A\x93\xEA\x6B\xF7\xC5\xD7"
3293 "\x0C\xD1\xBB\x29\x25\x14\x4C\x22"
3294 "\x77\xA6\x38\x00\xDB\xB9\xE2\x07"
3295 "\xD1\xAC\x82\xBA\xEA\x67\xAA\x39"
3296 "\x99\x34\x89\x5B\x54\xE9\x12\x13"
3297 "\x3B\x04\xE5\x12\x42\xC5\x79\xAB"
3298 "\x0D\xC7\x3C\x58\x2D\xA3\x98\xF6"
3299 "\xE4\x61\x9E\x17\x0B\xCE\xE8\xAA"
3300 "\xB5\x6C\x1A\x3A\x67\x52\x81\x6A"
3301 "\x04\xFF\x8A\x1B\x96\xFE\xE6\x87"
3302 "\x3C\xD4\x39\x7D\x36\x9B\x03\xD5"
3303 "\xB6\xA0\x75\x3C\x83\xE6\x1C\x73"
3304 "\x9D\x74\x2B\x77\x53\x2D\xE5\xBD"
3305 "\x69\xDA\x7A\x01\xF5\x6A\x70\x39"
3306 "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
3307 "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
3308 .ilen = 144,
3309 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3310 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3311 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3312 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3313 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3314 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3315 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3316 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3317 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3318 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3319 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3320 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3321 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3322 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3323 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3324 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3325 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3326 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3327 .rlen = 144,
3234 }, 3328 },
3235}; 3329};
3236 3330
@@ -3275,6 +3369,301 @@ static struct cipher_testvec tnepres_dec_tv_template[] = {
3275 }, 3369 },
3276}; 3370};
3277 3371
3372static struct cipher_testvec serpent_cbc_enc_tv_template[] = {
3373 { /* Generated with Crypto++ */
3374 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3375 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3376 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3377 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3378 .klen = 32,
3379 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3380 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3381 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3382 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3383 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3384 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3385 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3386 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3387 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3388 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3389 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3390 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3391 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3392 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3393 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3394 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3395 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3396 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3397 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3398 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3399 .ilen = 144,
3400 .result = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
3401 "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
3402 "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
3403 "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
3404 "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
3405 "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
3406 "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
3407 "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
3408 "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
3409 "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
3410 "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
3411 "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
3412 "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
3413 "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
3414 "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
3415 "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
3416 "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
3417 "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
3418 .rlen = 144,
3419 },
3420};
3421
3422static struct cipher_testvec serpent_cbc_dec_tv_template[] = {
3423 { /* Generated with Crypto++ */
3424 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3425 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3426 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3427 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3428 .klen = 32,
3429 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3430 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3431 .input = "\x80\xCF\x11\x41\x1A\xB9\x4B\x9C"
3432 "\xFF\xB7\x6C\xEA\xF0\xAF\x77\x6E"
3433 "\x71\x75\x95\x9D\x4E\x1C\xCF\xAD"
3434 "\x81\x34\xE9\x8F\xAE\x5A\x91\x1C"
3435 "\x38\x63\x35\x7E\x79\x18\x0A\xE8"
3436 "\x67\x06\x76\xD5\xFF\x22\x2F\xDA"
3437 "\xB6\x2D\x57\x13\xB6\x3C\xBC\x97"
3438 "\xFE\x53\x75\x35\x97\x7F\x51\xEA"
3439 "\xDF\x5D\xE8\x9D\xCC\xD9\xAE\xE7"
3440 "\x62\x67\xFF\x04\xC2\x18\x22\x5F"
3441 "\x2E\x06\xC1\xE2\x26\xCD\xC6\x1E"
3442 "\xE5\x2C\x4E\x87\x23\xDD\xF0\x41"
3443 "\x08\xA5\xB4\x3E\x07\x1E\x0B\xBB"
3444 "\x72\x84\xF8\x0A\x3F\x38\x5E\x91"
3445 "\x15\x26\xE1\xDB\xA4\x3D\x74\xD2"
3446 "\x41\x1E\x3F\xA9\xC6\x7D\x2A\xAB"
3447 "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
3448 "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
3449 .ilen = 144,
3450 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3451 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3452 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3453 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3454 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3455 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3456 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3457 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3458 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3459 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3460 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3461 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3462 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3463 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3464 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3465 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3466 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3467 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3468 .rlen = 144,
3469 },
3470};
3471
3472static struct cipher_testvec serpent_ctr_enc_tv_template[] = {
3473 { /* Generated with Crypto++ */
3474 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3475 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3476 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3477 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3478 .klen = 32,
3479 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3480 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3481 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3482 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3483 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3484 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3485 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3486 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3487 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3488 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3489 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3490 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3491 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3492 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3493 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3494 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3495 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3496 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3497 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3498 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3499 .ilen = 144,
3500 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
3501 "\x37\x69\xE3\x3A\x22\x85\x48\x46"
3502 "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
3503 "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
3504 "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
3505 "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
3506 "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
3507 "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
3508 "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
3509 "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
3510 "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
3511 "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
3512 "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
3513 "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
3514 "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
3515 "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
3516 "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
3517 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
3518 .rlen = 144,
3519 }, { /* Generated with Crypto++ */
3520 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3521 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3522 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3523 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3524 .klen = 32,
3525 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3526 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3527 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3528 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3529 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3530 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3531 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3532 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3533 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3534 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3535 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3536 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3537 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3538 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3539 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3540 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3541 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3542 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3543 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3544 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3545 "\xF1\x65\xFC",
3546 .ilen = 147,
3547 .result = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
3548 "\x37\x69\xE3\x3A\x22\x85\x48\x46"
3549 "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
3550 "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
3551 "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
3552 "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
3553 "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
3554 "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
3555 "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
3556 "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
3557 "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
3558 "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
3559 "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
3560 "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
3561 "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
3562 "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
3563 "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
3564 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
3565 "\xE6\xD0\x97",
3566 .rlen = 147,
3567 },
3568};
3569
3570static struct cipher_testvec serpent_ctr_dec_tv_template[] = {
3571 { /* Generated with Crypto++ */
3572 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3573 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3574 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3575 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3576 .klen = 32,
3577 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3578 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3579 .input = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
3580 "\x37\x69\xE3\x3A\x22\x85\x48\x46"
3581 "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
3582 "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
3583 "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
3584 "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
3585 "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
3586 "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
3587 "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
3588 "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
3589 "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
3590 "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
3591 "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
3592 "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
3593 "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
3594 "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
3595 "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
3596 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9",
3597 .ilen = 144,
3598 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3599 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3600 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3601 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3602 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3603 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3604 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3605 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3606 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3607 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3608 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3609 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3610 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3611 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3612 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3613 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3614 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3615 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
3616 .rlen = 144,
3617 }, { /* Generated with Crypto++ */
3618 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3619 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3620 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3621 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3622 .klen = 32,
3623 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3624 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3625 .input = "\x84\x68\xEC\xF2\x1C\x88\x20\xCA"
3626 "\x37\x69\xE3\x3A\x22\x85\x48\x46"
3627 "\x70\xAA\x25\xB4\xCD\x8B\x04\x4E"
3628 "\x8D\x15\x2B\x98\xDF\x7B\x6D\xB9"
3629 "\xE0\x4A\x73\x00\x65\xB6\x1A\x0D"
3630 "\x5C\x60\xDF\x34\xDC\x60\x4C\xDF"
3631 "\xB5\x1F\x26\x8C\xDA\xC1\x11\xA8"
3632 "\x80\xFA\x37\x7A\x89\xAA\xAE\x7B"
3633 "\x92\x6E\xB9\xDC\xC9\x62\x4F\x88"
3634 "\x0A\x5D\x97\x2F\x6B\xAC\x03\x7C"
3635 "\x22\xF6\x55\x5A\xFA\x35\xA5\x17"
3636 "\xA1\x5C\x5E\x2B\x63\x2D\xB9\x91"
3637 "\x3E\x83\x26\x00\x4E\xD5\xBE\xCE"
3638 "\x79\xC4\x3D\xFC\x70\xA0\xAD\x96"
3639 "\xBA\x58\x2A\x1C\xDF\xC2\x3A\xA5"
3640 "\x7C\xB5\x12\x89\xED\xBF\xB6\x09"
3641 "\x13\x4F\x7D\x61\x3C\x5C\x27\xFC"
3642 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
3643 "\xE6\xD0\x97",
3644 .ilen = 147,
3645 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3646 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3647 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3648 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3649 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3650 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3651 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3652 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3653 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3654 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3655 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3656 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3657 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3658 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3659 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3660 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3661 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3662 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3663 "\xF1\x65\xFC",
3664 .rlen = 147,
3665 },
3666};
3278 3667
3279/* Cast6 test vectors from RFC 2612 */ 3668/* Cast6 test vectors from RFC 2612 */
3280#define CAST6_ENC_TEST_VECTORS 3 3669#define CAST6_ENC_TEST_VECTORS 3