Skip to content

Commit

Permalink
Update build files in generated-src
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Jun 12, 2024
1 parent 0647e1a commit 1997f31
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 145 deletions.
28 changes: 6 additions & 22 deletions generated-src/ios-aarch64/crypto/chacha/chacha-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_AARCH64) && defined(__APPLE__)
#include <openssl/arm_arch.h>


.private_extern _OPENSSL_armcap_P

.section __TEXT,__const

.align 5
Expand All @@ -21,25 +18,11 @@ Lone:

.text

.globl _ChaCha20_ctr32
.private_extern _ChaCha20_ctr32
.globl _ChaCha20_ctr32_nohw
.private_extern _ChaCha20_ctr32_nohw

.align 5
_ChaCha20_ctr32:
AARCH64_VALID_CALL_TARGET
cbz x2,Labort
#if defined(OPENSSL_HWASAN) && __clang_major__ >= 10
adrp x5,:pg_hi21_nc:_OPENSSL_armcap_P
#else
adrp x5,_OPENSSL_armcap_P@PAGE
#endif
cmp x2,#192
b.lo Lshort
ldr w17,[x5,_OPENSSL_armcap_P@PAGEOFF]
tst w17,#ARMV7_NEON
b.ne ChaCha20_neon

Lshort:
_ChaCha20_ctr32_nohw:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down Expand Up @@ -254,7 +237,6 @@ Loop:
ldp x27,x28,[x29,#80]
ldp x29,x30,[sp],#96
AARCH64_VALIDATE_LINK_REGISTER
Labort:
ret

.align 4
Expand Down Expand Up @@ -314,9 +296,11 @@ Loop_tail:
ret


.globl _ChaCha20_ctr32_neon
.private_extern _ChaCha20_ctr32_neon

.align 5
ChaCha20_neon:
_ChaCha20_ctr32_neon:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down
46 changes: 8 additions & 38 deletions generated-src/ios-arm/crypto/chacha/chacha-armv4.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,17 @@ Lsigma:
.long 0x61707865,0x3320646e,0x79622d32,0x6b206574 @ endian-neutral
Lone:
.long 1,0,0,0
#if __ARM_MAX_ARCH__>=7
LOPENSSL_armcap:
.word OPENSSL_armcap_P-Lsigma
#else
.word -1
#endif

.globl _ChaCha20_ctr32
.private_extern _ChaCha20_ctr32
.globl _ChaCha20_ctr32_nohw
.private_extern _ChaCha20_ctr32_nohw
#ifdef __thumb2__
.thumb_func _ChaCha20_ctr32
.thumb_func _ChaCha20_ctr32_nohw
#endif
.align 5
_ChaCha20_ctr32:
LChaCha20_ctr32:
_ChaCha20_ctr32_nohw:
ldr r12,[sp,#0] @ pull pointer to counter and nonce
stmdb sp!,{r0,r1,r2,r4-r11,lr}
adr r14,Lsigma
cmp r2,#0 @ len==0?
#ifdef __thumb2__
itt eq
#endif
addeq sp,sp,#4*3
beq Lno_data
#if __ARM_MAX_ARCH__>=7
cmp r2,#192 @ test len
bls Lshort
ldr r4,[r14,#32]
ldr r4,[r14,r4]
# ifdef __APPLE__
ldr r4,[r4]
# endif
tst r4,#ARMV7_NEON
bne LChaCha20_neon
Lshort:
#endif
ldmia r12,{r4,r5,r6,r7} @ load counter and nonce
sub sp,sp,#4*(16) @ off-load area
stmdb sp!,{r4,r5,r6,r7} @ copy counter and nonce
Expand Down Expand Up @@ -793,21 +768,21 @@ Loop_tail:

Ldone:
add sp,sp,#4*(32+3)
Lno_data:
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}

#if __ARM_MAX_ARCH__>=7



.globl _ChaCha20_ctr32_neon
.private_extern _ChaCha20_ctr32_neon
#ifdef __thumb2__
.thumb_func ChaCha20_neon
.thumb_func _ChaCha20_ctr32_neon
#endif
.align 5
ChaCha20_neon:
_ChaCha20_ctr32_neon:
ldr r12,[sp,#0] @ pull pointer to counter and nonce
stmdb sp!,{r0,r1,r2,r4-r11,lr}
LChaCha20_neon:
adr r14,Lsigma
vstmdb sp!,{d8,d9,d10,d11,d12,d13,d14,d15} @ ABI spec says so
stmdb sp!,{r0,r1,r2,r3}
Expand Down Expand Up @@ -1476,10 +1451,5 @@ Ldone_neon:
add sp,sp,#4*(16+3)
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}

.comm _OPENSSL_armcap_P,4
.non_lazy_symbol_pointer
OPENSSL_armcap_P:
.indirect_symbol _OPENSSL_armcap_P
.long 0
#endif
#endif // !OPENSSL_NO_ASM && defined(OPENSSL_ARM) && defined(__APPLE__)
36 changes: 10 additions & 26 deletions generated-src/linux-aarch64/crypto/chacha/chacha-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_AARCH64) && defined(__ELF__)
#include <openssl/arm_arch.h>


.hidden OPENSSL_armcap_P

.section .rodata

.align 5
Expand All @@ -21,25 +18,11 @@

.text

.globl ChaCha20_ctr32
.hidden ChaCha20_ctr32
.type ChaCha20_ctr32,%function
.globl ChaCha20_ctr32_nohw
.hidden ChaCha20_ctr32_nohw
.type ChaCha20_ctr32_nohw,%function
.align 5
ChaCha20_ctr32:
AARCH64_VALID_CALL_TARGET
cbz x2,.Labort
#if defined(OPENSSL_HWASAN) && __clang_major__ >= 10
adrp x5,:pg_hi21_nc:OPENSSL_armcap_P
#else
adrp x5,OPENSSL_armcap_P
#endif
cmp x2,#192
b.lo .Lshort
ldr w17,[x5,:lo12:OPENSSL_armcap_P]
tst w17,#ARMV7_NEON
b.ne ChaCha20_neon

.Lshort:
ChaCha20_ctr32_nohw:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down Expand Up @@ -254,7 +237,6 @@ ChaCha20_ctr32:
ldp x27,x28,[x29,#80]
ldp x29,x30,[sp],#96
AARCH64_VALIDATE_LINK_REGISTER
.Labort:
ret

.align 4
Expand Down Expand Up @@ -312,11 +294,13 @@ ChaCha20_ctr32:
ldp x29,x30,[sp],#96
AARCH64_VALIDATE_LINK_REGISTER
ret
.size ChaCha20_ctr32,.-ChaCha20_ctr32
.size ChaCha20_ctr32_nohw,.-ChaCha20_ctr32_nohw

.type ChaCha20_neon,%function
.globl ChaCha20_ctr32_neon
.hidden ChaCha20_ctr32_neon
.type ChaCha20_ctr32_neon,%function
.align 5
ChaCha20_neon:
ChaCha20_ctr32_neon:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down Expand Up @@ -810,7 +794,7 @@ ChaCha20_neon:
ldp x29,x30,[sp],#96
AARCH64_VALIDATE_LINK_REGISTER
ret
.size ChaCha20_neon,.-ChaCha20_neon
.size ChaCha20_ctr32_neon,.-ChaCha20_ctr32_neon
.type ChaCha20_512_neon,%function
.align 5
ChaCha20_512_neon:
Expand Down
46 changes: 10 additions & 36 deletions generated-src/linux-arm/crypto/chacha/chacha-armv4.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,15 @@
.long 0x61707865,0x3320646e,0x79622d32,0x6b206574 @ endian-neutral
.Lone:
.long 1,0,0,0
#if __ARM_MAX_ARCH__>=7
.LOPENSSL_armcap:
.word OPENSSL_armcap_P-.Lsigma
#else
.word -1
#endif

.globl ChaCha20_ctr32
.hidden ChaCha20_ctr32
.type ChaCha20_ctr32,%function
.globl ChaCha20_ctr32_nohw
.hidden ChaCha20_ctr32_nohw
.type ChaCha20_ctr32_nohw,%function
.align 5
ChaCha20_ctr32:
.LChaCha20_ctr32:
ChaCha20_ctr32_nohw:
ldr r12,[sp,#0] @ pull pointer to counter and nonce
stmdb sp!,{r0,r1,r2,r4-r11,lr}
adr r14,.Lsigma
cmp r2,#0 @ len==0?
#ifdef __thumb2__
itt eq
#endif
addeq sp,sp,#4*3
beq .Lno_data
#if __ARM_MAX_ARCH__>=7
cmp r2,#192 @ test len
bls .Lshort
ldr r4,[r14,#32]
ldr r4,[r14,r4]
# ifdef __APPLE__
ldr r4,[r4]
# endif
tst r4,#ARMV7_NEON
bne .LChaCha20_neon
.Lshort:
#endif
ldmia r12,{r4,r5,r6,r7} @ load counter and nonce
sub sp,sp,#4*(16) @ off-load area
stmdb sp!,{r4,r5,r6,r7} @ copy counter and nonce
Expand Down Expand Up @@ -791,19 +766,19 @@ ChaCha20_ctr32:

.Ldone:
add sp,sp,#4*(32+3)
.Lno_data:
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}
.size ChaCha20_ctr32,.-ChaCha20_ctr32
.size ChaCha20_ctr32_nohw,.-ChaCha20_ctr32_nohw
#if __ARM_MAX_ARCH__>=7
.arch armv7-a
.fpu neon

.type ChaCha20_neon,%function
.globl ChaCha20_ctr32_neon
.hidden ChaCha20_ctr32_neon
.type ChaCha20_ctr32_neon,%function
.align 5
ChaCha20_neon:
ChaCha20_ctr32_neon:
ldr r12,[sp,#0] @ pull pointer to counter and nonce
stmdb sp!,{r0,r1,r2,r4-r11,lr}
.LChaCha20_neon:
adr r14,.Lsigma
vstmdb sp!,{d8,d9,d10,d11,d12,d13,d14,d15} @ ABI spec says so
stmdb sp!,{r0,r1,r2,r3}
Expand Down Expand Up @@ -1471,7 +1446,6 @@ ChaCha20_neon:
vldmia sp,{d8,d9,d10,d11,d12,d13,d14,d15}
add sp,sp,#4*(16+3)
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}
.size ChaCha20_neon,.-ChaCha20_neon
.comm OPENSSL_armcap_P,4,4
.size ChaCha20_ctr32_neon,.-ChaCha20_ctr32_neon
#endif
#endif // !OPENSSL_NO_ASM && defined(OPENSSL_ARM) && defined(__ELF__)
30 changes: 7 additions & 23 deletions generated-src/win-aarch64/crypto/chacha/chacha-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_AARCH64) && defined(_WIN32)
#include <openssl/arm_arch.h>




.section .rodata

.align 5
Expand All @@ -21,27 +18,13 @@ Lone:

.text

.globl ChaCha20_ctr32
.globl ChaCha20_ctr32_nohw

.def ChaCha20_ctr32
.def ChaCha20_ctr32_nohw
.type 32
.endef
.align 5
ChaCha20_ctr32:
AARCH64_VALID_CALL_TARGET
cbz x2,Labort
#if defined(OPENSSL_HWASAN) && __clang_major__ >= 10
adrp x5,:pg_hi21_nc:OPENSSL_armcap_P
#else
adrp x5,OPENSSL_armcap_P
#endif
cmp x2,#192
b.lo Lshort
ldr w17,[x5,:lo12:OPENSSL_armcap_P]
tst w17,#ARMV7_NEON
b.ne ChaCha20_neon

Lshort:
ChaCha20_ctr32_nohw:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down Expand Up @@ -256,7 +239,6 @@ Loop:
ldp x27,x28,[x29,#80]
ldp x29,x30,[sp],#96
AARCH64_VALIDATE_LINK_REGISTER
Labort:
ret

.align 4
Expand Down Expand Up @@ -316,11 +298,13 @@ Loop_tail:
ret


.def ChaCha20_neon
.globl ChaCha20_ctr32_neon

.def ChaCha20_ctr32_neon
.type 32
.endef
.align 5
ChaCha20_neon:
ChaCha20_ctr32_neon:
AARCH64_SIGN_LINK_REGISTER
stp x29,x30,[sp,#-96]!
add x29,sp,#0
Expand Down

0 comments on commit 1997f31

Please sign in to comment.