Skip to content

Commit 479eef8

Browse files
committed
test_compare_reference_impl_long_xof
1 parent 95e42b8 commit 479eef8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test.rs

+15
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,21 @@ fn test_compare_reference_impl() {
443443
}
444444
}
445445

446+
#[test]
447+
fn test_compare_reference_impl_long_xof() {
448+
let mut reference_output = [0u8; 32 * BLOCK_LEN - 1];
449+
let mut reference_hasher = reference_impl::Hasher::new_keyed(&TEST_KEY);
450+
reference_hasher.update(b"hello world");
451+
reference_hasher.finalize(&mut reference_output);
452+
453+
let mut test_output = [0u8; 32 * BLOCK_LEN - 1];
454+
let mut test_hasher = crate::Hasher::new_keyed(&TEST_KEY);
455+
test_hasher.update(b"hello world");
456+
test_hasher.finalize_xof().fill(&mut test_output);
457+
458+
assert_eq!(reference_output, test_output);
459+
}
460+
446461
#[test]
447462
fn test_xof_partial_blocks() {
448463
const OUT_LEN: usize = 6 * BLOCK_LEN;

0 commit comments

Comments
 (0)