]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
crypto: skcipher - add crypto_skcipher_min_keysize()
authorEric Biggers <ebiggers@google.com>
Sun, 1 Dec 2019 21:53:25 +0000 (13:53 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:37:00 +0000 (16:37 +0800)
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>
include/crypto/skcipher.h

index 8ebf4167632beabd9f2ebd81472e060bb1769a3c..141e7690f9c31f59fde23637881347e948c316e8 100644 (file)
@@ -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)
 {