]> Git Repo - linux.git/commitdiff
crypto: tcrypt - add skcipher speed for given alg
authorSergey Portnoy <[email protected]>
Mon, 17 Jun 2024 16:08:29 +0000 (17:08 +0100)
committerHerbert Xu <[email protected]>
Fri, 28 Jun 2024 01:35:46 +0000 (11:35 +1000)
Allow to run skcipher speed for given algorithm.
Case 600 is modified to cover ENCRYPT and DECRYPT
directions.

Example:
   modprobe tcrypt mode=600 alg="qat_aes_xts" klen=32

If succeed, the performance numbers will be printed in dmesg:
   testing speed of multibuffer qat_aes_xts (qat_aes_xts) encryption
   test 0 (256 bit key, 16 byte blocks): 1 operation in 14596 cycles (16 bytes)
   ...
   test 6 (256 bit key, 4096 byte blocks): 1 operation in 8053 cycles (4096 bytes)

Signed-off-by: Sergey Portnoy <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
crypto/tcrypt.c

index 8aea416f64808981dcf72f9427c23848b4836852..e9e7dceb606e1e2641734dd35d1b3f8119d1d8ff 100644 (file)
@@ -2613,6 +2613,15 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
                break;
 
        case 600:
+               if (alg) {
+                       u8 speed_template[2] = {klen, 0};
+                       test_mb_skcipher_speed(alg, ENCRYPT, sec, NULL, 0,
+                                              speed_template, num_mb);
+                       test_mb_skcipher_speed(alg, DECRYPT, sec, NULL, 0,
+                                              speed_template, num_mb);
+                       break;
+               }
+
                test_mb_skcipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
                                       speed_template_16_24_32, num_mb);
                test_mb_skcipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
This page took 0.057252 seconds and 4 git commands to generate.