openssl/crypto/chacha
Ard Biesheuvel 07a470729c chacha/asm/chacha-armv8.pl: preserve FP registers d8 and d9 correctly
Depending on the size of the input, we may take different paths through
the accelerated arm64 ChaCha20 routines, each of which use a different
subset of the FP registers, some of which need to be preserved and
restored, as required by the AArch64 calling convention (AAPCS64)

In some cases, (e.g., when the input size is 640 bytes), we call the 512
byte NEON path followed directly by the scalar path, and in this case,
we preserve and restore d8 and d9, only to clobber them again
immediately before handing over to the scalar path which does not touch
the FP registers at all, and hence does not restore them either.

Fix this by moving the restoration of d8 and d9 to a later stage in the
512 byte routine, either before calling the scalar path, or when exiting
the function.

Fixes #10470
CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10497)
2019-11-28 16:40:43 +01:00
..
asm chacha/asm/chacha-armv8.pl: preserve FP registers d8 and d9 correctly 2019-11-28 16:40:43 +01:00
build.info build.info: For all assembler generators, remove all arguments 2019-09-16 16:29:57 +02:00
chacha_enc.c chacha_enc.c: fix for EBCDIC platforms 2019-11-13 17:59:48 +01:00