summaryrefslogtreecommitdiff
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-11-13 16:12:34 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2022-11-25 17:39:18 +0800
commit9cadd73adef1e1d53ea100f28e3e258698b92418 (patch)
tree842c273fc7fbe8dff1d15e6cbaf7dc8f3a07b1dd /crypto/algapi.c
parenta7008584ab19d2df05caa95634cd72bc41f4cad3 (diff)
crypto: algboss - optimize registration of internal algorithms
Since algboss always skips testing of algorithms with the CRYPTO_ALG_INTERNAL flag, there is no need to go through the dance of creating the test kthread, which creates a lot of overhead. Instead, we can just directly finish the algorithm registration, like is now done when self-tests are disabled entirely. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 950195e90bfc..851b247f043d 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -278,7 +278,8 @@ static struct crypto_larval *crypto_alloc_test_larval(struct crypto_alg *alg)
struct crypto_larval *larval;
if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER) ||
- IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS))
+ IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) ||
+ (alg->cra_flags & CRYPTO_ALG_INTERNAL))
return NULL; /* No self-test needed */
larval = crypto_larval_alloc(alg->cra_name,