s390/sha3: Support sha3 performance enhancements
authorJoerg Schmidbauer <jschmidb@de.ibm.com>
Wed, 28 Aug 2024 11:52:30 +0000 (13:52 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 29 Aug 2024 20:56:34 +0000 (22:56 +0200)
commit88c02b3f79a61e659749773865998e0c33247e86
treec9a32b4f7daef390c23370509babb9eab2afd36f
parent177b621bf0685e8733fa6a7c796865f4200a6e2f
s390/sha3: Support sha3 performance enhancements

On newer machines the SHA3 performance of CPACF instructions KIMD and
KLMD can be enhanced by using additional modifier bits. This allows the
application to omit initializing the ICV, but also affects the internal
processing of the instructions. Performance is mostly gained when
processing short messages.

The new CPACF feature is backwards compatible with older machines, i.e.
the new modifier bits are ignored on older machines. However, to save the
ICV initialization, the application must detect the MSA level and omit
the ICV initialization only if this feature is supported.

Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Joerg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/crypto/sha.h
arch/s390/crypto/sha3_256_s390.c
arch/s390/crypto/sha3_512_s390.c
arch/s390/crypto/sha_common.c
arch/s390/include/asm/cpacf.h