]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/crypto: arm64/sha256: Add support for 2-way interleaved hashing
authorEric Biggers <ebiggers@kernel.org>
Mon, 15 Sep 2025 16:08:15 +0000 (11:08 -0500)
committerEric Biggers <ebiggers@kernel.org>
Wed, 17 Sep 2025 18:09:39 +0000 (13:09 -0500)
commit34c3f1e346e7b2b8a420b1ea341b341525baf92b
tree2574e9e39aab050a7cd582dd4e6f32225eb18d5f
parent4ca24d6abbca5df76c4b189dd94fb055613de297
lib/crypto: arm64/sha256: Add support for 2-way interleaved hashing

Add an implementation of sha256_finup_2x_arch() for arm64.  It
interleaves the computation of two SHA-256 hashes using the ARMv8
SHA-256 instructions.  dm-verity and fs-verity will take advantage of
this for greatly improved performance on capable CPUs.

This increases the throughput of SHA-256 hashing 4096-byte messages by
the following amounts on the following CPUs:

    ARM Cortex-X1: 70%
    ARM Cortex-X3: 68%
    ARM Cortex-A76: 65%
    ARM Cortex-A715: 43%
    ARM Cortex-A510: 25%
    ARM Cortex-A55: 8%

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250915160819.140019-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
lib/crypto/arm64/sha256-ce.S
lib/crypto/arm64/sha256.h