]> Gentwo Git Trees - linux/.git/commit
lib/crypto: x86/blake2s: Use vpternlogd for 3-input XORs
authorEric Biggers <ebiggers@kernel.org>
Sun, 2 Nov 2025 23:42:09 +0000 (15:42 -0800)
committerEric Biggers <ebiggers@kernel.org>
Thu, 6 Nov 2025 04:30:52 +0000 (20:30 -0800)
commit8ba60c5914f25a44f10189c6919a737b199f6dbf
treeea6f5dde3fa02e6ba66547cd982c6ccbfdf27483
parentcd5528621abb01664a477392cd3e76be2ef6296b
lib/crypto: x86/blake2s: Use vpternlogd for 3-input XORs

AVX-512 supports 3-input XORs via the vpternlogd (or vpternlogq)
instruction with immediate 0x96.  This approach, vs. the alternative of
two vpxor instructions, is already used in the CRC, AES-GCM, and AES-XTS
code, since it reduces the instruction count and is faster on some CPUs.
Make blake2s_compress_avx512() take advantage of it too.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251102234209.62133-7-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
lib/crypto/x86/blake2s-core.S