use hex_literal::hex;
use polyval::{BLOCK_SIZE, Polyval, universal_hash::UniversalHash};
const H: [u8; BLOCK_SIZE] = hex!("25629347589242761d31f826ba4b757b");
#[test]
fn longer_test() {
let inp = (1u16..=4096)
.map(|n| ((n * 3) % 0xFF) as u8)
.collect::<Vec<u8>>();
let mut poly = Polyval::new(&H.into());
poly.update_padded(&inp);
let result1 = poly.finalize_reset();
for block in inp.chunks(BLOCK_SIZE) {
poly.update(&[block.try_into().unwrap()]);
}
let result2 = poly.finalize();
assert_eq!(result1, result2);
}