crypto: tcrypt - enable tests for xxhash and blake2
authorArd Biesheuvel <ardb@kernel.org>
Thu, 20 May 2021 10:40:00 +0000 (12:40 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 May 2021 07:11:45 +0000 (15:11 +0800)
Fill some of the recently freed up slots in tcrypt with xxhash64 and
blake2b/blake2s, so we can easily benchmark their kernel implementations
from user space.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/tcrypt.c

index 6b7c158dc5087b6325896a0d5eac838296d99ab1..f8d06da78e4f3a9161043d7e8d767caa35075a16 100644 (file)
@@ -1847,10 +1847,22 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
                ret += tcrypt_test("cts(cbc(aes))");
                break;
 
+        case 39:
+               ret += tcrypt_test("xxhash64");
+               break;
+
         case 40:
                ret += tcrypt_test("rmd160");
                break;
 
+       case 41:
+               ret += tcrypt_test("blake2s-256");
+               break;
+
+       case 42:
+               ret += tcrypt_test("blake2b-512");
+               break;
+
        case 43:
                ret += tcrypt_test("ecb(seed)");
                break;
@@ -2356,10 +2368,22 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
                test_hash_speed("sha224", sec, generic_hash_speed_template);
                if (mode > 300 && mode < 400) break;
                fallthrough;
+       case 314:
+               test_hash_speed("xxhash64", sec, generic_hash_speed_template);
+               if (mode > 300 && mode < 400) break;
+               fallthrough;
        case 315:
                test_hash_speed("rmd160", sec, generic_hash_speed_template);
                if (mode > 300 && mode < 400) break;
                fallthrough;
+       case 316:
+               test_hash_speed("blake2s-256", sec, generic_hash_speed_template);
+               if (mode > 300 && mode < 400) break;
+               fallthrough;
+       case 317:
+               test_hash_speed("blake2b-512", sec, generic_hash_speed_template);
+               if (mode > 300 && mode < 400) break;
+               fallthrough;
        case 318:
                klen = 16;
                test_hash_speed("ghash", sec, generic_hash_speed_template);
@@ -2456,10 +2480,22 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
                test_ahash_speed("sha224", sec, generic_hash_speed_template);
                if (mode > 400 && mode < 500) break;
                fallthrough;
+       case 414:
+               test_ahash_speed("xxhash64", sec, generic_hash_speed_template);
+               if (mode > 400 && mode < 500) break;
+               fallthrough;
        case 415:
                test_ahash_speed("rmd160", sec, generic_hash_speed_template);
                if (mode > 400 && mode < 500) break;
                fallthrough;
+       case 416:
+               test_ahash_speed("blake2s-256", sec, generic_hash_speed_template);
+               if (mode > 400 && mode < 500) break;
+               fallthrough;
+       case 417:
+               test_ahash_speed("blake2b-512", sec, generic_hash_speed_template);
+               if (mode > 400 && mode < 500) break;
+               fallthrough;
        case 418:
                test_ahash_speed("sha3-224", sec, generic_hash_speed_template);
                if (mode > 400 && mode < 500) break;