diff --git a/evm/src/cpu/kernel/asm/sha2/compression.asm b/evm/src/cpu/kernel/asm/sha2/compression.asm index ef287cc0..31b30b21 100644 --- a/evm/src/cpu/kernel/asm/sha2/compression.asm +++ b/evm/src/cpu/kernel/asm/sha2/compression.asm @@ -1,5 +1,4 @@ global sha2_compression: - JUMPDEST // stack: message_schedule_addr, retdest push 0 // stack: i=0, message_schedule_addr, retdest @@ -48,7 +47,6 @@ global sha2_compression: // stack: a[0], b[0], c[0], d[0], e[0], f[0], g[0], h[0], num_blocks, scratch_space_addr, message_schedule_addr, i=0, retdest sha2_compression_start_block: // Store the current values of the working variables, as the "initial values" to be added back in at the end of this block. - JUMPDEST dup10 // stack: scratch_space_addr, a[0], b[0], c[0], d[0], e[0], f[0], g[0], h[0], num_blocks, scratch_space_addr, message_schedule_addr, i=0, retdest @@ -117,7 +115,6 @@ sha2_compression_start_block: // stack: a[0], b[0], c[0], d[0], e[0], f[0], g[0], h[0], num_blocks, scratch_space_addr, message_schedule_addr, i=0, retdest sha2_compression_loop: // Update the eight working variables, using the next constant K[i] and the next message schedule chunk W[i]. - JUMPDEST // stack: a[i], b[i], c[i], d[i], e[i], f[i], g[i], h[i], num_blocks, scratch_space_addr, message_schedule_addr, i, retdest dup11 // stack: message_schedule_addr, a[i], b[i], c[i], d[i], e[i], f[i], g[i], h[i], num_blocks, scratch_space_addr, message_schedule_addr, i, retdest @@ -253,7 +250,6 @@ sha2_compression_loop: %jump(sha2_compression_loop) sha2_compression_end_block: // Add the initial values of the eight working variables (from the start of this block's compression) back into them. - JUMPDEST // stack: a[64], b[64], c[64], d[64], e[64], f[64], g[64], h[64], num_blocks, scratch_space_addr, message_schedule_addr, i, retdest dup10 // stack: scratch_space_addr, a[64], b[64], c[64], d[64], e[64], f[64], g[64], h[64], num_blocks, scratch_space_addr, message_schedule_addr, i, retdest @@ -351,7 +347,6 @@ sha2_compression_end_block: swap8 %jump(sha2_compression_start_block) sha2_compression_end: - JUMPDEST // stack: num_blocks, a[0]+a[64], b[0]+b[64], c[0]+c[64], d[0]+d[64], e[0]+e[64], f[0]+f[64], g[0]+g[64], h[0]+h[64], scratch_space_addr, message_schedule_addr, i, retdest pop // stack: a[0]+a[64], b[0]+b[64], c[0]+c[64], d[0]+d[64], e[0]+e[64], f[0]+f[64], g[0]+g[64], h[0]+h[64], scratch_space_addr, message_schedule_addr, i, retdest diff --git a/evm/src/cpu/kernel/asm/sha2/message_schedule.asm b/evm/src/cpu/kernel/asm/sha2/message_schedule.asm index 9d49e06f..8f0cd58d 100644 --- a/evm/src/cpu/kernel/asm/sha2/message_schedule.asm +++ b/evm/src/cpu/kernel/asm/sha2/message_schedule.asm @@ -2,7 +2,6 @@ // Postcondition: 256 bytes starting at given output address contain the 64 32-bit chunks // of message schedule (in four-byte increments) global sha2_gen_message_schedule_from_block: - JUMPDEST // stack: block_addr, output_addr, retdest dup1 // stack: block_addr, block_addr, output_addr, retdest @@ -24,7 +23,6 @@ global sha2_gen_message_schedule_from_block: %jump(sha2_gen_message_schedule_from_block_0_loop) sha2_gen_message_schedule_from_block_0_loop: // Split the first half (256 bits) of the block into the first eight (32-bit) chunks of the message sdchedule. - JUMPDEST // stack: counter, output_addr, block[0], block[1], retdest swap2 // stack: block[0], output_addr, counter, block[1], retdest @@ -63,7 +61,6 @@ sha2_gen_message_schedule_from_block_0_loop: %jumpi(sha2_gen_message_schedule_from_block_0_end) %jump(sha2_gen_message_schedule_from_block_0_loop) sha2_gen_message_schedule_from_block_0_end: - JUMPDEST // stack: old counter=0, output_addr, block[0], block[1], retdest pop push 8 @@ -82,7 +79,6 @@ sha2_gen_message_schedule_from_block_0_end: // stack: counter, output_addr + 64, block[1], block[0], retdest sha2_gen_message_schedule_from_block_1_loop: // Split the second half (256 bits) of the block into the next eight (32-bit) chunks of the message sdchedule. - JUMPDEST // stack: counter, output_addr, block[1], block[0], retdest swap2 // stack: block[1], output_addr, counter, block[0], retdest @@ -121,7 +117,6 @@ sha2_gen_message_schedule_from_block_1_loop: %jumpi(sha2_gen_message_schedule_from_block_1_end) %jump(sha2_gen_message_schedule_from_block_1_loop) sha2_gen_message_schedule_from_block_1_end: - JUMPDEST // stack: old counter=0, output_addr, block[1], block[0], retdest pop // stack: output_addr, block[0], block[1], retdest @@ -135,7 +130,6 @@ sha2_gen_message_schedule_from_block_1_end: // stack: counter, output_addr + 36, block[0], block[1], retdest sha2_gen_message_schedule_remaining_loop: // Generate the next 48 chunks of the message schedule, one at a time, from prior chunks. - JUMPDEST // stack: counter, output_addr, block[0], block[1], retdest swap1 // stack: output_addr, counter, block[0], block[1], retdest @@ -218,7 +212,6 @@ sha2_gen_message_schedule_remaining_loop: %jumpi(sha2_gen_message_schedule_remaining_end) %jump(sha2_gen_message_schedule_remaining_loop) sha2_gen_message_schedule_remaining_end: - JUMPDEST // stack: counter=0, output_addr, block[0], block[1], retdest %pop4 JUMP @@ -228,7 +221,6 @@ sha2_gen_message_schedule_remaining_end: // Postcondition: starting at output_addr, set of 256 bytes per block // each contains the 64 32-bit chunks of the message schedule for that block (in four-byte increments) global sha2_gen_all_message_schedules: - JUMPDEST // stack: output_addr, retdest dup1 // stack: output_addr, output_addr, retdest @@ -239,7 +231,6 @@ global sha2_gen_all_message_schedules: push 1 // stack: cur_addr = 1, counter = num_blocks, output_addr, output_addr, retdest sha2_gen_all_message_schedules_loop: - JUMPDEST // stack: cur_addr, counter, cur_output_addr, output_addr, retdest push sha2_gen_all_message_schedules_loop_end // stack: new_retdest = sha2_gen_all_message_schedules_loop_end, cur_addr, counter, cur_output_addr, output_addr, retdest @@ -249,7 +240,6 @@ sha2_gen_all_message_schedules_loop: // stack: cur_addr, cur_output_addr, new_retdest, cur_addr, counter, cur_output_addr, output_addr, retdest %jump(sha2_gen_message_schedule_from_block) sha2_gen_all_message_schedules_loop_end: - JUMPDEST // stack: cur_addr, counter, cur_output_addr, output_addr, retdest %add_const(64) // stack: cur_addr + 64, counter, cur_output_addr, output_addr, retdest @@ -266,9 +256,7 @@ sha2_gen_all_message_schedules_loop_end: iszero %jumpi(sha2_gen_all_message_schedules_end) %jump(sha2_gen_all_message_schedules_loop) - JUMPDEST sha2_gen_all_message_schedules_end: - JUMPDEST // stack: cur_addr + 64, counter - 1, cur_output_addr + 256, output_addr, retdest %pop3 // stack: output_addr, retdest diff --git a/evm/src/cpu/kernel/asm/sha2/store_pad.asm b/evm/src/cpu/kernel/asm/sha2/store_pad.asm index d27ebaf8..5cd02ac5 100644 --- a/evm/src/cpu/kernel/asm/sha2/store_pad.asm +++ b/evm/src/cpu/kernel/asm/sha2/store_pad.asm @@ -1,5 +1,4 @@ global sha2_store: - JUMPDEST // stack: num_bytes, x[0], x[1], ..., x[num_bytes - 1], retdest dup1 // stack: num_bytes, num_bytes, x[0], x[1], ..., x[num_bytes - 1], retdest @@ -10,7 +9,6 @@ global sha2_store: push 1 // stack: addr=1, counter=num_bytes, x[0], x[1], x[2], ... , x[num_bytes-1], retdest sha2_store_loop: - JUMPDEST // stack: addr, counter, x[num_bytes-counter], ... , x[num_bytes-1], retdest dup1 // stack: addr, addr, counter, x[num_bytes-counter], ... , x[num_bytes-1], retdest @@ -33,7 +31,6 @@ sha2_store_loop: // stack: addr+1, counter-1, ... , x[num_bytes-1], retdest %jump(sha2_store_loop) sha2_store_end: - JUMPDEST // stack: counter=0, addr, retdest %pop2 // stack: retdest @@ -44,7 +41,6 @@ sha2_store_end: // Postcodition: output is in memory, starting at 0, of the form // num_blocks, block0[0], ..., block0[63], block1[0], ..., blocklast[63] global sha2_pad: - JUMPDEST // stack: retdest push 0 %mload_kernel_general @@ -94,5 +90,4 @@ global sha2_pad: %jump(sha2_gen_all_message_schedules) global sha2: - JUMPDEST %jump(sha2_store)