[PATCH] Make jump labels local in Salsa20 assembly

Jussi Kivilinna jussi.kivilinna at iki.fi
Mon Nov 4 14:01:08 CET 2013


* cipher/salsa20-amd64.S: Rename '._labels' to '.L_labels'.
* cipher/salsa20-armv7-neon.S: Ditto.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 cipher/salsa20-amd64.S      |   40 +++++++++++++++++-----------------
 cipher/salsa20-armv7-neon.S |   50 ++++++++++++++++++++++---------------------
 2 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/cipher/salsa20-amd64.S b/cipher/salsa20-amd64.S
index 691df58..e79da4e 100644
--- a/cipher/salsa20-amd64.S
+++ b/cipher/salsa20-amd64.S
@@ -42,8 +42,8 @@ _gcry_salsa20_amd64_keysetup:
 	movl   %eax,60(%rdi)
 	movl   %r10d,48(%rdi)
 	cmp  $256,%rdx
-	jb ._kbits128
-._kbits256:
+	jb .L_kbits128
+.L_kbits256:
 	movl   16(%rsi),%edx
 	movl   20(%rsi),%ecx
 	movl   24(%rsi),%r8d
@@ -60,8 +60,8 @@ _gcry_salsa20_amd64_keysetup:
 	movl   %edx,4(%rdi)
 	movl   %ecx,8(%rdi)
 	movl   %r8d,12(%rdi)
-	jmp ._keysetupdone
-._kbits128:
+	jmp .L_keysetupdone
+.L_kbits128:
 	movl   0(%rsi),%edx
 	movl   4(%rsi),%ecx
 	movl   8(%rsi),%r8d
@@ -78,7 +78,7 @@ _gcry_salsa20_amd64_keysetup:
 	movl   %edx,4(%rdi)
 	movl   %ecx,8(%rdi)
 	movl   %r8d,12(%rdi)
-._keysetupdone:
+.L_keysetupdone:
 	ret
 
 .align 8
@@ -117,10 +117,10 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	mov  %rdx,%rdi
 	mov  %rcx,%rdx
 	cmp  $0,%rdx
-	jbe ._done
-._start:
+	jbe .L_done
+.L_start:
 	cmp  $256,%rdx
-	jb ._bytes_are_64_128_or_192
+	jb .L_bytes_are_64_128_or_192
 	movdqa 0(%r8),%xmm0
 	pshufd $0x55,%xmm0,%xmm1
 	pshufd $0xaa,%xmm0,%xmm2
@@ -153,7 +153,7 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	movdqa %xmm1,176(%rsp)
 	movdqa %xmm2,192(%rsp)
 	movdqa %xmm0,208(%rsp)
-._bytesatleast256:
+.L_bytesatleast256:
 	movl   32(%r8),%ecx
 	movl   52(%r8),%r9d
 	movl %ecx,224(%rsp)
@@ -192,7 +192,7 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	movdqa 96(%rsp),%xmm13
 	movdqa 176(%rsp),%xmm14
 	movdqa 224(%rsp),%xmm15
-._mainloop1:
+.L_mainloop1:
 	movdqa %xmm1,256(%rsp)
 	movdqa %xmm2,272(%rsp)
 	movdqa %xmm13,%xmm1
@@ -434,7 +434,7 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	movdqa 256(%rsp),%xmm12
 	movdqa 272(%rsp),%xmm0
 	sub  $2,%rdx
-	ja ._mainloop1
+	ja .L_mainloop1
 	paddd 48(%rsp),%xmm12
 	paddd 112(%rsp),%xmm7
 	paddd 160(%rsp),%xmm10
@@ -696,10 +696,10 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	add  $256,%rsi
 	add  $256,%rdi
 	cmp  $256,%rdx
-	jae ._bytesatleast256
+	jae .L_bytesatleast256
 	cmp  $0,%rdx
-	jbe ._done
-._bytes_are_64_128_or_192:
+	jbe .L_done
+.L_bytes_are_64_128_or_192:
 	movq %rdx,288(%rsp)
 	movdqa 0(%r8),%xmm0
 	movdqa 16(%r8),%xmm1
