summaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-01-08 21:28:26 +0800
committerJiri Slaby <jslaby@suse.cz>2016-02-24 09:45:09 +0100
commitf382cd5ac26674877143fa7d9c0ea23c6640e706 (patch)
tree028187a360c073c7e04bf61acc019e4e95f42adf /include/crypto
parentc25e22ff51d3bebf579a054aecbaa98c81149c02 (diff)
downloadlwn-f382cd5ac26674877143fa7d9c0ea23c6640e706.tar.gz
lwn-f382cd5ac26674877143fa7d9c0ea23c6640e706.zip
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> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/hash.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 26cb1eb16f4c..4bdd795dfaf9 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,12 @@ 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);