Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bip32/signatory: Update dependencies to pre-release candidates #1198

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 201 additions & 81 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions bip32/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ rust-version = "1.65"

[dependencies]
bs58 = { version = "0.5", default-features = false, features = ["check"] }
hmac = { version = "0.12", default-features = false }
hmac = { version = "0.13.0-pre.4", default-features = false }
rand_core = { version = "0.6", default-features = false }
ripemd = { version = "0.1", default-features = false }
sha2 = { version = "0.10", default-features = false }
ripemd = { version = "0.2.0-pre", default-features = false }
sha2 = { version = "0.11.0-pre.4", default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1", default-features = false }

# optional dependencies
k256 = { version = "0.13", optional = true, default-features = false, features = ["ecdsa", "sha256"] }
k256 = {version = "0.14.0-pre.2", optional = true, default-features = false, features = ["ecdsa", "sha256"]}
signature = { version = "2.3.0-pre.4", default-features = false, features = ["alloc"] }
once_cell = { version = "1", optional = true }
pbkdf2 = { version = "0.12", optional = true, default-features = false, features = ["hmac"] }
secp256k1-ffi = { package = "secp256k1", version = "0.27", optional = true }
pbkdf2 = { version = "0.13.0-pre.1", optional = true, default-features = false, features = ["hmac"] }
secp256k1-ffi = { package = "secp256k1", version = "0.29", optional = true }

[dev-dependencies]
hex-literal = "0.4"
Expand Down
4 changes: 3 additions & 1 deletion bip32/src/extended_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ impl ExtendedKey {
bytes[13..45].copy_from_slice(&self.attrs.chain_code);
bytes[45..78].copy_from_slice(&self.key_bytes);

let base58_len = bs58::encode(&bytes).with_check().onto(buffer.as_mut())?;
let base58_len = bs58::encode(&bytes)
.with_check()
.onto(<[u8; Self::MAX_BASE58_SIZE] as AsMut<[u8]>>::as_mut(buffer))?;
bytes.zeroize();

str::from_utf8(&buffer[..base58_len]).map_err(|_| Error::Base58)
Expand Down
2 changes: 1 addition & 1 deletion bip32/src/extended_key/private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use core::{
fmt::{self, Debug},
str::FromStr,
};
use hmac::Mac;
use hmac::{KeyInit, Mac};
use subtle::{Choice, ConstantTimeEq};
use zeroize::Zeroize;

Expand Down
3 changes: 2 additions & 1 deletion bip32/src/mnemonic/phrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ impl Phrase {
/// Create a new BIP39 mnemonic phrase from the given entropy
pub fn from_entropy(entropy: Entropy, language: Language) -> Self {
let wordlist = language.wordlist();
let checksum_byte = Sha256::digest(entropy.as_ref()).as_slice()[0];
let checksum_byte =
Sha256::digest(<[u8; 32] as AsRef<[u8]>>::as_ref(&entropy)).as_slice()[0];

// First, create a byte iterator for the given entropy and the first byte of the
// hash of the entropy that will serve as the checksum (up to 8 bits for biggest
Expand Down
6 changes: 5 additions & 1 deletion bip32/src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ impl Prefix {
bytes[..4].copy_from_slice(&version.to_be_bytes());

let mut buffer = [0u8; ExtendedKey::MAX_BASE58_SIZE];
bs58::encode(&bytes).with_check().onto(buffer.as_mut())?;
bs58::encode(&bytes)
.with_check()
.onto(<[u8; ExtendedKey::MAX_BASE58_SIZE] as AsMut<[u8]>>::as_mut(
&mut buffer,
))?;

let s = str::from_utf8(&buffer[..4]).map_err(|_| Error::Base58)?;
Self::validate_str(s)?;
Expand Down
2 changes: 1 addition & 1 deletion bip32/src/private_key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Trait for deriving child keys on a given type.

use crate::{ChainCode, ChildNumber, Error, HmacSha512, PublicKey, Result, KEY_SIZE};
use hmac::Mac;
use hmac::{KeyInit, Mac};

#[cfg(feature = "secp256k1")]
use crate::XPrv;
Expand Down
2 changes: 1 addition & 1 deletion bip32/src/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::{
ChainCode, ChildNumber, Error, HmacSha512, KeyFingerprint, PrivateKeyBytes, Result, KEY_SIZE,
};
use hmac::Mac;
use hmac::{KeyInit, Mac};
use ripemd::Ripemd160;
use sha2::{Digest, Sha256};

Expand Down
12 changes: 6 additions & 6 deletions signatory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ rust-version = "1.65"
[dependencies]
pkcs8 = { version = "0.10", features = ["alloc", "pem"] }
rand_core = "0.6"
signature = "2"
signature = "2.3.0-pre.4"
zeroize = "1.5"

# optional dependencies
ecdsa = { version = "0.16", optional = true, features = ["pem", "pkcs8"] }
ed25519-dalek = { version = "2", optional = true, default-features = false }
k256 = { version = "0.13", optional = true, features = ["ecdsa", "sha256"] }
p256 = { version = "0.13", optional = true, features = ["ecdsa", "sha256"] }
p384 = { version = "0.13", optional = true, features = ["ecdsa", "sha384"] }
ecdsa = { version = "0.17.0-pre.9", optional = true, features = ["pem", "pkcs8"] }
ed25519-dalek = { version = "2.2.0-pre", optional = true, default-features = false, git = "https://github.com/dalek-cryptography/curve25519-dalek/", branch="rustcrypto-new-releases" }
k256 = {version = "0.14.0-pre.2", optional = true, default-features = false, features = ["ecdsa", "sha256"]}
p256 = { version = "0.14.0-pre.2", optional = true, features = ["ecdsa", "sha256"] }
p384 = { version = "0.14.0-pre.2", optional = true, features = ["ecdsa", "sha384"] }

[dev-dependencies]
tempfile = "3"
Expand Down