mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-10-23 07:34:24 +02:00
Added the self-test for the TLS1.2 algorithms offload
- aes-128-cbc-hmac-sha256 - aes-256-cbc-hmac-sha256 Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
This commit is contained in:
parent
0a756eeb94
commit
efdcc4e970
|
@ -1870,7 +1870,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
|
|||
ret = min(ret, tcrypt_test("ctr(aria)"));
|
||||
break;
|
||||
case 193:
|
||||
ret += tcrypt_test("tls10(hmac(sha1),cbc(aes))");
|
||||
ret += tcrypt_test("tls11(hmac(sha1),cbc(aes))");
|
||||
break;
|
||||
case 194:
|
||||
ret += tcrypt_test("tls12(hmac(sha256),cbc(aes))");
|
||||
break;
|
||||
case 200:
|
||||
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
|
||||
|
|
|
@ -2767,7 +2767,7 @@ static int __test_tls(struct crypto_aead *tfm, int enc,
|
|||
} else if (ret)
|
||||
continue;
|
||||
|
||||
authsize = 20;
|
||||
authsize = template[i].authlen;
|
||||
ret = crypto_aead_setauthsize(tfm, authsize);
|
||||
if (ret) {
|
||||
pr_err("alg: aead%s: Failed to set authsize to %u on test %d for %s\n",
|
||||
|
@ -5874,7 +5874,16 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|||
.hash = __VECS(streebog512_tv_template)
|
||||
}
|
||||
}, {
|
||||
.alg = "tls10(hmac(sha1),cbc(aes))",
|
||||
.alg = "tls11(hmac(sha1),cbc(aes))",
|
||||
.test = alg_test_tls,
|
||||
.suite = {
|
||||
.tls = {
|
||||
.enc = __VECS(tls12_enc_tv_template),
|
||||
.dec = __VECS(tls12_dec_tv_template)
|
||||
}
|
||||
}
|
||||
}, {
|
||||
.alg = "tls12(hmac(sha256),cbc(aes))",
|
||||
.test = alg_test_tls,
|
||||
.suite = {
|
||||
.tls = {
|
||||
|
|
509
crypto/testmgr.h
509
crypto/testmgr.h
|
@ -165,6 +165,7 @@ struct tls_testvec {
|
|||
unsigned short ilen; /* input data length */
|
||||
unsigned short alen; /* associated data length */
|
||||
unsigned short rlen; /* result length */
|
||||
unsigned short authlen; /* authentication length */
|
||||
};
|
||||
|
||||
struct akcipher_testvec {
|
||||
|
@ -198,7 +199,7 @@ struct kpp_testvec {
|
|||
static const char zeroed_string[48];
|
||||
|
||||
/*
|
||||
* TLS1.0 synthetic test vectors
|
||||
* TLS1.1 synthetic test vectors
|
||||
*/
|
||||
static struct tls_testvec tls_enc_tv_template[] = {
|
||||
{
|
||||
|
@ -213,19 +214,26 @@ static struct tls_testvec tls_enc_tv_template[] = {
|
|||
"authenticationkey20benckeyis16_bytes",
|
||||
.klen = 8 + 20 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "Single block msg",
|
||||
.ilen = 16,
|
||||
.input = "iv0123456789abcdSingle block msg",
|
||||
.ilen = 32,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x10",
|
||||
.alen = 13,
|
||||
.result = "\xd5\xac\xb\xd2\xac\xad\x3f\xb1"
|
||||
"\x59\x79\x1e\x91\x5f\x52\x14\x9c"
|
||||
"\xc0\x75\xd8\x4c\x97\x0f\x07\x73"
|
||||
"\xdc\x89\x47\x49\x49\xcb\x30\x6b"
|
||||
"\x1b\x45\x23\xa1\xd0\x51\xcf\x02"
|
||||
"\x2e\xa8\x5d\xa0\xfe\xca\x82\x61",
|
||||
.rlen = 16 + 20 + 12,
|
||||
}, {
|
||||
.result = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae"
|
||||
"\x6d\xc2\xeb\x76\xa1\x3b\xe2\x57"
|
||||
"\x64\xaf\x38\x42\x67\x8e\x57\x3e"
|
||||
"\xe7\x24\x44\x73\x0a\x23\x77\x07"
|
||||
"\xbb\xc8\x1f\x4e\x2c\xd4\x56\xa4"
|
||||
"\x16\x15\x38\x91\xed\x21\xec\x36"
|
||||
"\xd3\x05\xeb\x10\x04\x00\x4e\xc0",
|
||||
.rlen = 16 + 20 + 12 + 16,
|
||||
.authlen = 20,
|
||||
},
|
||||
/* Payload with payload len as zero leads to descriptor error.
|
||||
*/
|
||||
#if 0
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
.key = "\x08\x00" /* rta length */
|
||||
"\x01\x00" /* rta type */
|
||||
|
@ -237,17 +245,22 @@ static struct tls_testvec tls_enc_tv_template[] = {
|
|||
"authenticationkey20benckeyis16_bytes",
|
||||
.klen = 8 + 20 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "",
|
||||
.ilen = 0,
|
||||
.input = "iv0123456789abcd",
|
||||
.ilen = 16,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x00",
|
||||
"\x00\x03\x02\x00\x00",
|
||||
.alen = 13,
|
||||
.result = "\x58\x2a\x11\xc\x86\x8e\x4b\x67"
|
||||
"\x2d\x16\x26\x1a\xac\x4b\xe2\x1a"
|
||||
"\xe9\x6a\xcc\x4d\x6f\x79\x8a\x45"
|
||||
"\x1f\x4e\x27\xf2\xa7\x59\xb4\x5a",
|
||||
.rlen = 20 + 12,
|
||||
}, {
|
||||
.result = "\x31\x41\x4e\xea\x70\xc2\xb3\xa7"
|
||||
"\x3e\xcb\x1a\xee\xa9\xe1\xfc\xc4"
|
||||
"\x5d\xe0\xee\xaa\x6a\x83\x34\xb9"
|
||||
"\x3d\x9c\x20\x44\x09\xca\x94\xb6"
|
||||
"\x2d\xf9\xbd\x8a\x7b\x88\xdf\xec"
|
||||
"\xd5\xbc\x27\x61\xa9\x61\x56\xb6",
|
||||
.rlen = 20 + 12 + 16,
|
||||
.authlen = 20,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
.key = "\x08\x00" /* rta length */
|
||||
"\x01\x00" /* rta type */
|
||||
|
@ -259,45 +272,62 @@ static struct tls_testvec tls_enc_tv_template[] = {
|
|||
"authenticationkey20benckeyis16_bytes",
|
||||
.klen = 8 + 20 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "285 bytes plaintext285 bytes plaintext285 bytes"
|
||||
.input = "iv0123456789abcd"
|
||||
"285 bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext",
|
||||
.ilen = 285,
|
||||
.ilen = 285 + 16,
|
||||
.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,
|
||||
.result = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae"
|
||||
"\x79\x03\xd4\x14\x1c\x57\x86\x48"
|
||||
"\xec\x5e\x59\x21\x41\xff\xb9\x2f"
|
||||
"\x66\xe9\xc1\xc9\xe3\x01\x8c\x10"
|
||||
"\xb6\xde\x8f\xb1\xc0\x66\x93\xc5"
|
||||
"\xac\x10\xd6\x86\x35\x63\x2b\xc0"
|
||||
"\x7a\x40\xfd\x0e\x39\x0a\xf5\x18"
|
||||
"\x1a\xf7\x99\x3c\x45\xd8\xe4\x92"
|
||||
"\xd3\x39\x83\x58\x04\x8f\xe0\x95"
|
||||
"\x24\xee\x62\xc5\xdf\xf6\x4c\x25"
|
||||
"\x22\x0e\xf7\xe3\x33\x04\x88\x5b"
|
||||
"\x70\xf8\xf5\x39\x24\xa1\x58\xd2"
|
||||
"\xf9\x4c\xf9\x64\x0a\xcf\x9f\x36"
|
||||
"\x23\x43\xda\x44\xfc\x68\xd7\x23"
|
||||
"\x83\xc2\xb7\xc6\xd7\x7f\xd2\xec"
|
||||
"\xef\xd7\xfc\x6a\x64\xe9\x70\xdc"
|
||||
"\x53\x98\xfa\xf2\x41\x24\x87\xbc"
|
||||
"\x57\xc9\x1c\x38\xff\x4b\x95\x42"
|
||||
"\xb5\x2c\xfe\xd2\x34\xe2\xa7\x28"
|
||||
"\x61\x4a\x1d\xe0\x0f\x97\x62\x08"
|
||||
"\xa6\xa9\x5c\x89\x5e\x42\x60\x71"
|
||||
"\xda\xd9\xba\x95\x6f\x87\x9c\x00"
|
||||
"\x7e\x0c\x7a\x6f\xb4\x99\x7e\x0e"
|
||||
"\x6a\xe9\xab\x12\xda\x95\x25\x83"
|
||||
"\x8f\xa2\xc2\x91\xb5\x3f\xae\xc3"
|
||||
"\xf9\x03\xc9\x6d\xe7\xe7\x46\x61"
|
||||
"\xdc\xbc\xf1\x17\xcc\x93\x33\xa5"
|
||||
"\x06\x54\x45\x79\xcb\x1c\x67\x87"
|
||||
"\x87\x35\x9b\xc3\xfd\x3c\xcc\x43"
|
||||
"\xec\xac\xef\xfd\x3b\x35\xb3\xde"
|
||||
"\x7d\x82\x57\x49\xc5\xe8\x47\xbe"
|
||||
"\x70\xf2\xbf\x1c\x98\x1e\x3d\xa4"
|
||||
"\x25\xa2\x65\x6c\xca\x04\x9a\x1d"
|
||||
"\x01\x08\xa6\x36\xbe\x89\xd1\x4e"
|
||||
"\x87\x7f\xae\x70\x79\x0d\x42\x2d"
|
||||
"\x16\x6f\x00\xf5\x76\x51\xb4\x37"
|
||||
"\xda\xc2\x54\xa6\x39\x16\x26\x21"
|
||||
"\xb5\x78\x6e\xa1\xbb\x25\x80\xdf"
|
||||
"\xdb\x99\xdb\xc2\xec\x83\xf5\x88"
|
||||
"\x6d\x50\xba\xdd\x30\xb1\x72\xd9"
|
||||
"\xfc\xce\x7a\xcb\xcf\xd9\x0d\xc9",
|
||||
.rlen = 285 + 20 + 15 + 16,
|
||||
.authlen = 20,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -313,20 +343,26 @@ static struct tls_testvec tls_dec_tv_template[] = {
|
|||
"\x00\x00\x00\x10" /* enc key length */
|
||||
"authenticationkey20benckeyis16_bytes",
|
||||
.klen = 8 + 20 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "\xd5\xac\xb\xd2\xac\xad\x3f\xb1"
|
||||
"\x59\x79\x1e\x91\x5f\x52\x14\x9c"
|
||||
"\xc0\x75\xd8\x4c\x97\x0f\x07\x73"
|
||||
"\xdc\x89\x47\x49\x49\xcb\x30\x6b"
|
||||
"\x1b\x45\x23\xa1\xd0\x51\xcf\x02"
|
||||
"\x2e\xa8\x5d\xa0\xfe\xca\x82\x61",
|
||||
.iv = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae",
|
||||
.input = "\x6d\xc2\xeb\x76\xa1\x3b\xe2\x57"
|
||||
"\x64\xaf\x38\x42\x67\x8e\x57\x3e"
|
||||
"\xe7\x24\x44\x73\x0a\x23\x77\x07"
|
||||
"\xbb\xc8\x1f\x4e\x2c\xd4\x56\xa4"
|
||||
"\x16\x15\x38\x91\xed\x21\xec\x36"
|
||||
"\xd3\x05\xeb\x10\x04\x00\x4e\xc0",
|
||||
.ilen = 16 + 20 + 12,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x30",
|
||||
.alen = 13,
|
||||
.result = "Single block msg",
|
||||
.rlen = 16,
|
||||
}, {
|
||||
.authlen = 20,
|
||||
},
|
||||
/* Payload with payload len as zero leads to descriptor error.
|
||||
*/
|
||||
#if 0
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
.key = "\x08\x00" /* rta length */
|
||||
"\x01\x00" /* rta type */
|
||||
|
@ -337,18 +373,22 @@ static struct tls_testvec tls_dec_tv_template[] = {
|
|||
"\x00\x00\x00\x10" /* enc key length */
|
||||
"authenticationkey20benckeyis16_bytes",
|
||||
.klen = 8 + 20 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "\x58\x2a\x11\xc\x86\x8e\x4b\x67"
|
||||
"\x2d\x16\x26\x1a\xac\x4b\xe2\x1a"
|
||||
"\xe9\x6a\xcc\x4d\x6f\x79\x8a\x45"
|
||||
"\x1f\x4e\x27\xf2\xa7\x59\xb4\x5a",
|
||||
.iv = "\x31\x41\x4e\xea\x70\xc2\xb3\xa7"
|
||||
"\x3e\xcb\x1a\xee\xa9\xe1\xfc\xc4",
|
||||
.input = "\x5d\xe0\xee\xaa\x6a\x83\x34\xb9"
|
||||
"\x3d\x9c\x20\x44\x09\xca\x94\xb6"
|
||||
"\x2d\xf9\xbd\x8a\x7b\x88\xdf\xec"
|
||||
"\xd5\xbc\x27\x61\xa9\x61\x56\xb6",
|
||||
.ilen = 20 + 12,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x20",
|
||||
"\x00\x03\x02\x00\x20",
|
||||
.alen = 13,
|
||||
.result = "",
|
||||
.rlen = 0,
|
||||
}, {
|
||||
.authlen = 20,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
.key = "\x08\x00" /* rta length */
|
||||
"\x01\x00" /* rta type */
|
||||
|
@ -359,35 +399,48 @@ static struct tls_testvec tls_dec_tv_template[] = {
|
|||
"\x00\x00\x00\x10" /* enc key length */
|
||||
"authenticationkey20benckeyis16_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",
|
||||
|
||||
.iv = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae",
|
||||
.input = "\x79\x03\xd4\x14\x1c\x57\x86\x48"
|
||||
"\xec\x5e\x59\x21\x41\xff\xb9\x2f"
|
||||
"\x66\xe9\xc1\xc9\xe3\x01\x8c\x10"
|
||||
"\xb6\xde\x8f\xb1\xc0\x66\x93\xc5"
|
||||
"\xac\x10\xd6\x86\x35\x63\x2b\xc0"
|
||||
"\x7a\x40\xfd\x0e\x39\x0a\xf5\x18"
|
||||
"\x1a\xf7\x99\x3c\x45\xd8\xe4\x92"
|
||||
"\xd3\x39\x83\x58\x04\x8f\xe0\x95"
|
||||
"\x24\xee\x62\xc5\xdf\xf6\x4c\x25"
|
||||
"\x22\x0e\xf7\xe3\x33\x04\x88\x5b"
|
||||
"\x70\xf8\xf5\x39\x24\xa1\x58\xd2"
|
||||
"\xf9\x4c\xf9\x64\x0a\xcf\x9f\x36"
|
||||
"\x23\x43\xda\x44\xfc\x68\xd7\x23"
|
||||
"\x83\xc2\xb7\xc6\xd7\x7f\xd2\xec"
|
||||
"\xef\xd7\xfc\x6a\x64\xe9\x70\xdc"
|
||||
"\x53\x98\xfa\xf2\x41\x24\x87\xbc"
|
||||
"\x57\xc9\x1c\x38\xff\x4b\x95\x42"
|
||||
"\xb5\x2c\xfe\xd2\x34\xe2\xa7\x28"
|
||||
"\x61\x4a\x1d\xe0\x0f\x97\x62\x08"
|
||||
"\xa6\xa9\x5c\x89\x5e\x42\x60\x71"
|
||||
"\xda\xd9\xba\x95\x6f\x87\x9c\x00"
|
||||
"\x7e\x0c\x7a\x6f\xb4\x99\x7e\x0e"
|
||||
"\x6a\xe9\xab\x12\xda\x95\x25\x83"
|
||||
"\x8f\xa2\xc2\x91\xb5\x3f\xae\xc3"
|
||||
"\xf9\x03\xc9\x6d\xe7\xe7\x46\x61"
|
||||
"\xdc\xbc\xf1\x17\xcc\x93\x33\xa5"
|
||||
"\x06\x54\x45\x79\xcb\x1c\x67\x87"
|
||||
"\x87\x35\x9b\xc3\xfd\x3c\xcc\x43"
|
||||
"\xec\xac\xef\xfd\x3b\x35\xb3\xde"
|
||||
"\x7d\x82\x57\x49\xc5\xe8\x47\xbe"
|
||||
"\x70\xf2\xbf\x1c\x98\x1e\x3d\xa4"
|
||||
"\x25\xa2\x65\x6c\xca\x04\x9a\x1d"
|
||||
"\x01\x08\xa6\x36\xbe\x89\xd1\x4e"
|
||||
"\x87\x7f\xae\x70\x79\x0d\x42\x2d"
|
||||
"\x16\x6f\x00\xf5\x76\x51\xb4\x37"
|
||||
"\xda\xc2\x54\xa6\x39\x16\x26\x21"
|
||||
"\xb5\x78\x6e\xa1\xbb\x25\x80\xdf"
|
||||
"\xdb\x99\xdb\xc2\xec\x83\xf5\x88"
|
||||
"\x6d\x50\xba\xdd\x30\xb1\x72\xd9"
|
||||
"\xfc\xce\x7a\xcb\xcf\xd9\x0d\xc9",
|
||||
.ilen = 285 + 20 + 15,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x01\x40",
|
||||
|
@ -399,6 +452,274 @@ static struct tls_testvec tls_dec_tv_template[] = {
|
|||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext",
|
||||
.rlen = 285,
|
||||
.authlen = 20,
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* TLS1.2 synthetic test vectors
|
||||
*/
|
||||
static struct tls_testvec tls12_enc_tv_template[] = {
|
||||
{
|
||||
#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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "iv0123456789abcdSingle block msg",
|
||||
.ilen = 32,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x10",
|
||||
.alen = 13,
|
||||
.result = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae"
|
||||
"\x6d\xc2\xeb\x76\xa1\x3b\xe2\x57"
|
||||
"\x64\xaf\x38\x42\x67\x8e\x57\x3e"
|
||||
"\xbd\xeb\x2e\xe0\x26\xeb\xfe\xb4"
|
||||
"\x25\xcd\x36\x37\xc1\x81\xd1\x7f"
|
||||
"\x05\xf0\x21\xef\x9c\xe9\x2d\x23"
|
||||
"\x83\x00\x64\xd4\xad\x54\x6e\xe6"
|
||||
"\x9d\xfd\xf1\xd6\xdf\xd9\x1b\x15"
|
||||
"\xd7\x91\xba\x42\xca\xcb\xc5\xcf",
|
||||
.rlen = 16 + 32 + 16 + 16,
|
||||
.authlen = 32,
|
||||
},
|
||||
/* Payload with payload len as zero leads to descriptor error.
|
||||
*/
|
||||
#if 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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "iv0123456789abcd",
|
||||
.ilen = 16,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x03\x00\x00",
|
||||
.alen = 13,
|
||||
.result = "\x31\x41\x4e\xea\x70\xc2\xb3\xa7"
|
||||
"\x3e\xcb\x1a\xee\xa9\xe1\xfc\xc4"
|
||||
"\xfe\x63\xd4\x16\x45\x84\x36\x59"
|
||||
"\xb5\x81\xd7\x84\x5e\xb6\xd0\x18"
|
||||
"\x2c\x1b\x7a\x14\xc9\x3f\xe5\xc8"
|
||||
"\x0d\xec\xab\xcc\xcd\x97\x62\xa0"
|
||||
"\x26\xe8\x2b\xf9\x49\xdb\xf8\x55"
|
||||
"\x24\x59\xdd\x40\x89\xba\xed\x22",
|
||||
.rlen = 32 + 16 + 16,
|
||||
.authlen = 32,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
#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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "iv0123456789abcd",
|
||||
.input = "iv0123456789abcd"
|
||||
"285 bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext",
|
||||
.ilen = 285 + 16,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x01\x1d",
|
||||
.alen = 13,
|
||||
.result = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae"
|
||||
"\x79\x03\xd4\x14\x1c\x57\x86\x48"
|
||||
"\xec\x5e\x59\x21\x41\xff\xb9\x2f"
|
||||
"\x66\xe9\xc1\xc9\xe3\x01\x8c\x10"
|
||||
"\xb6\xde\x8f\xb1\xc0\x66\x93\xc5"
|
||||
"\xac\x10\xd6\x86\x35\x63\x2b\xc0"
|
||||
"\x7a\x40\xfd\x0e\x39\x0a\xf5\x18"
|
||||
"\x1a\xf7\x99\x3c\x45\xd8\xe4\x92"
|
||||
"\xd3\x39\x83\x58\x04\x8f\xe0\x95"
|
||||
"\x24\xee\x62\xc5\xdf\xf6\x4c\x25"
|
||||
"\x22\x0e\xf7\xe3\x33\x04\x88\x5b"
|
||||
"\x70\xf8\xf5\x39\x24\xa1\x58\xd2"
|
||||
"\xf9\x4c\xf9\x64\x0a\xcf\x9f\x36"
|
||||
"\x23\x43\xda\x44\xfc\x68\xd7\x23"
|
||||
"\x83\xc2\xb7\xc6\xd7\x7f\xd2\xec"
|
||||
"\xef\xd7\xfc\x6a\x64\xe9\x70\xdc"
|
||||
"\x53\x98\xfa\xf2\x41\x24\x87\xbc"
|
||||
"\x57\xc9\x1c\x38\xff\x4b\x95\x42"
|
||||
"\xb5\x2c\xfe\xd2\x34\xe2\xa7\x28"
|
||||
"\x61\x4a\x1d\xe0\x0f\x97\x62\x08"
|
||||
"\xa6\xa9\x5c\x89\x5e\x42\x60\x71"
|
||||
"\xda\xd9\xba\x95\x6f\x87\x9c\x00"
|
||||
"\x7e\x0c\x7a\x6f\xb4\x99\x7e\x0e"
|
||||
"\x6a\xe9\xab\x12\xda\x95\x25\x83"
|
||||
"\x8f\xa2\xc2\x91\xb5\x3f\xae\xc3"
|
||||
"\xf9\x03\xc9\x6d\xe7\xe7\x46\x61"
|
||||
"\xdc\xbc\xf1\x17\xcc\x93\x33\xa5"
|
||||
"\x06\x54\x45\x79\xcb\x1c\x67\x87"
|
||||
"\x87\x35\x9b\xc3\xfd\x3c\xcc\x43"
|
||||
"\xec\xac\xef\xfd\x3b\x35\xb3\xde"
|
||||
"\x7d\x82\x57\x49\xc5\xe8\x47\xbe"
|
||||
"\x70\xf2\xbf\x1c\x98\x1e\x3d\xa4"
|
||||
"\x25\xa2\x65\x6c\xca\x04\x9a\x1d"
|
||||
"\x01\x08\xa6\x36\xbe\x89\xd1\x4e"
|
||||
"\x87\x7f\xae\x70\x79\x0d\x42\x2d"
|
||||
"\xcc\x1b\x13\x34\xc5\x1d\xe7\x00"
|
||||
"\x7f\x65\x72\xa3\x66\xe0\x55\x4f"
|
||||
"\xf0\x81\x1a\xe0\x21\x4e\x00\xf4"
|
||||
"\x53\x62\x37\x35\x70\x38\x82\x81"
|
||||
"\x93\xac\x16\x00\x7a\xd8\xa1\x09"
|
||||
"\xf6\x2a\x54\x51\x75\xf5\x22\xdb",
|
||||
.rlen = 285 + 32 + 3 + 16,
|
||||
.authlen = 32,
|
||||
}
|
||||
};
|
||||
|
||||
static struct tls_testvec tls12_dec_tv_template[] = {
|
||||
{
|
||||
#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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae",
|
||||
.input = "\x6d\xc2\xeb\x76\xa1\x3b\xe2\x57"
|
||||
"\x64\xaf\x38\x42\x67\x8e\x57\x3e"
|
||||
"\xbd\xeb\x2e\xe0\x26\xeb\xfe\xb4"
|
||||
"\x25\xcd\x36\x37\xc1\x81\xd1\x7f"
|
||||
"\x05\xf0\x21\xef\x9c\xe9\x2d\x23"
|
||||
"\x83\x00\x64\xd4\xad\x54\x6e\xe6"
|
||||
"\x9d\xfd\xf1\xd6\xdf\xd9\x1b\x15"
|
||||
"\xd7\x91\xba\x42\xca\xcb\xc5\xcf",
|
||||
.ilen = 64,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x00\x40",
|
||||
.alen = 13,
|
||||
.result = "Single block msg",
|
||||
.rlen = 16,
|
||||
.authlen = 32,
|
||||
},
|
||||
/* Payload with payload len as zero leads to descriptor error.
|
||||
*/
|
||||
#if 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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "\x31\x41\x4e\xea\x70\xc2\xb3\xa7"
|
||||
"\x3e\xcb\x1a\xee\xa9\xe1\xfc\xc4",
|
||||
.input = "\xfe\x63\xd4\x16\x45\x84\x36\x59"
|
||||
"\xb5\x81\xd7\x84\x5e\xb6\xd0\x18"
|
||||
"\x2c\x1b\x7a\x14\xc9\x3f\xe5\xc8"
|
||||
"\x0d\xec\xab\xcc\xcd\x97\x62\xa0"
|
||||
"\x26\xe8\x2b\xf9\x49\xdb\xf8\x55"
|
||||
"\x24\x59\xdd\x40\x89\xba\xed\x22",
|
||||
.ilen = 32 + 16,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x03\x00\x30",
|
||||
.alen = 13,
|
||||
.result = "",
|
||||
.rlen = 0,
|
||||
.authlen = 32,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
#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 */
|
||||
"authenticationkeysizeis_32bytes_enckeyis16_bytes",
|
||||
.klen = 8 + 32 + 16,
|
||||
.iv = "\x4a\xd8\x67\x27\xec\x74\x48\x8e"
|
||||
"\x5a\xca\xba\x13\x9c\xcf\x02\xae",
|
||||
.input = "\x79\x03\xd4\x14\x1c\x57\x86\x48"
|
||||
"\xec\x5e\x59\x21\x41\xff\xb9\x2f"
|
||||
"\x66\xe9\xc1\xc9\xe3\x01\x8c\x10"
|
||||
"\xb6\xde\x8f\xb1\xc0\x66\x93\xc5"
|
||||
"\xac\x10\xd6\x86\x35\x63\x2b\xc0"
|
||||
"\x7a\x40\xfd\x0e\x39\x0a\xf5\x18"
|
||||
"\x1a\xf7\x99\x3c\x45\xd8\xe4\x92"
|
||||
"\xd3\x39\x83\x58\x04\x8f\xe0\x95"
|
||||
"\x24\xee\x62\xc5\xdf\xf6\x4c\x25"
|
||||
"\x22\x0e\xf7\xe3\x33\x04\x88\x5b"
|
||||
"\x70\xf8\xf5\x39\x24\xa1\x58\xd2"
|
||||
"\xf9\x4c\xf9\x64\x0a\xcf\x9f\x36"
|
||||
"\x23\x43\xda\x44\xfc\x68\xd7\x23"
|
||||
"\x83\xc2\xb7\xc6\xd7\x7f\xd2\xec"
|
||||
"\xef\xd7\xfc\x6a\x64\xe9\x70\xdc"
|
||||
"\x53\x98\xfa\xf2\x41\x24\x87\xbc"
|
||||
"\x57\xc9\x1c\x38\xff\x4b\x95\x42"
|
||||
"\xb5\x2c\xfe\xd2\x34\xe2\xa7\x28"
|
||||
"\x61\x4a\x1d\xe0\x0f\x97\x62\x08"
|
||||
"\xa6\xa9\x5c\x89\x5e\x42\x60\x71"
|
||||
"\xda\xd9\xba\x95\x6f\x87\x9c\x00"
|
||||
"\x7e\x0c\x7a\x6f\xb4\x99\x7e\x0e"
|
||||
"\x6a\xe9\xab\x12\xda\x95\x25\x83"
|
||||
"\x8f\xa2\xc2\x91\xb5\x3f\xae\xc3"
|
||||
"\xf9\x03\xc9\x6d\xe7\xe7\x46\x61"
|
||||
"\xdc\xbc\xf1\x17\xcc\x93\x33\xa5"
|
||||
"\x06\x54\x45\x79\xcb\x1c\x67\x87"
|
||||
"\x87\x35\x9b\xc3\xfd\x3c\xcc\x43"
|
||||
"\xec\xac\xef\xfd\x3b\x35\xb3\xde"
|
||||
"\x7d\x82\x57\x49\xc5\xe8\x47\xbe"
|
||||
"\x70\xf2\xbf\x1c\x98\x1e\x3d\xa4"
|
||||
"\x25\xa2\x65\x6c\xca\x04\x9a\x1d"
|
||||
"\x01\x08\xa6\x36\xbe\x89\xd1\x4e"
|
||||
"\x87\x7f\xae\x70\x79\x0d\x42\x2d"
|
||||
"\xcc\x1b\x13\x34\xc5\x1d\xe7\x00"
|
||||
"\x7f\x65\x72\xa3\x66\xe0\x55\x4f"
|
||||
"\xf0\x81\x1a\xe0\x21\x4e\x00\xf4"
|
||||
"\x53\x62\x37\x35\x70\x38\x82\x81"
|
||||
"\x93\xac\x16\x00\x7a\xd8\xa1\x09"
|
||||
"\xf6\x2a\x54\x51\x75\xf5\x22\xdb",
|
||||
.ilen = 320,
|
||||
.assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x00\x03\x01\x01\x40",
|
||||
.alen = 13,
|
||||
.result = "285 bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext285 bytes"
|
||||
" plaintext285 bytes plaintext285 bytes plaintext285"
|
||||
" bytes plaintext285 bytes plaintext",
|
||||
.rlen = 285,
|
||||
.authlen = 32,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user