Commit 507069c91e36786b3fa5d9515c35ed6bb0ce469b
Committed by
Herbert Xu
1 parent
68ee87164e
Exists in
master
and in
4 other branches
crypto: testmgr - Add ghash algorithm test before provide to users
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>
Showing 2 changed files with 24 additions and 0 deletions Side-by-side Diff
crypto/testmgr.c
... | ... | @@ -1943,6 +1943,15 @@ |
1943 | 1943 | } |
1944 | 1944 | } |
1945 | 1945 | }, { |
1946 | + .alg = "ghash", | |
1947 | + .test = alg_test_hash, | |
1948 | + .suite = { | |
1949 | + .hash = { | |
1950 | + .vecs = ghash_tv_template, | |
1951 | + .count = GHASH_TEST_VECTORS | |
1952 | + } | |
1953 | + } | |
1954 | + }, { | |
1946 | 1955 | .alg = "hmac(md5)", |
1947 | 1956 | .test = alg_test_hash, |
1948 | 1957 | .suite = { |
crypto/testmgr.h
... | ... | @@ -1003,6 +1003,21 @@ |
1003 | 1003 | }, |
1004 | 1004 | }; |
1005 | 1005 | |
1006 | +#define GHASH_TEST_VECTORS 1 | |
1007 | + | |
1008 | +static struct hash_testvec ghash_tv_template[] = | |
1009 | +{ | |
1010 | + { | |
1011 | + | |
1012 | + .key = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61", | |
1013 | + .ksize = 16, | |
1014 | + .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6", | |
1015 | + .psize = 16, | |
1016 | + .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6" | |
1017 | + "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60", | |
1018 | + }, | |
1019 | +}; | |
1020 | + | |
1006 | 1021 | /* |
1007 | 1022 | * HMAC-MD5 test vectors from RFC2202 |
1008 | 1023 | * (These need to be fixed to not use strlen). |