[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nettle-bugs
Subject:    [PATCH 2/2] salsa20: Don't return via W64_EXIT within the Lpartial subfunction
From:       Martin Storsjö <martin () martin ! st>
Date:       2013-04-23 14:12:45
Message-ID: 1366726365-11594-2-git-send-email-martin () martin ! st
[Download RAW message or body]

The Lpartial subfunction is entered with plain call instructions,
and the win64 epilogue should only run when actually exiting the
whole salsa20_crypt function.
---
 x86_64/salsa20-crypt.asm |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/x86_64/salsa20-crypt.asm b/x86_64/salsa20-crypt.asm
index 25b7e49..9d1b53d 100644
--- a/x86_64/salsa20-crypt.asm
+++ b/x86_64/salsa20-crypt.asm
@@ -224,10 +224,11 @@ PROLOGUE(nettle_salsa20_crypt)
 	shr	$16, XREG(T64)
 .Llt2:
 	test	$1, LENGTH
-	jz	.Lend
+	jz	.Lret
 	xor	(SRC, POS), LREG(T64)
 	mov	LREG(T64), (DST, POS)
 
-	jmp	.Lend
+.Lret:
+	ret
 
 EPILOGUE(nettle_salsa20_crypt)
-- 
1.7.9.5


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic