diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-10-27 17:29:40 +0300 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:59:01 +0200 |
| commit | de4ee70788eaefc7a56af1d6cf7a6fd6495b3135 (patch) | |
| tree | fa06aa6ee1d9eb22b91ed197db6ef3e2c6c439b9 /include/linux/crypto.h | |
| parent | 570f46919b474cbcd8f6880d89e3ab40ddb5f206 (diff) | |
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.
Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'include/linux/crypto.h')
| -rw-r--r-- | include/linux/crypto.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 2b00d92a6..61dd0b15d 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -354,6 +354,7 @@ struct ablkcipher_tfm { unsigned int ivsize; unsigned int reqsize; + bool has_setkey; }; struct aead_tfm { @@ -664,6 +665,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) { |
