diff options
| author | raveendra padasalagi <raveendra.padasalagi@broadcom.com> | 2016-06-17 01:00:36 -0400 | 
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-06-20 07:25:02 -0400 | 
| commit | 79cc6ab8947bd238b64afddc56ed84ee65f012ef (patch) | |
| tree | 3b361a923dee4a3b92043f78295f63f80fb2bc4f /crypto/tcrypt.c | |
| parent | 53964b9ee63b7075931b8df85307c449da564b50 (diff) | |
crypto: sha3 - Add SHA-3 Test's in tcrypt
Added support for SHA-3 algorithm test's
in tcrypt module and related test vectors.
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
| -rw-r--r-- | crypto/tcrypt.c | 53 | 
1 files changed, 52 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 579dce071463..4675459e82da 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c  | |||
| @@ -72,7 +72,8 @@ static char *check[] = { | |||
| 72 | "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", | 72 | "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", | 
| 73 | "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", | 73 | "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", | 
| 74 | "camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", | 74 | "camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", | 
| 75 | "lzo", "cts", "zlib", NULL | 75 | "lzo", "cts", "zlib", "sha3-224", "sha3-256", "sha3-384", "sha3-512", | 
| 76 | NULL | ||
| 76 | }; | 77 | }; | 
| 77 | 78 | ||
| 78 | struct tcrypt_result { | 79 | struct tcrypt_result { | 
| @@ -1284,6 +1285,22 @@ static int do_test(const char *alg, u32 type, u32 mask, int m) | |||
| 1284 | ret += tcrypt_test("crct10dif"); | 1285 | ret += tcrypt_test("crct10dif"); | 
| 1285 | break; | 1286 | break; | 
| 1286 | 1287 | ||
| 1288 | case 48: | ||
| 1289 | ret += tcrypt_test("sha3-224"); | ||
| 1290 | break; | ||
| 1291 | |||
| 1292 | case 49: | ||
| 1293 | ret += tcrypt_test("sha3-256"); | ||
| 1294 | break; | ||
| 1295 | |||
| 1296 | case 50: | ||
| 1297 | ret += tcrypt_test("sha3-384"); | ||
| 1298 | break; | ||
| 1299 | |||
| 1300 | case 51: | ||
| 1301 | ret += tcrypt_test("sha3-512"); | ||
| 1302 | break; | ||
| 1303 | |||
| 1287 | case 100: | 1304 | case 100: | 
| 1288 | ret += tcrypt_test("hmac(md5)"); | 1305 | ret += tcrypt_test("hmac(md5)"); | 
| 1289 | break; | 1306 | break; | 
| @@ -1691,6 +1708,22 @@ static int do_test(const char *alg, u32 type, u32 mask, int m) | |||
| 1691 | test_hash_speed("poly1305", sec, poly1305_speed_template); | 1708 | test_hash_speed("poly1305", sec, poly1305_speed_template); | 
| 1692 | if (mode > 300 && mode < 400) break; | 1709 | if (mode > 300 && mode < 400) break; | 
| 1693 | 1710 | ||
| 1711 | case 322: | ||
| 1712 | test_hash_speed("sha3-224", sec, generic_hash_speed_template); | ||
| 1713 | if (mode > 300 && mode < 400) break; | ||
| 1714 | |||
| 1715 | case 323: | ||
| 1716 | test_hash_speed("sha3-256", sec, generic_hash_speed_template); | ||
| 1717 | if (mode > 300 && mode < 400) break; | ||
| 1718 | |||
| 1719 | case 324: | ||
| 1720 | test_hash_speed("sha3-384", sec, generic_hash_speed_template); | ||
| 1721 | if (mode > 300 && mode < 400) break; | ||
| 1722 | |||
| 1723 | case 325: | ||
| 1724 | test_hash_speed("sha3-512", sec, generic_hash_speed_template); | ||
| 1725 | if (mode > 300 && mode < 400) break; | ||
| 1726 | |||
| 1694 | case 399: | 1727 | case 399: | 
| 1695 | break; | 1728 | break; | 
| 1696 | 1729 | ||
| @@ -1770,6 +1803,24 @@ static int do_test(const char *alg, u32 type, u32 mask, int m) | |||
| 1770 | test_ahash_speed("rmd320", sec, generic_hash_speed_template); | 1803 | test_ahash_speed("rmd320", sec, generic_hash_speed_template); | 
| 1771 | if (mode > 400 && mode < 500) break; | 1804 | if (mode > 400 && mode < 500) break; | 
| 1772 | 1805 | ||
| 1806 | case 418: | ||
| 1807 | test_ahash_speed("sha3-224", sec, generic_hash_speed_template); | ||
| 1808 | if (mode > 400 && mode < 500) break; | ||
| 1809 | |||
| 1810 | case 419: | ||
| 1811 | test_ahash_speed("sha3-256", sec, generic_hash_speed_template); | ||
| 1812 | if (mode > 400 && mode < 500) break; | ||
| 1813 | |||
| 1814 | case 420: | ||
| 1815 | test_ahash_speed("sha3-384", sec, generic_hash_speed_template); | ||
| 1816 | if (mode > 400 && mode < 500) break; | ||
| 1817 | |||
| 1818 | |||
| 1819 | case 421: | ||
| 1820 | test_ahash_speed("sha3-512", sec, generic_hash_speed_template); | ||
| 1821 | if (mode > 400 && mode < 500) break; | ||
| 1822 | |||
| 1823 | |||
| 1773 | case 499: | 1824 | case 499: | 
| 1774 | break; | 1825 | break; | 
| 1775 | 1826 | ||
