]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
salsa20: Don't return via W64_EXIT within the Lpartial subfunction
authorMartin Storsjö <martin@martin.st>
Tue, 23 Apr 2013 14:12:45 +0000 (17:12 +0300)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 23 Apr 2013 16:44:17 +0000 (18:44 +0200)
The Lpartial subfunction is entered with plain call instructions,
and the win64 epilogue should only run when actually exiting the
whole salsa20_crypt function.

ChangeLog
x86_64/salsa20-crypt.asm

index 0a30fbd4966174846804918846cd86ab25dca609..8dc48dee7de46e64e801d9f0e1919b796f7ae29b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2013-04-23  Niels Möller  <nisse@lysator.liu.se>
 
        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.
index 25b7e4973b298a100fd6d5e75fc6cc2573da962e..9d1b53d9f553fdd1c3bc14acfac08a45ec833fab 100644 (file)
@@ -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)