Skip to content

Commit

Permalink
chore(deps): use cryptoxide sha3 instead of depending on sha3 crate (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthz committed Apr 29, 2024
1 parent 9a405f2 commit 954e99d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pallas-addresses/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 2 additions & 6 deletions pallas-addresses/src/byron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pallas-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = ["Nicolas Di Prima <nicolas@primetype.co.uk>"]

[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" }
Expand Down

0 comments on commit 954e99d

Please sign in to comment.