Skip to content

Commit 6e282c5

Browse files
committed
bash-prg-hash: fix header length calculation multiplier
1 parent 98e5ed5 commit 6e282c5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bash-prg-hash/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<const RATE: usize, const CAPACITY: usize> TryCustomizedInit for BashPrgHash
9090
// Step 5: S[pos...1472) <- 0^{1472-pos}
9191

9292
let mut buf = [0u8; 8 * STATE_WORDS];
93-
buf[0] = u8::try_from(header_len / 4).expect("header_len fits into u8");
93+
buf[0] = u8::try_from(header_len * 4).expect("header_len fits into u8");
9494
buf[1..][..header_len].copy_from_slice(header);
9595

9696
let mut state = [0u64; STATE_WORDS];

0 commit comments

Comments
 (0)