Update Cryptography crates (#617)
* fix(core): use new k256 for pubkey calculation * fix(core): deserialize moonbeam keys with new fn * chore(signers): update crypto crates * chore: update cargo lock * ci: remove libudev req * chore: cargo fmt * chore: fix outstanding yubihsm errors
This commit is contained in:
parent
1f4ecc6e75
commit
568d9c8697
|
@ -90,8 +90,6 @@ jobs:
|
||||||
export PATH=$HOME/bin:$PATH
|
export PATH=$HOME/bin:$PATH
|
||||||
geth version
|
geth version
|
||||||
|
|
||||||
- name: Install libusb (for Ledger)
|
|
||||||
run: sudo apt update && sudo apt install pkg-config libudev-dev
|
|
||||||
- name: Install stable toolchain
|
- name: Install stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -121,8 +119,6 @@ jobs:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
override: true
|
override: true
|
||||||
- name: Install Dependencies
|
|
||||||
run: sudo apt-get install libudev-dev
|
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
with:
|
with:
|
||||||
cache-on-failure: true
|
cache-on-failure: true
|
||||||
|
|
|
@ -12,21 +12,6 @@ dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "addr2line"
|
|
||||||
version = "0.17.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
|
|
||||||
dependencies = [
|
|
||||||
"gimli",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "adler"
|
|
||||||
version = "1.0.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aead"
|
name = "aead"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
|
@ -58,15 +43,6 @@ dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "anomaly"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "550632e31568ae1a5f47998c3aa48563030fc49b9ec91913ca337cf64fbc5ccb"
|
|
||||||
dependencies = [
|
|
||||||
"backtrace",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_term"
|
name = "ansi_term"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
|
@ -151,21 +127,6 @@ version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "backtrace"
|
|
||||||
version = "0.3.63"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6"
|
|
||||||
dependencies = [
|
|
||||||
"addr2line",
|
|
||||||
"cc",
|
|
||||||
"cfg-if 1.0.0",
|
|
||||||
"libc",
|
|
||||||
"miniz_oxide",
|
|
||||||
"object",
|
|
||||||
"rustc-demangle",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base58"
|
name = "base58"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -452,7 +413,6 @@ dependencies = [
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"serde",
|
"serde",
|
||||||
"time",
|
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -488,14 +448,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coins-bip32"
|
name = "coins-bip32"
|
||||||
version = "0.3.0"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "01b669993c632e5fec4a297085ec57381f53e4646c123cb77a7ca754e005c921"
|
checksum = "471b39eadc9323de375dce5eff149a5a1ebd21c67f1da34a56f87ee62191d4ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"bs58",
|
"bs58",
|
||||||
"coins-core",
|
"coins-core",
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
|
"getrandom 0.2.3",
|
||||||
"hmac",
|
"hmac",
|
||||||
"k256",
|
"k256",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
@ -506,16 +467,16 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coins-bip39"
|
name = "coins-bip39"
|
||||||
version = "0.3.0"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "38426029442f91bd49973d6f59f28e3dbb14e633e3019ac4ec6bce402c44f81c"
|
checksum = "8f473ea37dfc9d2cb94fdde50c3d41f28c3f384b367573d66386fea38d76d466"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitvec 0.17.4",
|
"bitvec 0.17.4",
|
||||||
"coins-bip32",
|
"coins-bip32",
|
||||||
"getrandom 0.2.3",
|
"getrandom 0.2.3",
|
||||||
"hex",
|
"hex",
|
||||||
"hmac",
|
"hmac",
|
||||||
"pbkdf2",
|
"pbkdf2 0.8.0",
|
||||||
"rand 0.8.4",
|
"rand 0.8.4",
|
||||||
"sha2 0.9.8",
|
"sha2 0.9.8",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -544,16 +505,16 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coins-ledger"
|
name = "coins-ledger"
|
||||||
version = "0.4.2"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2943c8f53555b1f2ab5c047520b9fd73e5b0b22d216375b5b0112a7d2ae2a1c"
|
checksum = "498841803f751d49bb08fe4a88b514087c52e5df885575ed4757f14ab151e239"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"blake2b_simd",
|
"blake2b_simd",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"cfg-if 0.1.10",
|
"cfg-if 0.1.10",
|
||||||
"futures",
|
"futures",
|
||||||
"hidapi",
|
"hidapi-rusb",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -615,12 +576,6 @@ dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "const-oid"
|
|
||||||
version = "0.6.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
@ -761,18 +716,6 @@ version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
|
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crypto-bigint"
|
|
||||||
version = "0.2.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.14.4",
|
|
||||||
"rand_core 0.6.3",
|
|
||||||
"subtle",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crypto-bigint"
|
name = "crypto-bigint"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
|
@ -887,22 +830,13 @@ dependencies = [
|
||||||
"generic-array 0.14.4",
|
"generic-array 0.14.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "der"
|
|
||||||
version = "0.4.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4"
|
|
||||||
dependencies = [
|
|
||||||
"const-oid 0.6.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "der"
|
name = "der"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
|
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const-oid 0.7.1",
|
"const-oid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -981,13 +915,13 @@ checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ecdsa"
|
name = "ecdsa"
|
||||||
version = "0.12.4"
|
version = "0.13.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
checksum = "e91ae02c7618ee05108cd86a0be2f5586d1f0d965bede7ecfd46815f1b860227"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
"elliptic-curve 0.10.6",
|
"elliptic-curve",
|
||||||
"hmac",
|
"rfc6979",
|
||||||
"signature",
|
"signature",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1022,30 +956,17 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "elliptic-curve"
|
name = "elliptic-curve"
|
||||||
version = "0.10.6"
|
version = "0.11.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b"
|
checksum = "decb3a27ea454a5f23f96eb182af0671c12694d64ecc33dada74edd1301f6cfc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crypto-bigint 0.2.11",
|
"crypto-bigint",
|
||||||
|
"der",
|
||||||
"ff",
|
"ff",
|
||||||
"generic-array 0.14.4",
|
"generic-array 0.14.4",
|
||||||
"group",
|
"group",
|
||||||
"pkcs8",
|
|
||||||
"rand_core 0.6.3",
|
|
||||||
"subtle",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "elliptic-curve"
|
|
||||||
version = "0.11.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1f01ff20862362c34074072c8be2de97399633d6b1d2114afa56bf77a8b7f0a4"
|
|
||||||
dependencies = [
|
|
||||||
"crypto-bigint 0.3.2",
|
|
||||||
"der 0.5.1",
|
|
||||||
"generic-array 0.14.4",
|
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
|
"sec1",
|
||||||
"subtle",
|
"subtle",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
@ -1076,7 +997,7 @@ dependencies = [
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"hex",
|
"hex",
|
||||||
"hmac",
|
"hmac",
|
||||||
"pbkdf2",
|
"pbkdf2 0.8.0",
|
||||||
"rand 0.8.4",
|
"rand 0.8.4",
|
||||||
"scrypt",
|
"scrypt",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -1214,7 +1135,7 @@ dependencies = [
|
||||||
"cargo_metadata",
|
"cargo_metadata",
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"elliptic-curve 0.11.5",
|
"elliptic-curve",
|
||||||
"ethabi",
|
"ethabi",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"generic-array 0.14.4",
|
"generic-array 0.14.4",
|
||||||
|
@ -1333,7 +1254,7 @@ dependencies = [
|
||||||
"coins-bip32",
|
"coins-bip32",
|
||||||
"coins-bip39",
|
"coins-bip39",
|
||||||
"coins-ledger",
|
"coins-ledger",
|
||||||
"elliptic-curve 0.11.5",
|
"elliptic-curve",
|
||||||
"eth-keystore",
|
"eth-keystore",
|
||||||
"ethers-contract",
|
"ethers-contract",
|
||||||
"ethers-core",
|
"ethers-core",
|
||||||
|
@ -1415,9 +1336,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ff"
|
name = "ff"
|
||||||
version = "0.10.1"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0f40b2dcd8bc322217a5f6559ae5f9e9d1de202a2ecee2e9eafcbece7562a4f"
|
checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
"subtle",
|
"subtle",
|
||||||
|
@ -1622,12 +1543,6 @@ dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gimli"
|
|
||||||
version = "0.26.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glob"
|
name = "glob"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
@ -1636,9 +1551,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "group"
|
name = "group"
|
||||||
version = "0.10.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912"
|
checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ff",
|
"ff",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
|
@ -1670,12 +1585,6 @@ version = "1.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
|
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "harp"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "60bf12c625ed5e96f81609ae4377c34e9fa3e4d1fada392404322daeace511ab"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
|
@ -1713,14 +1622,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
|
checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hidapi"
|
name = "hidapi-rusb"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8d6f5e247bc66f3255d755e96d9d43f6b191f4e182072b811d55584ff58c510f"
|
checksum = "99e0b15c35f9c35cbadd0c388197364e8ff3feffd23b69cd45524a014932f5f1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
|
"rusb",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1947,13 +1857,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "k256"
|
name = "k256"
|
||||||
version = "0.9.6"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea"
|
checksum = "58e786b08b1c90389266b21e238894b88c03296b44db6c6a797484c6fb3e6e5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"elliptic-curve 0.10.6",
|
"elliptic-curve",
|
||||||
|
"sec1",
|
||||||
"sha2 0.9.8",
|
"sha2 0.9.8",
|
||||||
"sha3",
|
"sha3",
|
||||||
]
|
]
|
||||||
|
@ -1978,9 +1889,9 @@ checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libusb1-sys"
|
name = "libusb1-sys"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e22e89d08bbe6816c6c5d446203b859eba35b8fa94bf1b7edb2f6d25d43f023f"
|
checksum = "b8772b7e8d4d988e19684aec5a3f5e470ecaf5c705cf0303da3973508e873027"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -2059,16 +1970,6 @@ version = "0.3.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "miniz_oxide"
|
|
||||||
version = "0.4.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
|
|
||||||
dependencies = [
|
|
||||||
"adler",
|
|
||||||
"autocfg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mio"
|
name = "mio"
|
||||||
version = "0.7.14"
|
version = "0.7.14"
|
||||||
|
@ -2166,15 +2067,6 @@ version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
|
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "object"
|
|
||||||
version = "0.27.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.9.0"
|
version = "1.9.0"
|
||||||
|
@ -2243,23 +2135,25 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "p256"
|
name = "p256"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d053368e1bae4c8a672953397bd1bd7183dde1c72b0b7612a15719173148d186"
|
checksum = "d0e0c5310031b5d4528ac6534bccc1446c289ac45c47b277d5aa91089c5f74fa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"elliptic-curve 0.10.6",
|
"elliptic-curve",
|
||||||
|
"sec1",
|
||||||
"sha2 0.9.8",
|
"sha2 0.9.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "p384"
|
name = "p384"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f23bc88c404ccc881c8a1ad62ba5cd7d336a64ecbf46de4874f2ad955f67b157"
|
checksum = "755d8266e41f57bd8562ed9b6e93cdcf73ead050e1e8c3a27ea3871b6643a20c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"elliptic-curve 0.10.6",
|
"elliptic-curve",
|
||||||
|
"sec1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2337,6 +2231,15 @@ dependencies = [
|
||||||
"sha2 0.9.8",
|
"sha2 0.9.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[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]]
|
[[package]]
|
||||||
name = "percent-encoding"
|
name = "percent-encoding"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
|
@ -2387,12 +2290,13 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkcs8"
|
name = "pkcs8"
|
||||||
version = "0.7.6"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447"
|
checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
"spki",
|
"spki",
|
||||||
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2764,6 +2668,17 @@ dependencies = [
|
||||||
"winreg",
|
"winreg",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rfc6979"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-bigint",
|
||||||
|
"hmac",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ring"
|
name = "ring"
|
||||||
version = "0.16.20"
|
version = "0.16.20"
|
||||||
|
@ -2813,9 +2728,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusb"
|
name = "rusb"
|
||||||
version = "0.8.1"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9a5084628cc5be77b1c750b3e5ee0cc519d2f2491b3f06b78b3aac3328b00ad"
|
checksum = "83b454219aa5007af92a042ec13b2035325318a21d3c6be18bf592f841430794"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"libusb1-sys",
|
"libusb1-sys",
|
||||||
|
@ -2904,12 +2819,6 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc-demangle"
|
|
||||||
version = "0.1.21"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-hex"
|
name = "rustc-hex"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
|
@ -3001,7 +2910,7 @@ dependencies = [
|
||||||
"base64ct",
|
"base64ct",
|
||||||
"hmac",
|
"hmac",
|
||||||
"password-hash",
|
"password-hash",
|
||||||
"pbkdf2",
|
"pbkdf2 0.8.0",
|
||||||
"salsa20",
|
"salsa20",
|
||||||
"sha2 0.9.8",
|
"sha2 0.9.8",
|
||||||
]
|
]
|
||||||
|
@ -3016,6 +2925,19 @@ dependencies = [
|
||||||
"untrusted",
|
"untrusted",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sec1"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1"
|
||||||
|
dependencies = [
|
||||||
|
"der",
|
||||||
|
"generic-array 0.14.4",
|
||||||
|
"pkcs8",
|
||||||
|
"subtle",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "security-framework"
|
name = "security-framework"
|
||||||
version = "2.4.2"
|
version = "2.4.2"
|
||||||
|
@ -3276,11 +3198,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spki"
|
name = "spki"
|
||||||
version = "0.4.1"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32"
|
checksum = "964d3a6f8b7ef6d6d20887f4c30c4848f4ffa05f600c87277d30a5b4fe32cb4b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"base64ct",
|
||||||
|
"der",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3449,12 +3372,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.1.43"
|
version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
|
checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3659,13 +3582,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "trezor-client"
|
name = "trezor-client"
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff94fab279e0d429d762c289f9727f37a0f1b8207ea4795f09c11caad009046f"
|
checksum = "7f18d3fc60e99a85219fcd5a95311e20fb05805aab70719992b09853d47cae09"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"hex",
|
"hex",
|
||||||
"hidapi",
|
"hidapi-rusb",
|
||||||
"log",
|
"log",
|
||||||
"primitive-types",
|
"primitive-types",
|
||||||
"protobuf",
|
"protobuf",
|
||||||
|
@ -4056,28 +3979,25 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yubihsm"
|
name = "yubihsm"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0c32cd8146a6966df8137f5dbb77010ae5253e6937b21d1fd6ed55213478b4d0"
|
checksum = "6c7ba281142fd52beba6ed6e67752bdb93242dd7520908a1d93054bfb4dcc02d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"anomaly",
|
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"block-modes",
|
"block-modes",
|
||||||
"ccm",
|
"ccm",
|
||||||
"chrono",
|
|
||||||
"cmac",
|
"cmac",
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"ed25519",
|
"ed25519",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"harp",
|
|
||||||
"hmac",
|
"hmac",
|
||||||
"k256",
|
"k256",
|
||||||
"log",
|
"log",
|
||||||
"p256",
|
"p256",
|
||||||
"p384",
|
"p384",
|
||||||
"pbkdf2",
|
"pbkdf2 0.9.0",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
"rusb",
|
"rusb",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -4086,6 +4006,7 @@ dependencies = [
|
||||||
"signature",
|
"signature",
|
||||||
"subtle",
|
"subtle",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"time",
|
||||||
"uuid",
|
"uuid",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
|
@ -16,10 +16,10 @@ arrayvec = { version = "0.7.2", default-features = false }
|
||||||
rlp-derive = { version = "0.1.0", default-features = false }
|
rlp-derive = { version = "0.1.0", default-features = false }
|
||||||
|
|
||||||
# crypto
|
# crypto
|
||||||
ecdsa = { version = "0.12.3", default-features = false, features = ["std"] }
|
ecdsa = { version = "0.13.3", default-features = false, features = ["std"] }
|
||||||
elliptic-curve = { version = "0.11.5", default-features = false }
|
elliptic-curve = { version = "0.11.5", default-features = false }
|
||||||
generic-array = { version = "0.14.4", default-features = false }
|
generic-array = { version = "0.14.4", default-features = false }
|
||||||
k256 = { version = "0.9.5", default-features = false, features = ["keccak256", "ecdsa", "zeroize"] }
|
k256 = { version = "0.10.0", default-features = false, features = ["keccak256", "ecdsa"] }
|
||||||
rand = { version = "0.8.4", default-features = false }
|
rand = { version = "0.8.4", default-features = false }
|
||||||
tiny-keccak = { version = "2.0.2", default-features = false }
|
tiny-keccak = { version = "2.0.2", default-features = false }
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,14 @@ use std::{convert::TryFrom, fmt, str::FromStr};
|
||||||
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use elliptic_curve::consts::U32;
|
use elliptic_curve::{consts::U32, sec1::ToEncodedPoint};
|
||||||
use generic_array::GenericArray;
|
use generic_array::GenericArray;
|
||||||
use k256::{
|
use k256::{
|
||||||
ecdsa::{
|
ecdsa::{
|
||||||
recoverable::{Id as RecoveryId, Signature as RecoverableSignature},
|
recoverable::{Id as RecoveryId, Signature as RecoverableSignature},
|
||||||
Error as K256SignatureError, Signature as K256Signature,
|
Error as K256SignatureError, Signature as K256Signature,
|
||||||
},
|
},
|
||||||
EncodedPoint as K256PublicKey,
|
PublicKey as K256PublicKey,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// An error involving a signature.
|
/// An error involving a signature.
|
||||||
|
@ -105,15 +105,12 @@ impl Signature {
|
||||||
let verify_key =
|
let verify_key =
|
||||||
recoverable_sig.recover_verify_key_from_digest_bytes(message_hash.as_ref().into())?;
|
recoverable_sig.recover_verify_key_from_digest_bytes(message_hash.as_ref().into())?;
|
||||||
|
|
||||||
let uncompressed_pub_key = K256PublicKey::from(&verify_key).decompress();
|
let public_key = K256PublicKey::from(&verify_key);
|
||||||
if let Some(public_key) = uncompressed_pub_key {
|
let public_key = public_key.to_encoded_point(/* compress = */ false);
|
||||||
let public_key = public_key.to_bytes();
|
let public_key = public_key.as_bytes();
|
||||||
debug_assert_eq!(public_key[0], 0x04);
|
debug_assert_eq!(public_key[0], 0x04);
|
||||||
let hash = crate::utils::keccak256(&public_key[1..]);
|
let hash = crate::utils::keccak256(&public_key[1..]);
|
||||||
Ok(Address::from_slice(&hash[12..]))
|
Ok(Address::from_slice(&hash[12..]))
|
||||||
} else {
|
|
||||||
Err(SignatureError::RecoveryError)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves the recovery signature.
|
/// Retrieves the recovery signature.
|
||||||
|
|
|
@ -194,7 +194,7 @@ impl Ganache {
|
||||||
if is_private_key && line.starts_with('(') {
|
if is_private_key && line.starts_with('(') {
|
||||||
let key_str = &line[6..line.len() - 1];
|
let key_str = &line[6..line.len() - 1];
|
||||||
let key_hex = hex::decode(key_str).expect("could not parse as hex");
|
let key_hex = hex::decode(key_str).expect("could not parse as hex");
|
||||||
let key = K256SecretKey::from_bytes(&key_hex).expect("did not get private key");
|
let key = K256SecretKey::from_be_bytes(&key_hex).expect("did not get private key");
|
||||||
addresses.push(secret_key_to_address(&SigningKey::from(&key)));
|
addresses.push(secret_key_to_address(&SigningKey::from(&key)));
|
||||||
private_keys.push(key);
|
private_keys.push(key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,9 @@ pub use rlp;
|
||||||
pub use hex;
|
pub use hex;
|
||||||
|
|
||||||
use crate::types::{Address, Bytes, U256};
|
use crate::types::{Address, Bytes, U256};
|
||||||
|
use elliptic_curve::sec1::ToEncodedPoint;
|
||||||
use ethabi::ethereum_types::FromDecStrErr;
|
use ethabi::ethereum_types::FromDecStrErr;
|
||||||
use k256::{ecdsa::SigningKey, EncodedPoint as K256PublicKey};
|
use k256::{ecdsa::SigningKey, PublicKey as K256PublicKey};
|
||||||
use std::{convert::TryInto, ops::Neg};
|
use std::{convert::TryInto, ops::Neg};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
@ -242,9 +243,9 @@ pub fn get_create2_address_from_hash(
|
||||||
|
|
||||||
/// Converts a K256 SigningKey to an Ethereum Address
|
/// Converts a K256 SigningKey to an Ethereum Address
|
||||||
pub fn secret_key_to_address(secret_key: &SigningKey) -> Address {
|
pub fn secret_key_to_address(secret_key: &SigningKey) -> Address {
|
||||||
// TODO: Can we do this in a better way?
|
let public_key = K256PublicKey::from(&secret_key.verifying_key());
|
||||||
let uncompressed_pub_key = K256PublicKey::from(&secret_key.verifying_key()).decompress();
|
let public_key = public_key.to_encoded_point(/* compress = */ false);
|
||||||
let public_key = uncompressed_pub_key.unwrap().to_bytes();
|
let public_key = public_key.as_bytes();
|
||||||
debug_assert_eq!(public_key[0], 0x04);
|
debug_assert_eq!(public_key[0], 0x04);
|
||||||
let hash = keccak256(&public_key[1..]);
|
let hash = keccak256(&public_key[1..]);
|
||||||
Address::from_slice(&hash[12..])
|
Address::from_slice(&hash[12..])
|
||||||
|
|
|
@ -46,99 +46,67 @@ impl MoonbeamDev {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn to_secret_key(s: &str) -> SecretKey {
|
||||||
|
SecretKey::from_be_bytes(&hex::decode(s).unwrap()).unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for MoonbeamDev {
|
impl Default for MoonbeamDev {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
keys: BTreeMap::from([
|
keys: BTreeMap::from([
|
||||||
(
|
(
|
||||||
"Alith",
|
"Alith",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133",
|
||||||
"5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Baltathar",
|
"Baltathar",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b",
|
||||||
"8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Charleth",
|
"Charleth",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b",
|
||||||
"0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Dorothy",
|
"Dorothy",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68",
|
||||||
"39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Faith",
|
"Faith",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"b9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df",
|
||||||
"b9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Goliath",
|
"Goliath",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"96b8a38e12e1a31dee1eab2fffdf9d9990045f5b37e44d8cc27766ef294acf18",
|
||||||
"96b8a38e12e1a31dee1eab2fffdf9d9990045f5b37e44d8cc27766ef294acf18",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Heath",
|
"Heath",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"0d6dcaaef49272a5411896be8ad16c01c35d6f8c18873387b71fbc734759b0ab",
|
||||||
"0d6dcaaef49272a5411896be8ad16c01c35d6f8c18873387b71fbc734759b0ab",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Ida",
|
"Ida",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"4c42532034540267bf568198ccec4cb822a025da542861fcb146a5fab6433ff8",
|
||||||
"4c42532034540267bf568198ccec4cb822a025da542861fcb146a5fab6433ff8",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"Judith",
|
"Judith",
|
||||||
SecretKey::from_bytes(
|
to_secret_key(
|
||||||
hex::decode(
|
"94c49300a58d576011096bcb006aa06f5a91b34b4383891e8029c21dc39fbb8b",
|
||||||
"94c49300a58d576011096bcb006aa06f5a91b34b4383891e8029c21dc39fbb8b",
|
),
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,26 +16,26 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ethers-core = { version = "^0.6.0", path = "../ethers-core", features = ["eip712"]}
|
ethers-core = { version = "^0.6.0", path = "../ethers-core", features = ["eip712"]}
|
||||||
thiserror = { version = "1.0.30", default-features = false }
|
thiserror = { version = "1.0.30", default-features = false }
|
||||||
coins-bip32 = "0.3.0"
|
coins-bip32 = "0.6.0"
|
||||||
coins-bip39 = "0.3.0"
|
coins-bip39 = "0.6.0"
|
||||||
coins-ledger = { version = "0.4.2", default-features = false, optional = true }
|
coins-ledger = { version = "0.6.0", default-features = false, optional = true }
|
||||||
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
hex = { version = "0.4.3", default-features = false, features = ["std"] }
|
||||||
async-trait = { version = "0.1.50", default-features = false }
|
async-trait = { version = "0.1.50", default-features = false }
|
||||||
elliptic-curve = { version = "0.11.5", default-features = false }
|
elliptic-curve = { version = "0.11.6", default-features = false }
|
||||||
sha2 = { version = "0.9.8", default-features = false }
|
sha2 = { version = "0.9.8", default-features = false }
|
||||||
rand = { version = "0.8.4", default-features = false }
|
rand = { version = "0.8.4", default-features = false }
|
||||||
yubihsm = { version = "0.39.0", features = ["secp256k1", "http", "usb"], optional = true }
|
yubihsm = { version = "0.40.0", features = ["secp256k1", "http", "usb"], optional = true }
|
||||||
futures-util = "^0.3"
|
futures-util = "^0.3"
|
||||||
futures-executor = "^0.3"
|
futures-executor = "^0.3"
|
||||||
semver = "1.0.4"
|
semver = "1.0.4"
|
||||||
trezor-client = { version = "0.0.3", optional = true, default-features = false, features = ["f_ethereum"] }
|
trezor-client = { version = "0.0.4", optional = true, default-features = false, features = ["f_ethereum"] }
|
||||||
|
|
||||||
# aws
|
# aws
|
||||||
rusoto_core = { version = "0.47.0", optional = true }
|
rusoto_core = { version = "0.47.0", optional = true }
|
||||||
rusoto_kms = { version = "0.47.0", optional = true }
|
rusoto_kms = { version = "0.47.0", optional = true }
|
||||||
tracing = { version = "0.1.29", optional = true }
|
tracing = { version = "0.1.29", optional = true }
|
||||||
tracing-futures = { version = "0.2.5", optional = true }
|
tracing-futures = { version = "0.2.5", optional = true }
|
||||||
spki = { version = "0.4.1", optional = true }
|
spki = { version = "0.5.2", optional = true }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
eth-keystore = { version = "0.3.0" }
|
eth-keystore = { version = "0.3.0" }
|
||||||
|
@ -45,10 +45,10 @@ ethers-contract = { version = "^0.6.0", path = "../ethers-contract", features =
|
||||||
ethers-derive-eip712 = { version = "0.2.0", path = "../ethers-core/ethers-derive-eip712" }
|
ethers-derive-eip712 = { version = "0.2.0", path = "../ethers-core/ethers-derive-eip712" }
|
||||||
serde_json = { version = "1.0.64" }
|
serde_json = { version = "1.0.64" }
|
||||||
tracing-subscriber = "0.3.3"
|
tracing-subscriber = "0.3.3"
|
||||||
yubihsm = { version = "0.39.0", features = ["secp256k1", "usb", "mockhsm"] }
|
yubihsm = { version = "0.40.0", features = ["secp256k1", "usb", "mockhsm"] }
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||||
yubihsm = { version = "0.39.0", features = ["secp256k1", "usb", "mockhsm"] }
|
yubihsm = { version = "0.40.0", features = ["secp256k1", "usb", "mockhsm"] }
|
||||||
tokio = { version = "1.5", default-features = false, features = ["macros", "rt"] }
|
tokio = { version = "1.5", default-features = false, features = ["macros", "rt"] }
|
||||||
tempfile = "3.2.0"
|
tempfile = "3.2.0"
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ pub enum AwsSignerError {
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
K256(#[from] K256Error),
|
K256(#[from] K256Error),
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Spki(spki::der::Error),
|
Spki(spki::Error),
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Other(String),
|
Other(String),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
@ -100,8 +100,8 @@ impl From<String> for AwsSignerError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<spki::der::Error> for AwsSignerError {
|
impl From<spki::Error> for AwsSignerError {
|
||||||
fn from(e: spki::der::Error) -> Self {
|
fn from(e: spki::Error) -> Self {
|
||||||
Self::Spki(e)
|
Self::Spki(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,8 @@ pub(super) fn decode_signature(resp: SignResponse) -> Result<KSig, AwsSignerErro
|
||||||
.signature
|
.signature
|
||||||
.ok_or_else(|| AwsSignerError::from("Signature not found in response".to_owned()))?;
|
.ok_or_else(|| AwsSignerError::from("Signature not found in response".to_owned()))?;
|
||||||
|
|
||||||
let mut sig = KSig::from_der(&raw)?;
|
let sig = KSig::from_der(&raw)?
|
||||||
sig.normalize_s()?;
|
.normalize_s()
|
||||||
|
.ok_or_else(|| AwsSignerError::from("Could not normalize `s`".to_owned()))?;
|
||||||
Ok(sig)
|
Ok(sig)
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@ impl<W: Wordlist> MnemonicBuilder<W> {
|
||||||
) -> Result<Wallet<SigningKey>, WalletError> {
|
) -> Result<Wallet<SigningKey>, WalletError> {
|
||||||
let derived_priv_key =
|
let derived_priv_key =
|
||||||
mnemonic.derive_key(&self.derivation_path, self.password.as_deref())?;
|
mnemonic.derive_key(&self.derivation_path, self.password.as_deref())?;
|
||||||
let key: &SigningKey = derived_priv_key.as_ref();
|
let key: &coins_bip32::prelude::SigningKey = derived_priv_key.as_ref();
|
||||||
let signer = SigningKey::from_bytes(&key.to_bytes())?;
|
let signer = SigningKey::from_bytes(&key.to_bytes())?;
|
||||||
let address = secret_key_to_address(&signer);
|
let address = secret_key_to_address(&signer);
|
||||||
|
|
||||||
|
|
|
@ -121,8 +121,7 @@ use ethers_core::k256::SecretKey as K256SecretKey;
|
||||||
|
|
||||||
impl From<K256SecretKey> for Wallet<SigningKey> {
|
impl From<K256SecretKey> for Wallet<SigningKey> {
|
||||||
fn from(key: K256SecretKey) -> Self {
|
fn from(key: K256SecretKey) -> Self {
|
||||||
let signer = SigningKey::from_bytes(&*key.to_bytes())
|
let signer = key.into();
|
||||||
.expect("private key should always be convertible to signing key");
|
|
||||||
let address = secret_key_to_address(&signer);
|
let address = secret_key_to_address(&signer);
|
||||||
|
|
||||||
Self { signer, address, chain_id: 1 }
|
Self { signer, address, chain_id: 1 }
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
//! Helpers for creating wallets for YubiHSM2
|
//! Helpers for creating wallets for YubiHSM2
|
||||||
use super::Wallet;
|
use super::Wallet;
|
||||||
use ethers_core::{k256::Secp256k1, types::Address, utils::keccak256};
|
use elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint};
|
||||||
|
use ethers_core::{
|
||||||
|
k256::{PublicKey, Secp256k1},
|
||||||
|
types::Address,
|
||||||
|
utils::keccak256,
|
||||||
|
};
|
||||||
use yubihsm::{
|
use yubihsm::{
|
||||||
asymmetric::Algorithm::EcK256, ecdsa::Signer as YubiSigner, object, object::Label, Capability,
|
asymmetric::Algorithm::EcK256, ecdsa::Signer as YubiSigner, object, object::Label, Capability,
|
||||||
Client, Connector, Credentials, Domain,
|
Client, Connector, Credentials, Domain,
|
||||||
|
@ -50,7 +55,10 @@ impl Wallet<YubiSigner<Secp256k1>> {
|
||||||
|
|
||||||
impl From<YubiSigner<Secp256k1>> for Wallet<YubiSigner<Secp256k1>> {
|
impl From<YubiSigner<Secp256k1>> for Wallet<YubiSigner<Secp256k1>> {
|
||||||
fn from(signer: YubiSigner<Secp256k1>) -> Self {
|
fn from(signer: YubiSigner<Secp256k1>) -> Self {
|
||||||
let public_key = signer.public_key().decompress().unwrap().to_bytes();
|
// this will never fail
|
||||||
|
let public_key = PublicKey::from_encoded_point(signer.public_key()).unwrap();
|
||||||
|
let public_key = public_key.to_encoded_point(/* compress = */ false);
|
||||||
|
let public_key = public_key.as_bytes();
|
||||||
debug_assert_eq!(public_key[0], 0x04);
|
debug_assert_eq!(public_key[0], 0x04);
|
||||||
let hash = keccak256(&public_key[1..]);
|
let hash = keccak256(&public_key[1..]);
|
||||||
let address = Address::from_slice(&hash[12..]);
|
let address = Address::from_slice(&hash[12..]);
|
||||||
|
|
Loading…
Reference in New Issue