Skip to content

Commit

Permalink
Use new_personalized function in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpelissier committed Mar 15, 2024
1 parent 1f79203 commit 8d068b1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sha3/tests/cshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ where
}

macro_rules! new_cshake_test {
($name:ident, $test_name:expr, $hasher:ty, $hasher_core:ty, $test_func:ident $(,)?) => {
($name:ident, $test_name:expr, $hasher:ty, $test_func:ident $(,)?) => {
#[test]
fn $name() {
use digest::dev::blobby::Blob3Iterator;
Expand All @@ -97,7 +97,7 @@ macro_rules! new_cshake_test {
for (i, row) in Blob3Iterator::new(data).unwrap().enumerate() {
let [customization, input, output] = row.unwrap();
if let Some(desc) = $test_func(input, output, || {
<$hasher>::from_core(<$hasher_core>::new(customization))
<$hasher>::new_personalized(customization)
}) {
panic!(
"\n\
Expand All @@ -117,29 +117,25 @@ new_cshake_test!(
cshake128_reset,
"cshake128",
sha3::CShake128,
sha3::CShake128Core,
cshake_reset_test
);
#[cfg(feature = "reset")]
new_cshake_test!(
cshake256_reset,
"cshake256",
sha3::CShake256,
sha3::CShake256Core,
cshake_reset_test
);

new_cshake_test!(
cshake128,
"cshake128",
sha3::CShake128,
sha3::CShake128Core,
cshake_test
);
new_cshake_test!(
cshake256,
"cshake256",
sha3::CShake256,
sha3::CShake256Core,
cshake_test
);

0 comments on commit 8d068b1

Please sign in to comment.