diff options
| author | Gilad Ben-Yossef <gilad@benyossef.com> | 2018-09-20 09:18:38 -0400 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-09-28 00:46:26 -0400 |
| commit | 95ba597367ddc26c1062c7ee9697c9aee53d04d0 (patch) | |
| tree | 743244506ea01e21e1397ce2ebdb6eafa919f0f0 /crypto/tcrypt.c | |
| parent | ce1294d981c1467c13b2b698913f35859592308b (diff) | |
crypto: testmgr - update sm4 test vectors
Add additional test vectors from "The SM4 Blockcipher Algorithm And Its
Modes Of Operations" draft-ribose-cfrg-sm4-10 and register cipher speed
tests for sm4.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
| -rw-r--r-- | crypto/tcrypt.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 4385abe1f547..9430744b6f8e 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
| @@ -2031,6 +2031,8 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) | |||
| 2031 | break; | 2031 | break; |
| 2032 | case 191: | 2032 | case 191: |
| 2033 | ret += tcrypt_test("ecb(sm4)"); | 2033 | ret += tcrypt_test("ecb(sm4)"); |
| 2034 | ret += tcrypt_test("cbc(sm4)"); | ||
| 2035 | ret += tcrypt_test("ctr(sm4)"); | ||
| 2034 | break; | 2036 | break; |
| 2035 | case 200: | 2037 | case 200: |
| 2036 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, | 2038 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
| @@ -2280,6 +2282,20 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) | |||
| 2280 | num_mb); | 2282 | num_mb); |
| 2281 | break; | 2283 | break; |
| 2282 | 2284 | ||
| 2285 | case 218: | ||
| 2286 | test_cipher_speed("ecb(sm4)", ENCRYPT, sec, NULL, 0, | ||
| 2287 | speed_template_16); | ||
| 2288 | test_cipher_speed("ecb(sm4)", DECRYPT, sec, NULL, 0, | ||
| 2289 | speed_template_16); | ||
| 2290 | test_cipher_speed("cbc(sm4)", ENCRYPT, sec, NULL, 0, | ||
| 2291 | speed_template_16); | ||
| 2292 | test_cipher_speed("cbc(sm4)", DECRYPT, sec, NULL, 0, | ||
| 2293 | speed_template_16); | ||
| 2294 | test_cipher_speed("ctr(sm4)", ENCRYPT, sec, NULL, 0, | ||
| 2295 | speed_template_16); | ||
| 2296 | test_cipher_speed("ctr(sm4)", DECRYPT, sec, NULL, 0, | ||
| 2297 | speed_template_16); | ||
| 2298 | break; | ||
| 2283 | case 300: | 2299 | case 300: |
| 2284 | if (alg) { | 2300 | if (alg) { |
| 2285 | test_hash_speed(alg, sec, generic_hash_speed_template); | 2301 | test_hash_speed(alg, sec, generic_hash_speed_template); |
