File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ use crate::{
88fn hash_int < F : Field > ( hasher : & mut KeccakTranscript ) -> F :: U {
99 let n_bytes = F :: W :: num_words ( ) * 8 ;
1010 let bytes = hasher. get_random_bytes ( n_bytes) ;
11- hasher. absorb ( & bytes) ;
1211 F :: U :: from_bytes_be ( & bytes) . expect ( "Failed to convert bytes to CryptoUint" )
1312}
1413
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ impl KeccakTranscript {
5151 }
5252
5353 result. truncate ( length) ;
54+
55+ self . hasher . update ( [ 0x12 ] ) ;
56+ self . hasher . update ( & result) ;
57+ self . hasher . update ( [ 0x34 ] ) ;
58+
5459 result
5560 }
5661
@@ -145,9 +150,6 @@ impl KeccakTranscript {
145150 for i in 0 ..I :: W :: num_words ( ) {
146151 let mut challenge = [ 0u8 ; 8 ] ;
147152 challenge. copy_from_slice ( self . get_random_bytes ( 8 ) . as_slice ( ) ) ;
148- self . hasher . update ( [ 0x12 ] ) ;
149- self . hasher . update ( challenge) ;
150- self . hasher . update ( [ 0x34 ] ) ;
151153 words[ i] = PrimitiveConversion :: from_primitive ( u64:: from_le_bytes ( challenge) ) ;
152154 }
153155
You can’t perform that action at this time.
0 commit comments