@@ -676,7 +676,7 @@ where
676676 if len >= ( CHUNK - pos) {
677677 chunks. push ( ( pos. clone ( ) , CHUNK . clone ( ) ) ) ;
678678 len -= CHUNK - pos;
679- final_timestamp_inc += 2 * ( CHUNK - pos + 1 ) ;
679+ final_timestamp_inc += 2 * ( CHUNK - pos) + 1 ;
680680 pos = 0 ;
681681 } else {
682682 chunks. push ( ( pos. clone ( ) , pos + len) ) ;
@@ -766,11 +766,7 @@ where
766766 multi_observe_cols. end_idx = F :: from_canonical_usize ( chunk_end) ;
767767
768768 multi_observe_cols. is_first = F :: ZERO ;
769- multi_observe_cols. is_last = if i == num_chunks - 1 {
770- F :: ONE
771- } else {
772- F :: ZERO
773- } ;
769+ multi_observe_cols. is_last = if i == num_chunks - 1 { F :: ONE } else { F :: ZERO } ;
774770 multi_observe_cols. curr_len = F :: from_canonical_usize ( input_idx) ;
775771
776772 for j in chunk_start..CHUNK {
@@ -796,13 +792,10 @@ where
796792 cur_timestamp += 2 ;
797793 }
798794
795+ let permutation_input: [ F ; 16 ] =
796+ memory_read_native ( state. memory . data ( ) , state_ptr_u32) ;
799797 if chunk_end >= CHUNK {
800798 multi_observe_cols. should_permute = F :: ONE ;
801- let permutation_input: [ F ; 16 ] = tracing_read_native_helper (
802- state. memory ,
803- state_ptr_u32,
804- multi_observe_cols. read_sponge_state . as_mut ( ) ,
805- ) ;
806799 cols. inner . inputs . clone_from_slice ( & permutation_input) ;
807800 let output = self . subchip . permute ( permutation_input) ;
808801 tracing_write_native_inplace (
@@ -811,12 +804,10 @@ where
811804 std:: array:: from_fn ( |i| output[ i] ) ,
812805 & mut multi_observe_cols. write_sponge_state ,
813806 ) ;
814- cur_timestamp += 2 ;
807+ cur_timestamp += 1 ;
815808 } else {
816809 multi_observe_cols. should_permute = F :: ZERO ;
817- let sponge_state: [ F ; 16 ] =
818- memory_read_native ( state. memory . data ( ) , state_ptr_u32) ;
819- cols. inner . inputs . clone_from_slice ( & sponge_state) ;
810+ cols. inner . inputs . clone_from_slice ( & permutation_input) ;
820811 }
821812 }
822813 } else {
@@ -1219,11 +1210,6 @@ impl<F: PrimeField32, const SBOX_REGISTERS: usize> NativePoseidon2Filler<F, SBOX
12191210 mem_fill_helper (
12201211 mem_helper,
12211212 start_timestamp_u32,
1222- multi_observe_cols. read_sponge_state . as_mut ( ) ,
1223- ) ;
1224- mem_fill_helper (
1225- mem_helper,
1226- start_timestamp_u32 + 1 ,
12271213 multi_observe_cols. write_sponge_state . as_mut ( ) ,
12281214 ) ;
12291215 }
0 commit comments