Use sha3 in monero-generators

This commit is contained in:
Luke Parker
2022-09-29 08:08:49 -04:00
parent 2b7c9378c0
commit 8da0743361
3 changed files with 4 additions and 8 deletions

2
Cargo.lock generated
View File

@@ -4579,8 +4579,8 @@ dependencies = [
"dalek-ff-group",
"group",
"lazy_static",
"sha3 0.10.5",
"subtle",
"tiny-keccak",
]
[[package]]

View File

@@ -15,7 +15,7 @@ lazy_static = "1"
subtle = "2.4"
tiny-keccak = { version = "2", features = ["keccak"] }
sha3 = "0.10"
curve25519-dalek = { version = "3", features = ["std"] }

View File

@@ -4,7 +4,7 @@
use lazy_static::lazy_static;
use tiny_keccak::{Hasher, Keccak};
use sha3::{Digest, Keccak256};
use curve25519_dalek::{
constants::ED25519_BASEPOINT_POINT,
@@ -21,11 +21,7 @@ mod hash_to_point;
pub use hash_to_point::hash_to_point;
fn hash(data: &[u8]) -> [u8; 32] {
let mut keccak = Keccak::v256();
keccak.update(data);
let mut res = [0; 32];
keccak.finalize(&mut res);
res
Keccak256::digest(data).into()
}
lazy_static! {