]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: cipher - Remove crypto_clone_cipher()
authorEric Biggers <ebiggers@kernel.org>
Fri, 22 May 2026 05:30:24 +0000 (00:30 -0500)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 May 2026 00:45:45 +0000 (17:45 -0700)
Since the only caller of crypto_clone_cipher() was cmac_clone_tfm()
which has been removed, remove crypto_clone_cipher() as well.

Note that no tests need to be removed, as this function had no tests.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://patch.msgid.link/20260522053028.91165-3-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
crypto/cipher.c
include/crypto/internal/cipher.h

index 1fe62bf79656bb89b7aaa01ee1b07de5b3c3c4b9..c9dab656a622e0d09a6e54ca2929ce1e1df358c5 100644 (file)
@@ -89,31 +89,3 @@ void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
        cipher_crypt_one(tfm, dst, src, false);
 }
 EXPORT_SYMBOL_NS_GPL(crypto_cipher_decrypt_one, "CRYPTO_INTERNAL");
-
-struct crypto_cipher *crypto_clone_cipher(struct crypto_cipher *cipher)
-{
-       struct crypto_tfm *tfm = crypto_cipher_tfm(cipher);
-       struct crypto_alg *alg = tfm->__crt_alg;
-       struct crypto_cipher *ncipher;
-       struct crypto_tfm *ntfm;
-
-       if (alg->cra_init)
-               return ERR_PTR(-ENOSYS);
-
-       if (unlikely(!crypto_mod_get(alg)))
-               return ERR_PTR(-ESTALE);
-
-       ntfm = __crypto_alloc_tfmgfp(alg, CRYPTO_ALG_TYPE_CIPHER,
-                                    CRYPTO_ALG_TYPE_MASK, GFP_ATOMIC);
-       if (IS_ERR(ntfm)) {
-               crypto_mod_put(alg);
-               return ERR_CAST(ntfm);
-       }
-
-       ntfm->crt_flags = tfm->crt_flags;
-
-       ncipher = __crypto_cipher_cast(ntfm);
-
-       return ncipher;
-}
-EXPORT_SYMBOL_GPL(crypto_clone_cipher);
index 5030f6d2df3150ce95c692d6efb9fc4091b3f072..a9174ba90250030ebe118aa315b7847a6d3fc393 100644 (file)
@@ -176,8 +176,6 @@ void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
 void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
                               u8 *dst, const u8 *src);
 
-struct crypto_cipher *crypto_clone_cipher(struct crypto_cipher *cipher);
-
 struct crypto_cipher_spawn {
        struct crypto_spawn base;
 };