public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]crypto: Add ghash algorithm test before provide to users
@ 2009-11-19  0:42 Youquan,Song
  2009-11-23 12:23 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Youquan,Song @ 2009-11-19  0:42 UTC (permalink / raw)
  To: herbert; +Cc: linux-kernel, ying.huang, kent.liu, youquan.song

Add ghash algorithm test before provide it to users

Signed-off-by: Youquan, Song <youquan.song@intel.com>
---

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 1f2357b..7620bfc 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1943,6 +1943,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,
 		.suite = {
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 9963b18..fea00cd 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -1003,6 +1003,23 @@ 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
 /*
  * HMAC-MD5 test vectors from RFC2202
  * (These need to be fixed to not use strlen).

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH]crypto: Add ghash algorithm test before provide to users
  2009-11-19  0:42 [PATCH]crypto: Add ghash algorithm test before provide to users Youquan,Song
@ 2009-11-23 12:23 ` Herbert Xu
  2009-11-24 15:16   ` Youquan,Song
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2009-11-23 12:23 UTC (permalink / raw)
  To: Youquan,Song; +Cc: linux-kernel, ying.huang, kent.liu, youquan.song

On Wed, Nov 18, 2009 at 07:42:46PM -0500, Youquan,Song wrote:
> Add ghash algorithm test before provide it to users
> 
> Signed-off-by: Youquan, Song <youquan.song@intel.com>

Patch applied.

> diff --git a/crypto/testmgr.h b/crypto/testmgr.h
> index 9963b18..fea00cd 100644
> --- a/crypto/testmgr.h
> +++ b/crypto/testmgr.h
> @@ -1003,6 +1003,23 @@ 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
>  /*
>   * HMAC-MD5 test vectors from RFC2202
>   * (These need to be fixed to not use strlen).

This adds two bogus lines.  I've removed them for you but please
be more careful next time.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]crypto: Add ghash algorithm test before provide to users
  2009-11-23 12:23 ` Herbert Xu
@ 2009-11-24 15:16   ` Youquan,Song
  0 siblings, 0 replies; 3+ messages in thread
From: Youquan,Song @ 2009-11-24 15:16 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Youquan,Song, linux-kernel, ying.huang, kent.liu, youquan.song

> > +
> > +/*
> > + * HMAC-MD5 test vectors from RFC2202
> >  /*
> >   * HMAC-MD5 test vectors from RFC2202
> >   * (These need to be fixed to not use strlen).
> 
> This adds two bogus lines.  I've removed them for you but please
> be more careful next time.
> 
Sure. Thanks a lot! 

-Youquan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-24  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19  0:42 [PATCH]crypto: Add ghash algorithm test before provide to users Youquan,Song
2009-11-23 12:23 ` Herbert Xu
2009-11-24 15:16   ` Youquan,Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox