From b3501dd73876dfe47038b320acf4d83d5dc11936 Mon Sep 17 00:00:00 2001 From: "Youquan, Song" Date: Mon, 23 Nov 2009 20:23:04 +0800 Subject: [PATCH] --- yaml --- r: 173116 b: refs/heads/master c: 507069c91e36786b3fa5d9515c35ed6bb0ce469b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/crypto/testmgr.c | 9 +++++++++ trunk/crypto/testmgr.h | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index dd7782e331cc..2ec88dc59d2b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 68ee87164e73f68cf09070043c97e7f61e6966d4 +refs/heads/master: 507069c91e36786b3fa5d9515c35ed6bb0ce469b diff --git a/trunk/crypto/testmgr.c b/trunk/crypto/testmgr.c index 1f2357bc6424..7620bfce92f2 100644 --- a/trunk/crypto/testmgr.c +++ b/trunk/crypto/testmgr.c @@ -1942,6 +1942,15 @@ static const struct alg_test_desc alg_test_descs[] = { } } } + }, { + .alg = "ghash", + .test = alg_test_hash, + .suite = { + .hash = { + .vecs = ghash_tv_template, + .count = GHASH_TEST_VECTORS + } + } }, { .alg = "hmac(md5)", .test = alg_test_hash, diff --git a/trunk/crypto/testmgr.h b/trunk/crypto/testmgr.h index 9963b18983ab..fb765173d41c 100644 --- a/trunk/crypto/testmgr.h +++ b/trunk/crypto/testmgr.h @@ -1003,6 +1003,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).