]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/crypto: arm64/aes: Migrate optimized CBC-based MACs into library
authorEric Biggers <ebiggers@kernel.org>
Wed, 18 Feb 2026 21:34:51 +0000 (13:34 -0800)
committerEric Biggers <ebiggers@kernel.org>
Mon, 9 Mar 2026 20:27:20 +0000 (13:27 -0700)
commit58286738b159ca93d41438a6ddcc2ea5333191b4
tree4254bb7edf60afce482b9145c14d3e0504c4ea1a
parent4b908403209252e59ecad4c068bf967fa3f07525
lib/crypto: arm64/aes: Migrate optimized CBC-based MACs into library

Instead of exposing the arm64-optimized CMAC, XCBC-MAC, and CBC-MAC code
via arm64-specific crypto_shash algorithms, instead just implement the
aes_cbcmac_blocks_arch() library function.  This is much simpler, it
makes the corresponding library functions be arm64-optimized, and it
fixes the longstanding issue where this optimized code was disabled by
default.  The corresponding algorithms still remain available through
crypto_shash, but individual architectures no longer need to handle it.

Note that to be compatible with the library using 'size_t' lengths, the
type of the return value and 'blocks' parameter to the assembly
functions had to be changed to 'size_t', and the assembly code had to be
updated accordingly to use the corresponding 64-bit registers.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260218213501.136844-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
arch/arm64/crypto/Kconfig
arch/arm64/crypto/aes-glue.c
include/crypto/aes.h
lib/crypto/arm64/aes-modes.S
lib/crypto/arm64/aes.h