diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index 7d6d41b596..1f5a3652b2 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -25,7 +25,7 @@ bs58 = { workspace = true } clap = { workspace = true, features = ["cargo", "derive"] } dirs = "4.0" log = { workspace = true } # self explanatory -rand = { version = "0.7.3", features = ["wasm-bindgen"] } # rng-related traits + some rng implementation to use +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } # for config serialization/deserialization serde_json = { workspace = true } thiserror = { workspace = true } diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 460ed116ef..e729c1ae02 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -16,7 +16,7 @@ serde_json = { workspace = true } tap = "1.0.1" thiserror = { workspace = true } tokio = { version = "1.24.1", features = ["rt-multi-thread", "net", "signal"] } -rand = "0.7.3" +rand = { workspace = true } time = { workspace = true } url = { workspace = true } zeroize = { workspace = true } diff --git a/common/bandwidth-controller/Cargo.toml b/common/bandwidth-controller/Cargo.toml index 284ccbfc77..b122849639 100644 --- a/common/bandwidth-controller/Cargo.toml +++ b/common/bandwidth-controller/Cargo.toml @@ -9,7 +9,7 @@ license.workspace = true [dependencies] bip39 = { workspace = true } log = { workspace = true } -rand = "0.7.3" +rand = { workspace = true } thiserror = { workspace = true } url = { workspace = true } zeroize = { workspace = true } diff --git a/common/client-core/Cargo.toml b/common/client-core/Cargo.toml index 49a631e641..d6d1037b1b 100644 --- a/common/client-core/Cargo.toml +++ b/common/client-core/Cargo.toml @@ -17,7 +17,7 @@ clap = { workspace = true, optional = true } futures = { workspace = true } humantime-serde = { workspace = true } log = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } sha2 = "0.10.6" diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index b69b8bcea2..782439770b 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -14,7 +14,7 @@ futures = { workspace = true } log = { workspace = true } thiserror = { workspace = true } url = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } tokio = { version = "1.24.1", features = ["macros"] } si-scale = "0.2.2" time.workspace = true diff --git a/common/credentials/Cargo.toml b/common/credentials/Cargo.toml index 053e0f80fc..7d87b83585 100644 --- a/common/credentials/Cargo.toml +++ b/common/credentials/Cargo.toml @@ -23,5 +23,5 @@ nym-api-requests = { path = "../../nym-api/nym-api-requests" } nym-validator-client = { path = "../client-libs/validator-client", default-features = false } [dev-dependencies] -rand = "0.7.3" +rand = "0.8.5" diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index 061dea6183..aec1fc869c 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -17,9 +17,9 @@ generic-array = { workspace = true, optional = true } hkdf = { version = "0.12.3", optional = true } hmac = { version = "0.12.1", optional = true } cipher = { version = "0.4.3", optional = true } -x25519-dalek = { version = "1.1", optional = true } -ed25519-dalek = { version = "1.0", optional = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"], optional = true } +x25519-dalek = { version = "2.0.0", optional = true } +ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true } +rand = { version = "0.8.5", optional = true } serde_bytes = { version = "0.11.6", optional = true } serde_crate = { version = "1.0", optional = true, default_features = false, features = ["derive"], package = "serde" } subtle-encoding = { version = "0.5", features = ["bech32-preview"]} @@ -31,7 +31,7 @@ nym-sphinx-types = { path = "../nymsphinx/types", version = "0.2.0", default-fea nym-pemstore = { path = "../../common/pemstore", version = "0.3.0" } [dev-dependencies] -rand_chacha = "0.2" +rand_chacha = "0.3" [features] default = ["sphinx"] diff --git a/common/crypto/src/asymmetric/encryption/mod.rs b/common/crypto/src/asymmetric/encryption/mod.rs index 5e095beeab..60f8109e95 100644 --- a/common/crypto/src/asymmetric/encryption/mod.rs +++ b/common/crypto/src/asymmetric/encryption/mod.rs @@ -56,7 +56,7 @@ pub struct KeyPair { impl KeyPair { #[cfg(feature = "rand")] pub fn new(rng: &mut R) -> Self { - let private_key = x25519_dalek::StaticSecret::new(rng); + let private_key = x25519_dalek::StaticSecret::random_from_rng(rng); let public_key = (&private_key).into(); KeyPair { @@ -203,7 +203,7 @@ impl<'a> From<&'a PrivateKey> for PublicKey { impl PrivateKey { #[cfg(feature = "rand")] pub fn new(rng: &mut R) -> Self { - let x25519_secret = x25519_dalek::StaticSecret::new(rng); + let x25519_secret = x25519_dalek::StaticSecret::random_from_rng(rng); PrivateKey(x25519_secret) } @@ -322,9 +322,7 @@ impl<'a> From<&'a PrivateKey> for nym_sphinx_types::PrivateKey { #[cfg(feature = "sphinx")] impl From for PrivateKey { fn from(private_key: nym_sphinx_types::PrivateKey) -> Self { - let private_key_bytes = private_key.to_bytes(); - assert_eq!(private_key_bytes.len(), PRIVATE_KEY_SIZE); - Self::from_bytes(&private_key_bytes).unwrap() + Self(private_key) } } @@ -366,7 +364,7 @@ mod sphinx_key_conversion { #[test] fn works_for_backward_conversion() { for _ in 0..NUM_ITERATIONS { - let (sphinx_private, sphinx_public) = nym_sphinx_types::crypto::keygen(); + let (sphinx_private, sphinx_public) = nym_sphinx_types::test_utils::fixtures::keygen(); let private_bytes = sphinx_private.to_bytes(); let public_bytes = sphinx_public.as_bytes(); diff --git a/common/crypto/src/asymmetric/identity/mod.rs b/common/crypto/src/asymmetric/identity/mod.rs index a48fb78a82..eb7d5861d2 100644 --- a/common/crypto/src/asymmetric/identity/mod.rs +++ b/common/crypto/src/asymmetric/identity/mod.rs @@ -1,8 +1,8 @@ // Copyright 2021-2023 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -pub use ed25519_dalek::ed25519::signature::Signature as SignatureTrait; pub use ed25519_dalek::SignatureError; +use ed25519_dalek::{Signer, SigningKey}; pub use ed25519_dalek::{Verifier, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SIGNATURE_LENGTH}; use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use std::fmt::{self, Display, Formatter}; @@ -30,6 +30,9 @@ pub enum Ed25519RecoveryError { #[error(transparent)] MalformedBytes(#[from] SignatureError), + #[error(transparent)] + BytesLengthError(#[from] std::array::TryFromSliceError), + #[error("the base58 representation of the public key was malformed - {source}")] MalformedPublicKeyString { #[source] @@ -64,11 +67,11 @@ pub struct KeyPair { impl KeyPair { #[cfg(feature = "rand")] pub fn new(rng: &mut R) -> Self { - let ed25519_keypair = ed25519_dalek::Keypair::generate(rng); + let ed25519_signing_key = ed25519_dalek::SigningKey::generate(rng); KeyPair { - private_key: PrivateKey(ed25519_keypair.secret), - public_key: PublicKey(ed25519_keypair.public), + private_key: PrivateKey(ed25519_signing_key.to_bytes()), + public_key: PublicKey(ed25519_signing_key.verifying_key()), } } @@ -109,7 +112,7 @@ impl PemStorableKeyPair for KeyPair { /// ed25519 EdDSA Public Key #[derive(Debug, Copy, Clone, Eq, PartialEq)] -pub struct PublicKey(ed25519_dalek::PublicKey); +pub struct PublicKey(ed25519_dalek::VerifyingKey); impl Display for PublicKey { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { @@ -135,7 +138,9 @@ impl PublicKey { } pub fn from_bytes(b: &[u8]) -> Result { - Ok(PublicKey(ed25519_dalek::PublicKey::from_bytes(b)?)) + Ok(PublicKey(ed25519_dalek::VerifyingKey::from_bytes( + b.try_into()?, + )?)) } pub fn to_base58_string(self) -> String { @@ -189,7 +194,7 @@ impl<'d> Deserialize<'d> for PublicKey { where D: Deserializer<'d>, { - Ok(PublicKey(ed25519_dalek::PublicKey::deserialize( + Ok(PublicKey(ed25519_dalek::VerifyingKey::deserialize( deserializer, )?)) } @@ -223,14 +228,14 @@ impl Display for PrivateKey { impl<'a> From<&'a PrivateKey> for PublicKey { fn from(pk: &'a PrivateKey) -> Self { - PublicKey((&pk.0).into()) + PublicKey(SigningKey::from_bytes(&pk.0).verifying_key()) } } impl PrivateKey { #[cfg(feature = "rand")] pub fn new(rng: &mut R) -> Self { - let ed25519_secret = ed25519_dalek::SecretKey::generate(rng); + let ed25519_secret = ed25519_dalek::SigningKey::generate(rng).to_bytes(); PrivateKey(ed25519_secret) } @@ -240,11 +245,11 @@ impl PrivateKey { } pub fn to_bytes(&self) -> [u8; SECRET_KEY_LENGTH] { - self.0.to_bytes() + self.0 } pub fn from_bytes(b: &[u8]) -> Result { - Ok(PrivateKey(ed25519_dalek::SecretKey::from_bytes(b)?)) + Ok(PrivateKey(b.try_into()?)) } pub fn to_base58_string(&self) -> String { @@ -259,9 +264,8 @@ impl PrivateKey { } pub fn sign>(&self, message: M) -> Signature { - let expanded_secret_key = ed25519_dalek::ExpandedSecretKey::from(&self.0); - let public_key: PublicKey = self.into(); - let sig = expanded_secret_key.sign(message.as_ref(), &public_key.0); + let signing_key: SigningKey = self.0.into(); + let sig = signing_key.sign(message.as_ref()); Signature(sig) } @@ -330,7 +334,9 @@ impl Signature { } pub fn from_bytes(bytes: &[u8]) -> Result { - Ok(Signature(ed25519_dalek::Signature::from_bytes(bytes)?)) + Ok(Signature(ed25519_dalek::Signature::from_bytes( + bytes.try_into()?, + ))) } } diff --git a/common/crypto/src/shared_key.rs b/common/crypto/src/shared_key.rs index 35ccf2432e..bcc707489b 100644 --- a/common/crypto/src/shared_key.rs +++ b/common/crypto/src/shared_key.rs @@ -3,11 +3,11 @@ use crate::asymmetric::encryption; use crate::hkdf; +#[cfg(feature = "rand")] +use cipher::crypto_common::rand_core::{CryptoRng, RngCore}; use cipher::{Key, KeyIvInit, StreamCipher}; use digest::crypto_common::BlockSizeUser; use digest::Digest; -#[cfg(feature = "rand")] -use rand::{CryptoRng, RngCore}; /// Generate an ephemeral encryption keypair and perform diffie-hellman to establish /// shared key with the remote. diff --git a/common/mixnode-common/src/packet_processor/processor.rs b/common/mixnode-common/src/packet_processor/processor.rs index 03a8f37880..b577fe58ef 100644 --- a/common/mixnode-common/src/packet_processor/processor.rs +++ b/common/mixnode-common/src/packet_processor/processor.rs @@ -242,7 +242,7 @@ impl SphinxPacketProcessor { #[cfg(test)] mod tests { use super::*; - use nym_sphinx_types::crypto::keygen; + use nym_sphinx_types::test_utils::fixtures::keygen; fn fixture() -> SphinxPacketProcessor { let local_keys = keygen(); diff --git a/common/node-tester-utils/Cargo.toml b/common/node-tester-utils/Cargo.toml index 647453edfd..cdb2ddb994 100644 --- a/common/node-tester-utils/Cargo.toml +++ b/common/node-tester-utils/Cargo.toml @@ -8,7 +8,7 @@ license.workspace = true [dependencies] futures = { workspace = true } -rand = "0.7.3" +rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index 955051b267..7a7688ac3e 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -9,8 +9,8 @@ repository = { workspace = true } [dependencies] log = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } -rand_distr = "0.3" +rand = { workspace = true } +rand_distr = "0.4" thiserror = { workspace = true } nym-sphinx-acknowledgements = { path = "acknowledgements" } diff --git a/common/nymsphinx/acknowledgements/Cargo.toml b/common/nymsphinx/acknowledgements/Cargo.toml index da9977d1f3..3d997c436f 100644 --- a/common/nymsphinx/acknowledgements/Cargo.toml +++ b/common/nymsphinx/acknowledgements/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } repository = { workspace = true } [dependencies] -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde_crate = { version = "1.0", optional = true, default_features = false, features = ["derive"], package = "serde" } generic-array = { workspace = true, optional = true, features = ["serde"] } thiserror = { workspace = true } diff --git a/common/nymsphinx/addressing/Cargo.toml b/common/nymsphinx/addressing/Cargo.toml index c73e692e62..d1b58ebee5 100644 --- a/common/nymsphinx/addressing/Cargo.toml +++ b/common/nymsphinx/addressing/Cargo.toml @@ -14,5 +14,5 @@ serde = "1.0" # implementing serialization/deserialization for some types, like thiserror = { workspace = true } [dev-dependencies] -rand = "0.7" +rand = "0.8.5" nym-crypto = { path = "../../crypto", features = ["rand"] } \ No newline at end of file diff --git a/common/nymsphinx/anonymous-replies/Cargo.toml b/common/nymsphinx/anonymous-replies/Cargo.toml index 9c057f31f5..9ece0e1085 100644 --- a/common/nymsphinx/anonymous-replies/Cargo.toml +++ b/common/nymsphinx/anonymous-replies/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } repository = { workspace = true } [dependencies] -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } bs58 = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } @@ -24,4 +24,4 @@ nym-topology = { path = "../../topology" } version = "0.2.83" [dev-dependencies] -rand_chacha = "0.2" +rand_chacha = "0.3" diff --git a/common/nymsphinx/anonymous-replies/src/requests.rs b/common/nymsphinx/anonymous-replies/src/requests.rs index 9dd4c84dc0..b175026b18 100644 --- a/common/nymsphinx/anonymous-replies/src/requests.rs +++ b/common/nymsphinx/anonymous-replies/src/requests.rs @@ -570,7 +570,7 @@ mod tests { let mut address_bytes = [0; NODE_ADDRESS_LENGTH]; rng.fill_bytes(&mut address_bytes); - let dummy_private = PrivateKey::new_with_rng(rng); + let dummy_private = PrivateKey::random_from_rng(rng); let pub_key = (&dummy_private).into(); Node { address: NodeAddressBytes::from_bytes(address_bytes), diff --git a/common/nymsphinx/chunking/Cargo.toml b/common/nymsphinx/chunking/Cargo.toml index 542c8d28e2..dc608a9718 100644 --- a/common/nymsphinx/chunking/Cargo.toml +++ b/common/nymsphinx/chunking/Cargo.toml @@ -11,7 +11,7 @@ repository = { workspace = true } [dependencies] log = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } thiserror = { workspace = true } nym-sphinx-addressing = { path = "../addressing" } diff --git a/common/nymsphinx/cover/Cargo.toml b/common/nymsphinx/cover/Cargo.toml index d3da16d2db..59710923d1 100644 --- a/common/nymsphinx/cover/Cargo.toml +++ b/common/nymsphinx/cover/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } repository = { workspace = true } [dependencies] -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } thiserror = { workspace = true } nym-crypto = { path = "../../crypto" } diff --git a/common/nymsphinx/framing/src/codec.rs b/common/nymsphinx/framing/src/codec.rs index 2abc29f91e..65c2b39e46 100644 --- a/common/nymsphinx/framing/src/codec.rs +++ b/common/nymsphinx/framing/src/codec.rs @@ -130,28 +130,28 @@ impl Decoder for NymCodec { mod packet_encoding { use super::*; use nym_sphinx_types::{ - crypto, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, NodeAddressBytes, - DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, + test_utils, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, + NodeAddressBytes, DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, }; fn make_valid_outfox_packet(size: PacketSize) -> NymPacket { - let (_, node1_pk) = crypto::keygen(); + let (_, node1_pk) = test_utils::fixtures::keygen(); let node1 = Node::new( NodeAddressBytes::from_bytes([5u8; NODE_ADDRESS_LENGTH]), node1_pk, ); - let (_, node2_pk) = crypto::keygen(); + let (_, node2_pk) = test_utils::fixtures::keygen(); let node2 = Node::new( NodeAddressBytes::from_bytes([4u8; NODE_ADDRESS_LENGTH]), node2_pk, ); - let (_, node3_pk) = crypto::keygen(); + let (_, node3_pk) = test_utils::fixtures::keygen(); let node3 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node3_pk, ); - let (_, node4_pk) = crypto::keygen(); + let (_, node4_pk) = test_utils::fixtures::keygen(); let node4 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node4_pk, @@ -170,17 +170,17 @@ mod packet_encoding { } fn make_valid_sphinx_packet(size: PacketSize) -> NymPacket { - let (_, node1_pk) = crypto::keygen(); + let (_, node1_pk) = test_utils::fixtures::keygen(); let node1 = Node::new( NodeAddressBytes::from_bytes([5u8; NODE_ADDRESS_LENGTH]), node1_pk, ); - let (_, node2_pk) = crypto::keygen(); + let (_, node2_pk) = test_utils::fixtures::keygen(); let node2 = Node::new( NodeAddressBytes::from_bytes([4u8; NODE_ADDRESS_LENGTH]), node2_pk, ); - let (_, node3_pk) = crypto::keygen(); + let (_, node3_pk) = test_utils::fixtures::keygen(); let node3 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node3_pk, diff --git a/common/nymsphinx/types/Cargo.toml b/common/nymsphinx/types/Cargo.toml index 47ad47c2d2..fe47ed5212 100644 --- a/common/nymsphinx/types/Cargo.toml +++ b/common/nymsphinx/types/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } repository = { workspace = true } [dependencies] -sphinx-packet = { version = "0.1.0", optional = true } +sphinx-packet = { git = "https://github.com/nymtech/sphinx.git", branch = "simon/x25519", optional = true } nym-outfox = { path = "../../../nym-outfox", optional = true } thiserror = { workspace = true } diff --git a/common/nymsphinx/types/src/lib.rs b/common/nymsphinx/types/src/lib.rs index d75060e9b0..ec61abe22f 100644 --- a/common/nymsphinx/types/src/lib.rs +++ b/common/nymsphinx/types/src/lib.rs @@ -21,7 +21,7 @@ pub use sphinx_packet::{ payload::{Payload, PAYLOAD_OVERHEAD_SIZE}, route::{Destination, DestinationAddressBytes, Node, NodeAddressBytes, SURBIdentifier}, surb::{SURBMaterial, SURB}, - Error as SphinxError, ProcessedPacket, + test_utils, Error as SphinxError, ProcessedPacket, }; #[cfg(feature = "sphinx")] use sphinx_packet::{SphinxPacket, SphinxPacketBuilder}; diff --git a/common/socks5-client-core/Cargo.toml b/common/socks5-client-core/Cargo.toml index 52fc4d6d0b..49124fe02a 100644 --- a/common/socks5-client-core/Cargo.toml +++ b/common/socks5-client-core/Cargo.toml @@ -12,7 +12,7 @@ dirs = "4.0" futures = { workspace = true } log = { workspace = true } pin-project = "1.0" -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } reqwest = { workspace = true } schemars = { workspace = true, features = ["preserve_order"] } serde = { workspace = true, features = ["derive"] } # for config serialization/deserialization diff --git a/common/topology/Cargo.toml b/common/topology/Cargo.toml index f8ec395887..471a8621a4 100644 --- a/common/topology/Cargo.toml +++ b/common/topology/Cargo.toml @@ -14,7 +14,7 @@ documentation = { workspace = true } [dependencies] bs58 = { workspace = true } log = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } thiserror = { workspace = true } async-trait = { workspace = true, optional = true } semver = "0.11" diff --git a/common/wasm/client-core/Cargo.toml b/common/wasm/client-core/Cargo.toml index 5e6a701883..5a8cdc75bc 100644 --- a/common/wasm/client-core/Cargo.toml +++ b/common/wasm/client-core/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/nymtech/nym" [dependencies] async-trait = { workspace = true } js-sys = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde-wasm-bindgen = { workspace = true } thiserror = { workspace = true } diff --git a/common/wireguard-types/Cargo.toml b/common/wireguard-types/Cargo.toml index 07d440ad6b..d869184cc0 100644 --- a/common/wireguard-types/Cargo.toml +++ b/common/wireguard-types/Cargo.toml @@ -32,7 +32,7 @@ serde_json = { workspace = true, optional = true } x25519-dalek = { version = "2.0.0", features = ["static_secrets"] } [dev-dependencies] -rand = "0.7.3" +rand = "0.8.5" nym-crypto = { path = "../crypto", features = ["rand"]} diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index 026e514e9c..f4c99a774e 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -12,25 +12,34 @@ dependencies = [ "cipher", "cpufeatures", "ctr", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.14", "once_cell", "version_check", ] [[package]] -name = "anyhow" -version = "1.0.70" +name = "aho-corasick" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "arrayref" @@ -40,9 +49,9 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "base16ct" @@ -64,9 +73,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -133,9 +142,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-tools" @@ -145,23 +154,24 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -210,7 +220,7 @@ dependencies = [ "nym-coconut-dkg-common", "nym-group-contract-common", "nym-multisig-contract-common", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "schemars", "serde", "subtle-encoding", @@ -219,9 +229,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "cosmwasm-crypto" @@ -231,7 +241,7 @@ checksum = "c533b66e502ecab30fec23d03eb54ab1d3ce120645a00493459f8510b7a9736f" dependencies = [ "digest 0.10.7", "ed25519-zebra", - "k256 0.13.2", + "k256 0.13.3", "rand_core 0.6.4", "thiserror", ] @@ -275,7 +285,7 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98e19fae6c3f468412f731274b0f9434602722009d6a77432d39c7c4bb09202" dependencies = [ - "base64 0.21.0", + "base64 0.21.7", "bnum", "cosmwasm-crypto", "cosmwasm-derive", @@ -285,7 +295,7 @@ dependencies = [ "schemars", "serde", "serde-json-wasm", - "sha2 0.10.6", + "sha2 0.10.8", "thiserror", ] @@ -301,9 +311,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -384,6 +394,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle 2.4.1", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.59", +] + [[package]] name = "cw-controllers" version = "1.1.0" @@ -474,14 +512,13 @@ dependencies = [ [[package]] name = "cw20-base" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcd279230b08ed8afd8be5828221622bd5b9ce25d0b01d58bad626c6ce0169c" +checksum = "17ad79e86ea3707229bf78df94e08732e8f713207b4a77b2699755596725e7d9" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw-utils", "cw2", "cw20", "schemars", @@ -584,9 +621,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -594,9 +631,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -644,9 +681,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" @@ -666,9 +703,9 @@ version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.8", + "der 0.7.9", "digest 0.10.7", - "elliptic-curve 0.13.7", + "elliptic-curve 0.13.8", "rfc6979 0.4.0", "signature 2.2.0", "spki 0.7.3", @@ -676,24 +713,26 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "signature 1.6.4", + "pkcs8 0.10.2", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.2", "ed25519", - "rand 0.7.3", + "rand_core 0.6.4", "serde", - "sha2 0.9.9", + "sha2 0.10.8", + "subtle 2.4.1", "zeroize", ] @@ -703,7 +742,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 3.2.0", "hashbrown", "hex", "rand_core 0.6.4", @@ -714,9 +753,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elliptic-curve" @@ -740,9 +779,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.7" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9775b22bc152ad86a0cf23f0f348b884b26add12bf741e7ffc4d4ab2ab4d205" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct 0.2.0", "crypto-bigint 0.5.5", @@ -768,13 +807,13 @@ dependencies = [ [[package]] name = "enum-iterator-derive" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f93763ef7b0ae1c43c4d8eccc9d5848d84ad1a1d8ce61c421d1ac85a19d05" +checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.59", ] [[package]] @@ -798,10 +837,16 @@ dependencies = [ ] [[package]] -name = "form_urlencoded" -version = "1.1.0" +name = "fiat-crypto" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -814,9 +859,9 @@ checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -829,9 +874,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -839,15 +884,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -856,44 +901,44 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.59", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -942,9 +987,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -1060,9 +1105,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1079,24 +1124,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1110,20 +1155,20 @@ dependencies = [ "cfg-if", "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.6", + "sha2 0.10.8", ] [[package]] name = "k256" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa 0.16.9", - "elliptic-curve 0.13.7", + "elliptic-curve 0.13.8", "once_cell", - "sha2 0.10.6", + "sha2 0.10.8", "signature 2.2.0", ] @@ -1135,9 +1180,9 @@ checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" @@ -1153,15 +1198,15 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" dependencies = [ "cc", "libc", @@ -1183,18 +1228,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mixnet-vesting-integration-tests" @@ -1209,14 +1251,20 @@ dependencies = [ "nym-mixnet-contract-common", "nym-vesting-contract", "nym-vesting-contract-common", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", ] [[package]] -name = "num-traits" -version = "0.2.16" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -1300,7 +1348,7 @@ dependencies = [ "ed25519-dalek", "nym-pemstore", "nym-sphinx-types", - "rand 0.7.3", + "rand 0.8.5", "subtle-encoding", "thiserror", "x25519-dalek", @@ -1333,7 +1381,7 @@ dependencies = [ "nym-crypto", "nym-mixnet-contract-common", "nym-vesting-contract-common", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "semver", "serde", "thiserror", @@ -1393,7 +1441,7 @@ dependencies = [ "nym-name-service-common", "nym-sphinx-addressing", "rand 0.8.5", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "rstest", "semver", "serde", @@ -1438,7 +1486,7 @@ dependencies = [ "nym-contracts-common", "nym-crypto", "nym-service-provider-directory-common", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "rstest", "semver", "serde", @@ -1481,7 +1529,7 @@ dependencies = [ name = "nym-vesting-contract" version = "1.4.1" dependencies = [ - "base64 0.21.0", + "base64 0.21.7", "cosmwasm-crypto", "cosmwasm-derive", "cosmwasm-schema", @@ -1527,9 +1575,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "pem" @@ -1544,15 +1592,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1576,15 +1624,21 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", + "der 0.7.9", "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "platforms" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "powerfmt" @@ -1624,9 +1678,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -1656,9 +1710,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1722,7 +1776,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.14", ] [[package]] @@ -1746,18 +1800,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rfc6979" @@ -1817,15 +1885,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "schemars" @@ -1872,7 +1940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.8", + "der 0.7.9", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle 2.4.1", @@ -1881,15 +1949,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] @@ -1905,13 +1973,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.59", ] [[package]] @@ -1927,9 +1995,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -1938,13 +2006,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.59", ] [[package]] @@ -1957,14 +2025,14 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1993,9 +2061,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -2003,8 +2071,7 @@ dependencies = [ [[package]] name = "sphinx-packet" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc43eda802856ee82a7555c7b75ceb9e07451741c7a2f5f23d036020e01189d4" +source = "git+https://github.com/nymtech/sphinx.git?branch=simon/x25519#c557af4821597f5c5f18e8461f3ec02210c566be" dependencies = [ "aes", "arrayref", @@ -2012,7 +2079,6 @@ dependencies = [ "bs58 0.4.0", "byteorder", "chacha", - "curve25519-dalek", "digest 0.9.0", "hkdf", "hmac 0.11.0", @@ -2022,6 +2088,7 @@ dependencies = [ "rand_distr", "sha2 0.9.9", "subtle 2.4.1", + "x25519-dalek", ] [[package]] @@ -2041,7 +2108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.8", + "der 0.7.9", ] [[package]] @@ -2078,9 +2145,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" dependencies = [ "proc-macro2", "quote", @@ -2104,17 +2171,18 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.59", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2129,10 +2197,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -2153,36 +2222,36 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2232,9 +2301,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2242,24 +2311,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.59", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2267,39 +2336,40 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.59", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "x25519-dalek" -version = "1.1.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek", - "rand_core 0.5.1", + "curve25519-dalek 4.1.2", + "rand_core 0.6.4", + "serde", "zeroize", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -2312,5 +2382,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.59", ] diff --git a/contracts/coconut-test/Cargo.toml b/contracts/coconut-test/Cargo.toml index 22475dda1f..8b174175df 100644 --- a/contracts/coconut-test/Cargo.toml +++ b/contracts/coconut-test/Cargo.toml @@ -32,7 +32,7 @@ cw-multi-test = { workspace = true } cw3-flex-multisig = { path = "../multisig/cw3-flex-multisig" } cw4-group = { path = "../multisig/cw4-group" } -rand_chacha = "0.2" +rand_chacha = "0.3" [[test]] name = "coconut-test" diff --git a/contracts/mixnet-vesting-integration-tests/Cargo.toml b/contracts/mixnet-vesting-integration-tests/Cargo.toml index 24d2ddd1ab..a60f433758 100644 --- a/contracts/mixnet-vesting-integration-tests/Cargo.toml +++ b/contracts/mixnet-vesting-integration-tests/Cargo.toml @@ -25,7 +25,7 @@ nym-vesting-contract = { path = "../vesting" } nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } # external dependencies -rand_chacha = "0.2" +rand_chacha = "0.3" [[test]] name = "mixnet-vesting-test" diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index 9f2ba07124..2b854def9f 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -44,7 +44,7 @@ time = { version = "0.3", features = ["macros"] } semver = { workspace = true, default-features = false } [dev-dependencies] -rand_chacha = "0.2" +rand_chacha = "0.3" nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } [build-dependencies] diff --git a/contracts/name-service/Cargo.toml b/contracts/name-service/Cargo.toml index c1bf210637..e3ec82c685 100644 --- a/contracts/name-service/Cargo.toml +++ b/contracts/name-service/Cargo.toml @@ -33,7 +33,7 @@ cw-multi-test = { workspace = true } nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } nym-sphinx-addressing = { path = "../../common/nymsphinx/addressing" } rand = "0.8.5" -rand_chacha = "0.2" +rand_chacha = "0.3" rstest = "0.17.0" [features] diff --git a/contracts/service-provider-directory/Cargo.toml b/contracts/service-provider-directory/Cargo.toml index e4a75c50f0..570b50e8aa 100644 --- a/contracts/service-provider-directory/Cargo.toml +++ b/contracts/service-provider-directory/Cargo.toml @@ -31,7 +31,7 @@ vergen = { version = "=7.4.3", default-features = false, features = ["build", "g anyhow = "1.0.40" cw-multi-test = { workspace = true } nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } -rand_chacha = "0.2" +rand_chacha = "0.3" rstest = "0.17.0" [features] diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 76b425b190..e6672dd1d5 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -30,7 +30,7 @@ humantime-serde = { workspace = true } ipnetwork = "0.16" log = { workspace = true } once_cell = "1.7.2" -rand = "0.7" +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } sqlx = { workspace = true, features = [ diff --git a/gateway/gateway-requests/Cargo.toml b/gateway/gateway-requests/Cargo.toml index 770ce79cd4..9802a6c590 100644 --- a/gateway/gateway-requests/Cargo.toml +++ b/gateway/gateway-requests/Cargo.toml @@ -15,7 +15,7 @@ bs58 = { workspace = true } futures = { workspace = true } generic-array = { workspace = true, features = ["serde"] } log = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } thiserror = { workspace = true } diff --git a/gateway/gateway-requests/src/registration/handshake/shared_key.rs b/gateway/gateway-requests/src/registration/handshake/shared_key.rs index 4d4dce6e7f..64975fe4cd 100644 --- a/gateway/gateway-requests/src/registration/handshake/shared_key.rs +++ b/gateway/gateway-requests/src/registration/handshake/shared_key.rs @@ -82,8 +82,10 @@ impl SharedKeys { ) } }; - let mac = - compute_keyed_hmac::(self.mac_key(), &encrypted_data); + let mac = compute_keyed_hmac::( + self.mac_key().as_slice(), + &encrypted_data, + ); mac.into_bytes().into_iter().chain(encrypted_data).collect() } @@ -102,7 +104,7 @@ impl SharedKeys { let message_bytes = &enc_data[mac_size..]; if !recompute_keyed_hmac_and_verify_tag::( - self.mac_key(), + self.mac_key().as_slice(), message_bytes, mac_tag, ) { diff --git a/gateway/gateway-requests/src/types.rs b/gateway/gateway-requests/src/types.rs index 1da37fd0ab..6c564d4ae8 100644 --- a/gateway/gateway-requests/src/types.rs +++ b/gateway/gateway-requests/src/types.rs @@ -421,7 +421,7 @@ impl BinaryResponse { let message_bytes = &raw_req[mac_size..]; if !recompute_keyed_hmac_and_verify_tag::( - shared_keys.mac_key(), + shared_keys.mac_key().as_slice(), message_bytes, mac_tag, ) { diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index b64bb9bfc7..e0ae3bec5c 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -28,7 +28,7 @@ futures = { workspace = true } humantime-serde = { workspace = true } lazy_static = "1.4" log = { workspace = true } -rand = "0.7.3" +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } sysinfo = "0.27.7" diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index 2aa85d714c..58212c8c70 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -141,8 +141,8 @@ mod tests { use nym_sphinx_params::packet_sizes::PacketSize; use nym_sphinx_params::PacketType; use nym_sphinx_types::{ - crypto, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, NodeAddressBytes, - DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, + test_utils, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, + NodeAddressBytes, DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, }; #[derive(Default)] @@ -166,17 +166,17 @@ mod tests { } fn make_valid_sphinx_packet(size: PacketSize) -> NymPacket { - let (_, node1_pk) = crypto::keygen(); + let (_, node1_pk) = test_utils::fixtures::keygen(); let node1 = Node::new( NodeAddressBytes::from_bytes([5u8; NODE_ADDRESS_LENGTH]), node1_pk, ); - let (_, node2_pk) = crypto::keygen(); + let (_, node2_pk) = test_utils::fixtures::keygen(); let node2 = Node::new( NodeAddressBytes::from_bytes([4u8; NODE_ADDRESS_LENGTH]), node2_pk, ); - let (_, node3_pk) = crypto::keygen(); + let (_, node3_pk) = test_utils::fixtures::keygen(); let node3 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node3_pk, @@ -197,23 +197,23 @@ mod tests { } fn make_valid_outfox_packet(size: PacketSize) -> NymPacket { - let (_, node1_pk) = crypto::keygen(); + let (_, node1_pk) = test_utils::fixtures::keygen(); let node1 = Node::new( NodeAddressBytes::from_bytes([5u8; NODE_ADDRESS_LENGTH]), node1_pk, ); - let (_, node2_pk) = crypto::keygen(); + let (_, node2_pk) = test_utils::fixtures::keygen(); let node2 = Node::new( NodeAddressBytes::from_bytes([4u8; NODE_ADDRESS_LENGTH]), node2_pk, ); - let (_, node3_pk) = crypto::keygen(); + let (_, node3_pk) = test_utils::fixtures::keygen(); let node3 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node3_pk, ); - let (_, node4_pk) = crypto::keygen(); + let (_, node4_pk) = test_utils::fixtures::keygen(); let node4 = Node::new( NodeAddressBytes::from_bytes([2u8; NODE_ADDRESS_LENGTH]), node4_pk, diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 4ab459165c..f9fa59e3cc 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -29,8 +29,7 @@ humantime-serde = { workspace = true } k256 = { version = "*", features = ["ecdsa-core"] } # needed for the Verifier trait; pull whatever version is used by other dependencies log = { workspace = true } pin-project = "1.0" -rand = "0.8.5" -rand-07 = { package = "rand", version = "0.7.3" } # required for compatibility +rand = { workspace = true } reqwest = { workspace = true, features = ["json"] } rocket = { version = "0.5.0", features = ["json"] } rocket_cors = { version = "0.6.0" } @@ -125,6 +124,5 @@ tempfile = "3.3.0" cw3 = { workspace = true } cw-utils = { workspace = true } rand_chacha = "0.3" -rand_chacha_02 = { package = "rand_chacha", version = "0.2" } sha2 = "0.9" diff --git a/nym-api/src/coconut/tests/fixtures.rs b/nym-api/src/coconut/tests/fixtures.rs index 36e416df19..a23b77e034 100644 --- a/nym-api/src/coconut/tests/fixtures.rs +++ b/nym-api/src/coconut/tests/fixtures.rs @@ -27,11 +27,6 @@ pub fn test_rng(seed: [u8; 32]) -> ChaCha20Rng { ChaCha20Rng::from_seed(seed) } -pub fn test_rng_07(seed: [u8; 32]) -> rand_chacha_02::ChaCha20Rng { - use rand_chacha_02::rand_core::SeedableRng; - rand_chacha_02::ChaCha20Rng::from_seed(seed) -} - pub fn pseudorandom_account(rng: &mut ChaCha20Rng) -> AccountId { let mut dummy_account_key_hash = [0u8; 32]; rng.fill_bytes(&mut dummy_account_key_hash); @@ -48,7 +43,7 @@ pub fn dealer_fixture(mut rng: &mut ChaCha20Rng, id: NodeIndex) -> DealerDetails rng.fill_bytes(&mut secondary_seed); let addr = pseudorandom_account(rng); - let identity_keypair = identity::KeyPair::new(&mut test_rng_07(secondary_seed)); + let identity_keypair = identity::KeyPair::new(&mut test_rng(secondary_seed)); let bte_public_key_with_proof = bs58::encode(&keypair.public_key().to_bytes()).into_string(); let port = 8080 + id; @@ -156,7 +151,7 @@ impl TestingDkgControllerBuilder { let mut secondary_seed = [0u8; 32]; rng.fill_bytes(&mut secondary_seed); - let identity_keypair = identity::KeyPair::new(&mut test_rng_07(secondary_seed)); + let identity_keypair = identity::KeyPair::new(&mut test_rng(secondary_seed)); DealerDetails { address: Addr::unchecked(address.as_ref()), diff --git a/nym-api/src/coconut/tests/mod.rs b/nym-api/src/coconut/tests/mod.rs index 02c430d4c2..bd29db0412 100644 --- a/nym-api/src/coconut/tests/mod.rs +++ b/nym-api/src/coconut/tests/mod.rs @@ -49,8 +49,8 @@ use nym_validator_client::nyxd::Coin; use nym_validator_client::nyxd::{ AccountId, Algorithm, Event, EventAttribute, ExecTxResult, Fee, Hash, TxResponse, }; -use rand_07::rngs::OsRng; -use rand_07::RngCore; +use rand::rngs::OsRng; +use rand::RngCore; use rocket::http::Status; use rocket::local::asynchronous::Client; use std::collections::{BTreeMap, HashMap}; @@ -1336,7 +1336,7 @@ struct TestFixture { impl TestFixture { async fn new() -> Self { - let mut rng = crate::coconut::tests::fixtures::test_rng_07([69u8; 32]); + let mut rng = crate::coconut::tests::fixtures::test_rng([69u8; 32]); let params = Parameters::new(4).unwrap(); let coconut_keypair = nym_coconut::ttp_keygen(¶ms, 1, 1).unwrap().remove(0); let identity = identity::KeyPair::new(&mut rng); diff --git a/nym-api/src/network_monitor/chunker.rs b/nym-api/src/network_monitor/chunker.rs index ec91577866..a45a551502 100644 --- a/nym-api/src/network_monitor/chunker.rs +++ b/nym-api/src/network_monitor/chunker.rs @@ -8,7 +8,7 @@ use nym_sphinx::{ acknowledgements::AckKey, addressing::clients::Recipient, preparer::MessagePreparer, }; use nym_topology::NymTopology; -use rand_07::rngs::OsRng; +use rand::rngs::OsRng; use std::time::Duration; const DEFAULT_AVERAGE_PACKET_DELAY: Duration = Duration::from_millis(200); diff --git a/nym-api/src/network_monitor/mod.rs b/nym-api/src/network_monitor/mod.rs index 29298be436..cc308a627f 100644 --- a/nym-api/src/network_monitor/mod.rs +++ b/nym-api/src/network_monitor/mod.rs @@ -73,7 +73,7 @@ impl<'a> NetworkMonitorBuilder<'a> { // TODO: those keys change constant throughout the whole execution of the monitor. // and on top of that, they are used with ALL the gateways -> presumably this should change // in the future - let mut rng = rand_07::rngs::OsRng; + let mut rng = rand::rngs::OsRng; let identity_keypair = Arc::new(identity::KeyPair::new(&mut rng)); let encryption_keypair = Arc::new(encryption::KeyPair::new(&mut rng)); diff --git a/nym-api/src/network_monitor/monitor/preparer.rs b/nym-api/src/network_monitor/monitor/preparer.rs index 4e9cfda0fd..73a11b4d60 100644 --- a/nym-api/src/network_monitor/monitor/preparer.rs +++ b/nym-api/src/network_monitor/monitor/preparer.rs @@ -14,7 +14,7 @@ use nym_sphinx::addressing::clients::Recipient; use nym_sphinx::forwarding::packet::MixPacket; use nym_sphinx::params::{PacketSize, PacketType}; use nym_topology::{gateway, mix}; -use rand_07::{rngs::ThreadRng, seq::SliceRandom, thread_rng, Rng}; +use rand::{rngs::ThreadRng, seq::SliceRandom, thread_rng, Rng}; use std::collections::{HashMap, HashSet}; use std::fmt::{self, Display, Formatter}; diff --git a/nym-api/src/support/config/helpers.rs b/nym-api/src/support/config/helpers.rs index a124a8e4dd..9f965e7815 100644 --- a/nym-api/src/support/config/helpers.rs +++ b/nym-api/src/support/config/helpers.rs @@ -9,7 +9,6 @@ use crate::support::config::{ use anyhow::{Context, Result}; use nym_crypto::asymmetric::identity; use rand::rngs::OsRng; -use rand_07::rngs::OsRng as OsRng07; use std::{fs, io}; // TODO: once we upgrade ed25519 library, we could use the same rand library and use proper @@ -20,7 +19,7 @@ fn init_identity_keys(config: &config::NymApiPaths) -> Result<()> { &config.public_identity_key_file, ); - let mut rng = OsRng07; + let mut rng = OsRng; let keypair = identity::KeyPair::new(&mut rng); nym_pemstore::store_keypair(&keypair, &keypaths) .context("failed to store identity keys of the nym api")?; diff --git a/nym-connect/desktop/src-tauri/Cargo.toml b/nym-connect/desktop/src-tauri/Cargo.toml index 49240be6c2..653c98841c 100644 --- a/nym-connect/desktop/src-tauri/Cargo.toml +++ b/nym-connect/desktop/src-tauri/Cargo.toml @@ -30,15 +30,24 @@ itertools = "0.10.5" log = { version = "0.4", features = ["serde"] } pretty_env_logger = "0.4.0" rand = "0.8" -rand-07 = { package = "rand", version = "0.7.3" } -reqwest = { version = "0.12.4", features = ["json", "socks"] } +reqwest = { version = "0.11.22", features = ["json", "socks"] } rust-embed = { version = "6.4.2", features = ["include-exclude"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_repr = "0.1" tap = "1.0.1" # 07.07.23: JS: I changed the version from ^1.2.2 to fix up indirect import of web-sys -tauri = { version = "1.4.1", features = ["clipboard-write-text", "macos-private-api", "notification-all", "shell-open", "system-tray", "updater", "window-close", "window-minimize", "window-start-dragging"] } +tauri = { version = "1.4.1", features = [ + "clipboard-write-text", + "macos-private-api", + "notification-all", + "shell-open", + "system-tray", + "updater", + "window-close", + "window-minimize", + "window-start-dragging", +] } #tendermint-rpc = "0.23.0" thiserror = "1.0" time = { version = "0.3.17", features = ["local-offset"] } diff --git a/nym-connect/desktop/src-tauri/src/config/mod.rs b/nym-connect/desktop/src-tauri/src/config/mod.rs index 79b70f814b..adc00b48cd 100644 --- a/nym-connect/desktop/src-tauri/src/config/mod.rs +++ b/nym-connect/desktop/src-tauri/src/config/mod.rs @@ -20,7 +20,7 @@ use nym_config::{ }; use nym_crypto::asymmetric::identity; use nym_socks5_client_core::config::Config as Socks5CoreConfig; -use rand_07::rngs::OsRng; +use rand::rngs::OsRng; use serde::{Deserialize, Serialize}; use std::path::{Path, PathBuf}; use std::{fs, io}; @@ -214,7 +214,7 @@ pub async fn init_socks5_config(provider_address: String, chosen_gateway_id: Str let gateway_setup = if !already_init { let selection_spec = GatewaySelectionSpecification::new(Some(chosen_gateway_id), None, false); - let mut rng = rand_07::thread_rng(); + let mut rng = rand::thread_rng(); let available_gateways = current_gateways(&mut rng, &config.core.base.client.nym_api_urls).await?; GatewaySetup::New { diff --git a/nym-connect/desktop/src-tauri/src/operations/directory/gateways.rs b/nym-connect/desktop/src-tauri/src/operations/directory/gateways.rs index fca43e8fff..b868054b66 100644 --- a/nym-connect/desktop/src-tauri/src/operations/directory/gateways.rs +++ b/nym-connect/desktop/src-tauri/src/operations/directory/gateways.rs @@ -87,7 +87,7 @@ async fn select_gateway_by_latency(gateways: Vec) -> Resul .filter_map(|g| g.gateway_bond.try_into().ok()) .collect(); - let mut rng = rand_07::rngs::OsRng; + let mut rng = rand::rngs::OsRng; let selected_gateway = nym_client_core::init::helpers::choose_gateway_by_latency( &mut rng, &gateways_as_nodes, diff --git a/nym-node/Cargo.toml b/nym-node/Cargo.toml index 5aec940189..10fe8f4ecc 100644 --- a/nym-node/Cargo.toml +++ b/nym-node/Cargo.toml @@ -22,7 +22,7 @@ colored = "2" clap = { workspace = true, features = ["cargo", "env"] } humantime-serde = { workspace = true } ipnetwork = "0.16.0" -rand = "0.7.3" +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json.workspace = true thiserror.workspace = true diff --git a/nym-node/nym-node-http-api/Cargo.toml b/nym-node/nym-node-http-api/Cargo.toml index ab15236224..c2092d66be 100644 --- a/nym-node/nym-node-http-api/Cargo.toml +++ b/nym-node/nym-node-http-api/Cargo.toml @@ -23,7 +23,7 @@ utoipa-swagger-ui = { workspace = true, features = ["axum"] } colored = "2" ipnetwork = "0.16" -rand = "0.7.3" +rand = { workspace = true } # Wireguard: fastrand = "2" diff --git a/nym-node/nym-node-requests/Cargo.toml b/nym-node/nym-node-requests/Cargo.toml index 1708e12293..100f048efd 100644 --- a/nym-node/nym-node-requests/Cargo.toml +++ b/nym-node/nym-node-requests/Cargo.toml @@ -36,7 +36,7 @@ nym-bin-common = { path = "../../common/bin-common", features = ["bin_info_schem [dev-dependencies] tokio = { workspace = true, features = ["full"] } -rand_chacha = "0.2" +rand_chacha = "0.3" nym-crypto = { path = "../../common/crypto", features = ["rand"] } diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 93cc7eeb4d..54b9533bfc 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -64,7 +64,7 @@ nym-store-cipher = { path = "../../common/store-cipher", features = ["json"] } [dev-dependencies] nym-crypto = { path = "../../common/crypto", features = ["rand"] } -rand_chacha = "0.2" +rand_chacha = "0.3" tempfile = "3.3.0" ts-rs = "7.0.0" diff --git a/nym-wallet/src-tauri/src/error.rs b/nym-wallet/src-tauri/src/error.rs index 7f542d257c..1ed617dc4b 100644 --- a/nym-wallet/src-tauri/src/error.rs +++ b/nym-wallet/src-tauri/src/error.rs @@ -1,5 +1,4 @@ use nym_contracts_common::signing::SigningAlgorithm; -use nym_crypto::asymmetric::identity; use nym_crypto::asymmetric::identity::Ed25519RecoveryError; use nym_types::error::TypesError; use nym_validator_client::nym_api::error::NymAPIError; @@ -150,9 +149,6 @@ pub enum BackendError { #[error(transparent)] Ed25519Recovery(#[from] Ed25519RecoveryError), - #[error("failed to verify ed25519 signature: {0}")] - Ed25519SignatureError(#[from] identity::SignatureError), - #[error("This command ({name}) has been removed. Please try to use {alternative} instead.")] RemovedCommand { name: String, alternative: String }, } diff --git a/sdk/lib/socks5-listener/Cargo.toml b/sdk/lib/socks5-listener/Cargo.toml index 425154a5cb..7ce9bcdf3b 100644 --- a/sdk/lib/socks5-listener/Cargo.toml +++ b/sdk/lib/socks5-listener/Cargo.toml @@ -26,7 +26,7 @@ nym-socks5-client-core = { path = "../../../common/socks5-client-core", default- serde = { workspace = true } tokio = { workspace = true, features = ["sync", "time"] } log = "0.4.17" -rand = "0.7.3" +rand = { workspace = true } safer-ffi = { version = "0.1.4" } diff --git a/sdk/rust/nym-sdk/Cargo.toml b/sdk/rust/nym-sdk/Cargo.toml index 13b987e9aa..064f8f0143 100644 --- a/sdk/rust/nym-sdk/Cargo.toml +++ b/sdk/rust/nym-sdk/Cargo.toml @@ -32,7 +32,7 @@ http = "0.2.9" futures = { workspace = true } log = { workspace = true } -rand = { version = "0.7.3" } +rand = { workspace = true } tap = "1.0.1" thiserror = { workspace = true } url = { workspace = true } diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index 7c44692652..925f5d7573 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -28,7 +28,7 @@ ipnetwork = "0.20.0" log = { workspace = true } pretty_env_logger = "0.4.0" publicsuffix = "2.2.3" -rand = "0.7.3" +rand = { workspace = true } regex = "1.8.4" reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } diff --git a/wasm/client/Cargo.toml b/wasm/client/Cargo.toml index 2232c88877..eea8ccb0b6 100644 --- a/wasm/client/Cargo.toml +++ b/wasm/client/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] anyhow = "1.0" futures = { workspace = true } js-sys = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = "1.0" serde-wasm-bindgen = { workspace = true } diff --git a/wasm/mix-fetch/Cargo.toml b/wasm/mix-fetch/Cargo.toml index 373b6d423f..fd187f04e1 100644 --- a/wasm/mix-fetch/Cargo.toml +++ b/wasm/mix-fetch/Cargo.toml @@ -17,7 +17,7 @@ crate-type = ["cdylib", "rlib"] async-trait = { workspace = true } futures = { workspace = true } js-sys = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde-wasm-bindgen = { workspace = true } tokio = { workspace = true, features = ["sync"] } diff --git a/wasm/node-tester/Cargo.toml b/wasm/node-tester/Cargo.toml index fd295cd0e3..b2330c04ae 100644 --- a/wasm/node-tester/Cargo.toml +++ b/wasm/node-tester/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] futures = { workspace = true } js-sys = { workspace = true } -rand = { version = "0.7.3", features = ["wasm-bindgen"] } +rand = { workspace = true } serde = { workspace = true, features = ["derive"] } serde-wasm-bindgen = { workspace = true } tokio = { workspace = true, features = ["sync"] }