mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-17 01:17:36 +00:00
Use sha3 in monero-generators
This commit is contained in:
parent
2b7c9378c0
commit
8da0743361
3 changed files with 4 additions and 8 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -4579,8 +4579,8 @@ dependencies = [
|
||||||
"dalek-ff-group",
|
"dalek-ff-group",
|
||||||
"group",
|
"group",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
"sha3 0.10.5",
|
||||||
"subtle",
|
"subtle",
|
||||||
"tiny-keccak",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -15,7 +15,7 @@ lazy_static = "1"
|
||||||
|
|
||||||
subtle = "2.4"
|
subtle = "2.4"
|
||||||
|
|
||||||
tiny-keccak = { version = "2", features = ["keccak"] }
|
sha3 = "0.10"
|
||||||
|
|
||||||
curve25519-dalek = { version = "3", features = ["std"] }
|
curve25519-dalek = { version = "3", features = ["std"] }
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
use tiny_keccak::{Hasher, Keccak};
|
use sha3::{Digest, Keccak256};
|
||||||
|
|
||||||
use curve25519_dalek::{
|
use curve25519_dalek::{
|
||||||
constants::ED25519_BASEPOINT_POINT,
|
constants::ED25519_BASEPOINT_POINT,
|
||||||
|
@ -21,11 +21,7 @@ mod hash_to_point;
|
||||||
pub use hash_to_point::hash_to_point;
|
pub use hash_to_point::hash_to_point;
|
||||||
|
|
||||||
fn hash(data: &[u8]) -> [u8; 32] {
|
fn hash(data: &[u8]) -> [u8; 32] {
|
||||||
let mut keccak = Keccak::v256();
|
Keccak256::digest(data).into()
|
||||||
keccak.update(data);
|
|
||||||
let mut res = [0; 32];
|
|
||||||
keccak.finalize(&mut res);
|
|
||||||
res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
|
Loading…
Reference in a new issue