This commit is contained in:
Dmitry Vagner 2022-09-20 10:11:45 -07:00
parent c127f80bfa
commit 9f1e97edc4
3 changed files with 18 additions and 18 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

@ -22,9 +22,9 @@ store_size:
// stack: ab
%extract_and_store_byte(70)
// stack: a
%mstore_ripemd(71)
// stack: 0x80 // padding has 0x80 in first position and zeros elsewhere
%mstore_ripemd(72) // store first padding term here so as to avoid extra label
%mstore_ripemd_offset(71)
// stack: 0x80 // padding has 0x80 in first position and zeros elsewhere
%mstore_ripemd_offset(72) // store first padding term here so as to avoid extra label
%jump(store_padding)
store_padding:
@ -107,26 +107,26 @@ store_input:
DIV
SWAP1
// stack: y, xs
%mstore_ripemd($offset)
%mstore_ripemd_offset($offset)
// stack: xs
%endmacro
%macro mstore_ripemd_offset($offset)
%macro mstore_ripemd_offset(offset)
// stack: value
PUSH $offset
// stack: offset, value
%mstore_kernel(SEGMENT_RIPEMD)
%mstore_kernel(@SEGMENT_RIPEMD)
// stack:
%endmacro
%macro mstore_ripemd
// stack: offset, value
%mstore_kernel(SEGMENT_RIPEMD)
%mstore_kernel(@SEGMENT_RIPEMD)
// stack:
%endmacro
%macro mload_ripemd
%mload_kernel(SEGMENT_RIPEMD)
%mload_kernel(@SEGMENT_RIPEMD)
%endmacro
// Load LE u32 from 4 contiguous bytes a, b, c, d in SEGMENT_RIPEMD

View File

@ -35,7 +35,7 @@ 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
%stack (c, l, o, l1, l2, l3) -> (0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0, c, l, o, l1, l2, l3)
%stack (c, l, o, l1, l2, l3) -> (0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0, c, l, o, l1, l2, l3)
// stack: 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0, count, length, virt, *labels
%jump(ripemd_update)
ripemd_1:
@ -59,26 +59,26 @@ process:
%flip_bytes_u32
// stack: a', b, c, d, e, *vars
SWAP1
%flip_bytes_32
%flip_bytes_u32
%shl_const(32)
OR
// stack: b' a', c, d, e, *vars
SWAP1
%flip_bytes_32
%flip_bytes_u32
%shl_const(64)
OR
// stack: c' b' a', d, e, *vars
SWAP1
%flip_bytes_32
%flip_bytes_u32
%shl_const(96)
OR
// stack: d' c' b' a', e, *vars
SWAP1
%flip_bytes_32
%flip_bytes_u32
%shl_const(96)
OR
// stack: e' d' c' b' a', *vars
%stack (result, x, y, z) -> result
%stack (result, x, y, z) -> (result)
// stack: result