From: Harald Freudenberger Date: Tue, 17 Jun 2025 13:44:38 +0000 (+0200) Subject: crypto: ahash - Add crypto_ahash_tested() helper function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0da164ba63dd6ff3696c565b118631a277822c3;p=thirdparty%2Flinux.git crypto: ahash - Add crypto_ahash_tested() helper function Add a little inline helper function crypto_ahash_tested() to the internal/hash.h header file to retrieve the tested status (that is the CRYPTO_ALG_TESTED bit in the cra_flags). Signed-off-by: Harald Freudenberger Suggested-by: Herbert Xu Reviewed-by: Holger Dengler Signed-off-by: Herbert Xu --- diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 2456d6ea73f0a..6ec5f2f37ccbe 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h @@ -196,6 +196,13 @@ static inline void crypto_ahash_set_reqsize(struct crypto_ahash *tfm, tfm->reqsize = reqsize; } +static inline bool crypto_ahash_tested(struct crypto_ahash *tfm) +{ + struct crypto_tfm *tfm_base = crypto_ahash_tfm(tfm); + + return tfm_base->__crt_alg->cra_flags & CRYPTO_ALG_TESTED; +} + static inline void crypto_ahash_set_reqsize_dma(struct crypto_ahash *ahash, unsigned int reqsize) {