Add s390x/zSeries acceleration for SHA1
* cipher/asm-inline-s390x.h (ALWAYS_INLINE): New. (klmd_query): New. (km_function_to_mask, kimd_execute, klmd_execute): Mark as always inline. * cipher/rijndael-s390x.c (ALWAYS_INLINE): Remove. * cipher/sha1.c (do_sha1_transform_s390x, do_sha1_final_s390x): New. (sha1_init) [SHA1_USE_S390X_CRYPTO]: Detect and setup s390x/zSeries acceleration. (sha1_final) [SHA1_USE_S390X_CRYPTO]: Use accelerated final function. * cipher/sha1.h (SHA1_USE_S390X_CRYPTO): New. (SHA1_CONTEXT) [SHA1_USE_S390X_CRYPTO]: New.
Benchmark (z15, 5.2Ghz):
Before:
| nanosecs/byte mebibytes/sec cycles/byte
SHA1 | 2.48 ns/B 384.1 MiB/s 12.91 c/B
After:
| nanosecs/byte mebibytes/sec cycles/byte
SHA1 | 0.513 ns/B 1861 MiB/s 2.67 c/B
- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>