crypto: Add ghash algorithm test before provide to users
Subsystems (2)
PATCH 1/1 crypto: Add ghash algorithm test before provide to users
Add ghash algorithm test before provide it to users
Signed-off-by Youquan, Song <[email protected]>
---
crypto/testmgr.c +9 -0
@@ -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 = {
crypto/testmgr.h +17 -0
@@ -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).
Herbert Xu
maintainerQuoted 3 lines · Youquan,Song
Add ghash algorithm test before provide it to users
Signed-off-by Youquan, Song <[email protected]>
Patch applied.
Quoted 18 lines
crypto/testmgr.h +10
-0@@ -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 ,
crypto/testmgr.h static struct hash_testvec tgr128_tv_template[] = { · line 1025
Quoted 10 lines
crypto/testmgr.h +7
-0+ .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,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 10 lines
crypto/testmgr.h static struct hash_testvec tgr128_tv_template[] = { · line 1025
Quoted 6 lines
crypto/testmgr.h +3
-0+ +/* +* 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