Skip to content

Commit

Permalink
FIXUP2 TurboSHAKE tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Mar 16, 2023
1 parent 098df34 commit 0c7db92
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sha3/tests/turboshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ use digest::ExtendableOutput;
pub(crate) fn turbo_shake_test<D, F>(
input: &[u8],
output: &[u8],
truncate_output: u64,
truncate_output: usize,
new: F,
) -> Option<&'static str>
where
D: ExtendableOutput + Debug + Clone,
F: Fn() -> D,
{
let truncate_output: usize = truncate_output.try_into().unwrap();

let mut hasher = new();
let mut buf = [0u8; 16 * 1024];
let buf = &mut buf[..truncate_output + output.len()];
Expand Down Expand Up @@ -76,7 +74,7 @@ macro_rules! new_turbo_shake_test {
if let Some(desc) = $test_func(
&input,
output,
u64::from_be_bytes(truncate_output.try_into().unwrap()),
u64::from_be_bytes(truncate_output.try_into().unwrap()).try_into().unwrap(),
|| <$hasher>::from_core(<$hasher_core>::new(domain_separation[0])),
) {
panic!(
Expand Down

0 comments on commit 0c7db92

Please sign in to comment.