From 7e0334fccebc93506904882b8aca5705112cbda7 Mon Sep 17 00:00:00 2001 From: Dmitry Vagner Date: Sat, 30 Jul 2022 14:21:06 -0400 Subject: [PATCH] fix shift direction --- evm/src/cpu/kernel/asm/ripemd/subroutines.asm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/evm/src/cpu/kernel/asm/ripemd/subroutines.asm b/evm/src/cpu/kernel/asm/ripemd/subroutines.asm index ce91e1bc..263dfcd0 100644 --- a/evm/src/cpu/kernel/asm/ripemd/subroutines.asm +++ b/evm/src/cpu/kernel/asm/ripemd/subroutines.asm @@ -14,21 +14,21 @@ global Rol: swap1 // stack: x, 32-n, x, n, retdest shr - // stack: x << (32-n), x, n, retdest + // stack: x >> (32-n), x, n, retdest swap2 - // stack: n, x, x << (32-n), retdest + // stack: n, x, x >> (32-n), retdest swap1 - // stack: x, n, x << (32-n), retdest + // stack: x, n, x >> (32-n), retdest shl - // stack: x >> n, x << (32-n), retdest + // stack: x << n, x >> (32-n), retdest push 0xffffffff - // stack: 0xffffffff, (x >> n), x << (32-n), retdest + // stack: 0xffffffff, (x << n), x >> (32-n), retdest and - // stack: (x >> n) & 0xffffffff, x << (32-n), retdest + // stack: (x << n) & 0xffffffff, x >> (32-n), retdest or - // stack: ((x >> n) & 0xffffffff) | (x << (32-n)), retdest + // stack: ((x << n) & 0xffffffff) | (x >> (32-n)), retdest swap1 - // stack: retdest, ((x >> n) & 0xffffffff) | (x << (32-n)) + // stack: retdest, ((x << n) & 0xffffffff) | (x >> (32-n)) jump