88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- use std:: uint ;
11+ use std:: iter :: range_step ;
1212
1313use cryptoutil:: { write_u64_be, write_u32_be, read_u64v_be, read_u32v_be, add_bytes_to_bits,
1414 add_bytes_to_bits_tuple, FixedBuffer , FixedBuffer128 , FixedBuffer64 , StandardPadding } ;
@@ -111,7 +111,7 @@ impl Engine512State {
111111
112112 // Putting the message schedule inside the same loop as the round calculations allows for
113113 // the compiler to generate better code.
114- do uint :: range_step( 0 , 64 , 8 ) |t| {
114+ for t in range_step( 0 u , 64 , 8 ) {
115115 schedule_round!( t + 16 ) ;
116116 schedule_round!( t + 17 ) ;
117117 schedule_round!( t + 18 ) ;
@@ -129,10 +129,9 @@ impl Engine512State {
129129 sha2_round!( d, e, f, g, h, a, b, c, K64 , t + 5 ) ;
130130 sha2_round!( c, d, e, f, g, h, a, b, K64 , t + 6 ) ;
131131 sha2_round!( b, c, d, e, f, g, h, a, K64 , t + 7 ) ;
132- true
133- } ;
132+ }
134133
135- do uint :: range_step( 64 , 80 , 8 ) |t| {
134+ for t in range_step( 64 u , 80 , 8 ) {
136135 sha2_round!( a, b, c, d, e, f, g, h, K64 , t) ;
137136 sha2_round!( h, a, b, c, d, e, f, g, K64 , t + 1 ) ;
138137 sha2_round!( g, h, a, b, c, d, e, f, K64 , t + 2 ) ;
@@ -141,8 +140,7 @@ impl Engine512State {
141140 sha2_round!( d, e, f, g, h, a, b, c, K64 , t + 5 ) ;
142141 sha2_round!( c, d, e, f, g, h, a, b, K64 , t + 6 ) ;
143142 sha2_round!( b, c, d, e, f, g, h, a, K64 , t + 7 ) ;
144- true
145- } ;
143+ }
146144
147145 self . H0 += a;
148146 self . H1 += b;
@@ -527,7 +525,7 @@ impl Engine256State {
527525
528526 // Putting the message schedule inside the same loop as the round calculations allows for
529527 // the compiler to generate better code.
530- do uint :: range_step( 0 , 48 , 8 ) |t| {
528+ for t in range_step( 0 u , 48 , 8 ) {
531529 schedule_round!( t + 16 ) ;
532530 schedule_round!( t + 17 ) ;
533531 schedule_round!( t + 18 ) ;
@@ -545,10 +543,9 @@ impl Engine256State {
545543 sha2_round!( d, e, f, g, h, a, b, c, K32 , t + 5 ) ;
546544 sha2_round!( c, d, e, f, g, h, a, b, K32 , t + 6 ) ;
547545 sha2_round!( b, c, d, e, f, g, h, a, K32 , t + 7 ) ;
548- true
549- } ;
546+ }
550547
551- do uint :: range_step( 48 , 64 , 8 ) |t| {
548+ for t in range_step( 48 u , 64 , 8 ) {
552549 sha2_round!( a, b, c, d, e, f, g, h, K32 , t) ;
553550 sha2_round!( h, a, b, c, d, e, f, g, K32 , t + 1 ) ;
554551 sha2_round!( g, h, a, b, c, d, e, f, K32 , t + 2 ) ;
@@ -557,8 +554,7 @@ impl Engine256State {
557554 sha2_round!( d, e, f, g, h, a, b, c, K32 , t + 5 ) ;
558555 sha2_round!( c, d, e, f, g, h, a, b, K32 , t + 6 ) ;
559556 sha2_round!( b, c, d, e, f, g, h, a, K32 , t + 7 ) ;
560- true
561- } ;
557+ }
562558
563559 self . H0 += a;
564560 self . H1 += b;
0 commit comments