File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,7 @@ impl RawPadding for ZeroPadding {
138
138
if pos > block. len ( ) {
139
139
panic ! ( "`pos` is bigger than block size" ) ;
140
140
}
141
- for b in & mut block[ pos..] {
142
- * b = 0 ;
143
- }
141
+ block[ pos..] . fill ( 0 ) ;
144
142
}
145
143
146
144
#[ inline]
@@ -207,9 +205,7 @@ impl RawPadding for Pkcs7 {
207
205
panic ! ( "`pos` is bigger or equal to block size" ) ;
208
206
}
209
207
let n = ( block. len ( ) - pos) as u8 ;
210
- for b in & mut block[ pos..] {
211
- * b = n;
212
- }
208
+ block[ pos..] . fill ( n) ;
213
209
}
214
210
215
211
#[ inline]
@@ -286,9 +282,7 @@ impl RawPadding for AnsiX923 {
286
282
panic ! ( "`pos` is bigger or equal to block size" ) ;
287
283
}
288
284
let bs = block. len ( ) ;
289
- for b in & mut block[ pos..bs - 1 ] {
290
- * b = 0 ;
291
- }
285
+ block[ pos..bs - 1 ] . fill ( 0 ) ;
292
286
block[ bs - 1 ] = ( bs - pos) as u8 ;
293
287
}
294
288
@@ -338,9 +332,7 @@ impl RawPadding for Iso7816 {
338
332
panic ! ( "`pos` is bigger or equal to block size" ) ;
339
333
}
340
334
block[ pos] = 0x80 ;
341
- for b in & mut block[ pos + 1 ..] {
342
- * b = 0 ;
343
- }
335
+ block[ pos + 1 ..] . fill ( 0 ) ;
344
336
}
345
337
346
338
#[ inline]
You can’t perform that action at this time.
0 commit comments