From 0b88e4246da2b54f5b1c5ba15268313f4f44f40d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 6 Jul 2022 23:11:23 +0200 Subject: [PATCH] deps: bump crypto deps (#1465) --- Cargo.lock | 280 ++++++++++------------- ethers-core/Cargo.toml | 4 +- ethers-core/src/types/signature.rs | 15 +- ethers-signers/Cargo.toml | 16 +- ethers-signers/src/aws/utils.rs | 2 +- ethers-signers/src/wallet/hash.rs | 35 ++- ethers-signers/src/wallet/private_key.rs | 2 +- ethers-solc/Cargo.toml | 2 +- 8 files changed, 147 insertions(+), 209 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe031011..f010b507 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,13 +242,11 @@ dependencies = [ [[package]] name = "blake2" -version = "0.9.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -280,7 +278,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", "generic-array 0.14.5", ] @@ -538,72 +535,72 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b70e37282d9624283878ffda1d1e53883bcf868cf441bddda44127620b39572d" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac", "dbl", ] [[package]] name = "coins-bip32" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471b39eadc9323de375dce5eff149a5a1ebd21c67f1da34a56f87ee62191d4ea" +checksum = "634c509653de24b439672164bbf56f5f582a2ab0e313d3b0f6af0b7345cf2560" dependencies = [ "bincode", "bs58", "coins-core", - "digest 0.9.0", + "digest 0.10.3", "getrandom 0.2.7", - "hmac 0.11.0", + "hmac 0.12.1", "k256", "lazy_static", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "thiserror", ] [[package]] name = "coins-bip39" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f473ea37dfc9d2cb94fdde50c3d41f28c3f384b367573d66386fea38d76d466" +checksum = "2a11892bcac83b4c6e95ab84b5b06c76d9d70ad73548dd07418269c5c7977171" dependencies = [ "bitvec 0.17.4", "coins-bip32", "getrandom 0.2.7", "hex", - "hmac 0.11.0", - "pbkdf2 0.8.0", + "hmac 0.12.1", + "pbkdf2 0.11.0", "rand 0.8.5", - "sha2 0.9.9", + "sha2 0.10.2", "thiserror", ] [[package]] name = "coins-core" -version = "0.2.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257d975731955ee86fa7f348000c3fea09c262e84c70c11e994a85aa4f467a7" +checksum = "c94090a6663f224feae66ab01e41a2555a8296ee07b5f20dab8888bdefc9f617" dependencies = [ "base58check", "base64 0.12.3", "bech32", "blake2", - "digest 0.9.0", + "digest 0.10.3", "generic-array 0.14.5", "hex", - "ripemd160", + "ripemd", "serde", "serde_derive", - "sha2 0.9.9", - "sha3 0.9.1", + "sha2 0.10.2", + "sha3", "thiserror", ] [[package]] name = "coins-ledger" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa8a730d02735d8d53888a95d8f33aaa9dda9979862de113202421db939b2a" +checksum = "d9766e413812861a04ceb82c8008e7fea9fe75845b68ed41241c34274702ed9d" dependencies = [ "async-trait", "blake2b_simd", @@ -672,12 +669,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - [[package]] name = "const-oid" version = "0.9.0" @@ -820,9 +811,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.3.2" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" dependencies = [ "generic-array 0.14.5", "rand_core 0.6.3", @@ -840,16 +831,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.5", - "subtle", -] - [[package]] name = "crypto-mac" version = "0.11.1" @@ -924,22 +905,14 @@ dependencies = [ "generic-array 0.14.5", ] -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid 0.7.1", -] - [[package]] name = "der" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" dependencies = [ - "const-oid 0.9.0", + "const-oid", + "zeroize", ] [[package]] @@ -1018,11 +991,11 @@ checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" [[package]] name = "ecdsa" -version = "0.13.4" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" dependencies = [ - "der 0.5.1", + "der", "elliptic-curve", "rfc6979", "signature", @@ -1059,16 +1032,18 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "elliptic-curve" -version = "0.11.12" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" dependencies = [ "base16ct", "crypto-bigint", - "der 0.5.1", + "der", + "digest 0.10.3", "ff", "generic-array 0.14.5", "group", + "pkcs8", "rand_core 0.6.3", "sec1", "subtle", @@ -1128,10 +1103,10 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.1", - "sha3 0.10.0", + "sha2 0.10.2", + "sha3", "thiserror", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -1146,7 +1121,7 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3 0.10.0", + "sha3", "thiserror", "uint", ] @@ -1420,8 +1395,8 @@ dependencies = [ "rusoto_kms", "semver", "serde_json", - "sha2 0.9.9", - "spki 0.6.0", + "sha2 0.10.2", + "spki", "tempfile", "thiserror", "tokio", @@ -1458,7 +1433,7 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.2", "solang-parser", "svm-rs", "svm-rs-builds", @@ -1540,9 +1515,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e" +checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" dependencies = [ "rand_core 0.6.3", "subtle", @@ -1795,9 +1770,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "group" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" dependencies = [ "ff", "rand_core 0.6.3", @@ -1889,7 +1864,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac", "digest 0.9.0", ] @@ -2137,16 +2112,15 @@ dependencies = [ [[package]] name = "k256" -version = "0.10.4" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" dependencies = [ "cfg-if 1.0.0", "ecdsa", "elliptic-curve", - "sec1", - "sha2 0.9.9", - "sha3 0.9.1", + "sha2 0.10.2", + "sha3", ] [[package]] @@ -2470,25 +2444,24 @@ dependencies = [ [[package]] name = "p256" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19736d80675fbe9fe33426268150b951a3fb8f5cfca2a23a17c85ef3adb24e3b" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa", "elliptic-curve", - "sec1", - "sha2 0.9.9", + "sha2 0.10.2", ] [[package]] name = "p384" -version = "0.9.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755d8266e41f57bd8562ed9b6e93cdcf73ead050e1e8c3a27ea3871b6643a20c" +checksum = "70723b6e03216e79df3765a7e4cdf39746c4a2392ba4bdb458111a939494cc1d" dependencies = [ "ecdsa", "elliptic-curve", - "sec1", + "sha2 0.10.2", ] [[package]] @@ -2567,9 +2540,9 @@ dependencies = [ [[package]] name = "password-hash" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e0b28ace46c5a396546bcf443bf422b57049617433d8854227352a4a9b24e7" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" dependencies = [ "base64ct", "rand_core 0.6.3", @@ -2578,9 +2551,9 @@ dependencies = [ [[package]] name = "password-hash" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.3", @@ -2593,28 +2566,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c54014ba3c1880122928735226f78b6f5bf5bd1fed15e41e92cf7aa20278ce28" -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "base64ct", - "crypto-mac 0.11.1", - "hmac 0.11.0", - "password-hash 0.2.3", - "sha2 0.9.9", -] - -[[package]] -name = "pbkdf2" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739" -dependencies = [ - "crypto-mac 0.11.1", -] - [[package]] name = "pbkdf2" version = "0.10.1" @@ -2624,7 +2575,19 @@ dependencies = [ "digest 0.10.3", "hmac 0.12.1", "password-hash 0.3.2", - "sha2 0.10.1", + "sha2 0.10.2", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.3", + "hmac 0.12.1", + "password-hash 0.4.2", + "sha2 0.10.2", ] [[package]] @@ -2746,13 +2709,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der 0.5.1", - "spki 0.5.4", - "zeroize", + "der", + "spki", ] [[package]] @@ -3095,12 +3057,12 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" dependencies = [ "crypto-bigint", - "hmac 0.11.0", + "hmac 0.12.1", "zeroize", ] @@ -3120,14 +3082,12 @@ dependencies = [ ] [[package]] -name = "ripemd160" -version = "0.9.1" +name = "ripemd" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +checksum = "1facec54cb5e0dc08553501fa740091086d0259ad0067e0d4103448e4cb22ed3" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -3353,7 +3313,7 @@ dependencies = [ "password-hash 0.3.2", "pbkdf2 0.10.1", "salsa20", - "sha2 0.10.1", + "sha2 0.10.2", ] [[package]] @@ -3368,11 +3328,12 @@ dependencies = [ [[package]] name = "sec1" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "der 0.5.1", + "base16ct", + "der", "generic-array 0.14.5", "pkcs8", "subtle", @@ -3556,13 +3517,14 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.10.3", + "sha2-asm", ] [[package]] @@ -3574,18 +3536,6 @@ dependencies = [ "cc", ] -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - [[package]] name = "sha3" version = "0.10.0" @@ -3622,20 +3572,20 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" dependencies = [ - "digest 0.9.0", + "digest 0.10.3", "rand_core 0.6.3", "signature_derive", ] [[package]] name = "signature_derive" -version = "1.0.0-pre.3" +version = "1.0.0-pre.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffba76095b73f87680d2cf325a8000d5fc507ca6c20c4f7e2747405550620d90" +checksum = "a7b87d3bd8d687b9265557e613e59ddc5dcb2ed6395523846d2fe76736073d5c" dependencies = [ "proc-macro2", "quote", @@ -3690,23 +3640,14 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der 0.5.1", -] - [[package]] name = "spki" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ - "der 0.6.0", + "base64ct", + "der", ] [[package]] @@ -4275,6 +4216,15 @@ dependencies = [ "serde", ] +[[package]] +name = "uuid" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +dependencies = [ + "serde", +] + [[package]] name = "valuable" version = "0.1.0" @@ -4598,35 +4548,35 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "yubihsm" -version = "0.40.0" +version = "0.41.0-pre" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7ba281142fd52beba6ed6e67752bdb93242dd7520908a1d93054bfb4dcc02d" +checksum = "58964f0e7f3ddf7606324e0ceb1657577234724b8ad1ffc53b9b6ba342f559ce" dependencies = [ "aes", "bitflags", "block-modes", "ccm", "cmac", - "digest 0.9.0", + "digest 0.10.3", "ecdsa", "ed25519", "ed25519-dalek", - "hmac 0.11.0", + "hmac 0.12.1", "k256", "log", "p256", "p384", - "pbkdf2 0.9.0", + "pbkdf2 0.11.0", "rand_core 0.6.3", "rusb", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.2", "signature", "subtle", "thiserror", "time", - "uuid", + "uuid 1.1.2", "zeroize", ] diff --git a/ethers-core/Cargo.toml b/ethers-core/Cargo.toml index dff12758..f174ab76 100644 --- a/ethers-core/Cargo.toml +++ b/ethers-core/Cargo.toml @@ -17,9 +17,9 @@ arrayvec = { version = "0.7.2", default-features = false } rlp-derive = { version = "0.1.0", default-features = false } # crypto -elliptic-curve = { version = "0.11.12", default-features = false } +elliptic-curve = { version = "0.12.2", default-features = false } generic-array = { version = "0.14.5", default-features = false } -k256 = { version = "0.10.4", default-features = false, features = ["keccak256", "ecdsa", "std"] } +k256 = { version = "0.11", default-features = false, features = ["keccak256", "ecdsa", "std"] } rand = { version = "0.8.5", default-features = false } tiny-keccak = { version = "2.0.2", default-features = false } diff --git a/ethers-core/src/types/signature.rs b/ethers-core/src/types/signature.rs index 95c3f324..8e2ff8e9 100644 --- a/ethers-core/src/types/signature.rs +++ b/ethers-core/src/types/signature.rs @@ -3,14 +3,8 @@ use crate::{ types::{Address, H256, U256}, utils::hash_message, }; - -use fastrlp::Decodable; -use serde::{Deserialize, Serialize}; -use std::{convert::TryFrom, fmt, str::FromStr}; - -use thiserror::Error; - use elliptic_curve::{consts::U32, sec1::ToEncodedPoint}; +use fastrlp::Decodable; use generic_array::GenericArray; use k256::{ ecdsa::{ @@ -19,6 +13,9 @@ use k256::{ }, PublicKey as K256PublicKey, }; +use serde::{Deserialize, Serialize}; +use std::{convert::TryFrom, fmt, str::FromStr}; +use thiserror::Error; /// An error involving a signature. #[derive(Debug, Error)] @@ -103,8 +100,8 @@ impl Signature { }; let (recoverable_sig, _recovery_id) = self.as_signature()?; - let verify_key = - recoverable_sig.recover_verify_key_from_digest_bytes(message_hash.as_ref().into())?; + let verify_key = recoverable_sig + .recover_verifying_key_from_digest_bytes(message_hash.as_ref().into())?; let public_key = K256PublicKey::from(&verify_key); let public_key = public_key.to_encoded_point(/* compress = */ false); diff --git a/ethers-signers/Cargo.toml b/ethers-signers/Cargo.toml index 19de8701..250ae471 100644 --- a/ethers-signers/Cargo.toml +++ b/ethers-signers/Cargo.toml @@ -16,15 +16,15 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] ethers-core = { version = "^0.13.0", path = "../ethers-core", features = ["eip712"]} thiserror = { version = "1.0.31", default-features = false } -coins-bip32 = "0.6.0" -coins-bip39 = "0.6.0" -coins-ledger = { version = "0.6.1", default-features = false, optional = true } +coins-bip32 = "0.7.0" +coins-bip39 = "0.7.0" +coins-ledger = { version = "0.7.0", default-features = false, optional = true } hex = { version = "0.4.3", default-features = false, features = ["std"] } async-trait = { version = "0.1.50", default-features = false } -elliptic-curve = { version = "0.11.12", default-features = false } -sha2 = { version = "0.9.8", default-features = false } +elliptic-curve = { version = "0.12.2", default-features = false } +sha2 = { version = "0.10.2", default-features = false } rand = { version = "0.8.5", default-features = false } -yubihsm = { version = "0.40.0", features = ["secp256k1", "http", "usb"], optional = true } +yubihsm = { version = "0.41.0-pre", features = ["secp256k1", "http", "usb"], optional = true } futures-util = { version = "^0.3", optional = true } futures-executor = { version = "^0.3", optional = true } semver = { version = "1.0.12", optional = true } @@ -45,10 +45,10 @@ ethers-contract = { version = "^0.13.0", path = "../ethers-contract", features = ethers-derive-eip712 = { version = "^0.13.0", path = "../ethers-core/ethers-derive-eip712" } serde_json = { version = "1.0.64" } tracing-subscriber = "0.3.11" -yubihsm = { version = "0.40.0", features = ["secp256k1", "usb", "mockhsm"] } +yubihsm = { version = "0.41.0-pre", features = ["secp256k1", "usb", "mockhsm"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -yubihsm = { version = "0.40.0", features = ["secp256k1", "usb", "mockhsm"] } +yubihsm = { version = "0.41.0-pre", features = ["secp256k1", "usb", "mockhsm"] } tokio = { version = "1.18", default-features = false, features = ["macros", "rt"] } tempfile = "3.3.0" diff --git a/ethers-signers/src/aws/utils.rs b/ethers-signers/src/aws/utils.rs index ba28ea67..ad5c4fa4 100644 --- a/ethers-signers/src/aws/utils.rs +++ b/ethers-signers/src/aws/utils.rs @@ -34,7 +34,7 @@ pub(super) fn rsig_to_ethsig(sig: &RSig) -> EthSig { /// Makes a trial recovery to check whether an RSig corresponds to a known /// `VerifyingKey` fn check_candidate(sig: &RSig, digest: [u8; 32], vk: &VerifyingKey) -> bool { - if let Ok(key) = sig.recover_verify_key_from_digest_bytes(digest.as_ref().into()) { + if let Ok(key) = sig.recover_verifying_key_from_digest_bytes(digest.as_ref().into()) { key == *vk } else { false diff --git a/ethers-signers/src/wallet/hash.rs b/ethers-signers/src/wallet/hash.rs index 9614607c..ddb2a5fb 100644 --- a/ethers-signers/src/wallet/hash.rs +++ b/ethers-signers/src/wallet/hash.rs @@ -1,9 +1,9 @@ //! This is a helper module used to pass the pre-hashed message for signing to the //! `sign_digest` methods of K256. -use elliptic_curve::consts::U64; use ethers_core::{ k256::ecdsa::signature::digest::{ - generic_array::GenericArray, BlockInput, Digest, FixedOutput, Output, Reset, Update, + generic_array::GenericArray, Digest, FixedOutput, FixedOutputReset, HashMarker, Output, + OutputSizeUser, Reset, Update, }, types::H256, }; @@ -18,7 +18,7 @@ pub enum ProxyDigest { impl From for ProxyDigest where - GenericArray::OutputSize>: Copy, + GenericArray::OutputSize>: Copy, { fn from(src: H256) -> Self { ProxyDigest::Proxy(*GenericArray::from_slice(src.as_bytes())) @@ -33,7 +33,7 @@ impl Default for ProxyDigest { impl Update for ProxyDigest { // we update only if we are digest - fn update(&mut self, data: impl AsRef<[u8]>) { + fn update(&mut self, data: &[u8]) { match self { ProxyDigest::Digest(ref mut d) => { d.update(data); @@ -43,18 +43,10 @@ impl Update for ProxyDigest { } } } - - // we chain only if we are digest - fn chain(self, data: impl AsRef<[u8]>) -> Self { - match self { - ProxyDigest::Digest(d) => ProxyDigest::Digest(d.chain(data)), - ProxyDigest::Proxy(..) => { - unreachable!("can not update if we are proxy"); - } - } - } } +impl HashMarker for ProxyDigest {} + impl Reset for ProxyDigest { // make new one fn reset(&mut self) { @@ -62,15 +54,12 @@ impl Reset for ProxyDigest { } } -// Use Sha256 with 512 bit blocks -impl BlockInput for ProxyDigest { - type BlockSize = U64; +impl OutputSizeUser for ProxyDigest { + // we default to the output of the original digest + type OutputSize = ::OutputSize; } impl FixedOutput for ProxyDigest { - // we default to the output of the original digest - type OutputSize = D::OutputSize; - fn finalize_into(self, out: &mut GenericArray) { match self { ProxyDigest::Digest(d) => { @@ -81,9 +70,11 @@ impl FixedOutput for ProxyDigest { } } } +} - fn finalize_into_reset(&mut self, out: &mut GenericArray) { +impl FixedOutputReset for ProxyDigest { + fn finalize_into_reset(&mut self, out: &mut Output) { let s = std::mem::take(self); - s.finalize_into(out); + Digest::finalize_into(s, out) } } diff --git a/ethers-signers/src/wallet/private_key.rs b/ethers-signers/src/wallet/private_key.rs index e9871d92..8003fa31 100644 --- a/ethers-signers/src/wallet/private_key.rs +++ b/ethers-signers/src/wallet/private_key.rs @@ -52,7 +52,7 @@ impl Clone for Wallet { fn clone(&self) -> Self { Self { // TODO: Can we have a better way to clone here? - signer: SigningKey::from_bytes(&*self.signer.to_bytes()).unwrap(), + signer: SigningKey::from_bytes(&self.signer.to_bytes()).unwrap(), address: self.address, chain_id: self.chain_id, } diff --git a/ethers-solc/Cargo.toml b/ethers-solc/Cargo.toml index b5d8a4d5..31b027c5 100644 --- a/ethers-solc/Cargo.toml +++ b/ethers-solc/Cargo.toml @@ -33,7 +33,7 @@ num_cpus = "1.13.1" tiny-keccak = { version = "2.0.2", default-features = false } tempfile = { version = "3.3.0", optional = true } fs_extra = { version = "1.2.0", optional = true } -sha2 = { version = "0.9.8", default-features = false, optional = true } +sha2 = { version = "0.10.2", default-features = false, optional = true } dunce = "1.0.2" solang-parser = { default-features = false, version = "=0.1.16" } rayon = "1.5.3"