Skip to content

Commit

Permalink
fixed a bug in the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kevjue committed Dec 6, 2023
1 parent 698638a commit bb4cee3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions curta/src/machine/hash/blake/blake2b/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ pub mod test_utils {

let mut t_value = 0u64;
let msg_len = msg.len();
let mut msg_digest_idx = msg_len / 128;
if (msg_len % 128) == 0 && msg_len != 0 {
msg_digest_idx += 1;
}
let msg_digest_idx = if msg_len == 0 { 0 } else { (msg_len - 1) / 128 };
assert!(msg_padded_chunks.len() == *msg_max_chunk_size as usize);
for (i, chunk) in msg_padded_chunks.iter().enumerate() {
padded_chunks_values.push(*chunk);
Expand Down

0 comments on commit bb4cee3

Please sign in to comment.