linux/arch/powerpc/crypto
Eric Biggers 73f315c15d lib/crypto: powerpc/ghash: Migrate optimized code into library
Remove the "p8_ghash" crypto_shash algorithm.  Move the corresponding
assembly code into lib/crypto/, and wire it up to the GHASH library.

This makes the GHASH library be optimized for POWER8.  It also greatly
reduces the amount of powerpc-specific glue code that is needed, and it
fixes the issue where this optimized GHASH code was disabled by default.

Note that previously the C code defined the POWER8 GHASH key format as
"u128 htable[16]", despite the assembly code only using four entries.
Fix the C code to use the correct key format.  To fulfill the library
API contract, also make the key preparation work in all contexts.

Note that the POWER8 assembly code takes the accumulator in GHASH
format, but it actually byte-reflects it to get it into POLYVAL format.
The library already works with POLYVAL natively.  For now, just wire up
this existing code by converting it to/from GHASH format in C code.
This should be cleaned up to eliminate the unnecessary conversion later.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260319061723.1140720-12-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-03-23 16:44:29 -07:00
..
.gitignore powerpc/crypto: Add generated P8 asm to .gitignore 2024-06-04 17:45:46 +10:00
aes_cbc.c crypto: powerpc/aes - Rename struct aes_key 2026-01-12 11:39:58 -08:00
aes_ctr.c crypto: powerpc/aes - Rename struct aes_key 2026-01-12 11:39:58 -08:00
aes_xts.c crypto: powerpc/aes - Rename struct aes_key 2026-01-12 11:39:58 -08:00
aes-gcm-p10-glue.c crypto: powerpc/aes - Rename struct aes_key 2026-01-12 11:39:58 -08:00
aes-gcm-p10.S crypto: powerpc/p10-aes-gcm - Re-write AES/GCM stitched implementation 2024-10-05 13:22:05 +08:00
aes-spe-glue.c lib/crypto: powerpc/aes: Migrate SPE optimized code into library 2026-01-12 11:39:58 -08:00
aesp8-ppc.h lib/crypto: powerpc/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
aesp10-ppc.pl powerpc/crypto: Fix aes-gcm-p10 link errors 2023-05-30 15:50:32 +10:00
ghashp10-ppc.pl powerpc/crypto: Fix aes-gcm-p10 link errors 2023-05-30 15:50:32 +10:00
Kconfig lib/crypto: powerpc/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
Makefile lib/crypto: powerpc/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
ppc-xlate.pl crypto: p10-aes-gcm - A perl script to process PowerPC assembler source. 2023-03-14 17:06:43 +08:00
vmx.c lib/crypto: powerpc/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00