From e055e160a80e4770cddb6026cb4158ab903a0685 Mon Sep 17 00:00:00 2001 From: Cristian Stoica Date: Tue, 4 Mar 2014 10:49:00 +0200 Subject: crypto: testmgr - add test vector for TLS1.0 AES128-CBC-SHA1 This test vector exercises encryption and decryption with a payload large enough to be non-trivial. Change-Id: Iecca48fc21a44a6f1e9fecddc8c349c7a822c5c0 Signed-off-by: Cristian Stoica Reviewed-on: http://git.am.freescale.net:8181/10084 Tested-by: Review Code-CDREVIEW Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Jose Rivera (cherry picked from commit f76b14b48bb051bd9b873aeb49ab7fa5d8badce5) Reviewed-on: http://git.am.freescale.net:8181/10383 Reviewed-by: Mircea Pop Reviewed-by: Alexandru Porosanu diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 4522228..3b7d45e 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -112,8 +112,8 @@ static char zeroed_string[48]; /* * TLS1.0 synthetic test vectors */ -#define TLS_ENC_TEST_VECTORS 2 -#define TLS_DEC_TEST_VECTORS 2 +#define TLS_ENC_TEST_VECTORS 3 +#define TLS_DEC_TEST_VECTORS 3 static struct tls_testvec tls_enc_tv_template[] = { { @@ -164,6 +164,59 @@ static struct tls_testvec tls_enc_tv_template[] = { "\xe9\x6a\xcc\x4d\x6f\x79\x8a\x45" "\x1f\x4e\x27\xf2\xa7\x59\xb4\x5a", .rlen = 20 + 12, + }, { +#ifdef __LITTLE_ENDIAN + .key = "\x08\x00" /* rta length */ + "\x01\x00" /* rta type */ +#else + .key = "\x00\x08" /* rta length */ + "\x00\x01" /* rta type */ +#endif + "\x00\x00\x00\x10" /* enc key length */ + "authenticationkey20b" + "enckeyis16_bytes", + .klen = 8 + 20 + 16, + .iv = "iv0123456789abcd", + .input = "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext", + .ilen = 285, + .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x00\x03\x01\x01\x1d", + .alen = 13, + .result = "\x80\x23\x82\x44\x14\x2a\x1d\x94\xc\xc2\x1d\xd" + "\x3a\x32\x89\x4c\x57\x30\xa8\x89\x76\x46\xcc\x90" + "\x1d\x88\xb8\xa6\x1a\x58\xe\x2d\xeb\x2c\xc7\x3a" + "\x52\x4e\xdb\xb3\x1e\x83\x11\xf5\x3c\xce\x6e\x94" + "\xd3\x26\x6a\x9a\xd\xbd\xc7\x98\xb9\xb3\x3a\x51" + "\x1e\x4\x84\x8a\x8f\x54\x9a\x51\x69\x9c\xce\x31" + "\x8d\x5d\x8b\xee\x5f\x70\xc\xc9\xb8\x50\x54\xf8" + "\xb2\x4a\x7a\xcd\xeb\x7a\x82\x81\xc6\x41\xc8\x50" + "\x91\x8d\xc8\xed\xcd\x40\x8f\x55\xd1\xec\xc9\xac" + "\x15\x18\xf9\x20\xa0\xed\x18\xa1\xe3\x56\xe3\x14" + "\xe5\xe8\x66\x63\x20\xed\xe4\x62\x9d\xa3\xa4\x1d" + "\x81\x89\x18\xf2\x36\xae\xc8\x8a\x2b\xbc\xc3\xb8" + "\x80\xf\x97\x21\x36\x39\x8\x84\x23\x18\x9e\x9c" + "\x72\x32\x75\x2d\x2e\xf9\x60\xb\xe8\xcc\xd9\x74" + "\x4\x1b\x8e\x99\xc1\x94\xee\xd0\xac\x4e\xfc\x7e" + "\xf1\x96\xb3\xe7\x14\xb8\xf2\xc\x25\x97\x82\x6b" + "\xbd\x0\x65\xab\x5c\xe3\x16\xfb\x68\xef\xea\x9d" + "\xff\x44\x1d\x2a\x44\xf5\xc8\x56\x77\xb7\xbf\x13" + "\xc8\x54\xdb\x92\xfe\x16\x4c\xbe\x18\xe9\xb\x8d" + "\xb\xd4\x43\x58\x43\xaa\xf4\x3\x80\x97\x62\xd5" + "\xdf\x3c\x28\xaa\xee\x48\x4b\x55\x41\x1b\x31\x2" + "\xbe\xa0\x1c\xbd\xb7\x22\x2a\xe5\x53\x72\x73\x20" + "\x44\x4f\xe6\x1\x2b\x34\x33\x11\x7d\xfb\x10\xc1" + "\x66\x7c\xa6\xf4\x48\x36\x5e\x2\xda\x41\x4b\x3e" + "\xe7\x80\x17\x17\xce\xf1\x3e\x6a\x8e\x26\xf3\xb7" + "\x2b\x85\xd\x31\x8d\xba\x6c\x22\xb4\x28\x55\x7e" + "\x2a\x9e\x26\xf1\x3d\x21\xac\x65", + .rlen = 285 + 20 + 15, } }; @@ -216,6 +269,60 @@ static struct tls_testvec tls_dec_tv_template[] = { .alen = 13, .result = "", .rlen = 0, + }, { +#ifdef __LITTLE_ENDIAN + .key = "\x08\x00" /* rta length */ + "\x01\x00" /* rta type */ +#else + .key = "\x00\x08" /* rta length */ + "\x00\x01" /* rta type */ +#endif + "\x00\x00\x00\x10" /* enc key length */ + "authenticationkey20b" + "enckeyis16_bytes", + .klen = 8 + 20 + 16, + .iv = "iv0123456789abcd", + .input = "\x80\x23\x82\x44\x14\x2a\x1d\x94\xc\xc2\x1d\xd" + "\x3a\x32\x89\x4c\x57\x30\xa8\x89\x76\x46\xcc\x90" + "\x1d\x88\xb8\xa6\x1a\x58\xe\x2d\xeb\x2c\xc7\x3a" + "\x52\x4e\xdb\xb3\x1e\x83\x11\xf5\x3c\xce\x6e\x94" + "\xd3\x26\x6a\x9a\xd\xbd\xc7\x98\xb9\xb3\x3a\x51" + "\x1e\x4\x84\x8a\x8f\x54\x9a\x51\x69\x9c\xce\x31" + "\x8d\x5d\x8b\xee\x5f\x70\xc\xc9\xb8\x50\x54\xf8" + "\xb2\x4a\x7a\xcd\xeb\x7a\x82\x81\xc6\x41\xc8\x50" + "\x91\x8d\xc8\xed\xcd\x40\x8f\x55\xd1\xec\xc9\xac" + "\x15\x18\xf9\x20\xa0\xed\x18\xa1\xe3\x56\xe3\x14" + "\xe5\xe8\x66\x63\x20\xed\xe4\x62\x9d\xa3\xa4\x1d" + "\x81\x89\x18\xf2\x36\xae\xc8\x8a\x2b\xbc\xc3\xb8" + "\x80\xf\x97\x21\x36\x39\x8\x84\x23\x18\x9e\x9c" + "\x72\x32\x75\x2d\x2e\xf9\x60\xb\xe8\xcc\xd9\x74" + "\x4\x1b\x8e\x99\xc1\x94\xee\xd0\xac\x4e\xfc\x7e" + "\xf1\x96\xb3\xe7\x14\xb8\xf2\xc\x25\x97\x82\x6b" + "\xbd\x0\x65\xab\x5c\xe3\x16\xfb\x68\xef\xea\x9d" + "\xff\x44\x1d\x2a\x44\xf5\xc8\x56\x77\xb7\xbf\x13" + "\xc8\x54\xdb\x92\xfe\x16\x4c\xbe\x18\xe9\xb\x8d" + "\xb\xd4\x43\x58\x43\xaa\xf4\x3\x80\x97\x62\xd5" + "\xdf\x3c\x28\xaa\xee\x48\x4b\x55\x41\x1b\x31\x2" + "\xbe\xa0\x1c\xbd\xb7\x22\x2a\xe5\x53\x72\x73\x20" + "\x44\x4f\xe6\x1\x2b\x34\x33\x11\x7d\xfb\x10\xc1" + "\x66\x7c\xa6\xf4\x48\x36\x5e\x2\xda\x41\x4b\x3e" + "\xe7\x80\x17\x17\xce\xf1\x3e\x6a\x8e\x26\xf3\xb7" + "\x2b\x85\xd\x31\x8d\xba\x6c\x22\xb4\x28\x55\x7e" + "\x2a\x9e\x26\xf1\x3d\x21\xac\x65", + + .ilen = 285 + 20 + 15, + .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x00\x03\x01\x01\x40", + .alen = 13, + .result = "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext285 bytes plaintext" + "285 bytes plaintext", + .rlen = 285, } }; -- cgit v0.10.2