mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 00:03:10 +00:00
fix merge problem
This commit is contained in:
parent
6e5fe43c7e
commit
54885fefa0
@ -39,16 +39,6 @@ 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/box.asm"),
|
||||
include_str!("asm/ripemd/compression.asm"),
|
||||
include_str!("asm/ripemd/constants.asm"),
|
||||
include_str!("asm/ripemd/functions.asm"),
|
||||
include_str!("asm/ripemd/main.asm"),
|
||||
include_str!("asm/ripemd/memory.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"),
|
||||
include_str!("asm/mpt/hash.asm"),
|
||||
include_str!("asm/mpt/hash_trie_specific.asm"),
|
||||
include_str!("asm/mpt/hex_prefix.asm"),
|
||||
@ -58,6 +48,13 @@ pub(crate) fn combined_kernel() -> Kernel {
|
||||
include_str!("asm/mpt/storage_write.asm"),
|
||||
include_str!("asm/mpt/util.asm"),
|
||||
include_str!("asm/mpt/write.asm"),
|
||||
include_str!("asm/ripemd/box.asm"),
|
||||
include_str!("asm/ripemd/compression.asm"),
|
||||
include_str!("asm/ripemd/constants.asm"),
|
||||
include_str!("asm/ripemd/functions.asm"),
|
||||
include_str!("asm/ripemd/main.asm"),
|
||||
include_str!("asm/ripemd/memory.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"),
|
||||
|
||||
@ -55,8 +55,7 @@
|
||||
// stack: (empty)
|
||||
%endmacro
|
||||
|
||||
// Load a big-endian u32, consisting of 4 bytes (c_3, c_2, c_1, c_0),
|
||||
// from the kernel.
|
||||
// Load from the kernel a big-endian u32, consisting of 4 bytes (c_3, c_2, c_1, c_0)
|
||||
%macro mload_kernel_u32(segment)
|
||||
// stack: offset
|
||||
DUP1
|
||||
@ -85,6 +84,32 @@
|
||||
// stack: (((((c_3 << 8) | c_2) << 8) | c_1) << 8) | c_0
|
||||
%endmacro
|
||||
|
||||
// Load from the kernel a little-endian u32, consisting of 4 bytes (c_0, c_1, c_2, c_3)
|
||||
%macro mload_kernel_u32_LE(segment)
|
||||
// stack: offset
|
||||
DUP1
|
||||
%mload_kernel($segment)
|
||||
// stack: c0 , offset
|
||||
DUP2
|
||||
%add_const(1)
|
||||
%mload_kernel($segment)
|
||||
%shl_const(8)
|
||||
OR
|
||||
// stack: c0 | (c1 << 8) , offset
|
||||
DUP2
|
||||
%add_const(2)
|
||||
%mload_kernel($segment)
|
||||
%shl_const(16)
|
||||
OR
|
||||
// stack: c0 | (c1 << 8) | (c2 << 16), offset
|
||||
SWAP1
|
||||
%add_const(3)
|
||||
%mload_kernel($segment)
|
||||
%shl_const(24)
|
||||
OR
|
||||
// stack: c0 | (c1 << 8) | (c2 << 16) | (c3 << 24)
|
||||
%endmacro
|
||||
|
||||
// Load a u256 (big-endian) from the kernel.
|
||||
%macro mload_kernel_u256(segment)
|
||||
// stack: offset
|
||||
@ -228,6 +253,17 @@
|
||||
// stack: value
|
||||
%endmacro
|
||||
|
||||
%macro mload_kernel_code_u32(label)
|
||||
// stack: u32_shift
|
||||
%mul_const(4)
|
||||
// stack: byte_shift
|
||||
PUSH $label
|
||||
ADD
|
||||
// stack: offset
|
||||
%mload_kernel_u32(@SEGMENT_CODE)
|
||||
// stack: value
|
||||
%endmacro
|
||||
|
||||
// Load a big-endian u32, consisting of 4 bytes (c_3, c_2, c_1, c_0),
|
||||
// from kernel general memory.
|
||||
%macro mload_kernel_general_u32
|
||||
@ -236,6 +272,14 @@
|
||||
// stack: value
|
||||
%endmacro
|
||||
|
||||
// Load a little-endian u32, consisting of 4 bytes (c_3, c_2, c_1, c_0),
|
||||
// from kernel general memory.
|
||||
%macro mload_kernel_general_u32_LE
|
||||
// stack: offset
|
||||
%mload_kernel_u32_LE(@SEGMENT_KERNEL_GENERAL)
|
||||
// stack: value
|
||||
%endmacro
|
||||
|
||||
// Load a u256 (big-endian) from kernel code.
|
||||
%macro mload_kernel_code_u256
|
||||
// stack: offset
|
||||
|
||||
@ -35,7 +35,7 @@ pre_rol:
|
||||
%mload_kernel_code(r_data)
|
||||
ADD
|
||||
// stack: virt + r, box, a, b, c, d, e, F, K, boxes, rounds, sides, virt
|
||||
%mload_kernel_general_u32
|
||||
%mload_kernel_general_u32_LE
|
||||
// stack: x, box, a, b, c, d, e, F, K, boxes, rounds, sides, virt
|
||||
SWAP1
|
||||
SWAP2
|
||||
|
||||
@ -135,7 +135,6 @@ update_round_vars:
|
||||
// stack: rnd, rnd, STATE, F', K , 16, rounds, sides, virt, retdest
|
||||
SWAP8
|
||||
POP
|
||||
%mul_const(4)
|
||||
%mload_kernel_code_u32(k_data)
|
||||
SWAP7
|
||||
POP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user