From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH] lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h>
Date: Mon, 30 Mar 2026 19:44:38 -0700 [thread overview]
Message-ID: <20260331024438.51783-1-ebiggers@kernel.org> (raw)
Since the lib/crypto/ files that include <crypto/algapi.h> need it only
for the transitive inclusion of <crypto/utils.h> (and not all the
traditional crypto API stuff that the rest of <crypto/algapi.h> is
filled with), replace these inclusions with direct inclusions of
<crypto/utils.h>.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
lib/crypto/aescfb.c | 2 +-
lib/crypto/chacha.c | 2 +-
lib/crypto/memneq.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/crypto/aescfb.c b/lib/crypto/aescfb.c
index e38848d101e3..82cd55436055 100644
--- a/lib/crypto/aescfb.c
+++ b/lib/crypto/aescfb.c
@@ -4,11 +4,11 @@
*
* Copyright 2023 Google LLC
*/
#include <crypto/aes.h>
-#include <crypto/algapi.h>
+#include <crypto/utils.h>
#include <linux/export.h>
#include <linux/module.h>
/**
* aescfb_encrypt - Perform AES-CFB encryption on a block of data
diff --git a/lib/crypto/chacha.c b/lib/crypto/chacha.c
index e0c7cb4af318..86e5d382a4e0 100644
--- a/lib/crypto/chacha.c
+++ b/lib/crypto/chacha.c
@@ -3,12 +3,12 @@
* The ChaCha stream cipher (RFC7539)
*
* Copyright (C) 2015 Martin Willi
*/
-#include <crypto/algapi.h> // for crypto_xor_cpy
#include <crypto/chacha.h>
+#include <crypto/utils.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/module.h>
static void __maybe_unused
diff --git a/lib/crypto/memneq.c b/lib/crypto/memneq.c
index 44daacb8cb51..08924acd44bc 100644
--- a/lib/crypto/memneq.c
+++ b/lib/crypto/memneq.c
@@ -57,11 +57,11 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <crypto/algapi.h>
+#include <crypto/utils.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/unaligned.h>
/* Generic path for arbitrary size */
@@ -157,11 +157,11 @@ static inline unsigned long __crypto_memneq_16(const void *a, const void *b)
}
/* Compare two areas of memory without leaking timing information,
* and with special optimizations for common sizes. Users should
* not call this function directly, but should instead use
- * crypto_memneq defined in crypto/algapi.h.
+ * crypto_memneq defined in crypto/utils.h.
*/
noinline unsigned long __crypto_memneq(const void *a, const void *b,
size_t size)
{
switch (size) {
base-commit: d2a68aba8505ce88b39c34ecb3b707c776af79d4
prerequisite-patch-id: bb75bceea1086ce63912baf959cd010cdd451208
prerequisite-patch-id: 0bd0bf7e94c78811a3371910650acf3a62b7de2c
--
2.53.0
next reply other threads:[~2026-03-31 2:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 2:44 Eric Biggers [this message]
2026-03-31 6:51 ` [PATCH] lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> Ard Biesheuvel
2026-04-02 23:11 ` Eric Biggers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260331024438.51783-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox