diff --git a/evm/src/cpu/kernel/asm/curve_add.asm b/evm/src/cpu/kernel/asm/curve_add.asm index 541b1605..15f9df05 100644 --- a/evm/src/cpu/kernel/asm/curve_add.asm +++ b/evm/src/cpu/kernel/asm/curve_add.asm @@ -104,7 +104,7 @@ ec_add_snd_zero: JUMPDEST // stack: x0, y0, x1, y1, retdest - // Just return (x1,y1) + // Just return (x0,y0) %stack (x0, y0, x1, y1, retdest) -> (retdest, x0, y0) JUMP diff --git a/evm/src/cpu/kernel/stack_manipulation.rs b/evm/src/cpu/kernel/stack_manipulation.rs index 6f20ead6..63d0566c 100644 --- a/evm/src/cpu/kernel/stack_manipulation.rs +++ b/evm/src/cpu/kernel/stack_manipulation.rs @@ -214,8 +214,11 @@ impl StackOp { // This is just a rough estimate; we can update it after implementing PUSH. (bytes, bytes) } - Pop => (1, 1), + // A POP takes one cycle, and doesn't involve memory, it just decrements a pointer. + Pop => (1, 0), + // A DUP takes one cycle, and a read and a write. StackOp::Dup(_) => (1, 2), + // A SWAP takes one cycle with four memory ops, to read both values then write to them. StackOp::Swap(_) => (1, 4), };