Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove kernel memory zeroizing in SHA256 precompile #1302

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 0 additions & 103 deletions evm/src/cpu/kernel/asm/core/precompiles/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -65,106 +65,3 @@ handle_precompiles_from_eoa_finish:
%stack (new_ctx, addr, retdest) -> (addr, new_ctx, retdest)
%handle_precompiles
PANIC // We already checked that a precompile is called, so this should be unreachable.

%macro zero_out_kernel_general
PUSH 0 PUSH 0 %mstore_kernel_general
PUSH 0 PUSH 1 %mstore_kernel_general
PUSH 0 PUSH 2 %mstore_kernel_general
PUSH 0 PUSH 3 %mstore_kernel_general
PUSH 0 PUSH 4 %mstore_kernel_general
PUSH 0 PUSH 5 %mstore_kernel_general
PUSH 0 PUSH 6 %mstore_kernel_general
PUSH 0 PUSH 7 %mstore_kernel_general
PUSH 0 PUSH 8 %mstore_kernel_general
PUSH 0 PUSH 9 %mstore_kernel_general
PUSH 0 PUSH 10 %mstore_kernel_general
PUSH 0 PUSH 11 %mstore_kernel_general
PUSH 0 PUSH 12 %mstore_kernel_general
PUSH 0 PUSH 13 %mstore_kernel_general
PUSH 0 PUSH 14 %mstore_kernel_general
PUSH 0 PUSH 15 %mstore_kernel_general
PUSH 0 PUSH 16 %mstore_kernel_general
PUSH 0 PUSH 17 %mstore_kernel_general
PUSH 0 PUSH 18 %mstore_kernel_general
PUSH 0 PUSH 19 %mstore_kernel_general
PUSH 0 PUSH 20 %mstore_kernel_general
PUSH 0 PUSH 21 %mstore_kernel_general
PUSH 0 PUSH 22 %mstore_kernel_general
PUSH 0 PUSH 23 %mstore_kernel_general
PUSH 0 PUSH 24 %mstore_kernel_general
PUSH 0 PUSH 25 %mstore_kernel_general
PUSH 0 PUSH 26 %mstore_kernel_general
PUSH 0 PUSH 27 %mstore_kernel_general
PUSH 0 PUSH 28 %mstore_kernel_general
PUSH 0 PUSH 29 %mstore_kernel_general
PUSH 0 PUSH 30 %mstore_kernel_general
PUSH 0 PUSH 31 %mstore_kernel_general
PUSH 0 PUSH 32 %mstore_kernel_general
PUSH 0 PUSH 33 %mstore_kernel_general
PUSH 0 PUSH 34 %mstore_kernel_general
PUSH 0 PUSH 35 %mstore_kernel_general
PUSH 0 PUSH 36 %mstore_kernel_general
PUSH 0 PUSH 37 %mstore_kernel_general
PUSH 0 PUSH 38 %mstore_kernel_general
PUSH 0 PUSH 39 %mstore_kernel_general
PUSH 0 PUSH 40 %mstore_kernel_general
PUSH 0 PUSH 41 %mstore_kernel_general
PUSH 0 PUSH 42 %mstore_kernel_general
PUSH 0 PUSH 43 %mstore_kernel_general
PUSH 0 PUSH 44 %mstore_kernel_general
PUSH 0 PUSH 45 %mstore_kernel_general
PUSH 0 PUSH 46 %mstore_kernel_general
PUSH 0 PUSH 47 %mstore_kernel_general
PUSH 0 PUSH 48 %mstore_kernel_general
PUSH 0 PUSH 49 %mstore_kernel_general
PUSH 0 PUSH 50 %mstore_kernel_general
PUSH 0 PUSH 51 %mstore_kernel_general
PUSH 0 PUSH 52 %mstore_kernel_general
PUSH 0 PUSH 53 %mstore_kernel_general
PUSH 0 PUSH 54 %mstore_kernel_general
PUSH 0 PUSH 55 %mstore_kernel_general
PUSH 0 PUSH 56 %mstore_kernel_general
PUSH 0 PUSH 57 %mstore_kernel_general
PUSH 0 PUSH 58 %mstore_kernel_general
PUSH 0 PUSH 59 %mstore_kernel_general
PUSH 0 PUSH 60 %mstore_kernel_general
PUSH 0 PUSH 61 %mstore_kernel_general
PUSH 0 PUSH 62 %mstore_kernel_general
PUSH 0 PUSH 63 %mstore_kernel_general
PUSH 0 PUSH 64 %mstore_kernel_general
PUSH 0 PUSH 65 %mstore_kernel_general
PUSH 0 PUSH 66 %mstore_kernel_general
PUSH 0 PUSH 67 %mstore_kernel_general
PUSH 0 PUSH 68 %mstore_kernel_general
PUSH 0 PUSH 69 %mstore_kernel_general
PUSH 0 PUSH 70 %mstore_kernel_general
PUSH 0 PUSH 71 %mstore_kernel_general
PUSH 0 PUSH 72 %mstore_kernel_general
PUSH 0 PUSH 73 %mstore_kernel_general
PUSH 0 PUSH 74 %mstore_kernel_general
PUSH 0 PUSH 75 %mstore_kernel_general
PUSH 0 PUSH 76 %mstore_kernel_general
PUSH 0 PUSH 77 %mstore_kernel_general
PUSH 0 PUSH 78 %mstore_kernel_general
PUSH 0 PUSH 79 %mstore_kernel_general
PUSH 0 PUSH 80 %mstore_kernel_general
PUSH 0 PUSH 81 %mstore_kernel_general
PUSH 0 PUSH 82 %mstore_kernel_general
PUSH 0 PUSH 83 %mstore_kernel_general
PUSH 0 PUSH 84 %mstore_kernel_general
PUSH 0 PUSH 85 %mstore_kernel_general
PUSH 0 PUSH 86 %mstore_kernel_general
PUSH 0 PUSH 87 %mstore_kernel_general
PUSH 0 PUSH 88 %mstore_kernel_general
PUSH 0 PUSH 89 %mstore_kernel_general
PUSH 0 PUSH 90 %mstore_kernel_general
PUSH 0 PUSH 91 %mstore_kernel_general
PUSH 0 PUSH 92 %mstore_kernel_general
PUSH 0 PUSH 93 %mstore_kernel_general
PUSH 0 PUSH 94 %mstore_kernel_general
PUSH 0 PUSH 95 %mstore_kernel_general
PUSH 0 PUSH 96 %mstore_kernel_general
PUSH 0 PUSH 97 %mstore_kernel_general
PUSH 0 PUSH 98 %mstore_kernel_general
PUSH 0 PUSH 99 %mstore_kernel_general
%endmacro
3 changes: 0 additions & 3 deletions evm/src/cpu/kernel/asm/core/precompiles/sha256.asm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ global precompile_sha256:
// stack: gas, kexit_info
%charge_gas

// TODO: fix this
%zero_out_kernel_general

// Copy the call data to the kernel general segment (sha2 expects it there) and call sha2.
%calldatasize
GET_CONTEXT
Expand Down
Loading