summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-01-11 21:26:50 +0800
committerBen Hutchings <ben@decadent.org.uk>2016-02-13 10:34:12 +0000
commit3ba1945b048afd9cd8dba6b341160fffc4e431a0 (patch)
treee9aa1d1427e66cbb8f576a7d0109d960b7aba76e /include
parent5d4c935b8a1ea8bb0efed11b204de06f96fdb6b1 (diff)
downloadlwn-3ba1945b048afd9cd8dba6b341160fffc4e431a0.tar.gz
lwn-3ba1945b048afd9cd8dba6b341160fffc4e431a0.zip
crypto: skcipher - Add crypto_skcipher_has_setkey
commit a1383cd86a062fc798899ab20f0ec2116cce39cb upstream. This patch adds a way for skcipher users to determine whether a key is required by a transform. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> [bwh: Backported to 3.2: add to ablkcipher API instead] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/crypto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index ca01ea899114..6f501deccf41 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -346,6 +346,7 @@ struct ablkcipher_tfm {
unsigned int ivsize;
unsigned int reqsize;
+ bool has_setkey;
};
struct aead_tfm {
@@ -656,6 +657,13 @@ static inline int crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm,
return crt->setkey(crt->base, key, keylen);
}
+static inline bool crypto_ablkcipher_has_setkey(struct crypto_ablkcipher *tfm)
+{
+ struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(tfm);
+
+ return crt->has_setkey;
+}
+
static inline struct crypto_ablkcipher *crypto_ablkcipher_reqtfm(
struct ablkcipher_request *req)
{