summaryrefslogtreecommitdiff
path: root/src/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.rs')
-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];