diff --git a/evm/src/cpu/kernel/asm/bignum/ge.asm b/evm/src/cpu/kernel/asm/bignum/ge.asm index cdd7712f..e7f5aca2 100644 --- a/evm/src/cpu/kernel/asm/bignum/ge.asm +++ b/evm/src/cpu/kernel/asm/bignum/ge.asm @@ -1,7 +1,8 @@ // Arithmetic on little-endian integers represented with 128-bit limbs. // All integers must be under a given length bound, and are padded with leading zeroes. -// Returns a >= b. +// Compares two bignums of the same given length. Assumes that len > 0. +// Returns 1 if a > b, 3 if a == b, and 0 if a < b. global ge_bignum: // stack: len, a_start_loc, b_start_loc, retdest SWAP1 diff --git a/evm/src/cpu/kernel/asm/bignum/iszero.asm b/evm/src/cpu/kernel/asm/bignum/iszero.asm index ff755270..2f742f77 100644 --- a/evm/src/cpu/kernel/asm/bignum/iszero.asm +++ b/evm/src/cpu/kernel/asm/bignum/iszero.asm @@ -3,6 +3,10 @@ global iszero_bignum: // stack: len, start_loc, retdest + DUP1 + // stack: len, len, start_loc, retdest + ISZERO + %jumpi(eqzero) DUP2 // stack: start_loc, len, start_loc, retdest ADD