diff options
Diffstat (limited to 'reference_impl')
| -rw-r--r-- | reference_impl/reference_impl.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs index e669f36..83ac795 100644 --- a/reference_impl/reference_impl.rs +++ b/reference_impl/reference_impl.rs @@ -125,8 +125,9 @@ fn first_8_words(compression_output: [u32; 16]) -> [u32; 8] { } fn words_from_little_endian_bytes(bytes: &[u8], words: &mut [u32]) { - for (bytes_block, word) in bytes.chunks_exact(4).zip(words.iter_mut()) { - *word = u32::from_le_bytes(bytes_block.try_into().unwrap()); + debug_assert_eq!(bytes.len(), 4 * words.len()); + for (four_bytes, word) in bytes.chunks_exact(4).zip(words) { + *word = u32::from_le_bytes(four_bytes.try_into().unwrap()); } } |
