From: Martin Storsjö Date: Tue, 23 Apr 2013 14:12:45 +0000 (+0300) Subject: salsa20: Don't return via W64_EXIT within the Lpartial subfunction X-Git-Tag: nettle_2.7_release_20130424~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99740b4fac501e26f226aed284b825273c41432e;p=thirdparty%2Fnettle.git salsa20: Don't return via W64_EXIT within the Lpartial subfunction The Lpartial subfunction is entered with plain call instructions, and the win64 epilogue should only run when actually exiting the whole salsa20_crypt function. --- diff --git a/ChangeLog b/ChangeLog index 0a30fbd4..8dc48dee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2013-04-23 Niels Möller From Martin Storsjö: + * x86_64/salsa20-crypt.asm (Lpartial): Don't return via W64_EXIT + within this subfunction. * x86_64/machine.m4 (W64_ENTRY): Use movdqu instead of movdqa for saving xmm registers, since the stack is not guaranteed to be 16-byte aligned on win64. diff --git a/x86_64/salsa20-crypt.asm b/x86_64/salsa20-crypt.asm index 25b7e497..9d1b53d9 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)