Skip to content

Commit

Permalink
Support tiny_keccak_2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Josiah Evans authored and ChosunOne committed Nov 20, 2019
1 parent d9992f9 commit 4a42929
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/tree/tree_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/tree_hasher/keccak.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use tiny_keccak::Keccak;
use tiny_keccak::Hasher;

use crate::traits::Array;

Expand All @@ -12,7 +13,7 @@ where

#[inline]
fn new(_size: usize) -> Self {
let hasher = Keccak::new_keccak256();
let hasher = Keccak::v256();
Self(hasher)
}

Expand Down
7 changes: 4 additions & 3 deletions src/tree_hasher/sha3_openssl.rs
Original file line number Diff line number Diff line change
@@ -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<ArrayType> crate::traits::Hasher<ArrayType> for Sha3Hasher
where
Expand All @@ -12,7 +13,7 @@ where

#[inline]
fn new(_size: usize) -> Self {
let hasher = Keccak::new_sha3_256();
let hasher = Sha3::v256();
Self(hasher)
}

Expand Down

0 comments on commit 4a42929

Please sign in to comment.