]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/crypto: x86/blake2s: Avoid writing back unchanged 'f' value
authorEric Biggers <ebiggers@kernel.org>
Sun, 2 Nov 2025 23:42:08 +0000 (15:42 -0800)
committerEric Biggers <ebiggers@kernel.org>
Thu, 6 Nov 2025 04:30:52 +0000 (20:30 -0800)
commitcd5528621abb01664a477392cd3e76be2ef6296b
treeecbb13c1f67c44fecfa557cbeff758e961b2e6af
parenta7acd77ebd7f17b07a6ab2ca1dd1e4d487bdfa80
lib/crypto: x86/blake2s: Avoid writing back unchanged 'f' value

Just before returning, blake2s_compress_ssse3() and
blake2s_compress_avx512() store updated values to the 'h', 't', and 'f'
fields of struct blake2s_ctx.  But 'f' is always unchanged (which is
correct; only the C code changes it).  So, there's no need to write to
'f'.  Use 64-bit stores (movq and vmovq) instead of 128-bit stores
(movdqu and vmovdqu) so that only 't' is written.

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