mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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>
65 lines
2.1 KiB
Plaintext
65 lines
2.1 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
menu "Accelerated Cryptographic Algorithms for CPU (powerpc)"
|
|
|
|
config CRYPTO_AES_PPC_SPE
|
|
tristate "Ciphers: AES, modes: ECB/CBC/CTR/XTS (SPE)"
|
|
depends on SPE
|
|
select CRYPTO_LIB_AES
|
|
select CRYPTO_SKCIPHER
|
|
help
|
|
Length-preserving ciphers: AES with ECB, CBC, CTR, and XTS modes
|
|
|
|
Architecture: powerpc using:
|
|
- SPE (Signal Processing Engine) extensions
|
|
|
|
SPE is available for:
|
|
- Processor Type: Freescale 8500
|
|
- CPU selection: e500 (8540)
|
|
|
|
This module should only be used for low power (router) devices
|
|
without hardware AES acceleration (e.g. caam crypto). It reduces the
|
|
size of the AES tables from 16KB to 8KB + 256 bytes and mitigates
|
|
timining attacks. Nevertheless it might be not as secure as other
|
|
architecture specific assembler implementations that work on 1KB
|
|
tables or 256 bytes S-boxes.
|
|
|
|
config CRYPTO_AES_GCM_P10
|
|
tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)"
|
|
depends on PPC64 && CPU_LITTLE_ENDIAN && VSX
|
|
select CRYPTO_LIB_AES
|
|
select CRYPTO_ALGAPI
|
|
select CRYPTO_AEAD
|
|
select CRYPTO_SKCIPHER
|
|
select CRYPTO_SIMD
|
|
help
|
|
AEAD cipher: AES cipher algorithms (FIPS-197)
|
|
GCM (Galois/Counter Mode) authenticated encryption mode (NIST SP800-38D)
|
|
Architecture: powerpc64 using:
|
|
- little-endian
|
|
- Power10 or later features
|
|
|
|
Support for cryptographic acceleration instructions on Power10 or
|
|
later CPU. This module supports stitched acceleration for AES/GCM.
|
|
|
|
config CRYPTO_DEV_VMX
|
|
bool "Support for VMX cryptographic acceleration instructions"
|
|
depends on PPC64 && VSX
|
|
help
|
|
Support for VMX cryptographic acceleration instructions.
|
|
|
|
config CRYPTO_DEV_VMX_ENCRYPT
|
|
tristate "Encryption acceleration support on P8 CPU"
|
|
depends on CRYPTO_DEV_VMX
|
|
select CRYPTO_AES
|
|
select CRYPTO_CBC
|
|
select CRYPTO_CTR
|
|
select CRYPTO_XTS
|
|
default m
|
|
help
|
|
Support for VMX cryptographic acceleration instructions on Power8 CPU.
|
|
This module supports acceleration for AES in hardware. If you choose
|
|
'M' here, this module will be called vmx-crypto.
|
|
|
|
endmenu
|