@@ -707,7 +707,7 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	movdqa 48(%r8),%xmm3
 	movdqa %xmm1,%xmm4
 	mov  %rbx,%rdx
-._mainloop2:
+.L_mainloop2:
 	paddd %xmm0,%xmm4
 	movdqa %xmm0,%xmm5
 	movdqa %xmm4,%xmm6
@@ -834,7 +834,7 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	pxor  %xmm5,%xmm0
 	pshufd $0x39,%xmm3,%xmm3
 	pxor  %xmm6,%xmm0
-	ja ._mainloop2
+	ja .L_mainloop2
 	paddd 0(%r8),%xmm0
 	paddd 16(%r8),%xmm1
 	paddd 32(%r8),%xmm2
@@ -907,17 +907,17 @@ _gcry_salsa20_amd64_encrypt_blocks:
 	movl   %ecx,32(%r8)
 	movl   %eax,52(%r8)
 	cmp  $64,%rdx
-	ja ._bytes_are_128_or_192
-._done:
+	ja .L_bytes_are_128_or_192
+.L_done:
 	add %r11,%rsp
 	mov %r11,%rax
 	pop %rbx
 	ret
-._bytes_are_128_or_192:
+.L_bytes_are_128_or_192:
 	sub  $64,%rdx
 	add  $64,%rdi
 	add  $64,%rsi
-	jmp ._bytes_are_64_128_or_192
+	jmp .L_bytes_are_64_128_or_192
 .size _gcry_salsa20_amd64_encrypt_blocks,.-_gcry_salsa20_amd64_encrypt_blocks;
 
 #endif /*defined(USE_SALSA20)*/
