]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: skcipher - Add new helper function crypto_skcipher_tested
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 15 Jan 2026 12:00:23 +0000 (13:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 31 Jan 2026 02:52:30 +0000 (10:52 +0800)
Add a new helper function crypto_skcipher_tested() which evaluates
the CRYPTO_ALG_TESTED flag from the tfm base cra_flags field.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
include/crypto/internal/skcipher.h

index 0cad8e7364c8e1e6bb0167f68126de7cc67ffdaa..a965b6aabf6160326ab7684850388bc2b0f235f4 100644 (file)
@@ -242,6 +242,13 @@ static inline void *crypto_skcipher_ctx_dma(struct crypto_skcipher *tfm)
        return crypto_tfm_ctx_dma(&tfm->base);
 }
 
+static inline bool crypto_skcipher_tested(struct crypto_skcipher *tfm)
+{
+       struct crypto_tfm *tfm_base = crypto_skcipher_tfm(tfm);
+
+       return tfm_base->__crt_alg->cra_flags & CRYPTO_ALG_TESTED;
+}
+
 static inline void *skcipher_request_ctx(struct skcipher_request *req)
 {
        return req->__ctx;