File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
crates/prover/src/core/channel Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,9 @@ impl Channel for Blake2sChannel {
106
106
fn draw_random_bytes ( & mut self ) -> Vec < u8 > {
107
107
let mut hash_input = self . digest . as_ref ( ) . to_vec ( ) ;
108
108
109
- // Pad the counter to 32 bytes.
110
- let mut padded_counter = [ 0 ; BLAKE_BYTES_PER_HASH ] ;
109
+ // Append counter bytes directly (4 bytes for u32).
111
110
let counter_bytes = self . channel_time . n_sent . to_le_bytes ( ) ;
112
- padded_counter[ 0 ..counter_bytes. len ( ) ] . copy_from_slice ( & counter_bytes) ;
113
-
114
- hash_input. extend_from_slice ( & padded_counter) ;
111
+ hash_input. extend_from_slice ( & counter_bytes) ;
115
112
116
113
self . channel_time . inc_sent ( ) ;
117
114
Blake2sHasher :: hash ( & hash_input) . into ( )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub const EXTENSION_FELTS_PER_HASH: usize = 2;
18
18
#[ derive( Clone , Default , Debug ) ]
19
19
pub struct ChannelTime {
20
20
pub n_challenges : usize ,
21
- n_sent : usize ,
21
+ n_sent : u32 ,
22
22
}
23
23
24
24
impl ChannelTime {
You can’t perform that action at this time.
0 commit comments