From 479eef82d756221abe9f93077b91ce8cf763c32a Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Mon, 19 Aug 2024 11:10:11 -0700 Subject: [PATCH] test_compare_reference_impl_long_xof --- src/test.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test.rs b/src/test.rs index bb99d1021..a7ac4fcf6 100644 --- a/src/test.rs +++ b/src/test.rs @@ -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;