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, Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 0/8] lib/crypto: De-bloat and optimize sha512-ssse3-asm.S
Date: Sat, 21 Nov 2026 18:20:22 -0800 [thread overview]
Message-ID: <20261122022030.296468-1-ebiggers@kernel.org> (raw)
This series reduces the text size of sha512-ssse3-asm.o by over 10 KB,
eliminates an excessively large stack frame that wasn't being zeroized,
and implements various additional optimizations. Many of these
optimizations were already being used in other code such as
sha512-avx2-asm.o; this older file was just never updated properly.
I don't have access to an x86_64 CPU that lacks AVX2 support, but
running this code on a more recent CPU shows a 30% increase in SHA-512
throughput. Since the benefit of the 'shld' hack in sha512-avx-asm.S on
Sandy Bridge was allegedly 20%, it's plausible that this more than
closes the gap after the removal of that file. But even if it doesn't,
it should be a worthwhile cleanup, especially because of the text and
stack size reductions and increased consistency with other files.
Patch 1 is an updated version of
https://lore.kernel.org/linux-crypto/20261112082839.414786-3-ebiggers@kernel.org/
Eric Biggers (8):
lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3()
lib/crypto: x86/sha512: Keep message schedule in XMM registers
lib/crypto: x86/sha512: Keep W[t]+K[t] in %xmm5 instead of stack
lib/crypto: x86/sha512: Keep XMM_QWORD_BSWAP in %xmm14 across blocks
lib/crypto: x86/sha512: Use pshufb for ror64(x, 8) in SSSE3 s0
lib/crypto: x86/sha512: Keep state in registers across blocks in SSSE3
lib/crypto: x86/sha512: Shorten critical-path additions in SSSE3
lib/crypto: x86/sha512: Use local labels for data
lib/crypto/x86/sha512-ssse3-asm.S | 298 ++++++++++++++++++------------
1 file changed, 175 insertions(+), 123 deletions(-)
base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
--
2.56.1
next reply other threads:[~2026-11-22 2:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 2:20 Eric Biggers [this message]
2026-11-22 2:20 ` [PATCH 1/8] lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3() Eric Biggers
2026-11-22 2:20 ` [PATCH 2/8] lib/crypto: x86/sha512: Keep message schedule in XMM registers Eric Biggers
2026-11-22 2:20 ` [PATCH 3/8] lib/crypto: x86/sha512: Keep W[t]+K[t] in %xmm5 instead of stack Eric Biggers
2026-11-22 2:20 ` [PATCH 4/8] lib/crypto: x86/sha512: Keep XMM_QWORD_BSWAP in %xmm14 across blocks Eric Biggers
2026-11-22 2:20 ` [PATCH 5/8] lib/crypto: x86/sha512: Use pshufb for ror64(x, 8) in SSSE3 s0 Eric Biggers
2026-11-22 2:20 ` [PATCH 6/8] lib/crypto: x86/sha512: Keep state in registers across blocks in SSSE3 Eric Biggers
2026-11-22 2:20 ` [PATCH 7/8] lib/crypto: x86/sha512: Shorten critical-path additions " Eric Biggers
2026-11-22 2:20 ` [PATCH 8/8] lib/crypto: x86/sha512: Use local labels for data 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=20261122022030.296468-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=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