summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-08-20 05:02:40 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2015-08-21 10:21:20 -0400
commitd4421c54c45f643731c92daa8e268ce74dcdf5a2 (patch)
treef4fe2abda7788a5d524db09d507addb6f28e48b3 /include/crypto
parent12773d932fc22c60e0d5a20660d564542fab811b (diff)
crypto: hash - Add AHASH_REQUEST_ON_STACK
This patch adds the helper AHASH_REQUEST_ON_STACK for those users of ahash that are synchronous only. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/hash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 57c8a6ee33c2..8e920b44c0ac 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -63,6 +63,11 @@ struct ahash_request {
63 void *__ctx[] CRYPTO_MINALIGN_ATTR; 63 void *__ctx[] CRYPTO_MINALIGN_ATTR;
64}; 64};
65 65
66#define AHASH_REQUEST_ON_STACK(name, ahash) \
67 char __##name##_desc[sizeof(struct ahash_request) + \
68 crypto_ahash_reqsize(ahash)] CRYPTO_MINALIGN_ATTR; \
69 struct ahash_request *name = (void *)__##name##_desc
70
66/** 71/**
67 * struct ahash_alg - asynchronous message digest definition 72 * struct ahash_alg - asynchronous message digest definition
68 * @init: Initialize the transformation context. Intended only to initialize the 73 * @init: Initialize the transformation context. Intended only to initialize the