--- zzzz-none-000/linux-5.4.213/crypto/testmgr.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/crypto/testmgr.c 2024-08-14 09:01:35.000000000 +0000 @@ -290,15 +290,22 @@ .name = "in-place", .inplace = true, .src_divs = { { .proportion_of_total = 10000 } }, - }, { + }, + + { .name = "out-of-place", + .inplace = false, .src_divs = { { .proportion_of_total = 10000 } }, - }, { + }, + + { .name = "unaligned buffer, offset=1", + .inplace = true, .src_divs = { { .proportion_of_total = 10000, .offset = 1 } }, .iv_offset = 1, }, { .name = "buffer aligned only to alignmask", + .inplace = true, .src_divs = { { .proportion_of_total = 10000, @@ -308,7 +315,10 @@ }, .iv_offset = 1, .iv_offset_relative_to_alignmask = true, - }, { + }, +#ifndef CONFIG_CRYPTO_DISABLE_AUTH_SPLIT_TESTS + /* HW requires authentication data not be to be split between scatters */ + { .name = "two even aligned splits", .src_divs = { { .proportion_of_total = 5000 }, @@ -336,14 +346,19 @@ }, }, } +#endif }; static const struct testvec_config default_hash_testvec_configs[] = { +#ifndef CONFIG_CRYPTO_DISABLE_AHASH_TYPE1_TESTS + /* Update in testmgr requires the result back whereas HW hides result from the user */ { .name = "init+update+final aligned buffer", .src_divs = { { .proportion_of_total = 10000 } }, .finalization_type = FINALIZATION_TYPE_FINAL, - }, { + }, +#endif + { .name = "init+finup aligned buffer", .src_divs = { { .proportion_of_total = 10000 } }, .finalization_type = FINALIZATION_TYPE_FINUP, @@ -351,11 +366,16 @@ .name = "digest aligned buffer", .src_divs = { { .proportion_of_total = 10000 } }, .finalization_type = FINALIZATION_TYPE_DIGEST, - }, { + }, +#ifndef CONFIG_CRYPTO_DISABLE_AHASH_TYPE1_TESTS + /* Update in testmgr requires the result back whereas HW hides result from the user */ + { .name = "init+update+final misaligned buffer", .src_divs = { { .proportion_of_total = 10000, .offset = 1 } }, .finalization_type = FINALIZATION_TYPE_FINAL, - }, { + }, +#endif + { .name = "digest buffer aligned only to alignmask", .src_divs = { { @@ -365,7 +385,10 @@ }, }, .finalization_type = FINALIZATION_TYPE_DIGEST, - }, { + }, +#ifndef CONFIG_CRYPTO_DISABLE_AHASH_TYPE2_TESTS + /* Update in testmgr requires the result back whereas HW hides result from the user */ + { .name = "init+update+update+final two even splits", .src_divs = { { .proportion_of_total = 5000 }, @@ -375,7 +398,9 @@ }, }, .finalization_type = FINALIZATION_TYPE_FINAL, - }, { + }, +#endif + { .name = "digest uneven misaligned splits, may sleep", .req_flags = CRYPTO_TFM_REQ_MAY_SLEEP, .src_divs = { @@ -396,7 +421,10 @@ }, }, .finalization_type = FINALIZATION_TYPE_DIGEST, - }, { + }, +#ifndef CONFIG_CRYPTO_DISABLE_AHASH_TYPE3_TESTS + /* import/export are not supported by HW */ + { .name = "import/export", .src_divs = { { @@ -409,6 +437,7 @@ }, .finalization_type = FINALIZATION_TYPE_FINAL, } +#endif }; static unsigned int count_test_sg_divisions(const struct test_sg_division *divs) @@ -3874,6 +3903,11 @@ return 0; } +static const char *test_disabled_algs[] = { + "essiv(cbc-aes-qce,sha256-generic)", + NULL, +}; + #define __VECS(tv) { .vecs = tv, .count = ARRAY_SIZE(tv) } /* Please keep this list sorted by algorithm name. */ @@ -3986,6 +4020,13 @@ .test = alg_test_null, .fips_allowed = 1, }, { + .alg = "authenc(hmac(sha384),cbc(aes))", + .test = alg_test_aead, + .fips_allowed = 1, + .suite = { + .aead = __VECS(hmac_sha384_aes_cbc_tv_temp) + } + }, { .alg = "authenc(hmac(sha384),cbc(des))", .test = alg_test_aead, .suite = { @@ -5203,6 +5244,19 @@ return -1; } +static bool alg_test_is_disabled(const char *alg) +{ + int curr = 0; + + while (test_disabled_algs[curr]) { + if (!strcmp(test_disabled_algs[curr], alg)) + return true; + curr++; + } + + return false; +} + int alg_test(const char *driver, const char *alg, u32 type, u32 mask) { int i; @@ -5234,6 +5288,9 @@ goto test_done; } + if (alg_test_is_disabled(driver)) + goto notest; + i = alg_find_test(alg); j = alg_find_test(driver); if (i < 0 && j < 0) @@ -5264,7 +5321,7 @@ return rc; notest: - printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver); + pr_debug(KERN_INFO "alg: No test for %s (%s)\n", alg, driver); return 0; non_fips_alg: return -EINVAL;