| .. | .. |
|---|
| 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): ", |
|---|
| .. | .. |
|---|
| 1284 | 1281 | testmgr_free_buf(data[i].xbuf); |
|---|
| 1285 | 1282 | goto out_free_tfm; |
|---|
| 1286 | 1283 | } |
|---|
| 1287 | | - |
|---|
| 1288 | | - |
|---|
| 1289 | | - for (i = 0; i < num_mb; ++i) |
|---|
| 1290 | | - if (testmgr_alloc_buf(data[i].xbuf)) { |
|---|
| 1291 | | - while (i--) |
|---|
| 1292 | | - testmgr_free_buf(data[i].xbuf); |
|---|
| 1293 | | - goto out_free_tfm; |
|---|
| 1294 | | - } |
|---|
| 1295 | | - |
|---|
| 1296 | 1284 | |
|---|
| 1297 | 1285 | for (i = 0; i < num_mb; ++i) { |
|---|
| 1298 | 1286 | data[i].req = skcipher_request_alloc(tfm, GFP_KERNEL); |
|---|
| .. | .. |
|---|
| 1518 | 1506 | return; |
|---|
| 1519 | 1507 | } |
|---|
| 1520 | 1508 | |
|---|
| 1521 | | - pr_info("\ntesting speed of async %s (%s) %s\n", algo, |
|---|
| 1522 | | - get_driver_name(crypto_skcipher, tfm), e); |
|---|
| 1509 | + pr_info("\ntesting speed of %s %s (%s) %s\n", async ? "async" : "sync", |
|---|
| 1510 | + algo, get_driver_name(crypto_skcipher, tfm), e); |
|---|
| 1523 | 1511 | |
|---|
| 1524 | 1512 | req = skcipher_request_alloc(tfm, GFP_KERNEL); |
|---|
| 1525 | 1513 | if (!req) { |
|---|
| .. | .. |
|---|
| 1638 | 1626 | |
|---|
| 1639 | 1627 | static void test_available(void) |
|---|
| 1640 | 1628 | { |
|---|
| 1641 | | - char **name = check; |
|---|
| 1629 | + const char **name = check; |
|---|
| 1642 | 1630 | |
|---|
| 1643 | 1631 | while (*name) { |
|---|
| 1644 | 1632 | printk("alg %s ", *name); |
|---|
| .. | .. |
|---|
| 1736 | 1724 | ret += tcrypt_test("xts(aes)"); |
|---|
| 1737 | 1725 | ret += tcrypt_test("ctr(aes)"); |
|---|
| 1738 | 1726 | ret += tcrypt_test("rfc3686(ctr(aes))"); |
|---|
| 1727 | + ret += tcrypt_test("ofb(aes)"); |
|---|
| 1739 | 1728 | ret += tcrypt_test("cfb(aes)"); |
|---|
| 1740 | 1729 | break; |
|---|
| 1741 | 1730 | |
|---|
| .. | .. |
|---|
| 1882 | 1871 | ret += tcrypt_test("ecb(seed)"); |
|---|
| 1883 | 1872 | break; |
|---|
| 1884 | 1873 | |
|---|
| 1885 | | - case 44: |
|---|
| 1886 | | - ret += tcrypt_test("zlib"); |
|---|
| 1887 | | - break; |
|---|
| 1888 | | - |
|---|
| 1889 | 1874 | case 45: |
|---|
| 1890 | 1875 | ret += tcrypt_test("rfc4309(ccm(aes))"); |
|---|
| 1891 | 1876 | break; |
|---|
| .. | .. |
|---|
| 1916 | 1901 | |
|---|
| 1917 | 1902 | case 52: |
|---|
| 1918 | 1903 | ret += tcrypt_test("sm3"); |
|---|
| 1904 | + break; |
|---|
| 1905 | + |
|---|
| 1906 | + case 53: |
|---|
| 1907 | + ret += tcrypt_test("streebog256"); |
|---|
| 1908 | + break; |
|---|
| 1909 | + |
|---|
| 1910 | + case 54: |
|---|
| 1911 | + ret += tcrypt_test("streebog512"); |
|---|
| 1919 | 1912 | break; |
|---|
| 1920 | 1913 | |
|---|
| 1921 | 1914 | case 100: |
|---|
| .. | .. |
|---|
| 1972 | 1965 | |
|---|
| 1973 | 1966 | case 114: |
|---|
| 1974 | 1967 | ret += tcrypt_test("hmac(sha3-512)"); |
|---|
| 1968 | + break; |
|---|
| 1969 | + |
|---|
| 1970 | + case 115: |
|---|
| 1971 | + ret += tcrypt_test("hmac(streebog256)"); |
|---|
| 1972 | + break; |
|---|
| 1973 | + |
|---|
| 1974 | + case 116: |
|---|
| 1975 | + ret += tcrypt_test("hmac(streebog512)"); |
|---|
| 1975 | 1976 | break; |
|---|
| 1976 | 1977 | |
|---|
| 1977 | 1978 | case 150: |
|---|
| .. | .. |
|---|
| 2037 | 2038 | break; |
|---|
| 2038 | 2039 | case 191: |
|---|
| 2039 | 2040 | ret += tcrypt_test("ecb(sm4)"); |
|---|
| 2041 | + ret += tcrypt_test("cbc(sm4)"); |
|---|
| 2042 | + ret += tcrypt_test("ctr(sm4)"); |
|---|
| 2040 | 2043 | break; |
|---|
| 2041 | 2044 | case 200: |
|---|
| 2042 | 2045 | test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
|---|
| .. | .. |
|---|
| 2290 | 2293 | num_mb); |
|---|
| 2291 | 2294 | break; |
|---|
| 2292 | 2295 | |
|---|
| 2296 | + case 218: |
|---|
| 2297 | + test_cipher_speed("ecb(sm4)", ENCRYPT, sec, NULL, 0, |
|---|
| 2298 | + speed_template_16); |
|---|
| 2299 | + test_cipher_speed("ecb(sm4)", DECRYPT, sec, NULL, 0, |
|---|
| 2300 | + speed_template_16); |
|---|
| 2301 | + test_cipher_speed("cbc(sm4)", ENCRYPT, sec, NULL, 0, |
|---|
| 2302 | + speed_template_16); |
|---|
| 2303 | + test_cipher_speed("cbc(sm4)", DECRYPT, sec, NULL, 0, |
|---|
| 2304 | + speed_template_16); |
|---|
| 2305 | + test_cipher_speed("ctr(sm4)", ENCRYPT, sec, NULL, 0, |
|---|
| 2306 | + speed_template_16); |
|---|
| 2307 | + test_cipher_speed("ctr(sm4)", DECRYPT, sec, NULL, 0, |
|---|
| 2308 | + speed_template_16); |
|---|
| 2309 | + break; |
|---|
| 2310 | + |
|---|
| 2293 | 2311 | case 219: |
|---|
| 2294 | 2312 | test_cipher_speed("adiantum(xchacha12,aes)", ENCRYPT, sec, NULL, |
|---|
| 2295 | 2313 | 0, speed_template_32); |
|---|
| .. | .. |
|---|
| 2301 | 2319 | 0, speed_template_32); |
|---|
| 2302 | 2320 | break; |
|---|
| 2303 | 2321 | |
|---|
| 2322 | + case 220: |
|---|
| 2323 | + test_acipher_speed("essiv(cbc(aes),sha256)", |
|---|
| 2324 | + ENCRYPT, sec, NULL, 0, |
|---|
| 2325 | + speed_template_16_24_32); |
|---|
| 2326 | + test_acipher_speed("essiv(cbc(aes),sha256)", |
|---|
| 2327 | + DECRYPT, sec, NULL, 0, |
|---|
| 2328 | + speed_template_16_24_32); |
|---|
| 2329 | + break; |
|---|
| 2330 | + |
|---|
| 2331 | + case 221: |
|---|
| 2332 | + test_aead_speed("aegis128", ENCRYPT, sec, |
|---|
| 2333 | + NULL, 0, 16, 8, speed_template_16); |
|---|
| 2334 | + test_aead_speed("aegis128", DECRYPT, sec, |
|---|
| 2335 | + NULL, 0, 16, 8, speed_template_16); |
|---|
| 2336 | + break; |
|---|
| 2337 | + |
|---|
| 2304 | 2338 | case 300: |
|---|
| 2305 | 2339 | if (alg) { |
|---|
| 2306 | 2340 | test_hash_speed(alg, sec, generic_hash_speed_template); |
|---|
| 2307 | 2341 | break; |
|---|
| 2308 | 2342 | } |
|---|
| 2309 | | - /* fall through */ |
|---|
| 2343 | + fallthrough; |
|---|
| 2310 | 2344 | case 301: |
|---|
| 2311 | 2345 | test_hash_speed("md4", sec, generic_hash_speed_template); |
|---|
| 2312 | 2346 | if (mode > 300 && mode < 400) break; |
|---|
| 2313 | | - /* fall through */ |
|---|
| 2347 | + fallthrough; |
|---|
| 2314 | 2348 | case 302: |
|---|
| 2315 | 2349 | test_hash_speed("md5", sec, generic_hash_speed_template); |
|---|
| 2316 | 2350 | if (mode > 300 && mode < 400) break; |
|---|
| 2317 | | - /* fall through */ |
|---|
| 2351 | + fallthrough; |
|---|
| 2318 | 2352 | case 303: |
|---|
| 2319 | 2353 | test_hash_speed("sha1", sec, generic_hash_speed_template); |
|---|
| 2320 | 2354 | if (mode > 300 && mode < 400) break; |
|---|
| 2321 | | - /* fall through */ |
|---|
| 2355 | + fallthrough; |
|---|
| 2322 | 2356 | case 304: |
|---|
| 2323 | 2357 | test_hash_speed("sha256", sec, generic_hash_speed_template); |
|---|
| 2324 | 2358 | if (mode > 300 && mode < 400) break; |
|---|
| 2325 | | - /* fall through */ |
|---|
| 2359 | + fallthrough; |
|---|
| 2326 | 2360 | case 305: |
|---|
| 2327 | 2361 | test_hash_speed("sha384", sec, generic_hash_speed_template); |
|---|
| 2328 | 2362 | if (mode > 300 && mode < 400) break; |
|---|
| 2329 | | - /* fall through */ |
|---|
| 2363 | + fallthrough; |
|---|
| 2330 | 2364 | case 306: |
|---|
| 2331 | 2365 | test_hash_speed("sha512", sec, generic_hash_speed_template); |
|---|
| 2332 | 2366 | if (mode > 300 && mode < 400) break; |
|---|
| 2333 | | - /* fall through */ |
|---|
| 2367 | + fallthrough; |
|---|
| 2334 | 2368 | case 307: |
|---|
| 2335 | 2369 | test_hash_speed("wp256", sec, generic_hash_speed_template); |
|---|
| 2336 | 2370 | if (mode > 300 && mode < 400) break; |
|---|
| 2337 | | - /* fall through */ |
|---|
| 2371 | + fallthrough; |
|---|
| 2338 | 2372 | case 308: |
|---|
| 2339 | 2373 | test_hash_speed("wp384", sec, generic_hash_speed_template); |
|---|
| 2340 | 2374 | if (mode > 300 && mode < 400) break; |
|---|
| 2341 | | - /* fall through */ |
|---|
| 2375 | + fallthrough; |
|---|
| 2342 | 2376 | case 309: |
|---|
| 2343 | 2377 | test_hash_speed("wp512", sec, generic_hash_speed_template); |
|---|
| 2344 | 2378 | if (mode > 300 && mode < 400) break; |
|---|
| 2345 | | - /* fall through */ |
|---|
| 2379 | + fallthrough; |
|---|
| 2346 | 2380 | case 310: |
|---|
| 2347 | 2381 | test_hash_speed("tgr128", sec, generic_hash_speed_template); |
|---|
| 2348 | 2382 | if (mode > 300 && mode < 400) break; |
|---|
| 2349 | | - /* fall through */ |
|---|
| 2383 | + fallthrough; |
|---|
| 2350 | 2384 | case 311: |
|---|
| 2351 | 2385 | test_hash_speed("tgr160", sec, generic_hash_speed_template); |
|---|
| 2352 | 2386 | if (mode > 300 && mode < 400) break; |
|---|
| 2353 | | - /* fall through */ |
|---|
| 2387 | + fallthrough; |
|---|
| 2354 | 2388 | case 312: |
|---|
| 2355 | 2389 | test_hash_speed("tgr192", sec, generic_hash_speed_template); |
|---|
| 2356 | 2390 | if (mode > 300 && mode < 400) break; |
|---|
| 2357 | | - /* fall through */ |
|---|
| 2391 | + fallthrough; |
|---|
| 2358 | 2392 | case 313: |
|---|
| 2359 | 2393 | test_hash_speed("sha224", sec, generic_hash_speed_template); |
|---|
| 2360 | 2394 | if (mode > 300 && mode < 400) break; |
|---|
| 2361 | | - /* fall through */ |
|---|
| 2395 | + fallthrough; |
|---|
| 2362 | 2396 | case 314: |
|---|
| 2363 | 2397 | test_hash_speed("rmd128", sec, generic_hash_speed_template); |
|---|
| 2364 | 2398 | if (mode > 300 && mode < 400) break; |
|---|
| 2365 | | - /* fall through */ |
|---|
| 2399 | + fallthrough; |
|---|
| 2366 | 2400 | case 315: |
|---|
| 2367 | 2401 | test_hash_speed("rmd160", sec, generic_hash_speed_template); |
|---|
| 2368 | 2402 | if (mode > 300 && mode < 400) break; |
|---|
| 2369 | | - /* fall through */ |
|---|
| 2403 | + fallthrough; |
|---|
| 2370 | 2404 | case 316: |
|---|
| 2371 | 2405 | test_hash_speed("rmd256", sec, generic_hash_speed_template); |
|---|
| 2372 | 2406 | if (mode > 300 && mode < 400) break; |
|---|
| 2373 | | - /* fall through */ |
|---|
| 2407 | + fallthrough; |
|---|
| 2374 | 2408 | case 317: |
|---|
| 2375 | 2409 | test_hash_speed("rmd320", sec, generic_hash_speed_template); |
|---|
| 2376 | 2410 | if (mode > 300 && mode < 400) break; |
|---|
| 2377 | | - /* fall through */ |
|---|
| 2411 | + fallthrough; |
|---|
| 2378 | 2412 | case 318: |
|---|
| 2379 | | - test_hash_speed("ghash-generic", sec, hash_speed_template_16); |
|---|
| 2413 | + klen = 16; |
|---|
| 2414 | + test_hash_speed("ghash", sec, generic_hash_speed_template); |
|---|
| 2380 | 2415 | if (mode > 300 && mode < 400) break; |
|---|
| 2381 | | - /* fall through */ |
|---|
| 2416 | + fallthrough; |
|---|
| 2382 | 2417 | case 319: |
|---|
| 2383 | 2418 | test_hash_speed("crc32c", sec, generic_hash_speed_template); |
|---|
| 2384 | 2419 | if (mode > 300 && mode < 400) break; |
|---|
| 2385 | | - /* fall through */ |
|---|
| 2420 | + fallthrough; |
|---|
| 2386 | 2421 | case 320: |
|---|
| 2387 | 2422 | test_hash_speed("crct10dif", sec, generic_hash_speed_template); |
|---|
| 2388 | 2423 | if (mode > 300 && mode < 400) break; |
|---|
| 2389 | | - /* fall through */ |
|---|
| 2424 | + fallthrough; |
|---|
| 2390 | 2425 | case 321: |
|---|
| 2391 | 2426 | test_hash_speed("poly1305", sec, poly1305_speed_template); |
|---|
| 2392 | 2427 | if (mode > 300 && mode < 400) break; |
|---|
| 2393 | | - /* fall through */ |
|---|
| 2428 | + fallthrough; |
|---|
| 2394 | 2429 | case 322: |
|---|
| 2395 | 2430 | test_hash_speed("sha3-224", sec, generic_hash_speed_template); |
|---|
| 2396 | 2431 | if (mode > 300 && mode < 400) break; |
|---|
| 2397 | | - /* fall through */ |
|---|
| 2432 | + fallthrough; |
|---|
| 2398 | 2433 | case 323: |
|---|
| 2399 | 2434 | test_hash_speed("sha3-256", sec, generic_hash_speed_template); |
|---|
| 2400 | 2435 | if (mode > 300 && mode < 400) break; |
|---|
| 2401 | | - /* fall through */ |
|---|
| 2436 | + fallthrough; |
|---|
| 2402 | 2437 | case 324: |
|---|
| 2403 | 2438 | test_hash_speed("sha3-384", sec, generic_hash_speed_template); |
|---|
| 2404 | 2439 | if (mode > 300 && mode < 400) break; |
|---|
| 2405 | | - /* fall through */ |
|---|
| 2440 | + fallthrough; |
|---|
| 2406 | 2441 | case 325: |
|---|
| 2407 | 2442 | test_hash_speed("sha3-512", sec, generic_hash_speed_template); |
|---|
| 2408 | 2443 | if (mode > 300 && mode < 400) break; |
|---|
| 2409 | | - /* fall through */ |
|---|
| 2444 | + fallthrough; |
|---|
| 2410 | 2445 | case 326: |
|---|
| 2411 | 2446 | test_hash_speed("sm3", sec, generic_hash_speed_template); |
|---|
| 2412 | 2447 | if (mode > 300 && mode < 400) break; |
|---|
| 2413 | | - /* fall through */ |
|---|
| 2448 | + fallthrough; |
|---|
| 2449 | + case 327: |
|---|
| 2450 | + test_hash_speed("streebog256", sec, |
|---|
| 2451 | + generic_hash_speed_template); |
|---|
| 2452 | + if (mode > 300 && mode < 400) break; |
|---|
| 2453 | + fallthrough; |
|---|
| 2454 | + case 328: |
|---|
| 2455 | + test_hash_speed("streebog512", sec, |
|---|
| 2456 | + generic_hash_speed_template); |
|---|
| 2457 | + if (mode > 300 && mode < 400) break; |
|---|
| 2458 | + fallthrough; |
|---|
| 2414 | 2459 | case 399: |
|---|
| 2415 | 2460 | break; |
|---|
| 2416 | 2461 | |
|---|
| .. | .. |
|---|
| 2419 | 2464 | test_ahash_speed(alg, sec, generic_hash_speed_template); |
|---|
| 2420 | 2465 | break; |
|---|
| 2421 | 2466 | } |
|---|
| 2422 | | - /* fall through */ |
|---|
| 2467 | + fallthrough; |
|---|
| 2423 | 2468 | case 401: |
|---|
| 2424 | 2469 | test_ahash_speed("md4", sec, generic_hash_speed_template); |
|---|
| 2425 | 2470 | if (mode > 400 && mode < 500) break; |
|---|
| 2426 | | - /* fall through */ |
|---|
| 2471 | + fallthrough; |
|---|
| 2427 | 2472 | case 402: |
|---|
| 2428 | 2473 | test_ahash_speed("md5", sec, generic_hash_speed_template); |
|---|
| 2429 | 2474 | if (mode > 400 && mode < 500) break; |
|---|
| 2430 | | - /* fall through */ |
|---|
| 2475 | + fallthrough; |
|---|
| 2431 | 2476 | case 403: |
|---|
| 2432 | 2477 | test_ahash_speed("sha1", sec, generic_hash_speed_template); |
|---|
| 2433 | 2478 | if (mode > 400 && mode < 500) break; |
|---|
| 2434 | | - /* fall through */ |
|---|
| 2479 | + fallthrough; |
|---|
| 2435 | 2480 | case 404: |
|---|
| 2436 | 2481 | test_ahash_speed("sha256", sec, generic_hash_speed_template); |
|---|
| 2437 | 2482 | if (mode > 400 && mode < 500) break; |
|---|
| 2438 | | - /* fall through */ |
|---|
| 2483 | + fallthrough; |
|---|
| 2439 | 2484 | case 405: |
|---|
| 2440 | 2485 | test_ahash_speed("sha384", sec, generic_hash_speed_template); |
|---|
| 2441 | 2486 | if (mode > 400 && mode < 500) break; |
|---|
| 2442 | | - /* fall through */ |
|---|
| 2487 | + fallthrough; |
|---|
| 2443 | 2488 | case 406: |
|---|
| 2444 | 2489 | test_ahash_speed("sha512", sec, generic_hash_speed_template); |
|---|
| 2445 | 2490 | if (mode > 400 && mode < 500) break; |
|---|
| 2446 | | - /* fall through */ |
|---|
| 2491 | + fallthrough; |
|---|
| 2447 | 2492 | case 407: |
|---|
| 2448 | 2493 | test_ahash_speed("wp256", sec, generic_hash_speed_template); |
|---|
| 2449 | 2494 | if (mode > 400 && mode < 500) break; |
|---|
| 2450 | | - /* fall through */ |
|---|
| 2495 | + fallthrough; |
|---|
| 2451 | 2496 | case 408: |
|---|
| 2452 | 2497 | test_ahash_speed("wp384", sec, generic_hash_speed_template); |
|---|
| 2453 | 2498 | if (mode > 400 && mode < 500) break; |
|---|
| 2454 | | - /* fall through */ |
|---|
| 2499 | + fallthrough; |
|---|
| 2455 | 2500 | case 409: |
|---|
| 2456 | 2501 | test_ahash_speed("wp512", sec, generic_hash_speed_template); |
|---|
| 2457 | 2502 | if (mode > 400 && mode < 500) break; |
|---|
| 2458 | | - /* fall through */ |
|---|
| 2503 | + fallthrough; |
|---|
| 2459 | 2504 | case 410: |
|---|
| 2460 | 2505 | test_ahash_speed("tgr128", sec, generic_hash_speed_template); |
|---|
| 2461 | 2506 | if (mode > 400 && mode < 500) break; |
|---|
| 2462 | | - /* fall through */ |
|---|
| 2507 | + fallthrough; |
|---|
| 2463 | 2508 | case 411: |
|---|
| 2464 | 2509 | test_ahash_speed("tgr160", sec, generic_hash_speed_template); |
|---|
| 2465 | 2510 | if (mode > 400 && mode < 500) break; |
|---|
| 2466 | | - /* fall through */ |
|---|
| 2511 | + fallthrough; |
|---|
| 2467 | 2512 | case 412: |
|---|
| 2468 | 2513 | test_ahash_speed("tgr192", sec, generic_hash_speed_template); |
|---|
| 2469 | 2514 | if (mode > 400 && mode < 500) break; |
|---|
| 2470 | | - /* fall through */ |
|---|
| 2515 | + fallthrough; |
|---|
| 2471 | 2516 | case 413: |
|---|
| 2472 | 2517 | test_ahash_speed("sha224", sec, generic_hash_speed_template); |
|---|
| 2473 | 2518 | if (mode > 400 && mode < 500) break; |
|---|
| 2474 | | - /* fall through */ |
|---|
| 2519 | + fallthrough; |
|---|
| 2475 | 2520 | case 414: |
|---|
| 2476 | 2521 | test_ahash_speed("rmd128", sec, generic_hash_speed_template); |
|---|
| 2477 | 2522 | if (mode > 400 && mode < 500) break; |
|---|
| 2478 | | - /* fall through */ |
|---|
| 2523 | + fallthrough; |
|---|
| 2479 | 2524 | case 415: |
|---|
| 2480 | 2525 | test_ahash_speed("rmd160", sec, generic_hash_speed_template); |
|---|
| 2481 | 2526 | if (mode > 400 && mode < 500) break; |
|---|
| 2482 | | - /* fall through */ |
|---|
| 2527 | + fallthrough; |
|---|
| 2483 | 2528 | case 416: |
|---|
| 2484 | 2529 | test_ahash_speed("rmd256", sec, generic_hash_speed_template); |
|---|
| 2485 | 2530 | if (mode > 400 && mode < 500) break; |
|---|
| 2486 | | - /* fall through */ |
|---|
| 2531 | + fallthrough; |
|---|
| 2487 | 2532 | case 417: |
|---|
| 2488 | 2533 | test_ahash_speed("rmd320", sec, generic_hash_speed_template); |
|---|
| 2489 | 2534 | if (mode > 400 && mode < 500) break; |
|---|
| 2490 | | - /* fall through */ |
|---|
| 2535 | + fallthrough; |
|---|
| 2491 | 2536 | case 418: |
|---|
| 2492 | 2537 | test_ahash_speed("sha3-224", sec, generic_hash_speed_template); |
|---|
| 2493 | 2538 | if (mode > 400 && mode < 500) break; |
|---|
| 2494 | | - /* fall through */ |
|---|
| 2539 | + fallthrough; |
|---|
| 2495 | 2540 | case 419: |
|---|
| 2496 | 2541 | test_ahash_speed("sha3-256", sec, generic_hash_speed_template); |
|---|
| 2497 | 2542 | if (mode > 400 && mode < 500) break; |
|---|
| 2498 | | - /* fall through */ |
|---|
| 2543 | + fallthrough; |
|---|
| 2499 | 2544 | case 420: |
|---|
| 2500 | 2545 | test_ahash_speed("sha3-384", sec, generic_hash_speed_template); |
|---|
| 2501 | 2546 | if (mode > 400 && mode < 500) break; |
|---|
| 2502 | | - /* fall through */ |
|---|
| 2547 | + fallthrough; |
|---|
| 2503 | 2548 | case 421: |
|---|
| 2504 | 2549 | test_ahash_speed("sha3-512", sec, generic_hash_speed_template); |
|---|
| 2505 | 2550 | if (mode > 400 && mode < 500) break; |
|---|
| 2506 | | - /* fall through */ |
|---|
| 2551 | + fallthrough; |
|---|
| 2507 | 2552 | case 422: |
|---|
| 2508 | 2553 | test_mb_ahash_speed("sha1", sec, generic_hash_speed_template, |
|---|
| 2509 | 2554 | num_mb); |
|---|
| 2510 | 2555 | if (mode > 400 && mode < 500) break; |
|---|
| 2511 | | - /* fall through */ |
|---|
| 2556 | + fallthrough; |
|---|
| 2512 | 2557 | case 423: |
|---|
| 2513 | 2558 | test_mb_ahash_speed("sha256", sec, generic_hash_speed_template, |
|---|
| 2514 | 2559 | num_mb); |
|---|
| 2515 | 2560 | if (mode > 400 && mode < 500) break; |
|---|
| 2516 | | - /* fall through */ |
|---|
| 2561 | + fallthrough; |
|---|
| 2517 | 2562 | case 424: |
|---|
| 2518 | 2563 | test_mb_ahash_speed("sha512", sec, generic_hash_speed_template, |
|---|
| 2519 | 2564 | num_mb); |
|---|
| 2520 | 2565 | if (mode > 400 && mode < 500) break; |
|---|
| 2521 | | - /* fall through */ |
|---|
| 2566 | + fallthrough; |
|---|
| 2522 | 2567 | case 425: |
|---|
| 2523 | 2568 | test_mb_ahash_speed("sm3", sec, generic_hash_speed_template, |
|---|
| 2524 | 2569 | num_mb); |
|---|
| 2525 | 2570 | if (mode > 400 && mode < 500) break; |
|---|
| 2526 | | - /* fall through */ |
|---|
| 2571 | + fallthrough; |
|---|
| 2572 | + case 426: |
|---|
| 2573 | + test_mb_ahash_speed("streebog256", sec, |
|---|
| 2574 | + generic_hash_speed_template, num_mb); |
|---|
| 2575 | + if (mode > 400 && mode < 500) break; |
|---|
| 2576 | + fallthrough; |
|---|
| 2577 | + case 427: |
|---|
| 2578 | + test_mb_ahash_speed("streebog512", sec, |
|---|
| 2579 | + generic_hash_speed_template, num_mb); |
|---|
| 2580 | + if (mode > 400 && mode < 500) break; |
|---|
| 2581 | + fallthrough; |
|---|
| 2527 | 2582 | case 499: |
|---|
| 2528 | 2583 | break; |
|---|
| 2529 | 2584 | |
|---|
| .. | .. |
|---|
| 3002 | 3057 | */ |
|---|
| 3003 | 3058 | static void __exit tcrypt_mod_fini(void) { } |
|---|
| 3004 | 3059 | |
|---|
| 3005 | | -module_init(tcrypt_mod_init); |
|---|
| 3060 | +subsys_initcall(tcrypt_mod_init); |
|---|
| 3006 | 3061 | module_exit(tcrypt_mod_fini); |
|---|
| 3007 | 3062 | |
|---|
| 3008 | 3063 | module_param(alg, charp, 0); |
|---|
| .. | .. |
|---|
| 3014 | 3069 | "(defaults to zero which uses CPU cycles instead)"); |
|---|
| 3015 | 3070 | module_param(num_mb, uint, 0000); |
|---|
| 3016 | 3071 | MODULE_PARM_DESC(num_mb, "Number of concurrent requests to be used in mb speed tests (defaults to 8)"); |
|---|
| 3072 | +module_param(klen, uint, 0); |
|---|
| 3073 | +MODULE_PARM_DESC(klen, "Key length (defaults to 0)"); |
|---|
| 3017 | 3074 | |
|---|
| 3018 | 3075 | MODULE_LICENSE("GPL"); |
|---|
| 3019 | 3076 | MODULE_DESCRIPTION("Quick & dirty crypto testing module"); |
|---|