Skip to content

Commit

Permalink
crypto: hash - Add AHASH_REQUEST_ON_STACK
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu committed Aug 21, 2015
1 parent 12773d9 commit d4421c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/crypto/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ struct ahash_request {
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};

#define AHASH_REQUEST_ON_STACK(name, ahash) \
char __##name##_desc[sizeof(struct ahash_request) + \
crypto_ahash_reqsize(ahash)] CRYPTO_MINALIGN_ATTR; \
struct ahash_request *name = (void *)__##name##_desc

/**
* struct ahash_alg - asynchronous message digest definition
* @init: Initialize the transformation context. Intended only to initialize the
Expand Down

0 comments on commit d4421c5

Please sign in to comment.