From 557632075d7f610d663ddc29cb11008915fa7a17 Mon Sep 17 00:00:00 2001 From: "Tony Arcieri (iqlusion)" Date: Mon, 29 May 2023 16:00:03 -0700 Subject: [PATCH] bip32: bump `bs58` to v0.5 (#1139) --- Cargo.lock | 75 ++++++++++----------------------------- bip32/Cargo.toml | 2 +- bip32/src/extended_key.rs | 4 +-- bip32/src/prefix.rs | 2 +- 4 files changed, 23 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83a5b38d..6315a369 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ dependencies = [ "rand_core", "ripemd", "secp256k1", - "sha2 0.10.6", + "sha2", "subtle", "zeroize", ] @@ -50,15 +50,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -70,11 +61,11 @@ dependencies = [ [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ - "sha2 0.9.9", + "sha2", ] [[package]] @@ -177,7 +168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03d928d978dbec61a1167414f5ec534f24bea0d7a0d24dd9b6233d3d8223e585" dependencies = [ "cfg-if", - "digest 0.10.6", + "digest", "fiat-crypto", "packed_simd_2", "platforms", @@ -195,22 +186,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "digest" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -223,7 +205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a48e5d537b8a30c0b023116d981b16334be1485af7ca68db3a2b7024cbc957fd" dependencies = [ "der", - "digest 0.10.6", + "digest", "elliptic-curve", "rfc6979", "signature", @@ -246,7 +228,7 @@ checksum = "798f704d128510932661a3489b08e3f4c934a01d61c5def59ae7b8e48f19665a" dependencies = [ "curve25519-dalek", "ed25519", - "sha2 0.10.6", + "sha2", ] [[package]] @@ -257,7 +239,7 @@ checksum = "22cdacd4d6ed3f9b98680b679c0e52a823b8a2c7a97358d508fe247f2180c282" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.6", + "digest", "ff", "generic-array", "group", @@ -505,7 +487,7 @@ dependencies = [ "once_cell", "pbkdf2", "rand_core", - "sha2 0.10.6", + "sha2", "subtle-encoding", "zeroize", ] @@ -525,7 +507,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest", ] [[package]] @@ -689,7 +671,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.6", + "sha2", "signature", ] @@ -774,12 +756,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "openssl" version = "0.10.48" @@ -834,7 +810,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2 0.10.6", + "sha2", ] [[package]] @@ -846,7 +822,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2 0.10.6", + "sha2", ] [[package]] @@ -865,7 +841,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" dependencies = [ - "digest 0.10.6", + "digest", "hmac", ] @@ -988,7 +964,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.6", + "digest", ] [[package]] @@ -1144,20 +1120,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] @@ -1168,7 +1131,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest", ] [[package]] @@ -1193,7 +1156,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.6", + "digest", "rand_core", ] diff --git a/bip32/Cargo.toml b/bip32/Cargo.toml index bbd702de..b7c4ed17 100644 --- a/bip32/Cargo.toml +++ b/bip32/Cargo.toml @@ -17,7 +17,7 @@ edition = "2021" rust-version = "1.65" [dependencies] -bs58 = { version = "0.4", default-features = false, features = ["check"] } +bs58 = { version = "0.5", default-features = false, features = ["check"] } hmac = { version = "0.12", default-features = false } rand_core = { version = "0.6", default-features = false } ripemd = { version = "0.1", default-features = false } diff --git a/bip32/src/extended_key.rs b/bip32/src/extended_key.rs index a7245845..63600720 100644 --- a/bip32/src/extended_key.rs +++ b/bip32/src/extended_key.rs @@ -49,7 +49,7 @@ 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().into(buffer.as_mut())?; + let base58_len = bs58::encode(&bytes).with_check().onto(buffer.as_mut())?; bytes.zeroize(); str::from_utf8(&buffer[..base58_len]).map_err(|_| Error::Base58) @@ -70,7 +70,7 @@ impl FromStr for ExtendedKey { fn from_str(base58: &str) -> Result { let mut bytes = [0u8; Self::BYTE_SIZE + 4]; // with 4-byte checksum - let decoded_len = bs58::decode(base58).with_check(None).into(&mut bytes)?; + let decoded_len = bs58::decode(base58).with_check(None).onto(&mut bytes)?; if decoded_len != Self::BYTE_SIZE { return Err(Error::Decode); diff --git a/bip32/src/prefix.rs b/bip32/src/prefix.rs index 520b589f..329b682c 100644 --- a/bip32/src/prefix.rs +++ b/bip32/src/prefix.rs @@ -86,7 +86,7 @@ impl Prefix { bytes[..4].copy_from_slice(&version.to_be_bytes()); let mut buffer = [0u8; ExtendedKey::MAX_BASE58_SIZE]; - bs58::encode(&bytes).with_check().into(buffer.as_mut())?; + bs58::encode(&bytes).with_check().onto(buffer.as_mut())?; let s = str::from_utf8(&buffer[..4]).map_err(|_| Error::Base58)?; Self::validate_str(s)?;