From: Eric Biggers <ebiggers@kernel.org>
To: Antonio Quartulli <antonio@mandelbit.com>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: lib/crypto: AES-GCM x86 arch hooks: any plan?
Date: Mon, 9 Nov 2026 19:20:53 +0000 [thread overview]
Message-ID: <20261109192053.GA57100@google.com> (raw)
In-Reply-To: <6ce2344c-f6b5-4051-87b0-88a1c258a6d3@mandelbit.com>
On Mon, Nov 09, 2026 at 04:47:05PM +0100, Antonio Quartulli wrote:
> Since the commit adding GCM to the library says the arch-optimized code
> will be migrated into it, do you already have work in progress for x86?
>
> If not, we'd be happy to help there, or to test yours on Zen 5 with ovpn
> as a user.
>
> One design question I have though: the VAES code needs the hash key
> powers H^16..H^1 (and H^8..H^1 for VAES-AVX2 / AES-NI), while the x86
> ghash_key only holds the PCLMUL state.
>
> Would you rather extend struct ghash_key on x86, or have an
> arch-specific part in struct aes_gcm_key that aes_gcm_preparekey()
> fills when the arch code is usable?
I'm planning it. I've just been trying to get other things out of the
way first. If you're interested you can try to do it; just keep in mind
it will be quite a bit of work to do properly.
The tentative plan is to implement the GHASH and AES-GCM arch hooks that
lib/crypto/aes.c already has in place. And yes, that would mean that
the x86 AES-GCM code would have to be reorganized to operate on struct
ghash_key (expanded to hold up to 16 key powers) and struct aes_enckey
rather than a combined struct.
That by itself may result in performance regressions on short messages,
though, as each AES-GCM operation would be broken up into multiple calls
to the arch code. There likely will also need to be new hooks for
one-shot AES-GCM operations to handle them efficiently.
- Eric
next prev parent reply other threads:[~2026-11-09 19:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 15:47 lib/crypto: AES-GCM x86 arch hooks: any plan? Antonio Quartulli
2026-11-09 19:20 ` Eric Biggers [this message]
2026-11-10 10:21 ` Antonio Quartulli
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=20261109192053.GA57100@google.com \
--to=ebiggers@kernel.org \
--cc=antonio@mandelbit.com \
--cc=linux-crypto@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