OSDN Git Service

crypto: arm64/chacha - optimize for arbitrary length inputs
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 4 Dec 2018 13:13:32 +0000 (14:13 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 13 Dec 2018 10:24:40 +0000 (18:24 +0800)
commitf2ca1cbd0fb584b5b5e0dbd9bda819f49cf9cdb6
tree13a610a77ea99a6862e68fcacae99ea4b18924cf
parentee5bbc9fd3a1fb81e9f6103d6c52ab88926a9603
crypto: arm64/chacha - optimize for arbitrary length inputs

Update the 4-way NEON ChaCha routine so it can handle input of any
length >64 bytes in its entirety, rather than having to call into
the 1-way routine and/or memcpy()s via temp buffers to handle the
tail of a ChaCha invocation that is not a multiple of 256 bytes.

On inputs that are a multiple of 256 bytes (and thus in tcrypt
benchmarks), performance drops by around 1% on Cortex-A57, while
performance for inputs drawn randomly from the range [64, 1024)
increases by around 30%.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/chacha-neon-core.S
arch/arm64/crypto/chacha-neon-glue.c