diff --git a/pallas-addresses/Cargo.toml b/pallas-addresses/Cargo.toml index c7547356..c860239d 100644 --- a/pallas-addresses/Cargo.toml +++ b/pallas-addresses/Cargo.toml @@ -18,4 +18,4 @@ base58 = "0.2.0" bech32 = "0.9.1" thiserror = "1.0.31" crc = "3.0.1" -sha3 = "0.10.8" +cryptoxide = "0.4" diff --git a/pallas-addresses/src/byron.rs b/pallas-addresses/src/byron.rs index 1d8c2385..f9924550 100644 --- a/pallas-addresses/src/byron.rs +++ b/pallas-addresses/src/byron.rs @@ -217,7 +217,7 @@ pub struct AddressPayload { pub addrtype: AddrType, } -use sha3::{Digest, Sha3_256}; +use cryptoxide::hashing::sha3_256; impl AddressPayload { pub fn hash_address_id( addrtype: &AddrType, @@ -227,11 +227,7 @@ impl AddressPayload { let parts = (addrtype, spending_data, attributes); let buf = minicbor::to_vec(parts).unwrap(); - let mut sha = Sha3_256::new(); - sha.update(buf); - let sha = sha.finalize(); - - pallas_crypto::hash::Hasher::<224>::hash(&sha) + pallas_crypto::hash::Hasher::<224>::hash(&sha3_256(&buf)) } pub fn new(addrtype: AddrType, spending_data: SpendingData, attributes: AddrAttrs) -> Self { diff --git a/pallas-crypto/Cargo.toml b/pallas-crypto/Cargo.toml index 4e205853..45c697a0 100644 --- a/pallas-crypto/Cargo.toml +++ b/pallas-crypto/Cargo.toml @@ -12,7 +12,7 @@ authors = ["Nicolas Di Prima "] [dependencies] hex = "0.4" -cryptoxide = { version = "0.4.1" } +cryptoxide = { version = "0.4.4" } thiserror = "1.0" rand_core = "0.6" pallas-codec = { version = "=0.25.0", path = "../pallas-codec" }