diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-01-08 16:28:26 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-02-13 13:34:12 +0300 |
commit | 91be8bcfc83376406f0737d91b06d2a1587aa31b (patch) | |
tree | c10fc4ee2b53f55efc6dda349fe5eac63a0291d5 /include/crypto | |
parent | 62a73f4b649dedf99e8a32fd4834ef8954d04a37 (diff) | |
download | linux-91be8bcfc83376406f0737d91b06d2a1587aa31b.tar.xz |
crypto: hash - Add crypto_ahash_has_setkey
commit a5596d6332787fd383b3b5427b41f94254430827 upstream.
This patch adds a way for ahash users to determine whether a key
is required by a crypto_ahash transform.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/hash.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 26cb1eb16f4c..c8c79878c082 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -94,6 +94,7 @@ struct crypto_ahash { unsigned int keylen); unsigned int reqsize; + bool has_setkey; struct crypto_tfm base; }; @@ -181,6 +182,11 @@ static inline void *ahash_request_ctx(struct ahash_request *req) int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen); +static inline bool crypto_ahash_has_setkey(struct crypto_ahash *tfm) +{ + return tfm->has_setkey; +} + int crypto_ahash_finup(struct ahash_request *req); int crypto_ahash_final(struct ahash_request *req); int crypto_ahash_digest(struct ahash_request *req); |