summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-12-01 22:53:25 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-11 09:37:00 +0100
commit7bada03311b62288035b0f5454cc154a44f33c56 (patch)
treefb5d15143b37160e691cb80e9f689cedddc8313d
parentcrypto: aead - move crypto_aead_maxauthsize() to <crypto/aead.h> (diff)
downloadlinux-7bada03311b62288035b0f5454cc154a44f33c56.tar.xz
linux-7bada03311b62288035b0f5454cc154a44f33c56.zip
crypto: skcipher - add crypto_skcipher_min_keysize()
Add a helper function crypto_skcipher_min_keysize() to mirror crypto_skcipher_max_keysize(). This will be used by the self-tests. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--include/crypto/skcipher.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index 8ebf4167632b..141e7690f9c3 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -368,6 +368,12 @@ static inline int crypto_sync_skcipher_setkey(struct crypto_sync_skcipher *tfm,
return crypto_skcipher_setkey(&tfm->base, key, keylen);
}
+static inline unsigned int crypto_skcipher_min_keysize(
+ struct crypto_skcipher *tfm)
+{
+ return crypto_skcipher_alg(tfm)->min_keysize;
+}
+
static inline unsigned int crypto_skcipher_max_keysize(
struct crypto_skcipher *tfm)
{