From f695ac2dc42b3346dcaa97fe3427849c921bd073 Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Tue, 2 May 2023 12:18:55 +0200 Subject: [PATCH] sha3: Use p1600 fn to fix performance degrade --- Cargo.lock | 4 ++-- sha3/Cargo.toml | 2 +- sha3/src/state.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c3c43c1d..7e439e61c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,9 +139,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] diff --git a/sha3/Cargo.toml b/sha3/Cargo.toml index b39e86394..4763c42c3 100644 --- a/sha3/Cargo.toml +++ b/sha3/Cargo.toml @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"] [dependencies] digest = "0.10.4" -keccak = "0.1.3" +keccak = "0.1.4" [dev-dependencies] digest = { version = "0.10.4", features = ["dev"] } diff --git a/sha3/src/state.rs b/sha3/src/state.rs index 7bd88d7a7..1ba9f11bd 100644 --- a/sha3/src/state.rs +++ b/sha3/src/state.rs @@ -34,7 +34,7 @@ impl Sha3State { *s ^= u64::from_le_bytes(b.try_into().unwrap()); } - keccak::keccak_p(&mut self.state, self.round_count); + keccak::p1600(&mut self.state, self.round_count); } #[inline(always)] @@ -46,6 +46,6 @@ impl Sha3State { #[inline(always)] pub(crate) fn permute(&mut self) { - keccak::keccak_p(&mut self.state, self.round_count); + keccak::p1600(&mut self.state, self.round_count); } }