diff --git a/x86/aes-decrypt-internal.asm b/x86/aes-decrypt-internal.asm index 730ce2ed88c78aa32f6417f01e28e831065329eb..36d6ca44dc4b50b972a054107c50d5f737f10042 100644 --- a/x86/aes-decrypt-internal.asm +++ b/x86/aes-decrypt-internal.asm @@ -90,7 +90,10 @@ PROLOGUE(_nettle_aes_decrypt) jz .Lend shrl $4, PARAM_LENGTH - subl $1, PARAM_ROUNDS + movl PARAM_ROUNDS, TMP + decl PARAM_ROUNDS + shll $4, TMP + addl TMP, PARAM_KEYS .Lblock_loop: movl PARAM_KEYS, KEY C address of subkeys @@ -103,7 +106,7 @@ PROLOGUE(_nettle_aes_decrypt) C Loop counter on stack movl TMP, FRAME_COUNT - addl $16,KEY C point to next key + subl $16,KEY C point to next key movl KEY,FRAME_KEY ALIGN(16) .Lround_loop: @@ -128,7 +131,7 @@ PROLOGUE(_nettle_aes_decrypt) xorl 4(KEY),SB xorl 8(KEY),SC xorl 12(KEY),SD - addl $16,FRAME_KEY C point to next key + subl $16,FRAME_KEY C point to next key decl FRAME_COUNT jnz .Lround_loop