Skip to content

Commit

Permalink
replace sha3 by cryptoxide used in pallas-crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthz committed Apr 28, 2024
1 parent 9a405f2 commit b3d8aab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 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

0 comments on commit b3d8aab

Please sign in to comment.