block_size macro

This commit is contained in:
Nicholas Ward 2022-12-13 14:42:45 -08:00
parent f3937e9977
commit 6ab6580058
2 changed files with 8 additions and 3 deletions

View File

@ -20,7 +20,7 @@
// stack: 0
%mload_kernel_general
// stack: num_blocks
%mul_const(128)
%block_size
%add_const(2)
// stack: num_bytes+2
%endmacro
@ -36,3 +36,8 @@
%blake2b_internal_state_addr
%add_const(16)
%endmacro
// Block size is 128 bytes.
%macro block_size
%mul_const(128)
%endmacro

View File

@ -42,7 +42,7 @@ compression_loop:
DUP2
// stack: cur_block, is_last_block * num_bytes, cur_block, is_last_block, retdest
%increment
%mul_const(128)
%block_size
// stack: (cur_block + 1) * 128, is_last_block * num_bytes, cur_block, is_last_block, retdest
DUP4
// stack: is_last_block, (cur_block + 1) * 128, is_last_block * num_bytes, cur_block, is_last_block, retdest
@ -56,7 +56,7 @@ compression_loop:
// stack: cur_block, t, is_last_block, retdest
DUP1
// stack: cur_block, cur_block, t, is_last_block, retdest
%mul_const(128)
%block_size
%add_const(2)
// stack: cur_block_start_byte, t, cur_block, is_last_block, retdest