Satisfy clippy in the SHA-1 helper

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-13 03:17:04 +02:00
parent 19d4146f04
commit 585a41acfa
+3 -3
View File
@@ -383,10 +383,10 @@ pub fn sha1(data: &[u8]) -> [u8; 20] {
msg.push(0);
}
msg.extend((data.len() as u64 * 8).to_be_bytes());
for block in msg.chunks_exact(64) {
for block in msg.as_chunks::<64>().0 {
let mut w = [0u32; 80];
for (i, word) in block.chunks_exact(4).enumerate() {
w[i] = u32::from_be_bytes(word.try_into().unwrap());
for (i, word) in block.as_chunks::<4>().0.iter().enumerate() {
w[i] = u32::from_be_bytes(*word);
}
for i in 16..80 {
w[i] = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]).rotate_left(1);