[2/7] crypto: skcipher - add crypto_skcipher_min_keysize()
diff mbox series

Message ID 20191201215330.171990-3-ebiggers@kernel.org
State Accepted
Delegated to: Herbert Xu
Headers show
Series
  • [1/7] crypto: aead - move crypto_aead_maxauthsize() to <crypto/aead.h>
Related show

Commit Message

Eric Biggers Dec. 1, 2019, 9:53 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

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>
---
 include/crypto/skcipher.h | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox series

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)
 {