diff options
author | fangming.fang <fangming.fang@arm.com> | 2024-01-08 09:35:46 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-01-10 09:52:15 +0100 |
commit | 1d1ca79fe35dbe5c05faed5a2ef8c4de9c5adc49 (patch) | |
tree | d62596310c73b67bf020ab304abb98d4a9b1901b /crypto/aes | |
parent | 806bbafe2df5b699feac6ef26e50c14e701950cf (diff) |
Preserve callee-saved registers in aarch64 AES-CTR code
The AES-CTR assembly code uses v8-v15 registers, they are
callee-saved registers, they must be preserved before the
use and restored after the use.
Change-Id: If9192d1f0f3cea7295f4b0d72ace88e6e8067493
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23233)
Diffstat (limited to 'crypto/aes')
-rwxr-xr-x | crypto/aes/asm/aesv8-armx.pl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl index 699ecfcd21..642d779b99 100755 --- a/crypto/aes/asm/aesv8-armx.pl +++ b/crypto/aes/asm/aesv8-armx.pl @@ -1780,8 +1780,12 @@ $code.=<<___ if ($flavour =~ /64/); ${prefix}_ctr32_encrypt_blocks_unroll12_eor3: AARCH64_VALID_CALL_TARGET // Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later. - stp x29,x30,[sp,#-16]! - add x29,sp,#0 + stp x29,x30,[sp,#-80]! + stp d8,d9,[sp, #16] + stp d10,d11,[sp, #32] + stp d12,d13,[sp, #48] + stp d14,d15,[sp, #64] + add x29,sp,#0 ldr $rounds,[$key,#240] @@ -2486,7 +2490,11 @@ ${prefix}_ctr32_encrypt_blocks_unroll12_eor3: vst1.8 {$in0},[$out],#16 .Lctr32_done_unroll: - ldr x29,[sp],#16 + ldp d8,d9,[sp, #16] + ldp d10,d11,[sp, #32] + ldp d12,d13,[sp, #48] + ldp d15,d16,[sp, #64] + ldr x29,[sp],#80 ret .size ${prefix}_ctr32_encrypt_blocks_unroll12_eor3,.-${prefix}_ctr32_encrypt_blocks_unroll12_eor3 ___ |