chore(deps): use cryptoxide sha3 instead of depending on sha3 crate (#452)
This commit is contained in:
parent
7374eeac92
commit
7c60affea1
3 changed files with 4 additions and 8 deletions
|
|
@ -18,4 +18,4 @@ base58 = "0.2.0"
|
||||||
bech32 = "0.9.1"
|
bech32 = "0.9.1"
|
||||||
thiserror = "1.0.31"
|
thiserror = "1.0.31"
|
||||||
crc = "3.0.1"
|
crc = "3.0.1"
|
||||||
sha3 = "0.10.8"
|
cryptoxide = "0.4"
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ pub struct AddressPayload {
|
||||||
pub addrtype: AddrType,
|
pub addrtype: AddrType,
|
||||||
}
|
}
|
||||||
|
|
||||||
use sha3::{Digest, Sha3_256};
|
use cryptoxide::hashing::sha3_256;
|
||||||
impl AddressPayload {
|
impl AddressPayload {
|
||||||
pub fn hash_address_id(
|
pub fn hash_address_id(
|
||||||
addrtype: &AddrType,
|
addrtype: &AddrType,
|
||||||
|
|
@ -227,11 +227,7 @@ impl AddressPayload {
|
||||||
let parts = (addrtype, spending_data, attributes);
|
let parts = (addrtype, spending_data, attributes);
|
||||||
let buf = minicbor::to_vec(parts).unwrap();
|
let buf = minicbor::to_vec(parts).unwrap();
|
||||||
|
|
||||||
let mut sha = Sha3_256::new();
|
pallas_crypto::hash::Hasher::<224>::hash(&sha3_256(&buf))
|
||||||
sha.update(buf);
|
|
||||||
let sha = sha.finalize();
|
|
||||||
|
|
||||||
pallas_crypto::hash::Hasher::<224>::hash(&sha)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(addrtype: AddrType, spending_data: SpendingData, attributes: AddrAttrs) -> Self {
|
pub fn new(addrtype: AddrType, spending_data: SpendingData, attributes: AddrAttrs) -> Self {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ authors = ["Nicolas Di Prima <nicolas@primetype.co.uk>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
cryptoxide = { version = "0.4.1" }
|
cryptoxide = { version = "0.4.4" }
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
rand_core = "0.6"
|
rand_core = "0.6"
|
||||||
pallas-codec = { version = "=0.25.0", path = "../pallas-codec" }
|
pallas-codec = { version = "=0.25.0", path = "../pallas-codec" }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue