s390/crypto: add SIMD implementation for ChaCha20
authorPatrick Steuer <patrick.steuer@de.ibm.com>
Thu, 4 Nov 2021 14:58:51 +0000 (15:58 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Dec 2021 13:42:24 +0000 (14:42 +0100)
commitb087dfab4d3902681550fd1f5ff9c3e942059478
treeacc95523edb8e6eac15e296eaf9ecb5b5ac889b5
parent0fcfb00b28c0b7884635dacf38e46d60bf3d4eb1
s390/crypto: add SIMD implementation for ChaCha20

Add an implementation of the ChaCha20 stream cipher (see e.g. RFC 7539)
that makes use of z13's vector instruction set extension.

The original implementation is by Andy Polyakov which is
adapted for kernel use.

Four to six blocks are processed in parallel resulting in a performance
gain for inputs >= 256 bytes.

chacha20-generic

1 operation in 622 cycles (256 bytes)
1 operation in 2346 cycles (1024 bytes)

chacha20-s390

1 operation in 218 cycles (256 bytes)
1 operation in 647 cycles (1024 bytes)

Cc: Andy Polyakov <appro@openssl.org>
Reviewed-by: Harald Freudenberger <freude@de.ibm.com>
Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
arch/s390/crypto/Makefile
arch/s390/crypto/chacha-glue.c [new file with mode: 0644]
arch/s390/crypto/chacha-s390.S [new file with mode: 0644]
arch/s390/crypto/chacha-s390.h [new file with mode: 0644]
arch/s390/include/asm/vx-insn.h
drivers/crypto/Kconfig