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)