]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
crypto: skcipher - unify the crypto_has_skcipher*() functions
authorEric Biggers <ebiggers@google.com>
Fri, 25 Oct 2019 19:41:09 +0000 (12:41 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Nov 2019 05:38:32 +0000 (13:38 +0800)
crypto_has_skcipher() and crypto_has_skcipher2() do the same thing: they
check for the availability of an algorithm of type skcipher, blkcipher,
or ablkcipher, which also meets any non-type constraints the caller
specified.  And they have exactly the same prototype.

Therefore, eliminate the redundancy by removing crypto_has_skcipher()
and renaming crypto_has_skcipher2() to crypto_has_skcipher().

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/skcipher.c
include/crypto/skcipher.h

index 22753c1c720229d3529e37ecaf4eb77a51e5b0af..233678d0781697e426a968b310ca40b66e611e17 100644 (file)
@@ -1017,12 +1017,12 @@ struct crypto_sync_skcipher *crypto_alloc_sync_skcipher(
 }
 EXPORT_SYMBOL_GPL(crypto_alloc_sync_skcipher);
 
-int crypto_has_skcipher2(const char *alg_name, u32 type, u32 mask)
+int crypto_has_skcipher(const char *alg_name, u32 type, u32 mask)
 {
        return crypto_type_has_alg(alg_name, &crypto_skcipher_type2,
                                   type, mask);
 }
-EXPORT_SYMBOL_GPL(crypto_has_skcipher2);
+EXPORT_SYMBOL_GPL(crypto_has_skcipher);
 
 static int skcipher_prepare_alg(struct skcipher_alg *alg)
 {
index aada87916918497c08cb36df3bcdf52d8afd6816..e34993f5d190975ea41a87194fe4d1dc571db1a8 100644 (file)
@@ -218,30 +218,13 @@ static inline void crypto_free_sync_skcipher(struct crypto_sync_skcipher *tfm)
  * crypto_has_skcipher() - Search for the availability of an skcipher.
  * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
  *           skcipher
- * @type: specifies the type of the cipher
- * @mask: specifies the mask for the cipher
- *
- * Return: true when the skcipher is known to the kernel crypto API; false
- *        otherwise
- */
-static inline int crypto_has_skcipher(const char *alg_name, u32 type,
-                                       u32 mask)
-{
-       return crypto_has_alg(alg_name, crypto_skcipher_type(type),
-                             crypto_skcipher_mask(mask));
-}
-
-/**
- * crypto_has_skcipher2() - Search for the availability of an skcipher.
- * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
- *           skcipher
  * @type: specifies the type of the skcipher
  * @mask: specifies the mask for the skcipher
  *
  * Return: true when the skcipher is known to the kernel crypto API; false
  *        otherwise
  */
-int crypto_has_skcipher2(const char *alg_name, u32 type, u32 mask);
+int crypto_has_skcipher(const char *alg_name, u32 type, u32 mask);
 
 static inline const char *crypto_skcipher_driver_name(
        struct crypto_skcipher *tfm)