Skip to content

Commit

Permalink
test_compare_reference_impl_long_xof
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 committed Aug 19, 2024
1 parent 95e42b8 commit 479eef8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,21 @@ fn test_compare_reference_impl() {
}
}

#[test]
fn test_compare_reference_impl_long_xof() {
let mut reference_output = [0u8; 32 * BLOCK_LEN - 1];
let mut reference_hasher = reference_impl::Hasher::new_keyed(&TEST_KEY);
reference_hasher.update(b"hello world");
reference_hasher.finalize(&mut reference_output);

let mut test_output = [0u8; 32 * BLOCK_LEN - 1];
let mut test_hasher = crate::Hasher::new_keyed(&TEST_KEY);
test_hasher.update(b"hello world");
test_hasher.finalize_xof().fill(&mut test_output);

assert_eq!(reference_output, test_output);
}

#[test]
fn test_xof_partial_blocks() {
const OUT_LEN: usize = 6 * BLOCK_LEN;
Expand Down

0 comments on commit 479eef8

Please sign in to comment.