Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	x86@kernel.org, Antonio Quartulli <antonio@mandelbit.com>
Subject: Re: [PATCH 00/11] Migrate x86_64 AES-GCM code into library
Date: Sat, 5 Dec 2026 18:09:20 -0800	[thread overview]
Message-ID: <20261206020920.GA362402@quark> (raw)
In-Reply-To: <20261129200245.146503-1-ebiggers@kernel.org>

On Sun, Nov 29, 2026 at 12:02:34PM -0800, Eric Biggers wrote:
> This series is targeting libcrypto-next.  It can also be retrieved from:
> 
>     git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git aes-gcm-x86-v1
> 
> This series migrates the x86_64 optimized AES-GCM code into lib/crypto/,
> fully optimizing the AES-GCM library functions on x86_64.

Applied (1-2 to libcrypto-fixes, and 3-11 to libcrypto-next based on
top).

Acks appreciated!

I folded in two minor one-line fixes that weren't worth sending a v2 of
the whole series for.  First is for better codegen and to avoid a false
positive warning at W=2, and second just adds an extra static_assert.

diff --git a/crypto/aes.c b/crypto/aes.c
index b2717f66fe65c..2d884ff8c6945 100644
--- a/crypto/aes.c
+++ b/crypto/aes.c
@@ -850,7 +850,7 @@ aead_sg_get_linear(struct scatterlist *sg, unsigned int assoclen,
 		}
 	}
 
-	if (tag_len) {
+	if (tag_out) {
 		if (off && sg->length == off) {
 			sg = sg_next(sg);
 			off = 0;
diff --git a/lib/crypto/x86/aes.h b/lib/crypto/x86/aes.h
index e0c65904eef09..fef09cf317b21 100644
--- a/lib/crypto/x86/aes.h
+++ b/lib/crypto/x86/aes.h
@@ -410,6 +410,7 @@ static bool aes_xts_decrypt_arch(u8 *dst, const u8 *src, size_t len,
 
 #if IS_ENABLED(CONFIG_CRYPTO_LIB_AES_GCM) && IS_ENABLED(CONFIG_X86_64)
 /* The assembly code assumes the following offsets. */
+static_assert(IS_ENABLED(CONFIG_CRYPTO_LIB_GF128HASH_ARCH));
 static_assert(offsetof(struct gf128hash_key_x86, h_powers_xored) == 0);
 static_assert(offsetof(struct gf128hash_key_x86, h_powers) == 128);
 static_assert(offsetof(struct gf128hash_key_x86, h_powers16) == 0);

      parent reply	other threads:[~2026-12-06  2:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 20:02 [PATCH 00/11] Migrate x86_64 AES-GCM code into library Eric Biggers
2026-11-29 20:02 ` [PATCH 01/11] crypto: aes - Flush dcache in CBC-CTS and XTS linear fast paths Eric Biggers
2026-11-29 20:02 ` [PATCH 02/11] lib/crypto: gf128hash: Link libgf128hash before libaes Eric Biggers
2026-11-29 20:02 ` [PATCH 03/11] lib/crypto: aes-gcm: Add one-shot AES-GCM arch hooks Eric Biggers
2026-11-29 20:02 ` [PATCH 04/11] crypto: aes - Add linear fast path for AES-GCM Eric Biggers
2026-11-29 20:02 ` [PATCH 05/11] lib/crypto: x86/gf128hash: Optimize GHASH and POLYVAL with PCLMULQDQ and AVX Eric Biggers
2026-11-29 20:02 ` [PATCH 06/11] lib/crypto: x86/gf128hash: Optimize GHASH and POLYVAL with VPCLMULQDQ and AVX2 Eric Biggers
2026-11-29 20:02 ` [PATCH 07/11] lib/crypto: x86/gf128hash: Optimize GHASH and POLYVAL with VPCLMULQDQ and AVX512 Eric Biggers
2026-11-29 20:02 ` [PATCH 08/11] lib/crypto: x86/aes-gcm: Migrate AES-NI optimized code into library Eric Biggers
2026-11-29 20:02 ` [PATCH 09/11] lib/crypto: x86/aes-gcm: Migrate VAES+AVX2 " Eric Biggers
2026-11-29 20:02 ` [PATCH 10/11] lib/crypto: x86/aes-gcm: Migrate VAES+AVX512 " Eric Biggers
2026-11-29 20:02 ` [PATCH 11/11] crypto: x86/aesni-intel - Remove empty module Eric Biggers
2026-12-05 19:51 ` [RFC PATCH] lib/crypto: x86/aes-gcm: Process short associated data in one asm call Antonio Quartulli
2026-12-06  2:27   ` Eric Biggers
2026-12-06  2:09 ` Eric Biggers [this message]

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=20261206020920.GA362402@quark \
    --to=ebiggers@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=antonio@mandelbit.com \
    --cc=ardb@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=x86@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