diff --git a/Cargo.toml b/Cargo.toml index d434fd1..5777a81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ serde-pickle = { version = "0.5.1", optional = true } ron = { version = "0.5.1", optional = true } groestl = { version = "0.8.0", optional = true } openssl = { version = "0.10.24", optional = true } -tiny-keccak = { version = "2.0.1", optional = true } +tiny-keccak = { version = "2.0.1", optional = true, features = ["sha3", "keccak"] } hashbrown = { version = "0.6.0", optional = true } rocksdb = { version = "0.13.0", optional = true } seahash = { version = "3.0.6", optional = true } diff --git a/src/tree/tree_branch.rs b/src/tree/tree_branch.rs index c8cad13..bf4ed10 100644 --- a/src/tree/tree_branch.rs +++ b/src/tree/tree_branch.rs @@ -97,7 +97,7 @@ where /// Set the location of the next node to traverse when going down the one side. fn set_one(&mut self, one: ArrayType) { - self.one = one;; + self.one = one; } /// Sets the index of the key to split on when deciding which child to traverse. diff --git a/src/tree_hasher/keccak.rs b/src/tree_hasher/keccak.rs index 4d456b3..a200b15 100644 --- a/src/tree_hasher/keccak.rs +++ b/src/tree_hasher/keccak.rs @@ -1,4 +1,5 @@ use tiny_keccak::Keccak; +use tiny_keccak::Hasher; use crate::traits::Array; @@ -12,7 +13,7 @@ where #[inline] fn new(_size: usize) -> Self { - let hasher = Keccak::new_keccak256(); + let hasher = Keccak::v256(); Self(hasher) } diff --git a/src/tree_hasher/sha3_openssl.rs b/src/tree_hasher/sha3_openssl.rs index bda2caf..92ab88e 100644 --- a/src/tree_hasher/sha3_openssl.rs +++ b/src/tree_hasher/sha3_openssl.rs @@ -1,8 +1,9 @@ -use tiny_keccak::Keccak; +use tiny_keccak::Sha3; +use tiny_keccak::Hasher; use crate::traits::Array; -pub struct Sha3Hasher(Keccak); +pub struct Sha3Hasher(Sha3); impl crate::traits::Hasher for Sha3Hasher where @@ -12,7 +13,7 @@ where #[inline] fn new(_size: usize) -> Self { - let hasher = Keccak::new_sha3_256(); + let hasher = Sha3::v256(); Self(hasher) }