File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -311,25 +311,13 @@ macro_rules! blake2_impl {
311311 . expect( "hash data length overflow" ) ;
312312 }
313313
314- while rest. len ( ) >= block {
314+ for part in rest. chunks ( block) {
315315 self . h. compress( & self . m, 0 , 0 , self . t) ;
316316
317- let part = & rest[ ..block] ;
318- rest = & rest[ part. len( ) ..] ;
319-
320317 copy( part, & mut self . m. as_mut_bytes( ) ) ;
321318 self . t = self . t. checked_add( part. len( ) as u64 )
322319 . expect( "hash data length overflow" ) ;
323320 }
324-
325- let n = rest. len( ) ;
326- if n > 0 {
327- self . h. compress( & self . m, 0 , 0 , self . t) ;
328-
329- copy( rest, & mut self . m. as_mut_bytes( ) ) ;
330- self . t = self . t. checked_add( rest. len( ) as u64 )
331- . expect( "hash data length overflow" ) ;
332- }
333321 }
334322
335323 #[ doc( hidden) ]
You can’t perform that action at this time.
0 commit comments