.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Quick & dirty crypto testing module. |
---|
3 | 4 | * |
---|
.. | .. |
---|
14 | 15 | * Gabriele Paoloni <gabriele.paoloni@intel.com> |
---|
15 | 16 | * Tadeusz Struk (tadeusz.struk@intel.com) |
---|
16 | 17 | * Copyright (c) 2010, Intel Corporation. |
---|
17 | | - * |
---|
18 | | - * This program is free software; you can redistribute it and/or modify it |
---|
19 | | - * under the terms of the GNU General Public License as published by the Free |
---|
20 | | - * Software Foundation; either version 2 of the License, or (at your option) |
---|
21 | | - * any later version. |
---|
22 | | - * |
---|
23 | 18 | */ |
---|
24 | 19 | |
---|
25 | 20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
68 | 63 | static u32 mask; |
---|
69 | 64 | static int mode; |
---|
70 | 65 | static u32 num_mb = 8; |
---|
| 66 | +static unsigned int klen; |
---|
71 | 67 | static char *tvmem[TVMEMSIZE]; |
---|
72 | 68 | |
---|
73 | | -static char *check[] = { |
---|
| 69 | +static const char *check[] = { |
---|
74 | 70 | "des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256", "sm3", |
---|
75 | 71 | "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", |
---|
76 | 72 | "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", |
---|
77 | 73 | "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", |
---|
78 | 74 | "camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", |
---|
79 | | - "lzo", "cts", "zlib", "sha3-224", "sha3-256", "sha3-384", "sha3-512", |
---|
| 75 | + "lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384", |
---|
| 76 | + "sha3-512", "streebog256", "streebog512", |
---|
80 | 77 | NULL |
---|
81 | 78 | }; |
---|
82 | 79 | |
---|
83 | | -static u32 block_sizes[] = { 16, 64, 256, 1024, 8192, 0 }; |
---|
| 80 | +static u32 block_sizes[] = { 16, 64, 256, 1024, 1472, 8192, 0 }; |
---|
84 | 81 | static u32 aead_sizes[] = { 16, 64, 256, 512, 1024, 2048, 4096, 8192, 0 }; |
---|
85 | 82 | |
---|
86 | 83 | #define XBUFSIZE 8 |
---|
.. | .. |
---|
402 | 399 | ret = do_one_aead_op(cur->req, ret); |
---|
403 | 400 | |
---|
404 | 401 | if (ret) { |
---|
405 | | - pr_err("calculating auth failed failed (%d)\n", |
---|
| 402 | + pr_err("calculating auth failed (%d)\n", |
---|
406 | 403 | ret); |
---|
407 | 404 | break; |
---|
408 | 405 | } |
---|
.. | .. |
---|
652 | 649 | crypto_aead_encrypt(req)); |
---|
653 | 650 | |
---|
654 | 651 | if (ret) { |
---|
655 | | - pr_err("calculating auth failed failed (%d)\n", |
---|
| 652 | + pr_err("calculating auth failed (%d)\n", |
---|
656 | 653 | ret); |
---|
657 | 654 | break; |
---|
658 | 655 | } |
---|
.. | .. |
---|
868 | 865 | goto out; |
---|
869 | 866 | } |
---|
870 | 867 | |
---|
871 | | - if (speed[i].klen) |
---|
872 | | - crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen); |
---|
| 868 | + if (klen) |
---|
| 869 | + crypto_ahash_setkey(tfm, tvmem[0], klen); |
---|
873 | 870 | |
---|
874 | 871 | for (k = 0; k < num_mb; k++) |
---|
875 | 872 | ahash_request_set_crypt(data[k].req, data[k].sg, |
---|
.. | .. |
---|
1103 | 1100 | break; |
---|
1104 | 1101 | } |
---|
1105 | 1102 | |
---|
1106 | | - if (speed[i].klen) |
---|
1107 | | - crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen); |
---|
| 1103 | + if (klen) |
---|
| 1104 | + crypto_ahash_setkey(tfm, tvmem[0], klen); |
---|
1108 | 1105 | |
---|
1109 | 1106 | pr_info("test%3u " |
---|
1110 | 1107 | "(%5u byte blocks,%5u bytes per update,%4u updates): ", |
---|
.. | .. |
---|
1518 | 1515 | return; |
---|
1519 | 1516 | } |
---|
1520 | 1517 | |
---|
1521 | | - pr_info("\ntesting speed of async %s (%s) %s\n", algo, |
---|
1522 | | - get_driver_name(crypto_skcipher, tfm), e); |
---|
| 1518 | + pr_info("\ntesting speed of %s %s (%s) %s\n", async ? "async" : "sync", |
---|
| 1519 | + algo, get_driver_name(crypto_skcipher, tfm), e); |
---|
1523 | 1520 | |
---|
1524 | 1521 | req = skcipher_request_alloc(tfm, GFP_KERNEL); |
---|
1525 | 1522 | if (!req) { |
---|
.. | .. |
---|
1638 | 1635 | |
---|
1639 | 1636 | static void test_available(void) |
---|
1640 | 1637 | { |
---|
1641 | | - char **name = check; |
---|
| 1638 | + const char **name = check; |
---|
1642 | 1639 | |
---|
1643 | 1640 | while (*name) { |
---|
1644 | 1641 | printk("alg %s ", *name); |
---|
.. | .. |
---|
1736 | 1733 | ret += tcrypt_test("xts(aes)"); |
---|
1737 | 1734 | ret += tcrypt_test("ctr(aes)"); |
---|
1738 | 1735 | ret += tcrypt_test("rfc3686(ctr(aes))"); |
---|
| 1736 | + ret += tcrypt_test("ofb(aes)"); |
---|
1739 | 1737 | ret += tcrypt_test("cfb(aes)"); |
---|
1740 | 1738 | break; |
---|
1741 | 1739 | |
---|
.. | .. |
---|
1882 | 1880 | ret += tcrypt_test("ecb(seed)"); |
---|
1883 | 1881 | break; |
---|
1884 | 1882 | |
---|
1885 | | - case 44: |
---|
1886 | | - ret += tcrypt_test("zlib"); |
---|
1887 | | - break; |
---|
1888 | | - |
---|
1889 | 1883 | case 45: |
---|
1890 | 1884 | ret += tcrypt_test("rfc4309(ccm(aes))"); |
---|
1891 | 1885 | break; |
---|
.. | .. |
---|
1916 | 1910 | |
---|
1917 | 1911 | case 52: |
---|
1918 | 1912 | ret += tcrypt_test("sm3"); |
---|
| 1913 | + break; |
---|
| 1914 | + |
---|
| 1915 | + case 53: |
---|
| 1916 | + ret += tcrypt_test("streebog256"); |
---|
| 1917 | + break; |
---|
| 1918 | + |
---|
| 1919 | + case 54: |
---|
| 1920 | + ret += tcrypt_test("streebog512"); |
---|
1919 | 1921 | break; |
---|
1920 | 1922 | |
---|
1921 | 1923 | case 100: |
---|
.. | .. |
---|
1972 | 1974 | |
---|
1973 | 1975 | case 114: |
---|
1974 | 1976 | ret += tcrypt_test("hmac(sha3-512)"); |
---|
| 1977 | + break; |
---|
| 1978 | + |
---|
| 1979 | + case 115: |
---|
| 1980 | + ret += tcrypt_test("hmac(streebog256)"); |
---|
| 1981 | + break; |
---|
| 1982 | + |
---|
| 1983 | + case 116: |
---|
| 1984 | + ret += tcrypt_test("hmac(streebog512)"); |
---|
1975 | 1985 | break; |
---|
1976 | 1986 | |
---|
1977 | 1987 | case 150: |
---|
.. | .. |
---|
2037 | 2047 | break; |
---|
2038 | 2048 | case 191: |
---|
2039 | 2049 | ret += tcrypt_test("ecb(sm4)"); |
---|
| 2050 | + ret += tcrypt_test("cbc(sm4)"); |
---|
| 2051 | + ret += tcrypt_test("ctr(sm4)"); |
---|
2040 | 2052 | break; |
---|
2041 | 2053 | case 200: |
---|
2042 | 2054 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
---|
.. | .. |
---|
2290 | 2302 | num_mb); |
---|
2291 | 2303 | break; |
---|
2292 | 2304 | |
---|
| 2305 | + case 218: |
---|
| 2306 | + test_cipher_speed("ecb(sm4)", ENCRYPT, sec, NULL, 0, |
---|
| 2307 | + speed_template_16); |
---|
| 2308 | + test_cipher_speed("ecb(sm4)", DECRYPT, sec, NULL, 0, |
---|
| 2309 | + speed_template_16); |
---|
| 2310 | + test_cipher_speed("cbc(sm4)", ENCRYPT, sec, NULL, 0, |
---|
| 2311 | + speed_template_16); |
---|
| 2312 | + test_cipher_speed("cbc(sm4)", DECRYPT, sec, NULL, 0, |
---|
| 2313 | + speed_template_16); |
---|
| 2314 | + test_cipher_speed("ctr(sm4)", ENCRYPT, sec, NULL, 0, |
---|
| 2315 | + speed_template_16); |
---|
| 2316 | + test_cipher_speed("ctr(sm4)", DECRYPT, sec, NULL, 0, |
---|
| 2317 | + speed_template_16); |
---|
| 2318 | + break; |
---|
| 2319 | + |
---|
2293 | 2320 | case 219: |
---|
2294 | 2321 | test_cipher_speed("adiantum(xchacha12,aes)", ENCRYPT, sec, NULL, |
---|
2295 | 2322 | 0, speed_template_32); |
---|
.. | .. |
---|
2301 | 2328 | 0, speed_template_32); |
---|
2302 | 2329 | break; |
---|
2303 | 2330 | |
---|
| 2331 | + case 220: |
---|
| 2332 | + test_acipher_speed("essiv(cbc(aes),sha256)", |
---|
| 2333 | + ENCRYPT, sec, NULL, 0, |
---|
| 2334 | + speed_template_16_24_32); |
---|
| 2335 | + test_acipher_speed("essiv(cbc(aes),sha256)", |
---|
| 2336 | + DECRYPT, sec, NULL, 0, |
---|
| 2337 | + speed_template_16_24_32); |
---|
| 2338 | + break; |
---|
| 2339 | + |
---|
| 2340 | + case 221: |
---|
| 2341 | + test_aead_speed("aegis128", ENCRYPT, sec, |
---|
| 2342 | + NULL, 0, 16, 8, speed_template_16); |
---|
| 2343 | + test_aead_speed("aegis128", DECRYPT, sec, |
---|
| 2344 | + NULL, 0, 16, 8, speed_template_16); |
---|
| 2345 | + break; |
---|
| 2346 | + |
---|
2304 | 2347 | case 300: |
---|
2305 | 2348 | if (alg) { |
---|
2306 | 2349 | test_hash_speed(alg, sec, generic_hash_speed_template); |
---|
2307 | 2350 | break; |
---|
2308 | 2351 | } |
---|
2309 | | - /* fall through */ |
---|
| 2352 | + fallthrough; |
---|
2310 | 2353 | case 301: |
---|
2311 | 2354 | test_hash_speed("md4", sec, generic_hash_speed_template); |
---|
2312 | 2355 | if (mode > 300 && mode < 400) break; |
---|
2313 | | - /* fall through */ |
---|
| 2356 | + fallthrough; |
---|
2314 | 2357 | case 302: |
---|
2315 | 2358 | test_hash_speed("md5", sec, generic_hash_speed_template); |
---|
2316 | 2359 | if (mode > 300 && mode < 400) break; |
---|
2317 | | - /* fall through */ |
---|
| 2360 | + fallthrough; |
---|
2318 | 2361 | case 303: |
---|
2319 | 2362 | test_hash_speed("sha1", sec, generic_hash_speed_template); |
---|
2320 | 2363 | if (mode > 300 && mode < 400) break; |
---|
2321 | | - /* fall through */ |
---|
| 2364 | + fallthrough; |
---|
2322 | 2365 | case 304: |
---|
2323 | 2366 | test_hash_speed("sha256", sec, generic_hash_speed_template); |
---|
2324 | 2367 | if (mode > 300 && mode < 400) break; |
---|
2325 | | - /* fall through */ |
---|
| 2368 | + fallthrough; |
---|
2326 | 2369 | case 305: |
---|
2327 | 2370 | test_hash_speed("sha384", sec, generic_hash_speed_template); |
---|
2328 | 2371 | if (mode > 300 && mode < 400) break; |
---|
2329 | | - /* fall through */ |
---|
| 2372 | + fallthrough; |
---|
2330 | 2373 | case 306: |
---|
2331 | 2374 | test_hash_speed("sha512", sec, generic_hash_speed_template); |
---|
2332 | 2375 | if (mode > 300 && mode < 400) break; |
---|
2333 | | - /* fall through */ |
---|
| 2376 | + fallthrough; |
---|
2334 | 2377 | case 307: |
---|
2335 | 2378 | test_hash_speed("wp256", sec, generic_hash_speed_template); |
---|
2336 | 2379 | if (mode > 300 && mode < 400) break; |
---|
2337 | | - /* fall through */ |
---|
| 2380 | + fallthrough; |
---|
2338 | 2381 | case 308: |
---|
2339 | 2382 | test_hash_speed("wp384", sec, generic_hash_speed_template); |
---|
2340 | 2383 | if (mode > 300 && mode < 400) break; |
---|
2341 | | - /* fall through */ |
---|
| 2384 | + fallthrough; |
---|
2342 | 2385 | case 309: |
---|
2343 | 2386 | test_hash_speed("wp512", sec, generic_hash_speed_template); |
---|
2344 | 2387 | if (mode > 300 && mode < 400) break; |
---|
2345 | | - /* fall through */ |
---|
| 2388 | + fallthrough; |
---|
2346 | 2389 | case 310: |
---|
2347 | 2390 | test_hash_speed("tgr128", sec, generic_hash_speed_template); |
---|
2348 | 2391 | if (mode > 300 && mode < 400) break; |
---|
2349 | | - /* fall through */ |
---|
| 2392 | + fallthrough; |
---|
2350 | 2393 | case 311: |
---|
2351 | 2394 | test_hash_speed("tgr160", sec, generic_hash_speed_template); |
---|
2352 | 2395 | if (mode > 300 && mode < 400) break; |
---|
2353 | | - /* fall through */ |
---|
| 2396 | + fallthrough; |
---|
2354 | 2397 | case 312: |
---|
2355 | 2398 | test_hash_speed("tgr192", sec, generic_hash_speed_template); |
---|
2356 | 2399 | if (mode > 300 && mode < 400) break; |
---|
2357 | | - /* fall through */ |
---|
| 2400 | + fallthrough; |
---|
2358 | 2401 | case 313: |
---|
2359 | 2402 | test_hash_speed("sha224", sec, generic_hash_speed_template); |
---|
2360 | 2403 | if (mode > 300 && mode < 400) break; |
---|
2361 | | - /* fall through */ |
---|
| 2404 | + fallthrough; |
---|
2362 | 2405 | case 314: |
---|
2363 | 2406 | test_hash_speed("rmd128", sec, generic_hash_speed_template); |
---|
2364 | 2407 | if (mode > 300 && mode < 400) break; |
---|
2365 | | - /* fall through */ |
---|
| 2408 | + fallthrough; |
---|
2366 | 2409 | case 315: |
---|
2367 | 2410 | test_hash_speed("rmd160", sec, generic_hash_speed_template); |
---|
2368 | 2411 | if (mode > 300 && mode < 400) break; |
---|
2369 | | - /* fall through */ |
---|
| 2412 | + fallthrough; |
---|
2370 | 2413 | case 316: |
---|
2371 | 2414 | test_hash_speed("rmd256", sec, generic_hash_speed_template); |
---|
2372 | 2415 | if (mode > 300 && mode < 400) break; |
---|
2373 | | - /* fall through */ |
---|
| 2416 | + fallthrough; |
---|
2374 | 2417 | case 317: |
---|
2375 | 2418 | test_hash_speed("rmd320", sec, generic_hash_speed_template); |
---|
2376 | 2419 | if (mode > 300 && mode < 400) break; |
---|
2377 | | - /* fall through */ |
---|
| 2420 | + fallthrough; |
---|
2378 | 2421 | case 318: |
---|
2379 | | - test_hash_speed("ghash-generic", sec, hash_speed_template_16); |
---|
| 2422 | + klen = 16; |
---|
| 2423 | + test_hash_speed("ghash", sec, generic_hash_speed_template); |
---|
2380 | 2424 | if (mode > 300 && mode < 400) break; |
---|
2381 | | - /* fall through */ |
---|
| 2425 | + fallthrough; |
---|
2382 | 2426 | case 319: |
---|
2383 | 2427 | test_hash_speed("crc32c", sec, generic_hash_speed_template); |
---|
2384 | 2428 | if (mode > 300 && mode < 400) break; |
---|
2385 | | - /* fall through */ |
---|
| 2429 | + fallthrough; |
---|
2386 | 2430 | case 320: |
---|
2387 | 2431 | test_hash_speed("crct10dif", sec, generic_hash_speed_template); |
---|
2388 | 2432 | if (mode > 300 && mode < 400) break; |
---|
2389 | | - /* fall through */ |
---|
| 2433 | + fallthrough; |
---|
2390 | 2434 | case 321: |
---|
2391 | 2435 | test_hash_speed("poly1305", sec, poly1305_speed_template); |
---|
2392 | 2436 | if (mode > 300 && mode < 400) break; |
---|
2393 | | - /* fall through */ |
---|
| 2437 | + fallthrough; |
---|
2394 | 2438 | case 322: |
---|
2395 | 2439 | test_hash_speed("sha3-224", sec, generic_hash_speed_template); |
---|
2396 | 2440 | if (mode > 300 && mode < 400) break; |
---|
2397 | | - /* fall through */ |
---|
| 2441 | + fallthrough; |
---|
2398 | 2442 | case 323: |
---|
2399 | 2443 | test_hash_speed("sha3-256", sec, generic_hash_speed_template); |
---|
2400 | 2444 | if (mode > 300 && mode < 400) break; |
---|
2401 | | - /* fall through */ |
---|
| 2445 | + fallthrough; |
---|
2402 | 2446 | case 324: |
---|
2403 | 2447 | test_hash_speed("sha3-384", sec, generic_hash_speed_template); |
---|
2404 | 2448 | if (mode > 300 && mode < 400) break; |
---|
2405 | | - /* fall through */ |
---|
| 2449 | + fallthrough; |
---|
2406 | 2450 | case 325: |
---|
2407 | 2451 | test_hash_speed("sha3-512", sec, generic_hash_speed_template); |
---|
2408 | 2452 | if (mode > 300 && mode < 400) break; |
---|
2409 | | - /* fall through */ |
---|
| 2453 | + fallthrough; |
---|
2410 | 2454 | case 326: |
---|
2411 | 2455 | test_hash_speed("sm3", sec, generic_hash_speed_template); |
---|
2412 | 2456 | if (mode > 300 && mode < 400) break; |
---|
2413 | | - /* fall through */ |
---|
| 2457 | + fallthrough; |
---|
| 2458 | + case 327: |
---|
| 2459 | + test_hash_speed("streebog256", sec, |
---|
| 2460 | + generic_hash_speed_template); |
---|
| 2461 | + if (mode > 300 && mode < 400) break; |
---|
| 2462 | + fallthrough; |
---|
| 2463 | + case 328: |
---|
| 2464 | + test_hash_speed("streebog512", sec, |
---|
| 2465 | + generic_hash_speed_template); |
---|
| 2466 | + if (mode > 300 && mode < 400) break; |
---|
| 2467 | + fallthrough; |
---|
2414 | 2468 | case 399: |
---|
2415 | 2469 | break; |
---|
2416 | 2470 | |
---|
.. | .. |
---|
2419 | 2473 | test_ahash_speed(alg, sec, generic_hash_speed_template); |
---|
2420 | 2474 | break; |
---|
2421 | 2475 | } |
---|
2422 | | - /* fall through */ |
---|
| 2476 | + fallthrough; |
---|
2423 | 2477 | case 401: |
---|
2424 | 2478 | test_ahash_speed("md4", sec, generic_hash_speed_template); |
---|
2425 | 2479 | if (mode > 400 && mode < 500) break; |
---|
2426 | | - /* fall through */ |
---|
| 2480 | + fallthrough; |
---|
2427 | 2481 | case 402: |
---|
2428 | 2482 | test_ahash_speed("md5", sec, generic_hash_speed_template); |
---|
2429 | 2483 | if (mode > 400 && mode < 500) break; |
---|
2430 | | - /* fall through */ |
---|
| 2484 | + fallthrough; |
---|
2431 | 2485 | case 403: |
---|
2432 | 2486 | test_ahash_speed("sha1", sec, generic_hash_speed_template); |
---|
2433 | 2487 | if (mode > 400 && mode < 500) break; |
---|
2434 | | - /* fall through */ |
---|
| 2488 | + fallthrough; |
---|
2435 | 2489 | case 404: |
---|
2436 | 2490 | test_ahash_speed("sha256", sec, generic_hash_speed_template); |
---|
2437 | 2491 | if (mode > 400 && mode < 500) break; |
---|
2438 | | - /* fall through */ |
---|
| 2492 | + fallthrough; |
---|
2439 | 2493 | case 405: |
---|
2440 | 2494 | test_ahash_speed("sha384", sec, generic_hash_speed_template); |
---|
2441 | 2495 | if (mode > 400 && mode < 500) break; |
---|
2442 | | - /* fall through */ |
---|
| 2496 | + fallthrough; |
---|
2443 | 2497 | case 406: |
---|
2444 | 2498 | test_ahash_speed("sha512", sec, generic_hash_speed_template); |
---|
2445 | 2499 | if (mode > 400 && mode < 500) break; |
---|
2446 | | - /* fall through */ |
---|
| 2500 | + fallthrough; |
---|
2447 | 2501 | case 407: |
---|
2448 | 2502 | test_ahash_speed("wp256", sec, generic_hash_speed_template); |
---|
2449 | 2503 | if (mode > 400 && mode < 500) break; |
---|
2450 | | - /* fall through */ |
---|
| 2504 | + fallthrough; |
---|
2451 | 2505 | case 408: |
---|
2452 | 2506 | test_ahash_speed("wp384", sec, generic_hash_speed_template); |
---|
2453 | 2507 | if (mode > 400 && mode < 500) break; |
---|
2454 | | - /* fall through */ |
---|
| 2508 | + fallthrough; |
---|
2455 | 2509 | case 409: |
---|
2456 | 2510 | test_ahash_speed("wp512", sec, generic_hash_speed_template); |
---|
2457 | 2511 | if (mode > 400 && mode < 500) break; |
---|
2458 | | - /* fall through */ |
---|
| 2512 | + fallthrough; |
---|
2459 | 2513 | case 410: |
---|
2460 | 2514 | test_ahash_speed("tgr128", sec, generic_hash_speed_template); |
---|
2461 | 2515 | if (mode > 400 && mode < 500) break; |
---|
2462 | | - /* fall through */ |
---|
| 2516 | + fallthrough; |
---|
2463 | 2517 | case 411: |
---|
2464 | 2518 | test_ahash_speed("tgr160", sec, generic_hash_speed_template); |
---|
2465 | 2519 | if (mode > 400 && mode < 500) break; |
---|
2466 | | - /* fall through */ |
---|
| 2520 | + fallthrough; |
---|
2467 | 2521 | case 412: |
---|
2468 | 2522 | test_ahash_speed("tgr192", sec, generic_hash_speed_template); |
---|
2469 | 2523 | if (mode > 400 && mode < 500) break; |
---|
2470 | | - /* fall through */ |
---|
| 2524 | + fallthrough; |
---|
2471 | 2525 | case 413: |
---|
2472 | 2526 | test_ahash_speed("sha224", sec, generic_hash_speed_template); |
---|
2473 | 2527 | if (mode > 400 && mode < 500) break; |
---|
2474 | | - /* fall through */ |
---|
| 2528 | + fallthrough; |
---|
2475 | 2529 | case 414: |
---|
2476 | 2530 | test_ahash_speed("rmd128", sec, generic_hash_speed_template); |
---|
2477 | 2531 | if (mode > 400 && mode < 500) break; |
---|
2478 | | - /* fall through */ |
---|
| 2532 | + fallthrough; |
---|
2479 | 2533 | case 415: |
---|
2480 | 2534 | test_ahash_speed("rmd160", sec, generic_hash_speed_template); |
---|
2481 | 2535 | if (mode > 400 && mode < 500) break; |
---|
2482 | | - /* fall through */ |
---|
| 2536 | + fallthrough; |
---|
2483 | 2537 | case 416: |
---|
2484 | 2538 | test_ahash_speed("rmd256", sec, generic_hash_speed_template); |
---|
2485 | 2539 | if (mode > 400 && mode < 500) break; |
---|
2486 | | - /* fall through */ |
---|
| 2540 | + fallthrough; |
---|
2487 | 2541 | case 417: |
---|
2488 | 2542 | test_ahash_speed("rmd320", sec, generic_hash_speed_template); |
---|
2489 | 2543 | if (mode > 400 && mode < 500) break; |
---|
2490 | | - /* fall through */ |
---|
| 2544 | + fallthrough; |
---|
2491 | 2545 | case 418: |
---|
2492 | 2546 | test_ahash_speed("sha3-224", sec, generic_hash_speed_template); |
---|
2493 | 2547 | if (mode > 400 && mode < 500) break; |
---|
2494 | | - /* fall through */ |
---|
| 2548 | + fallthrough; |
---|
2495 | 2549 | case 419: |
---|
2496 | 2550 | test_ahash_speed("sha3-256", sec, generic_hash_speed_template); |
---|
2497 | 2551 | if (mode > 400 && mode < 500) break; |
---|
2498 | | - /* fall through */ |
---|
| 2552 | + fallthrough; |
---|
2499 | 2553 | case 420: |
---|
2500 | 2554 | test_ahash_speed("sha3-384", sec, generic_hash_speed_template); |
---|
2501 | 2555 | if (mode > 400 && mode < 500) break; |
---|
2502 | | - /* fall through */ |
---|
| 2556 | + fallthrough; |
---|
2503 | 2557 | case 421: |
---|
2504 | 2558 | test_ahash_speed("sha3-512", sec, generic_hash_speed_template); |
---|
2505 | 2559 | if (mode > 400 && mode < 500) break; |
---|
2506 | | - /* fall through */ |
---|
| 2560 | + fallthrough; |
---|
2507 | 2561 | case 422: |
---|
2508 | 2562 | test_mb_ahash_speed("sha1", sec, generic_hash_speed_template, |
---|
2509 | 2563 | num_mb); |
---|
2510 | 2564 | if (mode > 400 && mode < 500) break; |
---|
2511 | | - /* fall through */ |
---|
| 2565 | + fallthrough; |
---|
2512 | 2566 | case 423: |
---|
2513 | 2567 | test_mb_ahash_speed("sha256", sec, generic_hash_speed_template, |
---|
2514 | 2568 | num_mb); |
---|
2515 | 2569 | if (mode > 400 && mode < 500) break; |
---|
2516 | | - /* fall through */ |
---|
| 2570 | + fallthrough; |
---|
2517 | 2571 | case 424: |
---|
2518 | 2572 | test_mb_ahash_speed("sha512", sec, generic_hash_speed_template, |
---|
2519 | 2573 | num_mb); |
---|
2520 | 2574 | if (mode > 400 && mode < 500) break; |
---|
2521 | | - /* fall through */ |
---|
| 2575 | + fallthrough; |
---|
2522 | 2576 | case 425: |
---|
2523 | 2577 | test_mb_ahash_speed("sm3", sec, generic_hash_speed_template, |
---|
2524 | 2578 | num_mb); |
---|
2525 | 2579 | if (mode > 400 && mode < 500) break; |
---|
2526 | | - /* fall through */ |
---|
| 2580 | + fallthrough; |
---|
| 2581 | + case 426: |
---|
| 2582 | + test_mb_ahash_speed("streebog256", sec, |
---|
| 2583 | + generic_hash_speed_template, num_mb); |
---|
| 2584 | + if (mode > 400 && mode < 500) break; |
---|
| 2585 | + fallthrough; |
---|
| 2586 | + case 427: |
---|
| 2587 | + test_mb_ahash_speed("streebog512", sec, |
---|
| 2588 | + generic_hash_speed_template, num_mb); |
---|
| 2589 | + if (mode > 400 && mode < 500) break; |
---|
| 2590 | + fallthrough; |
---|
2527 | 2591 | case 499: |
---|
2528 | 2592 | break; |
---|
2529 | 2593 | |
---|
.. | .. |
---|
3002 | 3066 | */ |
---|
3003 | 3067 | static void __exit tcrypt_mod_fini(void) { } |
---|
3004 | 3068 | |
---|
3005 | | -module_init(tcrypt_mod_init); |
---|
| 3069 | +subsys_initcall(tcrypt_mod_init); |
---|
3006 | 3070 | module_exit(tcrypt_mod_fini); |
---|
3007 | 3071 | |
---|
3008 | 3072 | module_param(alg, charp, 0); |
---|
.. | .. |
---|
3014 | 3078 | "(defaults to zero which uses CPU cycles instead)"); |
---|
3015 | 3079 | module_param(num_mb, uint, 0000); |
---|
3016 | 3080 | MODULE_PARM_DESC(num_mb, "Number of concurrent requests to be used in mb speed tests (defaults to 8)"); |
---|
| 3081 | +module_param(klen, uint, 0); |
---|
| 3082 | +MODULE_PARM_DESC(klen, "Key length (defaults to 0)"); |
---|
3017 | 3083 | |
---|
3018 | 3084 | MODULE_LICENSE("GPL"); |
---|
3019 | 3085 | MODULE_DESCRIPTION("Quick & dirty crypto testing module"); |
---|