mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 08:43:06 +00:00
cleanup and comments
This commit is contained in:
parent
5d7edb33d4
commit
c11c526462
@ -3,7 +3,7 @@
|
||||
// stack: x, y
|
||||
ADD
|
||||
// stack: x + y
|
||||
%and_const(0xFFFFFFFF)
|
||||
%truncate_to_u32
|
||||
// stack: (x + y) & u32::MAX
|
||||
%endmacro
|
||||
|
||||
@ -25,13 +25,7 @@
|
||||
// stack: 32 - rot, value, value >> rot
|
||||
SHL
|
||||
// stack: value << (32 - rot), value >> rot
|
||||
PUSH 32
|
||||
PUSH 1
|
||||
SWAP1
|
||||
SHL
|
||||
// stack: 1 << 32, value << (32 - rot), value >> rot
|
||||
SWAP1
|
||||
MOD
|
||||
%truncate_to_u32
|
||||
// stack: (value << (32 - rot)) % (1 << 32), value >> rot
|
||||
ADD
|
||||
%endmacro
|
||||
|
||||
@ -1,11 +1,18 @@
|
||||
// We put the message schedule in memory starting at 64 * num_blocks + 2.
|
||||
%macro message_schedule_addr_from_num_blocks
|
||||
// stack: num_blocks
|
||||
%mul_const(64)
|
||||
%add_const(2)
|
||||
%endmacro
|
||||
|
||||
// We use memory starting at 320 * num_blocks + 2 (after the message schedule
|
||||
// space) as scratch space to store stack values.
|
||||
%macro scratch_space_addr_from_num_blocks
|
||||
// stack: num_blocks
|
||||
%mul_const(320)
|
||||
%add_const(2)
|
||||
%endmacro
|
||||
|
||||
%macro truncate_to_u32
|
||||
%and_const(0xFFFFFFFF)
|
||||
%endmacro
|
||||
Loading…
x
Reference in New Issue
Block a user