chore(deps): use cryptoxide sha3 instead of depending on sha3 crate (#452)

This commit is contained in:
Vincent Hanquez 2024-04-30 01:51:47 +08:00 committed by GitHub
parent 9a405f22ee
commit 954e99db9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 8 deletions

View file

@ -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"

View file

@ -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 {