From 1cebb203836596b680c4af9e5f13e871f840ffaa Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Wed, 28 Aug 2024 20:56:07 -0400 Subject: [PATCH 1/4] xmtp_cryptography -> WASM target --- Cargo.lock | 5 +++-- Cargo.toml | 1 + bindings_ffi/Cargo.lock | 5 +++-- bindings_node/Cargo.lock | 5 +++-- xmtp_cryptography/Cargo.toml | 9 ++++++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da2dabc7f..e191732e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6313,11 +6313,12 @@ name = "xmtp_cryptography" version = "0.1.0" dependencies = [ "curve25519-dalek", - "ecdsa 0.15.1", + "ecdsa 0.16.9", "ethers", "ethers-core", + "getrandom", "hex", - "k256 0.12.0", + "k256 0.13.3", "log", "rand", "rand_chacha", diff --git a/Cargo.toml b/Cargo.toml index 4048b2f7b..977fe4527 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,6 +59,7 @@ tonic = "^0.11" tracing = { version = "0.1" } tracing-subscriber = "0.3" url = "2.5.0" +getrandom = { version = "0.2", default-features = false } # Internal Crate Dependencies xmtp_cryptography = { path = "xmtp_cryptography" } diff --git a/bindings_ffi/Cargo.lock b/bindings_ffi/Cargo.lock index 613099112..4b796c348 100644 --- a/bindings_ffi/Cargo.lock +++ b/bindings_ffi/Cargo.lock @@ -5758,11 +5758,12 @@ name = "xmtp_cryptography" version = "0.1.0" dependencies = [ "curve25519-dalek", - "ecdsa 0.15.1", + "ecdsa 0.16.9", "ethers", "ethers-core", + "getrandom", "hex", - "k256 0.12.0", + "k256 0.13.3", "log", "rand", "rand_chacha", diff --git a/bindings_node/Cargo.lock b/bindings_node/Cargo.lock index 8668af521..6dd0df229 100644 --- a/bindings_node/Cargo.lock +++ b/bindings_node/Cargo.lock @@ -5215,11 +5215,12 @@ name = "xmtp_cryptography" version = "0.1.0" dependencies = [ "curve25519-dalek", - "ecdsa 0.15.1", + "ecdsa 0.16.9", "ethers", "ethers-core", + "getrandom", "hex", - "k256 0.12.0", + "k256 0.13.3", "log", "rand", "rand_chacha", diff --git a/xmtp_cryptography/Cargo.toml b/xmtp_cryptography/Cargo.toml index 3b59b57be..1290f85b4 100644 --- a/xmtp_cryptography/Cargo.toml +++ b/xmtp_cryptography/Cargo.toml @@ -2,15 +2,15 @@ name = "xmtp_cryptography" version = "0.1.0" edition = "2021" -rust-version = "1.64" +rust-version = "1.70" [dependencies] curve25519-dalek = "4" -ecdsa = "0.15.1" +ecdsa = "0.16.9" ethers = { workspace = true } ethers-core = { workspace = true } hex = { workspace = true } -k256 = { version = "0.12.0", features = ["ecdh"] } +k256 = { version = "0.13.3", features = ["ecdh"] } log = { workspace = true } rand = { workspace = true } rand_chacha = "0.3.1" @@ -20,6 +20,9 @@ sha2 = "0.10.7" sha3 = "0.10.6" thiserror = { workspace = true } +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { workspace = true, features = ["js"] } + [features] ws = ["ethers/ws"] From 32852c1a1b6422beb2dad8004d3439bcaa8e81e9 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Wed, 28 Aug 2024 20:57:37 -0400 Subject: [PATCH 2/4] workspace dependencies --- xmtp_api_grpc_gateway/Cargo.toml | 2 +- xmtp_v2/Cargo.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xmtp_api_grpc_gateway/Cargo.toml b/xmtp_api_grpc_gateway/Cargo.toml index 3fb0db72f..c2d975d87 100644 --- a/xmtp_api_grpc_gateway/Cargo.toml +++ b/xmtp_api_grpc_gateway/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] async-trait = "0.1.68" futures = "0.3.29" -getrandom = { version = "0.2", features = ["js"] } +getrandom = { workspace = true, features = ["js"] } hex = "0.4" js-sys = "0.3" prost = { version = "^0.12", features = ["prost-derive"] } diff --git a/xmtp_v2/Cargo.toml b/xmtp_v2/Cargo.toml index f99ad24c0..f1d295f46 100644 --- a/xmtp_v2/Cargo.toml +++ b/xmtp_v2/Cargo.toml @@ -6,12 +6,12 @@ rust-version = "1.64" [dependencies] aes-gcm = "0.10.1" -ecdsa = "0.15.1" +ecdsa = "0.16.9" generic-array = "0.14.6" -getrandom = { version = "0.2.8", features = ["js"] } +getrandom = { workspace = true, features = ["js"] } hex = { workspace = true } hkdf = "0.12.3" -k256 = { version = "0.12.0", features = ["ecdh"] } +k256 = { version = "0.13.0", features = ["ecdh"] } rand = { workspace = true } rand_chacha = "0.3.1" sha2 = "0.10.6" From 8899f36596b41d3d1a757fed822644db0af27e17 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Thu, 29 Aug 2024 11:33:47 -0400 Subject: [PATCH 3/4] compile xmtp_cryptography for wasm target --- Cargo.lock | 207 +++++++++-------------------------------------------- 1 file changed, 33 insertions(+), 174 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e191732e3..0d0c6499d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,12 +333,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -679,7 +673,7 @@ dependencies = [ "coins-core", "digest 0.10.7", "hmac 0.12.1", - "k256 0.13.3", + "k256", "serde", "sha2 0.10.8", "thiserror", @@ -888,18 +882,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1020,16 +1002,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - [[package]] name = "der" version = "0.7.9" @@ -1195,30 +1167,18 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" -[[package]] -name = "ecdsa" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12844141594ad74185a926d030f3b605f6a903b4e3fec351f3ea338ac5b7637e" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.9", + "der", "digest 0.10.7", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", + "elliptic-curve", + "rfc6979", "signature", - "spki 0.7.3", + "spki", ] [[package]] @@ -1227,7 +1187,7 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8 0.10.2", + "pkcs8", "signature", ] @@ -1253,44 +1213,23 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array", - "group 0.12.1", - "hkdf", - "pkcs8 0.9.0", - "rand_core", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array", - "group 0.13.0", + "group", "hkdf", "pem-rfc7468", - "pkcs8 0.10.2", + "pkcs8", "rand_core", - "sec1 0.7.3", + "sec1", "subtle", "zeroize", ] @@ -1328,7 +1267,7 @@ dependencies = [ "base64 0.21.7", "bytes", "hex", - "k256 0.13.3", + "k256", "log", "rand", "rlp", @@ -1554,10 +1493,10 @@ dependencies = [ "cargo_metadata", "chrono", "const-hex", - "elliptic-curve 0.13.8", + "elliptic-curve", "ethabi", "generic-array", - "k256 0.13.3", + "k256", "num_enum", "once_cell", "open-fastrlp", @@ -1664,7 +1603,7 @@ dependencies = [ "coins-bip32", "coins-bip39", "const-hex", - "elliptic-curve 0.13.8", + "elliptic-curve", "eth-keystore", "ethers-core", "rand", @@ -1743,16 +1682,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core", - "subtle", -] - [[package]] name = "ff" version = "0.13.0" @@ -2037,24 +1966,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core", "subtle", ] @@ -2696,20 +2614,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "k256" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a55e0ff3b72c262bcf041d9e97f1b84492b68f1c1a384de2323d3dc9403397" -dependencies = [ - "cfg-if", - "ecdsa 0.15.1", - "elliptic-curve 0.12.3", - "once_cell", - "sha2 0.10.8", - "signature", -] - [[package]] name = "k256" version = "0.13.3" @@ -2717,8 +2621,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.8", "signature", @@ -3413,8 +3317,8 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "primeorder", "sha2 0.10.8", ] @@ -3425,7 +3329,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ - "elliptic-curve 0.13.8", + "elliptic-curve", "primeorder", ] @@ -3681,24 +3585,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.9", - "spki 0.7.3", + "der", + "spki", ] [[package]] @@ -3827,7 +3721,7 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve 0.13.8", + "elliptic-curve", ] [[package]] @@ -4166,17 +4060,6 @@ dependencies = [ "winreg 0.52.0", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -4524,30 +4407,16 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.9", + "base16ct", + "der", "generic-array", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -4820,16 +4689,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.3" @@ -4837,7 +4696,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.9", + "der", ] [[package]] @@ -6313,12 +6172,12 @@ name = "xmtp_cryptography" version = "0.1.0" dependencies = [ "curve25519-dalek", - "ecdsa 0.16.9", + "ecdsa", "ethers", "ethers-core", "getrandom", "hex", - "k256 0.13.3", + "k256", "log", "rand", "rand_chacha", @@ -6457,12 +6316,12 @@ name = "xmtp_v2" version = "0.1.0" dependencies = [ "aes-gcm", - "ecdsa 0.15.1", + "ecdsa", "generic-array", "getrandom", "hex", "hkdf", - "k256 0.12.0", + "k256", "rand", "rand_chacha", "sha2 0.10.8", From 97364654b90c4f70af171cc131338fc0f24918a6 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Thu, 29 Aug 2024 11:43:05 -0400 Subject: [PATCH 4/4] revert pkg updates in xmtp_v2 --- Cargo.lock | 207 +++++++++++++++++++++++++++++++++++++-------- xmtp_v2/Cargo.toml | 4 +- 2 files changed, 176 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d0c6499d..e191732e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,6 +333,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -673,7 +679,7 @@ dependencies = [ "coins-core", "digest 0.10.7", "hmac 0.12.1", - "k256", + "k256 0.13.3", "serde", "sha2 0.10.8", "thiserror", @@ -882,6 +888,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1002,6 +1020,16 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der" version = "0.7.9" @@ -1167,18 +1195,30 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "ecdsa" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12844141594ad74185a926d030f3b605f6a903b4e3fec351f3ea338ac5b7637e" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature", +] + [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.9", "digest 0.10.7", - "elliptic-curve", - "rfc6979", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", "signature", - "spki", + "spki 0.7.3", ] [[package]] @@ -1187,7 +1227,7 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8", + "pkcs8 0.10.2", "signature", ] @@ -1213,23 +1253,44 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "hkdf", + "pkcs8 0.9.0", + "rand_core", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array", - "group", + "group 0.13.0", "hkdf", "pem-rfc7468", - "pkcs8", + "pkcs8 0.10.2", "rand_core", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1267,7 +1328,7 @@ dependencies = [ "base64 0.21.7", "bytes", "hex", - "k256", + "k256 0.13.3", "log", "rand", "rlp", @@ -1493,10 +1554,10 @@ dependencies = [ "cargo_metadata", "chrono", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "ethabi", "generic-array", - "k256", + "k256 0.13.3", "num_enum", "once_cell", "open-fastrlp", @@ -1603,7 +1664,7 @@ dependencies = [ "coins-bip32", "coins-bip39", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", "rand", @@ -1682,6 +1743,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -1966,13 +2037,24 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core", "subtle", ] @@ -2614,6 +2696,20 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "k256" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a55e0ff3b72c262bcf041d9e97f1b84492b68f1c1a384de2323d3dc9403397" +dependencies = [ + "cfg-if", + "ecdsa 0.15.1", + "elliptic-curve 0.12.3", + "once_cell", + "sha2 0.10.8", + "signature", +] + [[package]] name = "k256" version = "0.13.3" @@ -2621,8 +2717,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", "sha2 0.10.8", "signature", @@ -3317,8 +3413,8 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "primeorder", "sha2 0.10.8", ] @@ -3329,7 +3425,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ - "elliptic-curve", + "elliptic-curve 0.13.8", "primeorder", ] @@ -3585,14 +3681,24 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] [[package]] @@ -3721,7 +3827,7 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve", + "elliptic-curve 0.13.8", ] [[package]] @@ -4060,6 +4166,17 @@ dependencies = [ "winreg 0.52.0", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -4407,16 +4524,30 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct", - "der", + "base16ct 0.2.0", + "der 0.7.9", "generic-array", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -4689,6 +4820,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -4696,7 +4837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -6172,12 +6313,12 @@ name = "xmtp_cryptography" version = "0.1.0" dependencies = [ "curve25519-dalek", - "ecdsa", + "ecdsa 0.16.9", "ethers", "ethers-core", "getrandom", "hex", - "k256", + "k256 0.13.3", "log", "rand", "rand_chacha", @@ -6316,12 +6457,12 @@ name = "xmtp_v2" version = "0.1.0" dependencies = [ "aes-gcm", - "ecdsa", + "ecdsa 0.15.1", "generic-array", "getrandom", "hex", "hkdf", - "k256", + "k256 0.12.0", "rand", "rand_chacha", "sha2 0.10.8", diff --git a/xmtp_v2/Cargo.toml b/xmtp_v2/Cargo.toml index f1d295f46..0667ef1b6 100644 --- a/xmtp_v2/Cargo.toml +++ b/xmtp_v2/Cargo.toml @@ -6,12 +6,12 @@ rust-version = "1.64" [dependencies] aes-gcm = "0.10.1" -ecdsa = "0.16.9" +ecdsa = "0.15.1" generic-array = "0.14.6" getrandom = { workspace = true, features = ["js"] } hex = { workspace = true } hkdf = "0.12.3" -k256 = { version = "0.13.0", features = ["ecdh"] } +k256 = { version = "0.12.0", features = ["ecdh"] } rand = { workspace = true } rand_chacha = "0.3.1" sha2 = "0.10.6"