]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
crypto: testmgr - Add ghash algorithm test before provide to users
authorYouquan, Song <youquan.song@intel.com>
Mon, 23 Nov 2009 12:23:04 +0000 (20:23 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 23 Nov 2009 12:23:04 +0000 (20:23 +0800)
Add ghash algorithm test before provide it to users

Signed-off-by: Youquan, Song <youquan.song@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c
crypto/testmgr.h

index 1f2357bc6424dc7b16c0c11c165e53f047f3da28..7620bfce92f22ff2cedc382c1f5137788bcdd33d 100644 (file)
@@ -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,
index 9963b18983abb3589657ec8974a3fa25c7bb4e82..fb765173d41ceeff27cddbab80c0b6741c825f07 100644 (file)
@@ -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).