This commit is contained in:
Nicholas Ward 2022-07-28 10:34:51 -07:00
parent 6a31a4b7ec
commit 4b3ce01f8e
2 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ sha2_store_loop:
JUMPDEST
// stack: addr, counter, x[num_bytes-counter], ... , x[num_bytes-1], retdest
dup1
STOP
// stack: addr, addr, counter, x[num_bytes-counter], ... , x[num_bytes-1], retdest
swap3
// stack: x[num_bytes-counter], addr, counter, addr, ... , x[num_bytes-1], retdest

View File

@ -29,6 +29,7 @@ fn test_sha2_store() -> Result<()> {
let mut initial_stack = vec![U256::from(num_bytes)];
initial_stack.extend(bytes);
initial_stack.push(U256::from_str("0xdeadbeef").unwrap());
initial_stack.reverse();
dbg!(initial_stack.clone());
let stack_with_kernel = run(&kernel.code, sha2_store, initial_stack)?.stack;
dbg!(stack_with_kernel);