zcash_primitives: Migrate to `sha2 0.10`, `bip0039 0.11`

This commit is contained in:
Jack Grigg 2023-04-11 13:44:09 +00:00
parent d2ccd1f017
commit 878f3e9214
4 changed files with 6 additions and 7 deletions

View File

@ -9,7 +9,7 @@ and this library adheres to Rust's notion of
### Changed ### Changed
- Bumped dependencies to `bls12_381 0.8`, `ff 0.13`, `group 0.13`, - Bumped dependencies to `bls12_381 0.8`, `ff 0.13`, `group 0.13`,
`jubjub 0.10`, `orchard 0.4`. `jubjub 0.10`, `orchard 0.4`, `sha2 0.10`, `bip0039 0.11`.
## [0.10.2] - 2023-03-16 ## [0.10.2] - 2023-03-16
### Added ### Added

View File

@ -30,7 +30,7 @@ rand_core = "0.6"
# - Digests (output types exposed) # - Digests (output types exposed)
blake2b_simd = "1" blake2b_simd = "1"
sha2 = "0.9" sha2 = "0.10"
# - Metrics # - Metrics
memuse = "0.2.1" memuse = "0.2.1"
@ -60,7 +60,7 @@ hdwallet = { version = "0.3.1", optional = true }
secp256k1 = { version = "0.21", optional = true } secp256k1 = { version = "0.21", optional = true }
# - ZIP 339 # - ZIP 339
bip0039 = { version = "0.9", features = ["std", "all-languages"] } bip0039 = { version = "0.11", features = ["std", "all-languages"] }
# Dependencies used internally: # Dependencies used internally:
# (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.) # (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.)

View File

@ -2,9 +2,8 @@ use hdwallet::{
traits::{Deserialize, Serialize}, traits::{Deserialize, Serialize},
ExtendedPrivKey, ExtendedPubKey, KeyIndex, ExtendedPrivKey, ExtendedPubKey, KeyIndex,
}; };
use ripemd::Digest as RipemdDigest;
use secp256k1::PublicKey; use secp256k1::PublicKey;
use sha2::{Digest as Sha2Digest, Sha256}; use sha2::{Digest, Sha256};
use crate::{consensus, keys::prf_expand_vec, zip32::AccountId}; use crate::{consensus, keys::prf_expand_vec, zip32::AccountId};

View File

@ -22,7 +22,7 @@ use {
TransactionData, TxDigests, TransactionData, TxDigests,
}, },
blake2b_simd::Hash as Blake2bHash, blake2b_simd::Hash as Blake2bHash,
ripemd::Digest, sha2::Digest,
}; };
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]
@ -144,7 +144,7 @@ impl TransparentBuilder {
match coin.script_pubkey.address() { match coin.script_pubkey.address() {
Some(TransparentAddress::PublicKey(hash)) => { Some(TransparentAddress::PublicKey(hash)) => {
use ripemd::Ripemd160; use ripemd::Ripemd160;
use sha2::{Digest, Sha256}; use sha2::Sha256;
if hash[..] != Ripemd160::digest(Sha256::digest(&pubkey))[..] { if hash[..] != Ripemd160::digest(Sha256::digest(&pubkey))[..] {
return Err(Error::InvalidAddress); return Err(Error::InvalidAddress);