File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ macro_rules! impl_chacha_rng {
336336 let mut block_counter = ( u64 :: from( self . core. core. 0 . state[ 13 ] ) << 32 )
337337 | u64 :: from( self . core. core. 0 . state[ 12 ] ) ;
338338 if self . core. word_offset( ) != 0 {
339- block_counter = block_counter. wrapping_sub( 4 ) ;
339+ block_counter = block_counter. wrapping_sub( BUF_BLOCKS as u64 ) ;
340340 }
341341 let word_pos =
342342 block_counter as u128 * BLOCK_WORDS as u128 + self . core. word_offset( ) as u128 ;
@@ -391,7 +391,7 @@ macro_rules! impl_chacha_rng {
391391 let counter =
392392 self . core. core. 0 . state[ 12 ] as u64 | ( ( self . core. core. 0 . state[ 13 ] as u64 ) << 32 ) ;
393393 if self . core. word_offset( ) != 0 {
394- counter - 4 + self . core. word_offset( ) as u64 / 16
394+ counter - BUF_BLOCKS as u64 + self . core. word_offset( ) as u64 / 16
395395 } else {
396396 counter
397397 }
You can’t perform that action at this time.
0 commit comments