summaryrefslogtreecommitdiff
path: root/include/crypto/internal
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-05-04 21:33:23 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 18:20:46 +0800
commit88bca957e87e9a8a274213db257a744170b7248a (patch)
treebf48cb5c060218d46a38ee60fa8babcd8c7aaa69 /include/crypto/internal
parent1052671ca118b79fa3f5de281bba850aaf20bbf5 (diff)
crypto: ahash - Add HASH_REQUEST_ZERO
Add a helper to zero hash stack requests that were never cloned off the stack. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal')
-rw-r--r--include/crypto/internal/hash.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index e911f32f46dc..f2bbdb74e11a 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -301,5 +301,9 @@ static inline unsigned int crypto_shash_coresize(struct crypto_shash *tfm)
return crypto_shash_statesize(tfm) - crypto_shash_blocksize(tfm) - 1;
}
+/* This can only be used if the request was never cloned. */
+#define HASH_REQUEST_ZERO(name) \
+ memzero_explicit(__##name##_req, sizeof(__##name##_req))
+
#endif /* _CRYPTO_INTERNAL_HASH_H */