everything is parsing

This commit is contained in:
Dmitry Vagner 2022-09-20 10:29:43 -07:00
parent d5f04cbfb4
commit 172bde8028
6 changed files with 15 additions and 13 deletions

View File

@ -38,12 +38,12 @@ pub(crate) fn combined_kernel() -> Kernel {
include_str!("asm/memory/metadata.asm"),
include_str!("asm/memory/packing.asm"),
include_str!("asm/memory/txn_fields.asm"),
// include_str!("asm/ripemd/compression.asm"),
// include_str!("asm/ripemd/constants.asm"),
include_str!("asm/ripemd/compression.asm"),
include_str!("asm/ripemd/constants.asm"),
include_str!("asm/ripemd/memory.asm"),
include_str!("asm/ripemd/ripemd.asm"),
// include_str!("asm/ripemd/subroutines.asm"),
// include_str!("asm/ripemd/update.asm"),
include_str!("asm/ripemd/subroutines.asm"),
include_str!("asm/ripemd/update.asm"),
include_str!("asm/rlp/encode.asm"),
include_str!("asm/rlp/decode.asm"),
include_str!("asm/rlp/read_to_memory.asm"),

View File

@ -5,7 +5,7 @@
// stack: K_data + 4*rnd
%mload_kernel_code_u32
// stack: K
%end_macro
%endmacro
K_data:
// Left

View File

@ -1,4 +1,4 @@
ripemd_storage: // starts by initializing buffer
global ripemd_storage: // starts by initializing buffer
// stack: i (init 64)
%store_zeros(64, ripemd_storage)
// stack:
@ -82,7 +82,9 @@ store_input:
%macro store_zeros(N, label)
// stack: i
%stack (i) -> ($N, i, 0, i)
PUSH 0
DUP2
PUSH $N
SUB
// stack: offset = N-i, 0, i
%mstore_ripemd

View File

@ -31,7 +31,7 @@ global ripemd:
// store _size at virt 64 [consumes length]
// store _padding at virt 72 [consumes 0x80, 63]
// store _input at virt 136 [consumes ADDR, length]
ripemd_init:
global ripemd_init:
// stack: length
%stack (length) -> ( 0, length, 136, ripemd_1, ripemd_2, process)
// stack: count = 0, length, virt = 136, ripemd_1, ripemd_2, process

View File

@ -24,7 +24,7 @@ global rol:
JUMP
%macro PUSH_F
%macro push_F
PUSH 0
%this_F(0,F0)
%this_F(1,F1)

View File

@ -34,7 +34,7 @@ global ripemd_update:
LT
NOT
// stack: Q, STATE, 0, shift, need, have, count, length, virt, retdest
%stack (Q, STATE, 0, shift, need, have) -> (have, Q, Q, STATE, 0, shift, need, have)
%stack (Q, a, b, c, d, e, i, shift, need, have) -> (have, Q, Q, a, b, c, d, e, i, shift, need, have)
AND
// stack: P, Q, STATE, 0, shift, need, have, count, length, virt, retdest
%jumpi(update_1)
@ -54,7 +54,7 @@ final_update:
// stack: R, ARGS, shift, need, have, STATE, count, length, virt, retdest
%jumpi(buffer_update)
// stack: ARGS, shift, need, have, STATE, count, length, virt, retdest
*pop3
%pop3
JUMP
return_step:
// stack: shift, need, have, STATE, count, length, virt, retdest
@ -76,11 +76,11 @@ return_step:
update_1:
// stack: Q, STATE, 0, shift, need, have, count, length, virt, retdest
%stack (Q, a, b, c, d, e, 0, shift, need, have, count, length, virt) -> (virt, have, need, update_1a, a, b, c, d, e, 0, shift, need, have, count, length, virt)
%stack (Q, a, b, c, d, e, i, shift, need, have, count, length, virt) -> (virt, have, need, update_1a, a, b, c, d, e, i, shift, need, have, count, length, virt)
%jump(buffer_update)
update_1a:
// stack: STATE, 0, shift, need, have, count, length, virt, retdest
%stack (a, b, c, d, e, 0, shift, need, have) -> (a, b, c, d, e, 0, update_2, need, need, 0)
%stack (a, b, c, d, e, i, shift, need, have) -> (a, b, c, d, e, i, update_2, need, need, 0)
// stack: STATE, 0, update_2, shift, need, have, count, length, virt, retdest
%jump(compress)