summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack O'Connor <oconnor663@gmail.com>2024-08-19 11:10:11 -0700
committerJack O'Connor <oconnor663@gmail.com>2024-08-19 11:10:11 -0700
commit479eef82d756221abe9f93077b91ce8cf763c32a (patch)
treee011b2d0a1cf15ddd48429e942483fb2d442d661
parent95e42b84fc4709974c7b23c7ae885989ab36c31e (diff)
test_compare_reference_impl_long_xof
-rw-r--r--src/test.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test.rs b/src/test.rs
index bb99d10..a7ac4fc 100644
--- a/src/test.rs
+++ b/src/test.rs
@@ -444,6 +444,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;
let mut reference_out = [0u8; OUT_LEN];