diff --git a/cipher/salsa20-armv7-neon.S b/cipher/salsa20-armv7-neon.S
index 7d31e9f..8a9d9c4 100644
--- a/cipher/salsa20-armv7-neon.S
+++ b/cipher/salsa20-armv7-neon.S
@@ -117,8 +117,8 @@ _gcry_arm_neon_salsa20_encrypt:
 	strd r8,[sp,#88]
 	nop
 	cmp r0,#192
-	blo ._mlenlowbelow192
-._mlenatleast192:
+	blo .L_mlenlowbelow192
+.L_mlenatleast192:
 	ldrd r2,[sp,#48]
 	vext.32 d7,d6,d6,#1
 	vmov q8,q1
@@ -157,7 +157,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	ldrd r2,[sp,#56]
 	vst1.8 {d14-d15},[r6,: 128]
 	ldrd r6,[sp,#40]
-._mainloop2:
+.L_mainloop2:
 	str r12,[sp,#248]
 	vadd.i32 q4,q10,q8
 	vadd.i32 q9,q13,q11
@@ -505,7 +505,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r9,r9,r14,ROR #14
 	veor q11,q9,q4
 	subs r12,r12,#4
-	bhi ._mainloop2
+	bhi .L_mainloop2
 	strd r8,[sp,#112]
 	ldrd r8,[sp,#64]
 	strd r2,[sp,#120]
@@ -526,7 +526,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	add r6,r6,r10
 	add r7,r7,r11
 	cmp r12,#0
-	beq ._nomessage1
+	beq .L_nomessage1
 	ldr r8,[r12,#0]
 	ldr r9,[r12,#4]
 	ldr r10,[r12,#8]
@@ -543,7 +543,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r5,r5,r9
 	eor r6,r6,r10
 	eor r7,r7,r11
-._nomessage1:
+.L_nomessage1:
 	ldr r14,[sp,#232]
 	vadd.i32 q4,q8,q1
 	str r0,[r14,#0]
@@ -592,7 +592,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	add r5,r11,r5
 	add r8,r14,#64
 	cmp r12,#0
-	beq ._nomessage2
+	beq .L_nomessage2
 	ldr r9,[r12,#32]
 	ldr r10,[r12,#36]
 	ldr r11,[r12,#40]
@@ -618,7 +618,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r1,r1,r14
 	vld1.8 {d20-d21},[r12]!
 	veor q9,q9,q10
-._nomessage2:
+.L_nomessage2:
 	vst1.8 {d8-d9},[r8]!
 	vst1.8 {d10-d11},[r8]!
 	vmov.i64 q4,#0xff
@@ -654,7 +654,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	vadd.i64 q3,q3,q4
 	sub r0,r0,#192
 	cmp r12,#0
-	beq ._nomessage21
+	beq .L_nomessage21
 	vld1.8 {d16-d17},[r12]!
 	veor q2,q2,q8
 	vld1.8 {d16-d17},[r12]!
@@ -663,7 +663,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	veor q6,q6,q8
 	vld1.8 {d16-d17},[r12]!
 	veor q7,q7,q8
-._nomessage21:
+.L_nomessage21:
 	vst1.8 {d4-d5},[r8]!
 	vst1.8 {d10-d11},[r8]!
 	vst1.8 {d12-d13},[r8]!
@@ -673,15 +673,15 @@ _gcry_arm_neon_salsa20_encrypt:
 	add r12,sp,#256
 	str r8,[sp,#232]
 	cmp r0,#192
-	bhs ._mlenatleast192
-._mlenlowbelow192:
+	bhs .L_mlenatleast192
+.L_mlenlowbelow192:
 	cmp r0,#0
-	beq ._done
-	b ._mlenatleast1
-._nextblock:
+	beq .L_done
+	b .L_mlenatleast1
+.L_nextblock:
 	sub r0,r0,#64
-._mlenatleast1:
-._handleblock:
+.L_mlenatleast1:
+.L_handleblock:
 	str r0,[sp,#248]
 	ldrd r2,[sp,#48]
 	ldrd r6,[sp,#32]
@@ -694,7 +694,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	ldrd r2,[sp,#56]
 	ldrd r6,[sp,#40]
 	ldr r12,[sp,#244]
-._mainloop1:
+.L_mainloop1:
 	str r12,[sp,#252]
 	add r12,r0,r2
 	add r14,r5,r1
@@ -778,7 +778,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r9,r9,r14,ROR #14
 	ldr r12,[sp,#252]
 	subs r12,r12,#2
-	bhi ._mainloop1
+	bhi .L_mainloop1
 	strd r6,[sp,#128]
 	strd r2,[sp,#120]
 	strd r10,[sp,#112]
@@ -799,7 +799,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	add r7,r7,r11
 	ldr r12,[sp,#236]
 	cmp r12,#0
-	beq ._nomessage10
+	beq .L_nomessage10
 	ldr r8,[r12,#0]
 	ldr r9,[r12,#4]
 	ldr r10,[r12,#8]
@@ -816,7 +816,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r5,r5,r9
 	eor r6,r6,r10
 	eor r7,r7,r11
-._nomessage10:
+.L_nomessage10:
 	ldr r14,[sp,#232]
 	str r0,[r14,#0]
 	str r1,[r14,#4]
@@ -846,7 +846,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	add r0,r8,r0
 	add r1,r9,r1
 	cmp r12,#0
-	beq ._nomessage11
+	beq .L_nomessage11
 	ldr r4,[r12,#32]
 	ldr r5,[r12,#36]
 	ldr r8,[r12,#40]
@@ -865,7 +865,7 @@ _gcry_arm_neon_salsa20_encrypt:
 	eor r1,r1,r9
 	add r4,r12,#64
 	str r4,[sp,#236]
-._nomessage11:
+.L_nomessage11:
 	str r6,[r14,#32]
 	str r7,[r14,#36]
 	str r10,[r14,#40]
@@ -878,8 +878,8 @@ _gcry_arm_neon_salsa20_encrypt:
 	str r0,[sp,#232]
 	ldr r0,[sp,#248]
 	cmp r0,#64
-	bhi ._nextblock
-._done:
+	bhi .L_nextblock
+.L_done:
 	ldr r2,[sp,#160]
 	ldrd r4,[sp,#0]
 	ldrd r6,[sp,#8]




More information about the Gcrypt-devel mailing list