[PATCH 08/16] header: add SHASH_DESC_ON_STACK()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SHASH_DESC_ON_STACK was added in Linux commit a0a77af14 "crypto:
LLVMLinux: Add macro to remove use of VLAIS in crypto code".

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/crypto/hash.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/crypto/hash.h b/backport/backport-include/crypto/hash.h
index 3510659..9c26e0c 100644
--- a/backport/backport-include/crypto/hash.h
+++ b/backport/backport-include/crypto/hash.h
@@ -28,4 +28,11 @@ static inline void ahash_request_zero(struct ahash_request *req)
 	struct ahash_request *name = (void *)__##name##_desc
 #endif
 
+#ifndef SHASH_DESC_ON_STACK
+#define SHASH_DESC_ON_STACK(shash, ctx)				  \
+	char __##shash##_desc[sizeof(struct shash_desc) +	  \
+		crypto_shash_descsize(ctx)] CRYPTO_MINALIGN_ATTR; \
+	struct shash_desc *shash = (struct shash_desc *)__##shash##_desc
+#endif
+
 #endif /* _BACKPORT_CRYPTO_HASH_H */
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux