diff --git a/Cargo.lock b/Cargo.lock index c5801327f0..2d9a6d9980 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -709,7 +709,7 @@ dependencies = [ "nonexhaustive-delayqueue", "nym-crypto", "nym-pemstore", - "nymsphinx", + "nym-sphinx", "rand 0.7.3", "serde", "serde_json", @@ -2128,7 +2128,7 @@ dependencies = [ "network-defaults", "nym-crypto", "nym-pemstore", - "nymsphinx", + "nym-sphinx", "rand 0.7.3", "serde", "task", @@ -2156,7 +2156,7 @@ dependencies = [ "log", "nym-crypto", "nym-pemstore", - "nymsphinx", + "nym-sphinx", "rand 0.7.3", "serde", "serde_json", @@ -3172,7 +3172,7 @@ version = "0.1.0" dependencies = [ "futures", "log", - "nymsphinx", + "nym-sphinx", "task", "tokio", "tokio-util", @@ -3188,12 +3188,12 @@ dependencies = [ "log", "network-defaults", "nym-crypto", - "nymsphinx-acknowledgements", - "nymsphinx-addressing", - "nymsphinx-forwarding", - "nymsphinx-framing", - "nymsphinx-params", - "nymsphinx-types", + "nym-sphinx-acknowledgements", + "nym-sphinx-addressing", + "nym-sphinx-forwarding", + "nym-sphinx-framing", + "nym-sphinx-params", + "nym-sphinx-types", "rand 0.8.5", "serde", "task", @@ -3405,9 +3405,9 @@ dependencies = [ "nym-crypto", "nym-mixnet-contract-common", "nym-pemstore", + "nym-sphinx", "nym-vesting-contract-common", "nymcoconut", - "nymsphinx", "okapi", "pin-project", "pretty_env_logger", @@ -3545,7 +3545,7 @@ dependencies = [ "network-defaults", "nym-crypto", "nym-pemstore", - "nymsphinx", + "nym-sphinx", "pretty_env_logger", "rand 0.7.3", "serde", @@ -3590,7 +3590,7 @@ dependencies = [ "hkdf 0.12.3", "hmac 0.12.1", "nym-pemstore", - "nymsphinx-types", + "nym-sphinx-types", "rand 0.7.3", "rand_chacha 0.2.2", "serde", @@ -3631,8 +3631,8 @@ dependencies = [ "nym-api-requests", "nym-crypto", "nym-pemstore", + "nym-sphinx", "nym-types", - "nymsphinx", "once_cell", "pretty_env_logger", "rand 0.7.3", @@ -3696,10 +3696,10 @@ dependencies = [ "nonexhaustive-delayqueue", "nym-crypto", "nym-pemstore", + "nym-sphinx", + "nym-sphinx-params", + "nym-sphinx-types", "nym-types", - "nymsphinx", - "nymsphinx-params", - "nymsphinx-types", "pretty_env_logger", "rand 0.7.3", "rocket", @@ -3736,7 +3736,7 @@ dependencies = [ "network-defaults", "nym-crypto", "nym-sdk", - "nymsphinx", + "nym-sphinx", "ordered-buffer", "pretty_env_logger", "proxy-helpers", @@ -3810,7 +3810,7 @@ dependencies = [ "logging", "network-defaults", "nym-crypto", - "nymsphinx", + "nym-sphinx", "pretty_env_logger", "rand 0.7.3", "tap", @@ -3846,7 +3846,7 @@ dependencies = [ "network-defaults", "nym-crypto", "nym-pemstore", - "nymsphinx", + "nym-sphinx", "ordered-buffer", "pin-project", "pretty_env_logger", @@ -3866,6 +3866,133 @@ dependencies = [ "version-checker", ] +[[package]] +name = "nym-sphinx" +version = "0.1.0" +dependencies = [ + "nym-crypto", + "nym-mixnet-contract-common", + "nym-sphinx-acknowledgements", + "nym-sphinx-addressing", + "nym-sphinx-anonymous-replies", + "nym-sphinx-chunking", + "nym-sphinx-cover", + "nym-sphinx-forwarding", + "nym-sphinx-framing", + "nym-sphinx-params", + "nym-sphinx-types", + "rand 0.7.3", + "rand_distr", + "thiserror", + "tokio", + "topology", +] + +[[package]] +name = "nym-sphinx-acknowledgements" +version = "0.1.0" +dependencies = [ + "nym-crypto", + "nym-pemstore", + "nym-sphinx-addressing", + "nym-sphinx-params", + "nym-sphinx-types", + "rand 0.7.3", + "thiserror", + "topology", +] + +[[package]] +name = "nym-sphinx-addressing" +version = "0.1.0" +dependencies = [ + "nym-crypto", + "nym-sphinx-types", + "rand 0.7.3", + "serde", + "thiserror", +] + +[[package]] +name = "nym-sphinx-anonymous-replies" +version = "0.1.0" +dependencies = [ + "bs58", + "nym-crypto", + "nym-sphinx-addressing", + "nym-sphinx-params", + "nym-sphinx-types", + "rand 0.7.3", + "serde", + "thiserror", + "topology", + "wasm-bindgen", +] + +[[package]] +name = "nym-sphinx-chunking" +version = "0.1.0" +dependencies = [ + "log", + "nym-sphinx-addressing", + "nym-sphinx-params", + "nym-sphinx-types", + "rand 0.7.3", + "thiserror", +] + +[[package]] +name = "nym-sphinx-cover" +version = "0.1.0" +dependencies = [ + "nym-crypto", + "nym-sphinx-acknowledgements", + "nym-sphinx-addressing", + "nym-sphinx-chunking", + "nym-sphinx-forwarding", + "nym-sphinx-params", + "nym-sphinx-types", + "rand 0.7.3", + "thiserror", + "topology", +] + +[[package]] +name = "nym-sphinx-forwarding" +version = "0.1.0" +dependencies = [ + "nym-sphinx-addressing", + "nym-sphinx-params", + "nym-sphinx-types", +] + +[[package]] +name = "nym-sphinx-framing" +version = "0.1.0" +dependencies = [ + "bytes", + "nym-sphinx-params", + "nym-sphinx-types", + "thiserror", + "tokio-util", +] + +[[package]] +name = "nym-sphinx-params" +version = "0.1.0" +dependencies = [ + "nym-crypto", + "nym-sphinx-types", + "thiserror", +] + +[[package]] +name = "nym-sphinx-types" +version = "0.1.0" +dependencies = [ + "sphinx", +] + [[package]] name = "nym-types" version = "1.0.0" @@ -3962,133 +4089,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "nymsphinx" -version = "0.1.0" -dependencies = [ - "nym-crypto", - "nym-mixnet-contract-common", - "nymsphinx-acknowledgements", - "nymsphinx-addressing", - "nymsphinx-anonymous-replies", - "nymsphinx-chunking", - "nymsphinx-cover", - "nymsphinx-forwarding", - "nymsphinx-framing", - "nymsphinx-params", - "nymsphinx-types", - "rand 0.7.3", - "rand_distr", - "thiserror", - "tokio", - "topology", -] - -[[package]] -name = "nymsphinx-acknowledgements" -version = "0.1.0" -dependencies = [ - "nym-crypto", - "nym-pemstore", - "nymsphinx-addressing", - "nymsphinx-params", - "nymsphinx-types", - "rand 0.7.3", - "thiserror", - "topology", -] - -[[package]] -name = "nymsphinx-addressing" -version = "0.1.0" -dependencies = [ - "nym-crypto", - "nymsphinx-types", - "rand 0.7.3", - "serde", - "thiserror", -] - -[[package]] -name = "nymsphinx-anonymous-replies" -version = "0.1.0" -dependencies = [ - "bs58", - "nym-crypto", - "nymsphinx-addressing", - "nymsphinx-params", - "nymsphinx-types", - "rand 0.7.3", - "serde", - "thiserror", - "topology", - "wasm-bindgen", -] - -[[package]] -name = "nymsphinx-chunking" -version = "0.1.0" -dependencies = [ - "log", - "nymsphinx-addressing", - "nymsphinx-params", - "nymsphinx-types", - "rand 0.7.3", - "thiserror", -] - -[[package]] -name = "nymsphinx-cover" -version = "0.1.0" -dependencies = [ - "nym-crypto", - "nymsphinx-acknowledgements", - "nymsphinx-addressing", - "nymsphinx-chunking", - "nymsphinx-forwarding", - "nymsphinx-params", - "nymsphinx-types", - "rand 0.7.3", - "thiserror", - "topology", -] - -[[package]] -name = "nymsphinx-forwarding" -version = "0.1.0" -dependencies = [ - "nymsphinx-addressing", - "nymsphinx-params", - "nymsphinx-types", -] - -[[package]] -name = "nymsphinx-framing" -version = "0.1.0" -dependencies = [ - "bytes", - "nymsphinx-params", - "nymsphinx-types", - "thiserror", - "tokio-util", -] - -[[package]] -name = "nymsphinx-params" -version = "0.1.0" -dependencies = [ - "nym-crypto", - "nymsphinx-types", - "thiserror", -] - -[[package]] -name = "nymsphinx-types" -version = "0.1.0" -dependencies = [ - "sphinx", -] - [[package]] name = "okapi" version = "0.7.0-rc.1" @@ -5526,7 +5526,7 @@ dependencies = [ "build-information", "log", "nym-sdk", - "nymsphinx-anonymous-replies", + "nym-sphinx-anonymous-replies", "serde", "serde_json", "thiserror", @@ -5713,7 +5713,7 @@ dependencies = [ name = "socks5-requests" version = "0.1.0" dependencies = [ - "nymsphinx-addressing", + "nym-sphinx-addressing", "serde", "serde_json", "service-providers-common", @@ -6541,8 +6541,8 @@ dependencies = [ "log", "nym-crypto", "nym-mixnet-contract-common", - "nymsphinx-addressing", - "nymsphinx-types", + "nym-sphinx-addressing", + "nym-sphinx-types", "rand 0.7.3", "thiserror", "version-checker", @@ -7184,7 +7184,7 @@ dependencies = [ name = "websocket-requests" version = "0.1.0" dependencies = [ - "nymsphinx", + "nym-sphinx", "serde", "serde_json", ] diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index d168b659ac..0f4b688584 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -31,7 +31,7 @@ gateway-client = { path = "../../common/client-libs/gateway-client" } #gateway-client = { path = "../../common/client-libs/gateway-client", default-features = false, features = ["wasm", "coconut"] } gateway-requests = { path = "../../gateway/gateway-requests" } nonexhaustive-delayqueue = { path = "../../common/nonexhaustive-delayqueue" } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } nym-pemstore = { path = "../../common/pemstore" } topology = { path = "../../common/topology" } validator-client = { path = "../../common/client-libs/validator-client", default-features = false } diff --git a/clients/client-core/src/client/base_client/mod.rs b/clients/client-core/src/client/base_client/mod.rs index ba9e4e8d66..b4f9ffeea9 100644 --- a/clients/client-core/src/client/base_client/mod.rs +++ b/clients/client-core/src/client/base_client/mod.rs @@ -32,10 +32,10 @@ use gateway_client::{ }; use log::{debug, info}; use nym_crypto::asymmetric::{encryption, identity}; -use nymsphinx::acknowledgements::AckKey; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::addressing::nodes::NodeIdentity; -use nymsphinx::receiver::ReconstructedMessage; +use nym_sphinx::acknowledgements::AckKey; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::nodes::NodeIdentity; +use nym_sphinx::receiver::ReconstructedMessage; use std::sync::Arc; use std::time::Duration; use tap::TapFallible; diff --git a/clients/client-core/src/client/cover_traffic_stream.rs b/clients/client-core/src/client/cover_traffic_stream.rs index 68fe05abd3..e6cef250e5 100644 --- a/clients/client-core/src/client/cover_traffic_stream.rs +++ b/clients/client-core/src/client/cover_traffic_stream.rs @@ -7,11 +7,11 @@ use crate::spawn_future; use futures::task::{Context, Poll}; use futures::{Future, Stream, StreamExt}; use log::*; -use nymsphinx::acknowledgements::AckKey; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::cover::generate_loop_cover_packet; -use nymsphinx::params::PacketSize; -use nymsphinx::utils::sample_poisson_duration; +use nym_sphinx::acknowledgements::AckKey; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::cover::generate_loop_cover_packet; +use nym_sphinx::params::PacketSize; +use nym_sphinx::utils::sample_poisson_duration; use rand::{rngs::OsRng, CryptoRng, Rng}; use std::pin::Pin; use std::sync::Arc; diff --git a/clients/client-core/src/client/inbound_messages.rs b/clients/client-core/src/client/inbound_messages.rs index e0d3eec05a..ff2293936e 100644 --- a/clients/client-core/src/client/inbound_messages.rs +++ b/clients/client-core/src/client/inbound_messages.rs @@ -1,6 +1,6 @@ use client_connections::TransmissionLane; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; pub type InputMessageSender = tokio::sync::mpsc::Sender; pub type InputMessageReceiver = tokio::sync::mpsc::Receiver; diff --git a/clients/client-core/src/client/key_manager.rs b/clients/client-core/src/client/key_manager.rs index daf71f4679..4f0f29eb8b 100644 --- a/clients/client-core/src/client/key_manager.rs +++ b/clients/client-core/src/client/key_manager.rs @@ -5,7 +5,7 @@ use crate::config::persistence::key_pathfinder::ClientKeyPathfinder; use gateway_requests::registration::handshake::SharedKeys; use log::*; use nym_crypto::asymmetric::{encryption, identity}; -use nymsphinx::acknowledgements::AckKey; +use nym_sphinx::acknowledgements::AckKey; use rand::{CryptoRng, RngCore}; use std::io; use std::sync::Arc; diff --git a/clients/client-core/src/client/mix_traffic.rs b/clients/client-core/src/client/mix_traffic.rs index 05d44824e7..afade091f9 100644 --- a/clients/client-core/src/client/mix_traffic.rs +++ b/clients/client-core/src/client/mix_traffic.rs @@ -6,7 +6,7 @@ use crate::spawn_future; use gateway_client::wasm_mockups::CosmWasmClient; use gateway_client::GatewayClient; use log::*; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; #[cfg(not(target_arch = "wasm32"))] use validator_client::nyxd::CosmWasmClient; diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs index 8febbfa85d..ab1603e09c 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs @@ -5,7 +5,7 @@ use super::action_controller::{AckActionSender, Action}; use futures::StreamExt; use gateway_client::AcknowledgementReceiver; use log::*; -use nymsphinx::{ +use nym_sphinx::{ acknowledgements::{identifier::recover_identifier, AckKey}, chunking::fragment::{FragmentIdentifier, COVER_FRAG_ID}, }; diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs index fe79e24183..f2656e060d 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs @@ -7,8 +7,8 @@ use futures::channel::mpsc; use futures::StreamExt; use log::*; use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey}; -use nymsphinx::chunking::fragment::FragmentIdentifier; -use nymsphinx::Delay as SphinxDelay; +use nym_sphinx::chunking::fragment::FragmentIdentifier; +use nym_sphinx::Delay as SphinxDelay; use std::collections::HashMap; use std::sync::Arc; use std::time::Duration; diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/input_message_listener.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/input_message_listener.rs index f492de1aae..c537755da7 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/input_message_listener.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/input_message_listener.rs @@ -6,8 +6,8 @@ use crate::client::real_messages_control::message_handler::MessageHandler; use crate::client::replies::reply_controller::ReplyControllerSender; use client_connections::TransmissionLane; use log::*; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use rand::{CryptoRng, Rng}; /// Module responsible for dealing with the received messages: splitting them, creating acknowledgements, diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/mod.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/mod.rs index befc24b86a..eaaacc8b74 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/mod.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/mod.rs @@ -15,9 +15,9 @@ use action_controller::AckActionReceiver; use futures::channel::mpsc; use gateway_client::AcknowledgementReceiver; use log::*; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx::params::PacketSize; -use nymsphinx::{ +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::params::PacketSize; +use nym_sphinx::{ acknowledgements::AckKey, addressing::clients::Recipient, chunking::fragment::{Fragment, FragmentIdentifier}, diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/retransmission_request_listener.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/retransmission_request_listener.rs index d8fb2b0a8d..eb05a29b47 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/retransmission_request_listener.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/retransmission_request_listener.rs @@ -12,9 +12,9 @@ use crate::client::replies::reply_controller::ReplyControllerSender; use client_connections::TransmissionLane; use futures::StreamExt; use log::*; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::chunking::fragment::Fragment; -use nymsphinx::preparer::PreparedFragment; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::chunking::fragment::Fragment; +use nym_sphinx::preparer::PreparedFragment; use rand::{CryptoRng, Rng}; use std::sync::{Arc, Weak}; diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/sent_notification_listener.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/sent_notification_listener.rs index a931ce4962..3e827b6b4f 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/sent_notification_listener.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/sent_notification_listener.rs @@ -5,7 +5,7 @@ use super::action_controller::{AckActionSender, Action}; use super::SentPacketNotificationReceiver; use futures::StreamExt; use log::*; -use nymsphinx::chunking::fragment::{FragmentIdentifier, COVER_FRAG_ID}; +use nym_sphinx::chunking::fragment::{FragmentIdentifier, COVER_FRAG_ID}; /// Module responsible for starting up retransmission timers. /// It is required because when we send our packet to the `real traffic stream` controlled diff --git a/clients/client-core/src/client/real_messages_control/message_handler.rs b/clients/client-core/src/client/real_messages_control/message_handler.rs index d6fcaab0c0..473e9d8985 100644 --- a/clients/client-core/src/client/real_messages_control/message_handler.rs +++ b/clients/client-core/src/client/real_messages_control/message_handler.rs @@ -10,15 +10,15 @@ use crate::client::replies::reply_storage::{ReceivedReplySurbsMap, SentReplyKeys use crate::client::topology_control::{TopologyAccessor, TopologyReadPermit}; use client_connections::TransmissionLane; use log::{debug, error, info, trace, warn}; -use nymsphinx::acknowledgements::AckKey; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::{AnonymousSenderTag, RepliableMessage, ReplyMessage}; -use nymsphinx::anonymous_replies::{ReplySurb, SurbEncryptionKey}; -use nymsphinx::chunking::fragment::{Fragment, FragmentIdentifier}; -use nymsphinx::message::NymMessage; -use nymsphinx::params::{PacketSize, DEFAULT_NUM_MIX_HOPS}; -use nymsphinx::preparer::{MessagePreparer, PreparedFragment}; -use nymsphinx::Delay; +use nym_sphinx::acknowledgements::AckKey; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::{AnonymousSenderTag, RepliableMessage, ReplyMessage}; +use nym_sphinx::anonymous_replies::{ReplySurb, SurbEncryptionKey}; +use nym_sphinx::chunking::fragment::{Fragment, FragmentIdentifier}; +use nym_sphinx::message::NymMessage; +use nym_sphinx::params::{PacketSize, DEFAULT_NUM_MIX_HOPS}; +use nym_sphinx::preparer::{MessagePreparer, PreparedFragment}; +use nym_sphinx::Delay; use rand::{CryptoRng, Rng}; use std::collections::HashMap; use std::sync::Arc; diff --git a/clients/client-core/src/client/real_messages_control/mod.rs b/clients/client-core/src/client/real_messages_control/mod.rs index 9a1372f6ba..158138b525 100644 --- a/clients/client-core/src/client/real_messages_control/mod.rs +++ b/clients/client-core/src/client/real_messages_control/mod.rs @@ -25,9 +25,9 @@ use client_connections::{ConnectionCommandReceiver, LaneQueueLengths}; use futures::channel::mpsc; use gateway_client::AcknowledgementReceiver; use log::*; -use nymsphinx::acknowledgements::AckKey; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::params::PacketSize; +use nym_sphinx::acknowledgements::AckKey; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::params::PacketSize; use rand::{rngs::OsRng, CryptoRng, Rng}; use std::sync::Arc; use std::time::Duration; diff --git a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs index 769233f926..333d5f0fbc 100644 --- a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs +++ b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs @@ -12,14 +12,14 @@ use client_connections::{ use futures::task::{Context, Poll}; use futures::{Future, Stream, StreamExt}; use log::*; -use nymsphinx::acknowledgements::AckKey; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::chunking::fragment::FragmentIdentifier; -use nymsphinx::cover::generate_loop_cover_packet; -use nymsphinx::forwarding::packet::MixPacket; -use nymsphinx::params::PacketSize; -use nymsphinx::preparer::PreparedFragment; -use nymsphinx::utils::sample_poisson_duration; +use nym_sphinx::acknowledgements::AckKey; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::chunking::fragment::FragmentIdentifier; +use nym_sphinx::cover::generate_loop_cover_packet; +use nym_sphinx::forwarding::packet::MixPacket; +use nym_sphinx::params::PacketSize; +use nym_sphinx::preparer::PreparedFragment; +use nym_sphinx::utils::sample_poisson_duration; use rand::{CryptoRng, Rng}; use std::pin::Pin; use std::sync::Arc; diff --git a/clients/client-core/src/client/received_buffer.rs b/clients/client-core/src/client/received_buffer.rs index e80540c386..4ff19d1552 100644 --- a/clients/client-core/src/client/received_buffer.rs +++ b/clients/client-core/src/client/received_buffer.rs @@ -11,13 +11,13 @@ use gateway_client::MixnetMessageReceiver; use log::*; use nym_crypto::asymmetric::encryption; use nym_crypto::Digest; -use nymsphinx::anonymous_replies::requests::{ +use nym_sphinx::anonymous_replies::requests::{ RepliableMessage, RepliableMessageContent, ReplyMessage, ReplyMessageContent, }; -use nymsphinx::anonymous_replies::{encryption_key::EncryptionKeyDigest, SurbEncryptionKey}; -use nymsphinx::message::{NymMessage, PlainMessage}; -use nymsphinx::params::ReplySurbKeyDigestAlgorithm; -use nymsphinx::receiver::{MessageReceiver, MessageRecoveryError, ReconstructedMessage}; +use nym_sphinx::anonymous_replies::{encryption_key::EncryptionKeyDigest, SurbEncryptionKey}; +use nym_sphinx::message::{NymMessage, PlainMessage}; +use nym_sphinx::params::ReplySurbKeyDigestAlgorithm; +use nym_sphinx::receiver::{MessageReceiver, MessageRecoveryError, ReconstructedMessage}; use std::collections::HashSet; use std::sync::Arc; @@ -47,7 +47,7 @@ struct ReceivedMessagesBufferInner { impl ReceivedMessagesBufferInner { fn recover_from_fragment(&mut self, fragment_data: &[u8]) -> Option { - if nymsphinx::cover::is_cover(fragment_data) { + if nym_sphinx::cover::is_cover(fragment_data) { trace!("The message was a loop cover message! Skipping it"); return None; } diff --git a/clients/client-core/src/client/replies/reply_controller/mod.rs b/clients/client-core/src/client/replies/reply_controller/mod.rs index e04ade2412..429f07dbf3 100644 --- a/clients/client-core/src/client/replies/reply_controller/mod.rs +++ b/clients/client-core/src/client/replies/reply_controller/mod.rs @@ -8,10 +8,10 @@ use client_connections::{ConnectionId, TransmissionLane}; use futures::channel::oneshot; use futures::StreamExt; use log::{debug, error, info, trace, warn}; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx::anonymous_replies::ReplySurb; -use nymsphinx::chunking::fragment::{Fragment, FragmentIdentifier}; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::anonymous_replies::ReplySurb; +use nym_sphinx::chunking::fragment::{Fragment, FragmentIdentifier}; use rand::{CryptoRng, Rng}; use std::cmp::{max, min}; use std::collections::btree_map::Entry; diff --git a/clients/client-core/src/client/replies/reply_controller/requests.rs b/clients/client-core/src/client/replies/reply_controller/requests.rs index 6b910ebde2..b4322c1e54 100644 --- a/clients/client-core/src/client/replies/reply_controller/requests.rs +++ b/clients/client-core/src/client/replies/reply_controller/requests.rs @@ -5,9 +5,9 @@ use crate::client::real_messages_control::acknowledgement_control::PendingAcknow use client_connections::{ConnectionId, TransmissionLane}; use futures::channel::{mpsc, oneshot}; use log::error; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx::anonymous_replies::ReplySurb; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::anonymous_replies::ReplySurb; use std::sync::Weak; pub(crate) fn new_control_channels() -> (ReplyControllerSender, ReplyControllerReceiver) { diff --git a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/mod.rs b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/mod.rs index 070344a21c..fd8a618542 100644 --- a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/mod.rs +++ b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/mod.rs @@ -12,7 +12,7 @@ use crate::client::replies::reply_storage::{ }; use async_trait::async_trait; use log::{error, info, warn}; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use std::fs; use std::path::{Path, PathBuf}; use time::OffsetDateTime; diff --git a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs index db039adb82..c7b5196654 100644 --- a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs +++ b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs @@ -5,11 +5,11 @@ use crate::client::replies::reply_storage::backend::fs_backend::error::StorageEr use crate::client::replies::reply_storage::key_storage::UsedReplyKey; use nym_crypto::generic_array::typenum::Unsigned; use nym_crypto::Digest; -use nymsphinx::addressing::clients::{Recipient, RecipientBytes}; -use nymsphinx::anonymous_replies::encryption_key::EncryptionKeyDigest; -use nymsphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; -use nymsphinx::anonymous_replies::{ReplySurb, SurbEncryptionKey, SurbEncryptionKeySize}; -use nymsphinx::params::ReplySurbKeyDigestAlgorithm; +use nym_sphinx::addressing::clients::{Recipient, RecipientBytes}; +use nym_sphinx::anonymous_replies::encryption_key::EncryptionKeyDigest; +use nym_sphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; +use nym_sphinx::anonymous_replies::{ReplySurb, SurbEncryptionKey, SurbEncryptionKeySize}; +use nym_sphinx::params::ReplySurbKeyDigestAlgorithm; #[derive(Debug, Clone)] pub(crate) struct StoredSenderTag { diff --git a/clients/client-core/src/client/replies/reply_storage/key_storage.rs b/clients/client-core/src/client/replies/reply_storage/key_storage.rs index 9c68f40e06..310a44e0eb 100644 --- a/clients/client-core/src/client/replies/reply_storage/key_storage.rs +++ b/clients/client-core/src/client/replies/reply_storage/key_storage.rs @@ -3,8 +3,8 @@ use dashmap::iter::Iter; use dashmap::DashMap; -use nymsphinx::anonymous_replies::encryption_key::EncryptionKeyDigest; -use nymsphinx::anonymous_replies::SurbEncryptionKey; +use nym_sphinx::anonymous_replies::encryption_key::EncryptionKeyDigest; +use nym_sphinx::anonymous_replies::SurbEncryptionKey; use std::ops::Deref; use std::sync::Arc; use time::OffsetDateTime; diff --git a/clients/client-core/src/client/replies/reply_storage/surb_storage.rs b/clients/client-core/src/client/replies/reply_storage/surb_storage.rs index ed2fd8d846..cb88e30a90 100644 --- a/clients/client-core/src/client/replies/reply_storage/surb_storage.rs +++ b/clients/client-core/src/client/replies/reply_storage/surb_storage.rs @@ -4,8 +4,8 @@ use dashmap::iter::Iter; use dashmap::DashMap; use log::trace; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx::anonymous_replies::ReplySurb; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::anonymous_replies::ReplySurb; use std::collections::VecDeque; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; diff --git a/clients/client-core/src/client/replies/reply_storage/tag_storage.rs b/clients/client-core/src/client/replies/reply_storage/tag_storage.rs index c91d2b003e..892018b6fc 100644 --- a/clients/client-core/src/client/replies/reply_storage/tag_storage.rs +++ b/clients/client-core/src/client/replies/reply_storage/tag_storage.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use dashmap::DashMap; -use nymsphinx::addressing::clients::{Recipient, RecipientBytes}; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::{Recipient, RecipientBytes}; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use std::sync::Arc; #[cfg(all(not(target_arch = "wasm32"), feature = "fs-surb-storage"))] diff --git a/clients/client-core/src/client/topology_control.rs b/clients/client-core/src/client/topology_control.rs index fd5b27860d..0f0c13ad1c 100644 --- a/clients/client-core/src/client/topology_control.rs +++ b/clients/client-core/src/client/topology_control.rs @@ -4,8 +4,8 @@ use crate::spawn_future; use futures::StreamExt; use log::*; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::params::DEFAULT_NUM_MIX_HOPS; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::params::DEFAULT_NUM_MIX_HOPS; use rand::seq::SliceRandom; use rand::thread_rng; use std::ops::Deref; diff --git a/clients/client-core/src/client/transmission_buffer.rs b/clients/client-core/src/client/transmission_buffer.rs index 1420ce0a7b..a8a26d1dd9 100644 --- a/clients/client-core/src/client/transmission_buffer.rs +++ b/clients/client-core/src/client/transmission_buffer.rs @@ -4,7 +4,7 @@ use crate::client::helpers::{get_time_now, Instant}; use crate::client::real_messages_control::real_traffic_stream::RealMessage; use client_connections::TransmissionLane; -use nymsphinx::chunking::fragment::Fragment; +use nym_sphinx::chunking::fragment::Fragment; use rand::{seq::SliceRandom, Rng}; use std::{ collections::{HashMap, HashSet, VecDeque}, diff --git a/clients/client-core/src/config/mod.rs b/clients/client-core/src/config/mod.rs index 04f6f5b90c..4c5c458e8c 100644 --- a/clients/client-core/src/config/mod.rs +++ b/clients/client-core/src/config/mod.rs @@ -3,7 +3,7 @@ use config::defaults::NymNetworkDetails; use config::{NymConfig, OptionalSet, DB_FILE_NAME}; -use nymsphinx::params::PacketSize; +use nym_sphinx::params::PacketSize; use serde::{Deserialize, Serialize}; use std::marker::PhantomData; use std::path::PathBuf; diff --git a/clients/client-core/src/init/mod.rs b/clients/client-core/src/init/mod.rs index 27e25d4972..667c5e0fa5 100644 --- a/clients/client-core/src/init/mod.rs +++ b/clients/client-core/src/init/mod.rs @@ -5,7 +5,7 @@ use std::fmt::Display; -use nymsphinx::addressing::{clients::Recipient, nodes::NodeIdentity}; +use nym_sphinx::addressing::{clients::Recipient, nodes::NodeIdentity}; use rand::rngs::OsRng; use serde::Serialize; use tap::TapFallible; diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index ed7227bf02..fbdd630764 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -47,7 +47,7 @@ logging = { path = "../../common/logging"} gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } nym-pemstore = { path = "../../common/pemstore" } task = { path = "../../common/task" } topology = { path = "../../common/topology" } diff --git a/clients/native/examples/websocket_binarysend.rs b/clients/native/examples/websocket_binarysend.rs index 64791abbc6..2b7fec32d0 100644 --- a/clients/native/examples/websocket_binarysend.rs +++ b/clients/native/examples/websocket_binarysend.rs @@ -1,5 +1,5 @@ use futures::{SinkExt, StreamExt}; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use tokio::net::TcpStream; use tokio_tungstenite::{ connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream, diff --git a/clients/native/src/client/mod.rs b/clients/native/src/client/mod.rs index ad8d166024..a16fbde944 100644 --- a/clients/native/src/client/mod.rs +++ b/clients/native/src/client/mod.rs @@ -18,14 +18,14 @@ use client_core::config::persistence::key_pathfinder::ClientKeyPathfinder; use futures::channel::mpsc; use gateway_client::bandwidth::BandwidthController; use log::*; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use task::TaskManager; use tokio::sync::watch::error::SendError; use validator_client::nyxd::QueryNyxdClient; pub use client_core::client::key_manager::KeyManager; -pub use nymsphinx::addressing::clients::Recipient; -pub use nymsphinx::receiver::ReconstructedMessage; +pub use nym_sphinx::addressing::clients::Recipient; +pub use nym_sphinx::receiver::ReconstructedMessage; pub mod config; pub struct SocketClient { diff --git a/clients/native/src/commands/init.rs b/clients/native/src/commands/init.rs index 8d6a0b5229..68b9312576 100644 --- a/clients/native/src/commands/init.rs +++ b/clients/native/src/commands/init.rs @@ -9,7 +9,7 @@ use crate::{ use clap::Args; use config::NymConfig; use nym_crypto::asymmetric::identity; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; use std::fmt::Display; use std::net::IpAddr; diff --git a/clients/native/src/websocket/handler.rs b/clients/native/src/websocket/handler.rs index fcc786d76e..fff50b77b9 100644 --- a/clients/native/src/websocket/handler.rs +++ b/clients/native/src/websocket/handler.rs @@ -14,9 +14,9 @@ use client_core::client::{ use futures::channel::mpsc; use futures::{SinkExt, StreamExt}; use log::*; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx::receiver::ReconstructedMessage; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::receiver::ReconstructedMessage; use std::time::Duration; use tokio::net::TcpStream; use tokio::time::Instant; diff --git a/clients/native/websocket-requests/Cargo.toml b/clients/native/websocket-requests/Cargo.toml index a2689476bc..0f0921f636 100644 --- a/clients/native/websocket-requests/Cargo.toml +++ b/clients/native/websocket-requests/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -nymsphinx = { path = "../../../common/nymsphinx" } +nym-sphinx = { path = "../../../common/nymsphinx" } diff --git a/clients/native/websocket-requests/src/requests.rs b/clients/native/websocket-requests/src/requests.rs index 637db0daba..1e72ea8cfe 100644 --- a/clients/native/websocket-requests/src/requests.rs +++ b/clients/native/websocket-requests/src/requests.rs @@ -6,8 +6,8 @@ use crate::error::{self, ErrorKind}; use crate::text::ClientRequestText; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; use std::convert::{TryFrom, TryInto}; use std::mem::size_of; diff --git a/clients/native/websocket-requests/src/responses.rs b/clients/native/websocket-requests/src/responses.rs index 8b4e60963a..bf087d04f3 100644 --- a/clients/native/websocket-requests/src/responses.rs +++ b/clients/native/websocket-requests/src/responses.rs @@ -6,9 +6,9 @@ use crate::error::{self, ErrorKind}; use crate::text::ServerResponseText; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; -use nymsphinx::receiver::ReconstructedMessage; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; +use nym_sphinx::receiver::ReconstructedMessage; use std::convert::TryInto; use std::mem::size_of; diff --git a/clients/native/websocket-requests/src/text.rs b/clients/native/websocket-requests/src/text.rs index 68091dbecf..944a3855fa 100644 --- a/clients/native/websocket-requests/src/text.rs +++ b/clients/native/websocket-requests/src/text.rs @@ -4,8 +4,8 @@ use crate::error::ErrorKind; use crate::requests::ClientRequest; use crate::responses::ServerResponse; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use serde::{Deserialize, Serialize}; use std::convert::{TryFrom, TryInto}; diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 397bba0f8f..976871cce5 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -41,7 +41,7 @@ logging = { path = "../../common/logging"} gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } ordered-buffer = { path = "../../common/socks5/ordered-buffer" } nym-pemstore = { path = "../../common/pemstore" } proxy-helpers = { path = "../../common/socks5/proxy-helpers" } diff --git a/clients/socks5/src/client/config/mod.rs b/clients/socks5/src/client/config/mod.rs index a47de5de99..79ad8e1f54 100644 --- a/clients/socks5/src/client/config/mod.rs +++ b/clients/socks5/src/client/config/mod.rs @@ -7,7 +7,7 @@ pub use client_core::config::MISSING_VALUE; use client_core::config::{ClientCoreConfigTrait, DebugConfig}; use config::defaults::DEFAULT_SOCKS5_LISTENING_PORT; use config::{NymConfig, OptionalSet}; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use serde::{Deserialize, Serialize}; use service_providers_common::interface::ProviderInterfaceVersion; use socks5_requests::Socks5ProtocolVersion; diff --git a/clients/socks5/src/client/mod.rs b/clients/socks5/src/client/mod.rs index b2f463a75f..3354bab401 100644 --- a/clients/socks5/src/client/mod.rs +++ b/clients/socks5/src/client/mod.rs @@ -21,7 +21,7 @@ use futures::StreamExt; #[cfg(not(feature = "mobile"))] use gateway_client::bandwidth::BandwidthController; use log::*; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use std::error::Error; use task::{TaskClient, TaskManager}; use validator_client::nyxd::QueryNyxdClient; diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index c2c4747c89..8cb67c278e 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -9,7 +9,7 @@ use crate::{ use clap::Args; use config::NymConfig; use nym_crypto::asymmetric::identity; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; use std::fmt::Display; use tap::TapFallible; diff --git a/clients/socks5/src/commands/run.rs b/clients/socks5/src/commands/run.rs index ddf4ffcf62..231965732e 100644 --- a/clients/socks5/src/commands/run.rs +++ b/clients/socks5/src/commands/run.rs @@ -11,7 +11,7 @@ use clap::Args; use config::NymConfig; use log::*; use nym_crypto::asymmetric::identity; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use version_checker::is_minor_version_compatible; #[derive(Args, Clone)] diff --git a/clients/socks5/src/socks/client.rs b/clients/socks5/src/socks/client.rs index d7a8e26b3e..75f5fada7c 100644 --- a/clients/socks5/src/socks/client.rs +++ b/clients/socks5/src/socks/client.rs @@ -9,7 +9,7 @@ use client_core::client::inbound_messages::{InputMessage, InputMessageSender}; use futures::channel::mpsc; use futures::task::{Context, Poll}; use log::*; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use pin_project::pin_project; use proxy_helpers::connection_controller::{ ConnectionReceiver, ControllerCommand, ControllerSender, diff --git a/clients/socks5/src/socks/mixnet_responses.rs b/clients/socks5/src/socks/mixnet_responses.rs index 8f1348f795..2c46bc3f6f 100644 --- a/clients/socks5/src/socks/mixnet_responses.rs +++ b/clients/socks5/src/socks/mixnet_responses.rs @@ -4,7 +4,7 @@ use log::*; use client_core::client::received_buffer::ReconstructedMessagesReceiver; use client_core::client::received_buffer::{ReceivedBufferMessage, ReceivedBufferRequestSender}; -use nymsphinx::receiver::ReconstructedMessage; +use nym_sphinx::receiver::ReconstructedMessage; use proxy_helpers::connection_controller::ControllerSender; use service_providers_common::interface::{ControlResponse, ResponseContent}; use socks5_requests::{Socks5ProviderResponse, Socks5Response, Socks5ResponseContent}; diff --git a/clients/socks5/src/socks/server.rs b/clients/socks5/src/socks/server.rs index 3f872a5877..5b376b1110 100644 --- a/clients/socks5/src/socks/server.rs +++ b/clients/socks5/src/socks/server.rs @@ -9,7 +9,7 @@ use client_core::client::{ inbound_messages::InputMessageSender, received_buffer::ReceivedBufferRequestSender, }; use log::*; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use proxy_helpers::connection_controller::Controller; use std::net::SocketAddr; use tap::TapFallible; diff --git a/clients/webassembly/Cargo.toml b/clients/webassembly/Cargo.toml index 852ee3bebc..cb15659b49 100644 --- a/clients/webassembly/Cargo.toml +++ b/clients/webassembly/Cargo.toml @@ -35,7 +35,7 @@ client-connections = { path = "../../common/client-connections" } coconut-interface = { path = "../../common/coconut-interface" } credentials = { path = "../../common/credentials" } nym-crypto = { path = "../../common/crypto" } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } topology = { path = "../../common/topology" } gateway-client = { path = "../../common/client-libs/gateway-client", default-features = false, features = ["wasm"] } validator-client = { path = "../../common/client-libs/validator-client", default-features = false } diff --git a/clients/webassembly/src/client/mod.rs b/clients/webassembly/src/client/mod.rs index 306c2d85ed..269dfee52d 100644 --- a/clients/webassembly/src/client/mod.rs +++ b/clients/webassembly/src/client/mod.rs @@ -13,8 +13,8 @@ use client_core::client::{inbound_messages::InputMessage, key_manager::KeyManage use gateway_client::bandwidth::BandwidthController; use gateway_client::wasm_mockups::SigningNyxdClient; use js_sys::Promise; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use rand::rngs::OsRng; use std::sync::Arc; use task::TaskManager; diff --git a/clients/webassembly/src/validation.rs b/clients/webassembly/src/validation.rs index c0273f8b61..830a3d789a 100644 --- a/clients/webassembly/src/validation.rs +++ b/clients/webassembly/src/validation.rs @@ -1,4 +1,4 @@ -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index dca0679f07..2be6ef78e1 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -23,7 +23,7 @@ credentials = { path = "../../credentials" } nym-crypto = { path = "../../crypto" } gateway-requests = { path = "../../../gateway/gateway-requests" } network-defaults = { path = "../../network-defaults" } -nymsphinx = { path = "../../nymsphinx" } +nym-sphinx = { path = "../../nymsphinx" } nym-pemstore = { path = "../../pemstore" } validator-client = { path = "../validator-client" } task = { path = "../../task" } diff --git a/common/client-libs/gateway-client/src/client.rs b/common/client-libs/gateway-client/src/client.rs index b89111256e..50253a706e 100644 --- a/common/client-libs/gateway-client/src/client.rs +++ b/common/client-libs/gateway-client/src/client.rs @@ -18,7 +18,7 @@ use gateway_requests::{BinaryRequest, ClientControlRequest, ServerResponse, PROT use log::*; use network_defaults::{REMAINING_BANDWIDTH_THRESHOLD, TOKENS_TO_BURN}; use nym_crypto::asymmetric::identity; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; use rand::rngs::OsRng; use std::convert::TryFrom; use std::sync::Arc; diff --git a/common/client-libs/gateway-client/src/packet_router.rs b/common/client-libs/gateway-client/src/packet_router.rs index daeac0e548..10877b29f7 100644 --- a/common/client-libs/gateway-client/src/packet_router.rs +++ b/common/client-libs/gateway-client/src/packet_router.rs @@ -7,8 +7,8 @@ use crate::error::GatewayClientError; use futures::channel::mpsc; use log::*; -use nymsphinx::addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; -use nymsphinx::params::packet_sizes::PacketSize; +use nym_sphinx::addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; +use nym_sphinx::params::packet_sizes::PacketSize; use task::TaskClient; pub type MixnetMessageSender = mpsc::UnboundedSender>>; diff --git a/common/client-libs/mixnet-client/Cargo.toml b/common/client-libs/mixnet-client/Cargo.toml index c64da7db48..03a40ec356 100644 --- a/common/client-libs/mixnet-client/Cargo.toml +++ b/common/client-libs/mixnet-client/Cargo.toml @@ -13,5 +13,5 @@ tokio = { version = "1.24.1", features = ["time", "net", "rt"] } tokio-util = { version = "0.7.4", features = ["codec"] } # internal -nymsphinx = { path = "../../nymsphinx" } -task = { path = "../../task" } \ No newline at end of file +nym-sphinx = { path = "../../nymsphinx" } +task = { path = "../../task" } diff --git a/common/client-libs/mixnet-client/src/client.rs b/common/client-libs/mixnet-client/src/client.rs index f3a04f1099..62e37bca90 100644 --- a/common/client-libs/mixnet-client/src/client.rs +++ b/common/client-libs/mixnet-client/src/client.rs @@ -4,10 +4,10 @@ use futures::channel::mpsc; use futures::StreamExt; use log::*; -use nymsphinx::framing::codec::SphinxCodec; -use nymsphinx::framing::packet::FramedSphinxPacket; -use nymsphinx::params::PacketMode; -use nymsphinx::{addressing::nodes::NymNodeRoutingAddress, SphinxPacket}; +use nym_sphinx::framing::codec::SphinxCodec; +use nym_sphinx::framing::packet::FramedSphinxPacket; +use nym_sphinx::params::PacketMode; +use nym_sphinx::{addressing::nodes::NymNodeRoutingAddress, SphinxPacket}; use std::collections::HashMap; use std::io; use std::net::SocketAddr; diff --git a/common/client-libs/mixnet-client/src/forwarder.rs b/common/client-libs/mixnet-client/src/forwarder.rs index 43384ba759..974ee1947b 100644 --- a/common/client-libs/mixnet-client/src/forwarder.rs +++ b/common/client-libs/mixnet-client/src/forwarder.rs @@ -5,7 +5,7 @@ use crate::client::{Client, Config, SendWithoutResponse}; use futures::channel::mpsc; use futures::StreamExt; use log::*; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; use std::time::Duration; pub type MixForwardingSender = mpsc::UnboundedSender; diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index 0821a3bdd4..b962a26f29 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -30,7 +30,7 @@ subtle-encoding = { version = "0.5", features = ["bech32-preview"]} thiserror = "1.0.37" # internal -nymsphinx-types = { path = "../nymsphinx/types" } +nym-sphinx-types = { path = "../nymsphinx/types" } nym-pemstore = { path = "../../common/pemstore", version = "0.1.0" } [dev-dependencies] diff --git a/common/crypto/src/asymmetric/encryption/mod.rs b/common/crypto/src/asymmetric/encryption/mod.rs index 6f45a74270..e81bea6e85 100644 --- a/common/crypto/src/asymmetric/encryption/mod.rs +++ b/common/crypto/src/asymmetric/encryption/mod.rs @@ -256,38 +256,38 @@ impl PemStorableKey for PrivateKey { } // compatibility with sphinx keys: -impl From for nymsphinx_types::PublicKey { +impl From for nym_sphinx_types::PublicKey { fn from(key: PublicKey) -> Self { - nymsphinx_types::PublicKey::from(key.to_bytes()) + nym_sphinx_types::PublicKey::from(key.to_bytes()) } } -impl<'a> From<&'a PublicKey> for nymsphinx_types::PublicKey { +impl<'a> From<&'a PublicKey> for nym_sphinx_types::PublicKey { fn from(key: &'a PublicKey) -> Self { - nymsphinx_types::PublicKey::from((*key).to_bytes()) + nym_sphinx_types::PublicKey::from((*key).to_bytes()) } } -impl From for PublicKey { - fn from(pub_key: nymsphinx_types::PublicKey) -> Self { +impl From for PublicKey { + fn from(pub_key: nym_sphinx_types::PublicKey) -> Self { Self(x25519_dalek::PublicKey::from(*pub_key.as_bytes())) } } -impl From for nymsphinx_types::PrivateKey { +impl From for nym_sphinx_types::PrivateKey { fn from(key: PrivateKey) -> Self { - nymsphinx_types::PrivateKey::from(key.to_bytes()) + nym_sphinx_types::PrivateKey::from(key.to_bytes()) } } -impl<'a> From<&'a PrivateKey> for nymsphinx_types::PrivateKey { +impl<'a> From<&'a PrivateKey> for nym_sphinx_types::PrivateKey { fn from(key: &'a PrivateKey) -> Self { - nymsphinx_types::PrivateKey::from(key.to_bytes()) + nym_sphinx_types::PrivateKey::from(key.to_bytes()) } } -impl From for PrivateKey { - fn from(private_key: nymsphinx_types::PrivateKey) -> Self { +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() @@ -312,10 +312,10 @@ mod sphinx_key_conversion { let private_bytes = private.to_bytes(); let public_bytes = public.to_bytes(); - let sphinx_private: nymsphinx_types::PrivateKey = private.into(); + let sphinx_private: nym_sphinx_types::PrivateKey = private.into(); let recovered_private = PrivateKey::from(sphinx_private); - let sphinx_public: nymsphinx_types::PublicKey = public.into(); + let sphinx_public: nym_sphinx_types::PublicKey = public.into(); let recovered_public = PublicKey::from(sphinx_public); assert_eq!(private_bytes, recovered_private.to_bytes()); assert_eq!(public_bytes, recovered_public.to_bytes()); @@ -325,16 +325,16 @@ mod sphinx_key_conversion { #[test] fn works_for_backward_conversion() { for _ in 0..NUM_ITERATIONS { - let (sphinx_private, sphinx_public) = nymsphinx_types::crypto::keygen(); + let (sphinx_private, sphinx_public) = nym_sphinx_types::crypto::keygen(); let private_bytes = sphinx_private.to_bytes(); let public_bytes = sphinx_public.as_bytes(); let private: PrivateKey = sphinx_private.into(); - let recovered_sphinx_private: nymsphinx_types::PrivateKey = private.into(); + let recovered_sphinx_private: nym_sphinx_types::PrivateKey = private.into(); let public: PublicKey = sphinx_public.into(); - let recovered_sphinx_public: nymsphinx_types::PublicKey = public.into(); + let recovered_sphinx_public: nym_sphinx_types::PublicKey = public.into(); assert_eq!(private_bytes, recovered_sphinx_private.to_bytes()); assert_eq!(public_bytes, recovered_sphinx_public.as_bytes()); } diff --git a/common/crypto/src/asymmetric/identity/mod.rs b/common/crypto/src/asymmetric/identity/mod.rs index c72f028607..7a3fed7948 100644 --- a/common/crypto/src/asymmetric/identity/mod.rs +++ b/common/crypto/src/asymmetric/identity/mod.rs @@ -5,7 +5,7 @@ pub use ed25519_dalek::ed25519::signature::Signature as SignatureTrait; pub use ed25519_dalek::SignatureError; pub use ed25519_dalek::{Verifier, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SIGNATURE_LENGTH}; use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; -use nymsphinx_types::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; +use nym_sphinx_types::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use thiserror::Error; diff --git a/common/mixnode-common/Cargo.toml b/common/mixnode-common/Cargo.toml index 904d457c8e..978379c1e5 100644 --- a/common/mixnode-common/Cargo.toml +++ b/common/mixnode-common/Cargo.toml @@ -20,12 +20,12 @@ thiserror = "1.0.37" nym-crypto = { path = "../crypto" } network-defaults = { path = "../network-defaults" } -nymsphinx-acknowledgements = { path = "../nymsphinx/acknowledgements" } -nymsphinx-addressing = { path = "../nymsphinx/addressing" } -nymsphinx-forwarding = { path = "../nymsphinx/forwarding" } -nymsphinx-framing = { path = "../nymsphinx/framing" } -nymsphinx-params = { path = "../nymsphinx/params" } -nymsphinx-types = { path = "../nymsphinx/types" } +nym-sphinx-acknowledgements = { path = "../nymsphinx/acknowledgements" } +nym-sphinx-addressing = { path = "../nymsphinx/addressing" } +nym-sphinx-forwarding = { path = "../nymsphinx/forwarding" } +nym-sphinx-framing = { path = "../nymsphinx/framing" } +nym-sphinx-params = { path = "../nymsphinx/params" } +nym-sphinx-types = { path = "../nymsphinx/types" } task = { path = "../task" } validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"]} version-checker = { path = "../version-checker" } diff --git a/common/mixnode-common/src/packet_processor/error.rs b/common/mixnode-common/src/packet_processor/error.rs index 084ce708a8..99d3a2d2f2 100644 --- a/common/mixnode-common/src/packet_processor/error.rs +++ b/common/mixnode-common/src/packet_processor/error.rs @@ -1,9 +1,9 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use nymsphinx_acknowledgements::surb_ack::SurbAckRecoveryError; -use nymsphinx_addressing::nodes::NymNodeRoutingAddressError; -use nymsphinx_types::Error as SphinxError; +use nym_sphinx_acknowledgements::surb_ack::SurbAckRecoveryError; +use nym_sphinx_addressing::nodes::NymNodeRoutingAddressError; +use nym_sphinx_types::Error as SphinxError; use thiserror::Error; #[derive(Error, Debug)] diff --git a/common/mixnode-common/src/packet_processor/processor.rs b/common/mixnode-common/src/packet_processor/processor.rs index 84e543d8bd..7d041fce3b 100644 --- a/common/mixnode-common/src/packet_processor/processor.rs +++ b/common/mixnode-common/src/packet_processor/processor.rs @@ -3,12 +3,12 @@ use crate::packet_processor::error::MixProcessingError; use log::*; -use nymsphinx_acknowledgements::surb_ack::SurbAck; -use nymsphinx_addressing::nodes::NymNodeRoutingAddress; -use nymsphinx_forwarding::packet::MixPacket; -use nymsphinx_framing::packet::FramedSphinxPacket; -use nymsphinx_params::{PacketMode, PacketSize}; -use nymsphinx_types::{ +use nym_sphinx_acknowledgements::surb_ack::SurbAck; +use nym_sphinx_addressing::nodes::NymNodeRoutingAddress; +use nym_sphinx_forwarding::packet::MixPacket; +use nym_sphinx_framing::packet::FramedSphinxPacket; +use nym_sphinx_params::{PacketMode, PacketSize}; +use nym_sphinx_types::{ Delay as SphinxDelay, DestinationAddressBytes, NodeAddressBytes, Payload, PrivateKey, ProcessedPacket, SphinxPacket, }; @@ -192,7 +192,7 @@ impl SphinxPacketProcessor { #[cfg(test)] mod tests { use super::*; - use nymsphinx_types::crypto::keygen; + use nym_sphinx_types::crypto::keygen; fn fixture() -> SphinxPacketProcessor { let local_keys = keygen(); diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index c2e555d19d..33246054e3 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx" +name = "nym-sphinx" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -11,14 +11,14 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] } rand_distr = "0.3" thiserror = "1.0.37" -nymsphinx-acknowledgements = { path = "acknowledgements" } -nymsphinx-addressing = { path = "addressing" } -nymsphinx-anonymous-replies = { path = "anonymous-replies" } -nymsphinx-chunking = { path = "chunking" } -nymsphinx-cover = { path = "cover" } -nymsphinx-forwarding = { path = "forwarding" } -nymsphinx-params = { path = "params" } -nymsphinx-types = { path = "types" } +nym-sphinx-acknowledgements = { path = "acknowledgements" } +nym-sphinx-addressing = { path = "addressing" } +nym-sphinx-anonymous-replies = { path = "anonymous-replies" } +nym-sphinx-chunking = { path = "chunking" } +nym-sphinx-cover = { path = "cover" } +nym-sphinx-forwarding = { path = "forwarding" } +nym-sphinx-params = { path = "params" } +nym-sphinx-types = { path = "types" } # those dependencies are due to intriducing preparer and receiver. Perpaphs that indicates they should be moved # to separate crate? @@ -30,7 +30,7 @@ nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contra # do not include this when compiling into wasm as it somehow when combined together with reqwest, it will require # net2 via tokio-util -> tokio -> mio -> net2 -[target."cfg(not(target_arch = \"wasm32\"))".dependencies.nymsphinx-framing] +[target."cfg(not(target_arch = \"wasm32\"))".dependencies.nym-sphinx-framing] path = "framing" [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio] diff --git a/common/nymsphinx/acknowledgements/Cargo.toml b/common/nymsphinx/acknowledgements/Cargo.toml index d9e1b29e7f..3e1abf760c 100644 --- a/common/nymsphinx/acknowledgements/Cargo.toml +++ b/common/nymsphinx/acknowledgements/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-acknowledgements" +name = "nym-sphinx-acknowledgements" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -11,9 +11,9 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" nym-crypto = { path = "../../crypto", features = ["symmetric", "rand"] } -nymsphinx-addressing = { path = "../addressing" } -nymsphinx-params = { path = "../params" } -nymsphinx-types = { path = "../types" } +nym-sphinx-addressing = { path = "../addressing" } +nym-sphinx-params = { path = "../params" } +nym-sphinx-types = { path = "../types" } nym-pemstore = { path = "../../pemstore" } topology = { path = "../../topology" } diff --git a/common/nymsphinx/acknowledgements/src/identifier.rs b/common/nymsphinx/acknowledgements/src/identifier.rs index 7a8282b109..9f6ffb49be 100644 --- a/common/nymsphinx/acknowledgements/src/identifier.rs +++ b/common/nymsphinx/acknowledgements/src/identifier.rs @@ -3,7 +3,7 @@ use crate::AckKey; use nym_crypto::symmetric::stream_cipher::{self, encrypt, iv_from_slice, random_iv, IvSizeUser}; -use nymsphinx_params::{ +use nym_sphinx_params::{ packet_sizes::PacketSize, AckEncryptionAlgorithm, SerializedFragmentIdentifier, FRAG_ID_LEN, }; use rand::{CryptoRng, RngCore}; diff --git a/common/nymsphinx/acknowledgements/src/key.rs b/common/nymsphinx/acknowledgements/src/key.rs index bfe8b36a2b..e43a4cf6e5 100644 --- a/common/nymsphinx/acknowledgements/src/key.rs +++ b/common/nymsphinx/acknowledgements/src/key.rs @@ -3,7 +3,7 @@ use nym_crypto::symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}; use nym_pemstore::traits::PemStorableKey; -use nymsphinx_params::AckEncryptionAlgorithm; +use nym_sphinx_params::AckEncryptionAlgorithm; use rand::{CryptoRng, RngCore}; use std::fmt::{self, Display, Formatter}; diff --git a/common/nymsphinx/acknowledgements/src/surb_ack.rs b/common/nymsphinx/acknowledgements/src/surb_ack.rs index 912ed4bc32..8526fc109f 100644 --- a/common/nymsphinx/acknowledgements/src/surb_ack.rs +++ b/common/nymsphinx/acknowledgements/src/surb_ack.rs @@ -3,15 +3,15 @@ use crate::identifier::prepare_identifier; use crate::AckKey; -use nymsphinx_addressing::clients::Recipient; -use nymsphinx_addressing::nodes::{ +use nym_sphinx_addressing::clients::Recipient; +use nym_sphinx_addressing::nodes::{ NymNodeRoutingAddress, NymNodeRoutingAddressError, MAX_NODE_ADDRESS_UNPADDED_LEN, }; -use nymsphinx_params::packet_sizes::PacketSize; -use nymsphinx_params::DEFAULT_NUM_MIX_HOPS; -use nymsphinx_types::builder::SphinxPacketBuilder; -use nymsphinx_types::Error as SphinxError; -use nymsphinx_types::{ +use nym_sphinx_params::packet_sizes::PacketSize; +use nym_sphinx_params::DEFAULT_NUM_MIX_HOPS; +use nym_sphinx_types::builder::SphinxPacketBuilder; +use nym_sphinx_types::Error as SphinxError; +use nym_sphinx_types::{ delays::{self, Delay}, SphinxPacket, }; diff --git a/common/nymsphinx/addressing/Cargo.toml b/common/nymsphinx/addressing/Cargo.toml index d62f86345c..dc38bc1f8a 100644 --- a/common/nymsphinx/addressing/Cargo.toml +++ b/common/nymsphinx/addressing/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-addressing" +name = "nym-sphinx-addressing" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -8,7 +8,7 @@ edition = "2021" [dependencies] nym-crypto = { path = "../../crypto", features = ["asymmetric"] } # all addresses are expressed in terms on their crypto keys -nymsphinx-types = { path = "../types" } # we need to be able to refer to some types defined inside sphinx crate +nym-sphinx-types = { path = "../types" } # we need to be able to refer to some types defined inside sphinx crate serde = "1.0" # implementing serialization/deserialization for some types, like `Recipient` thiserror = "1.0.37" diff --git a/common/nymsphinx/addressing/src/clients.rs b/common/nymsphinx/addressing/src/clients.rs index 929906dac9..a37f15a5fa 100644 --- a/common/nymsphinx/addressing/src/clients.rs +++ b/common/nymsphinx/addressing/src/clients.rs @@ -6,7 +6,7 @@ use crate::nodes::{NodeIdentity, NODE_IDENTITY_SIZE}; use nym_crypto::asymmetric::{encryption, identity}; -use nymsphinx_types::Destination; +use nym_sphinx_types::Destination; use serde::de::{Error as SerdeError, Unexpected, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::fmt::{self, Formatter}; diff --git a/common/nymsphinx/addressing/src/nodes.rs b/common/nymsphinx/addressing/src/nodes.rs index 7514341113..d1ed9d1790 100644 --- a/common/nymsphinx/addressing/src/nodes.rs +++ b/common/nymsphinx/addressing/src/nodes.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use nym_crypto::asymmetric::identity; -use nymsphinx_types::{NodeAddressBytes, NODE_ADDRESS_LENGTH}; +use nym_sphinx_types::{NodeAddressBytes, NODE_ADDRESS_LENGTH}; use std::convert::{TryFrom, TryInto}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; use thiserror::Error; diff --git a/common/nymsphinx/anonymous-replies/Cargo.toml b/common/nymsphinx/anonymous-replies/Cargo.toml index d1fc4fd3f8..25269fdbd6 100644 --- a/common/nymsphinx/anonymous-replies/Cargo.toml +++ b/common/nymsphinx/anonymous-replies/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-anonymous-replies" +name = "nym-sphinx-anonymous-replies" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -13,9 +13,9 @@ serde = "1.0" thiserror = "1" nym-crypto = { path = "../../crypto", features = ["symmetric", "rand"] } -nymsphinx-addressing = { path = "../addressing" } -nymsphinx-params = { path = "../params" } -nymsphinx-types = { path = "../types" } +nym-sphinx-addressing = { path = "../addressing" } +nym-sphinx-params = { path = "../params" } +nym-sphinx-types = { path = "../types" } topology = { path = "../../topology" } [target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen] diff --git a/common/nymsphinx/anonymous-replies/src/encryption_key.rs b/common/nymsphinx/anonymous-replies/src/encryption_key.rs index 63533260a2..87d847902b 100644 --- a/common/nymsphinx/anonymous-replies/src/encryption_key.rs +++ b/common/nymsphinx/anonymous-replies/src/encryption_key.rs @@ -7,7 +7,7 @@ use nym_crypto::{ symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}, OutputSizeUser, }; -use nymsphinx_params::{ReplySurbEncryptionAlgorithm, ReplySurbKeyDigestAlgorithm}; +use nym_sphinx_params::{ReplySurbEncryptionAlgorithm, ReplySurbKeyDigestAlgorithm}; use rand::{CryptoRng, RngCore}; use std::fmt::{self, Display, Formatter}; diff --git a/common/nymsphinx/anonymous-replies/src/reply_surb.rs b/common/nymsphinx/anonymous-replies/src/reply_surb.rs index 0e50d847f9..049e3569e7 100644 --- a/common/nymsphinx/anonymous-replies/src/reply_surb.rs +++ b/common/nymsphinx/anonymous-replies/src/reply_surb.rs @@ -3,11 +3,11 @@ use crate::encryption_key::{SurbEncryptionKey, SurbEncryptionKeyError, SurbEncryptionKeySize}; use nym_crypto::{generic_array::typenum::Unsigned, Digest}; -use nymsphinx_addressing::clients::Recipient; -use nymsphinx_addressing::nodes::{NymNodeRoutingAddress, MAX_NODE_ADDRESS_UNPADDED_LEN}; -use nymsphinx_params::packet_sizes::PacketSize; -use nymsphinx_params::{ReplySurbKeyDigestAlgorithm, DEFAULT_NUM_MIX_HOPS}; -use nymsphinx_types::{delays, Error as SphinxError, SURBMaterial, SphinxPacket, SURB}; +use nym_sphinx_addressing::clients::Recipient; +use nym_sphinx_addressing::nodes::{NymNodeRoutingAddress, MAX_NODE_ADDRESS_UNPADDED_LEN}; +use nym_sphinx_params::packet_sizes::PacketSize; +use nym_sphinx_params::{ReplySurbKeyDigestAlgorithm, DEFAULT_NUM_MIX_HOPS}; +use nym_sphinx_types::{delays, Error as SphinxError, SURBMaterial, SphinxPacket, SURB}; use rand::{CryptoRng, RngCore}; use serde::de::{Error as SerdeError, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; @@ -111,7 +111,7 @@ impl ReplySurb { /// Returns the expected number of bytes the [`ReplySURB`] will take after serialization. /// Useful for deserialization from a bytes stream. pub fn serialized_len(mix_hops: u8) -> usize { - use nymsphinx_types::{HEADER_SIZE, NODE_ADDRESS_LENGTH, PAYLOAD_KEY_SIZE}; + use nym_sphinx_types::{HEADER_SIZE, NODE_ADDRESS_LENGTH, PAYLOAD_KEY_SIZE}; // the SURB itself consists of SURB_header, first hop address and set of payload keys // (note extra 1 for the gateway) diff --git a/common/nymsphinx/anonymous-replies/src/requests.rs b/common/nymsphinx/anonymous-replies/src/requests.rs index 686f65aa79..a812474632 100644 --- a/common/nymsphinx/anonymous-replies/src/requests.rs +++ b/common/nymsphinx/anonymous-replies/src/requests.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ReplySurb, ReplySurbError}; -use nymsphinx_addressing::clients::{Recipient, RecipientFormattingError}; +use nym_sphinx_addressing::clients::{Recipient, RecipientFormattingError}; use rand::{CryptoRng, RngCore}; use std::fmt::{Display, Formatter}; use std::mem; diff --git a/common/nymsphinx/chunking/Cargo.toml b/common/nymsphinx/chunking/Cargo.toml index 42b0bfdf7d..580ffd9097 100644 --- a/common/nymsphinx/chunking/Cargo.toml +++ b/common/nymsphinx/chunking/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-chunking" +name = "nym-sphinx-chunking" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -11,6 +11,6 @@ log = { workspace = true } rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" -nymsphinx-addressing = { path = "../addressing" } -nymsphinx-params = { path = "../params" } -nymsphinx-types = { path = "../types" } +nym-sphinx-addressing = { path = "../addressing" } +nym-sphinx-params = { path = "../params" } +nym-sphinx-types = { path = "../types" } diff --git a/common/nymsphinx/chunking/src/fragment.rs b/common/nymsphinx/chunking/src/fragment.rs index 8d909982eb..7cc2d2c0e7 100644 --- a/common/nymsphinx/chunking/src/fragment.rs +++ b/common/nymsphinx/chunking/src/fragment.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::ChunkingError; -use nymsphinx_params::{SerializedFragmentIdentifier, FRAG_ID_LEN}; +use nym_sphinx_params::{SerializedFragmentIdentifier, FRAG_ID_LEN}; use std::convert::TryInto; use std::fmt::{self, Debug, Formatter}; @@ -461,7 +461,7 @@ impl FragmentHeader { #[cfg(test)] mod fragment_tests { use super::*; - use nymsphinx_params::packet_sizes::PacketSize; + use nym_sphinx_params::packet_sizes::PacketSize; use rand::{thread_rng, RngCore}; fn max_plaintext_size() -> usize { diff --git a/common/nymsphinx/chunking/src/lib.rs b/common/nymsphinx/chunking/src/lib.rs index 60316edb15..673181f773 100644 --- a/common/nymsphinx/chunking/src/lib.rs +++ b/common/nymsphinx/chunking/src/lib.rs @@ -137,8 +137,8 @@ pub fn number_of_required_fragments( mod tests { use super::*; use crate::set::{max_one_way_linked_set_payload_length, two_way_linked_set_payload_length}; - use nymsphinx_addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; - use nymsphinx_params::packet_sizes::PacketSize; + use nym_sphinx_addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; + use nym_sphinx_params::packet_sizes::PacketSize; #[test] fn calculating_number_of_required_fragments() { diff --git a/common/nymsphinx/chunking/src/set.rs b/common/nymsphinx/chunking/src/set.rs index 47e6b947c6..82af761b73 100644 --- a/common/nymsphinx/chunking/src/set.rs +++ b/common/nymsphinx/chunking/src/set.rs @@ -297,7 +297,7 @@ pub fn split_into_sets( #[cfg(test)] mod tests { use super::*; - use nymsphinx_params::packet_sizes::PacketSize; + use nym_sphinx_params::packet_sizes::PacketSize; fn max_plaintext_size() -> usize { PacketSize::default().plaintext_size() - PacketSize::AckPacket.size() diff --git a/common/nymsphinx/cover/Cargo.toml b/common/nymsphinx/cover/Cargo.toml index 88daa7e879..3677b8f8e3 100644 --- a/common/nymsphinx/cover/Cargo.toml +++ b/common/nymsphinx/cover/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-cover" +name = "nym-sphinx-cover" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -11,10 +11,10 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" nym-crypto = { path = "../../crypto" } -nymsphinx-acknowledgements = { path = "../acknowledgements" } -nymsphinx-addressing = { path = "../addressing" } -nymsphinx-chunking = { path = "../chunking" } -nymsphinx-params = { path = "../params" } -nymsphinx-forwarding = { path = "../forwarding" } -nymsphinx-types = { path = "../types" } +nym-sphinx-acknowledgements = { path = "../acknowledgements" } +nym-sphinx-addressing = { path = "../addressing" } +nym-sphinx-chunking = { path = "../chunking" } +nym-sphinx-params = { path = "../params" } +nym-sphinx-forwarding = { path = "../forwarding" } +nym-sphinx-types = { path = "../types" } topology = { path = "../../topology" } diff --git a/common/nymsphinx/cover/src/lib.rs b/common/nymsphinx/cover/src/lib.rs index 746521ee71..8a046b38a9 100644 --- a/common/nymsphinx/cover/src/lib.rs +++ b/common/nymsphinx/cover/src/lib.rs @@ -3,18 +3,18 @@ use nym_crypto::shared_key::new_ephemeral_shared_key; use nym_crypto::symmetric::stream_cipher; -use nymsphinx_acknowledgements::surb_ack::SurbAck; -use nymsphinx_acknowledgements::AckKey; -use nymsphinx_addressing::clients::Recipient; -use nymsphinx_addressing::nodes::NymNodeRoutingAddress; -use nymsphinx_chunking::fragment::COVER_FRAG_ID; -use nymsphinx_forwarding::packet::MixPacket; -use nymsphinx_params::packet_sizes::PacketSize; -use nymsphinx_params::{ +use nym_sphinx_acknowledgements::surb_ack::SurbAck; +use nym_sphinx_acknowledgements::AckKey; +use nym_sphinx_addressing::clients::Recipient; +use nym_sphinx_addressing::nodes::NymNodeRoutingAddress; +use nym_sphinx_chunking::fragment::COVER_FRAG_ID; +use nym_sphinx_forwarding::packet::MixPacket; +use nym_sphinx_params::packet_sizes::PacketSize; +use nym_sphinx_params::{ PacketEncryptionAlgorithm, PacketHkdfAlgorithm, PacketMode, DEFAULT_NUM_MIX_HOPS, }; -use nymsphinx_types::builder::SphinxPacketBuilder; -use nymsphinx_types::{delays, Error as SphinxError}; +use nym_sphinx_types::builder::SphinxPacketBuilder; +use nym_sphinx_types::{delays, Error as SphinxError}; use rand::{CryptoRng, RngCore}; use std::convert::TryFrom; use std::time; diff --git a/common/nymsphinx/forwarding/Cargo.toml b/common/nymsphinx/forwarding/Cargo.toml index 6b29d9f9e5..9eb8959a23 100644 --- a/common/nymsphinx/forwarding/Cargo.toml +++ b/common/nymsphinx/forwarding/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-forwarding" +name = "nym-sphinx-forwarding" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -7,6 +7,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -nymsphinx-addressing = { path = "../addressing" } -nymsphinx-params = { path = "../params" } -nymsphinx-types = { path = "../types" } +nym-sphinx-addressing = { path = "../addressing" } +nym-sphinx-params = { path = "../params" } +nym-sphinx-types = { path = "../types" } diff --git a/common/nymsphinx/forwarding/src/packet.rs b/common/nymsphinx/forwarding/src/packet.rs index 8c22b43f5c..024b80b005 100644 --- a/common/nymsphinx/forwarding/src/packet.rs +++ b/common/nymsphinx/forwarding/src/packet.rs @@ -1,9 +1,9 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use nymsphinx_addressing::nodes::{NymNodeRoutingAddress, NymNodeRoutingAddressError}; -use nymsphinx_params::{PacketMode, PacketSize}; -use nymsphinx_types::SphinxPacket; +use nym_sphinx_addressing::nodes::{NymNodeRoutingAddress, NymNodeRoutingAddressError}; +use nym_sphinx_params::{PacketMode, PacketSize}; +use nym_sphinx_types::SphinxPacket; use std::convert::TryFrom; use std::fmt::{self, Debug, Display, Formatter}; diff --git a/common/nymsphinx/framing/Cargo.toml b/common/nymsphinx/framing/Cargo.toml index 6652d8faf8..9060d3ef1c 100644 --- a/common/nymsphinx/framing/Cargo.toml +++ b/common/nymsphinx/framing/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-framing" +name = "nym-sphinx-framing" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -11,5 +11,5 @@ bytes = "1.0" tokio-util = { version = "0.7.4", features = ["codec"] } thiserror = "1.0.37" -nymsphinx-types = { path = "../types" } -nymsphinx-params = { path = "../params" } +nym-sphinx-types = { path = "../types" } +nym-sphinx-params = { path = "../params" } diff --git a/common/nymsphinx/framing/src/codec.rs b/common/nymsphinx/framing/src/codec.rs index f3986d2ece..1f427dc0d1 100644 --- a/common/nymsphinx/framing/src/codec.rs +++ b/common/nymsphinx/framing/src/codec.rs @@ -3,10 +3,10 @@ use crate::packet::{FramedSphinxPacket, Header}; use bytes::{Buf, BufMut, BytesMut}; -use nymsphinx_params::packet_modes::InvalidPacketMode; -use nymsphinx_params::packet_sizes::{InvalidPacketSize, PacketSize}; -use nymsphinx_types::Error as SphinxError; -use nymsphinx_types::SphinxPacket; +use nym_sphinx_params::packet_modes::InvalidPacketMode; +use nym_sphinx_params::packet_sizes::{InvalidPacketSize, PacketSize}; +use nym_sphinx_types::Error as SphinxError; +use nym_sphinx_types::SphinxPacket; use std::io; use thiserror::Error; use tokio_util::codec::{Decoder, Encoder}; @@ -128,8 +128,8 @@ impl Decoder for SphinxCodec { #[cfg(test)] mod packet_encoding { use super::*; - use nymsphinx_types::builder::SphinxPacketBuilder; - use nymsphinx_types::{ + use nym_sphinx_types::builder::SphinxPacketBuilder; + use nym_sphinx_types::{ crypto, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, NodeAddressBytes, DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, }; @@ -189,8 +189,8 @@ mod packet_encoding { #[cfg(test)] mod decode_will_allocate_enough_bytes_for_next_call { use super::*; - use nymsphinx_params::packet_version::PacketVersion; - use nymsphinx_params::PacketMode; + use nym_sphinx_params::packet_version::PacketVersion; + use nym_sphinx_params::PacketMode; #[test] fn for_empty_bytes() { diff --git a/common/nymsphinx/framing/src/packet.rs b/common/nymsphinx/framing/src/packet.rs index 997f2e6c35..e001083d31 100644 --- a/common/nymsphinx/framing/src/packet.rs +++ b/common/nymsphinx/framing/src/packet.rs @@ -3,10 +3,10 @@ use crate::codec::SphinxCodecError; use bytes::{BufMut, BytesMut}; -use nymsphinx_params::packet_sizes::PacketSize; -use nymsphinx_params::packet_version::PacketVersion; -use nymsphinx_params::PacketMode; -use nymsphinx_types::SphinxPacket; +use nym_sphinx_params::packet_sizes::PacketSize; +use nym_sphinx_params::packet_version::PacketVersion; +use nym_sphinx_params::PacketMode; +use nym_sphinx_types::SphinxPacket; use std::convert::TryFrom; pub struct FramedSphinxPacket { diff --git a/common/nymsphinx/params/Cargo.toml b/common/nymsphinx/params/Cargo.toml index 4956991730..bb63c0c94f 100644 --- a/common/nymsphinx/params/Cargo.toml +++ b/common/nymsphinx/params/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-params" +name = "nym-sphinx-params" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" @@ -10,4 +10,4 @@ edition = "2021" thiserror = "1.0.37" nym-crypto = { path = "../../crypto", features = ["hashing", "symmetric"] } -nymsphinx-types = { path = "../types" } +nym-sphinx-types = { path = "../types" } diff --git a/common/nymsphinx/params/src/packet_sizes.rs b/common/nymsphinx/params/src/packet_sizes.rs index 63cdc1eaa2..5b1bdb6bae 100644 --- a/common/nymsphinx/params/src/packet_sizes.rs +++ b/common/nymsphinx/params/src/packet_sizes.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::FRAG_ID_LEN; -use nymsphinx_types::header::HEADER_SIZE; -use nymsphinx_types::PAYLOAD_OVERHEAD_SIZE; +use nym_sphinx_types::header::HEADER_SIZE; +use nym_sphinx_types::PAYLOAD_OVERHEAD_SIZE; use std::convert::TryFrom; use std::str::FromStr; use thiserror::Error; diff --git a/common/nymsphinx/src/lib.rs b/common/nymsphinx/src/lib.rs index bbc69c2682..a9e2d376e4 100644 --- a/common/nymsphinx/src/lib.rs +++ b/common/nymsphinx/src/lib.rs @@ -7,16 +7,16 @@ pub mod receiver; pub mod utils; // re-export sub-crates -pub use nymsphinx_acknowledgements as acknowledgements; -pub use nymsphinx_addressing as addressing; -pub use nymsphinx_anonymous_replies as anonymous_replies; -pub use nymsphinx_chunking as chunking; -pub use nymsphinx_cover as cover; -pub use nymsphinx_forwarding as forwarding; +pub use nym_sphinx_acknowledgements as acknowledgements; +pub use nym_sphinx_addressing as addressing; +pub use nym_sphinx_anonymous_replies as anonymous_replies; +pub use nym_sphinx_chunking as chunking; +pub use nym_sphinx_cover as cover; +pub use nym_sphinx_forwarding as forwarding; #[cfg(not(target_arch = "wasm32"))] -pub use nymsphinx_framing as framing; -pub use nymsphinx_params as params; -pub use nymsphinx_types::*; +pub use nym_sphinx_framing as framing; +pub use nym_sphinx_params as params; +pub use nym_sphinx_types::*; // TEMP UNTIL FURTHER REFACTORING pub use preparer::payload::NymsphinxPayloadBuilder; diff --git a/common/nymsphinx/src/message.rs b/common/nymsphinx/src/message.rs index 86cfecea59..7182e5e254 100644 --- a/common/nymsphinx/src/message.rs +++ b/common/nymsphinx/src/message.rs @@ -4,14 +4,14 @@ use crate::chunking; use nym_crypto::asymmetric::encryption; use nym_crypto::Digest; -use nymsphinx_addressing::clients::Recipient; -use nymsphinx_addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; -use nymsphinx_anonymous_replies::requests::{ +use nym_sphinx_addressing::clients::Recipient; +use nym_sphinx_addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; +use nym_sphinx_anonymous_replies::requests::{ InvalidReplyRequestError, RepliableMessage, RepliableMessageContent, ReplyMessage, ReplyMessageContent, }; -use nymsphinx_chunking::fragment::Fragment; -use nymsphinx_params::{PacketSize, ReplySurbKeyDigestAlgorithm}; +use nym_sphinx_chunking::fragment::Fragment; +use nym_sphinx_params::{PacketSize, ReplySurbKeyDigestAlgorithm}; use rand::Rng; use std::fmt::{Display, Formatter}; use thiserror::Error; diff --git a/common/nymsphinx/src/preparer/mod.rs b/common/nymsphinx/src/preparer/mod.rs index 19f68e30bc..cc4c4bb026 100644 --- a/common/nymsphinx/src/preparer/mod.rs +++ b/common/nymsphinx/src/preparer/mod.rs @@ -3,17 +3,17 @@ use crate::message::NymMessage; use crate::NymsphinxPayloadBuilder; -use nymsphinx_acknowledgements::surb_ack::SurbAck; -use nymsphinx_acknowledgements::AckKey; -use nymsphinx_addressing::clients::Recipient; -use nymsphinx_addressing::nodes::NymNodeRoutingAddress; -use nymsphinx_anonymous_replies::reply_surb::ReplySurb; -use nymsphinx_chunking::fragment::{Fragment, FragmentIdentifier}; -use nymsphinx_forwarding::packet::MixPacket; -use nymsphinx_params::packet_sizes::PacketSize; -use nymsphinx_params::DEFAULT_NUM_MIX_HOPS; -use nymsphinx_types::builder::SphinxPacketBuilder; -use nymsphinx_types::{delays, Delay}; +use nym_sphinx_acknowledgements::surb_ack::SurbAck; +use nym_sphinx_acknowledgements::AckKey; +use nym_sphinx_addressing::clients::Recipient; +use nym_sphinx_addressing::nodes::NymNodeRoutingAddress; +use nym_sphinx_anonymous_replies::reply_surb::ReplySurb; +use nym_sphinx_chunking::fragment::{Fragment, FragmentIdentifier}; +use nym_sphinx_forwarding::packet::MixPacket; +use nym_sphinx_params::packet_sizes::PacketSize; +use nym_sphinx_params::DEFAULT_NUM_MIX_HOPS; +use nym_sphinx_types::builder::SphinxPacketBuilder; +use nym_sphinx_types::{delays, Delay}; use rand::{CryptoRng, Rng}; use std::convert::TryFrom; use std::time::Duration; diff --git a/common/nymsphinx/src/preparer/payload.rs b/common/nymsphinx/src/preparer/payload.rs index 41eb2b4c4c..60786d3f11 100644 --- a/common/nymsphinx/src/preparer/payload.rs +++ b/common/nymsphinx/src/preparer/payload.rs @@ -6,10 +6,10 @@ use nym_crypto::asymmetric::encryption; use nym_crypto::shared_key::new_ephemeral_shared_key; use nym_crypto::symmetric::stream_cipher; use nym_crypto::symmetric::stream_cipher::CipherKey; -use nymsphinx_acknowledgements::surb_ack::SurbAck; -use nymsphinx_anonymous_replies::SurbEncryptionKey; -use nymsphinx_chunking::fragment::Fragment; -use nymsphinx_params::{ +use nym_sphinx_acknowledgements::surb_ack::SurbAck; +use nym_sphinx_anonymous_replies::SurbEncryptionKey; +use nym_sphinx_chunking::fragment::Fragment; +use nym_sphinx_params::{ PacketEncryptionAlgorithm, PacketHkdfAlgorithm, ReplySurbEncryptionAlgorithm, }; use rand::{CryptoRng, RngCore}; diff --git a/common/nymsphinx/src/receiver.rs b/common/nymsphinx/src/receiver.rs index 6656a23c31..5651f98216 100644 --- a/common/nymsphinx/src/receiver.rs +++ b/common/nymsphinx/src/receiver.rs @@ -7,12 +7,12 @@ use nym_crypto::asymmetric::encryption; use nym_crypto::shared_key::recompute_shared_key; use nym_crypto::symmetric::stream_cipher; use nym_crypto::symmetric::stream_cipher::CipherKey; -use nymsphinx_anonymous_replies::requests::AnonymousSenderTag; -use nymsphinx_anonymous_replies::SurbEncryptionKey; -use nymsphinx_chunking::fragment::Fragment; -use nymsphinx_chunking::reconstruction::MessageReconstructor; -use nymsphinx_chunking::ChunkingError; -use nymsphinx_params::{ +use nym_sphinx_anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx_anonymous_replies::SurbEncryptionKey; +use nym_sphinx_chunking::fragment::Fragment; +use nym_sphinx_chunking::reconstruction::MessageReconstructor; +use nym_sphinx_chunking::ChunkingError; +use nym_sphinx_params::{ PacketEncryptionAlgorithm, PacketHkdfAlgorithm, ReplySurbEncryptionAlgorithm, DEFAULT_NUM_MIX_HOPS, }; diff --git a/common/nymsphinx/types/Cargo.toml b/common/nymsphinx/types/Cargo.toml index 353de2b1b2..a51281c5de 100644 --- a/common/nymsphinx/types/Cargo.toml +++ b/common/nymsphinx/types/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nymsphinx-types" +name = "nym-sphinx-types" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" diff --git a/common/socks5/requests/Cargo.toml b/common/socks5/requests/Cargo.toml index f8bb8336ca..f879221078 100644 --- a/common/socks5/requests/Cargo.toml +++ b/common/socks5/requests/Cargo.toml @@ -11,5 +11,5 @@ thiserror = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } -nymsphinx-addressing = { path = "../../../common/nymsphinx/addressing" } +nym-sphinx-addressing = { path = "../../../common/nymsphinx/addressing" } service-providers-common = { path = "../../../service-providers/common" } diff --git a/common/socks5/requests/src/request.rs b/common/socks5/requests/src/request.rs index 39857c2a26..867cbfa786 100644 --- a/common/socks5/requests/src/request.rs +++ b/common/socks5/requests/src/request.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{Socks5ProtocolVersion, Socks5RequestError, Socks5Response}; -use nymsphinx_addressing::clients::{Recipient, RecipientFormattingError}; +use nym_sphinx_addressing::clients::{Recipient, RecipientFormattingError}; use service_providers_common::interface::{Serializable, ServiceProviderRequest}; use std::convert::TryFrom; use thiserror::Error; diff --git a/common/topology/Cargo.toml b/common/topology/Cargo.toml index c0147bb03f..9d0eba1d5c 100644 --- a/common/topology/Cargo.toml +++ b/common/topology/Cargo.toml @@ -15,6 +15,6 @@ thiserror = "1.0.37" ## internal nym-crypto = { path = "../crypto" } nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } -nymsphinx-addressing = { path = "../nymsphinx/addressing" } -nymsphinx-types = { path = "../nymsphinx/types" } +nym-sphinx-addressing = { path = "../nymsphinx/addressing" } +nym-sphinx-types = { path = "../nymsphinx/types" } version-checker = { path = "../version-checker" } diff --git a/common/topology/src/gateway.rs b/common/topology/src/gateway.rs index 40b217b714..8a2a424925 100644 --- a/common/topology/src/gateway.rs +++ b/common/topology/src/gateway.rs @@ -4,8 +4,8 @@ use crate::{filter, NetworkAddress}; use nym_crypto::asymmetric::{encryption, identity}; use nym_mixnet_contract_common::GatewayBond; -use nymsphinx_addressing::nodes::{NodeIdentity, NymNodeRoutingAddress}; -use nymsphinx_types::Node as SphinxNode; +use nym_sphinx_addressing::nodes::{NodeIdentity, NymNodeRoutingAddress}; +use nym_sphinx_types::Node as SphinxNode; use std::convert::{TryFrom, TryInto}; use std::fmt; use std::io; diff --git a/common/topology/src/lib.rs b/common/topology/src/lib.rs index 7bd511e72b..54e41199e0 100644 --- a/common/topology/src/lib.rs +++ b/common/topology/src/lib.rs @@ -5,8 +5,8 @@ use crate::filter::VersionFilterable; use log::warn; use nym_mixnet_contract_common::mixnode::MixNodeDetails; use nym_mixnet_contract_common::GatewayBond; -use nymsphinx_addressing::nodes::NodeIdentity; -use nymsphinx_types::Node as SphinxNode; +use nym_sphinx_addressing::nodes::NodeIdentity; +use nym_sphinx_types::Node as SphinxNode; use rand::Rng; use std::collections::HashMap; use std::convert::TryInto; diff --git a/common/topology/src/mix.rs b/common/topology/src/mix.rs index f8756f4e55..c03e9d9978 100644 --- a/common/topology/src/mix.rs +++ b/common/topology/src/mix.rs @@ -4,8 +4,8 @@ use crate::{filter, NetworkAddress}; use nym_crypto::asymmetric::{encryption, identity}; use nym_mixnet_contract_common::{Layer, MixId, MixNodeBond}; -use nymsphinx_addressing::nodes::NymNodeRoutingAddress; -use nymsphinx_types::Node as SphinxNode; +use nym_sphinx_addressing::nodes::NymNodeRoutingAddress; +use nym_sphinx_types::Node as SphinxNode; use std::convert::{TryFrom, TryInto}; use std::io; use std::net::SocketAddr; diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 66d94cd1e8..28ed60d52c 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -63,7 +63,7 @@ gateway-requests = { path = "gateway-requests" } mixnet-client = { path = "../common/client-libs/mixnet-client" } mixnode-common = { path = "../common/mixnode-common" } network-defaults = { path = "../common/network-defaults" } -nymsphinx = { path = "../common/nymsphinx" } +nym-sphinx = { path = "../common/nymsphinx" } nym-pemstore = { path = "../common/pemstore" } statistics-common = { path = "../common/statistics" } nym-api-requests = { path = "../nym-api/nym-api-requests" } diff --git a/gateway/gateway-requests/Cargo.toml b/gateway/gateway-requests/Cargo.toml index 0b2377c016..714f7f446d 100644 --- a/gateway/gateway-requests/Cargo.toml +++ b/gateway/gateway-requests/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" bs58 = "0.4.0" futures = "0.3.15" log = { workspace = true } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } rand = { version = "0.7.3", features = ["wasm-bindgen"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/gateway/gateway-requests/src/authentication/encrypted_address.rs b/gateway/gateway-requests/src/authentication/encrypted_address.rs index c7015fe77d..2d94520ac1 100644 --- a/gateway/gateway-requests/src/authentication/encrypted_address.rs +++ b/gateway/gateway-requests/src/authentication/encrypted_address.rs @@ -4,8 +4,8 @@ use crate::iv::IV; use crate::registration::handshake::shared_key::SharedKeys; use nym_crypto::symmetric::stream_cipher; -use nymsphinx::params::GatewayEncryptionAlgorithm; -use nymsphinx::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; +use nym_sphinx::params::GatewayEncryptionAlgorithm; +use nym_sphinx::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; use thiserror::Error; pub const ENCRYPTED_ADDRESS_SIZE: usize = DESTINATION_ADDRESS_LENGTH; diff --git a/gateway/gateway-requests/src/iv.rs b/gateway/gateway-requests/src/iv.rs index 2240a393c9..d7ab8d1c19 100644 --- a/gateway/gateway-requests/src/iv.rs +++ b/gateway/gateway-requests/src/iv.rs @@ -3,7 +3,7 @@ use nym_crypto::generic_array::{typenum::Unsigned, GenericArray}; use nym_crypto::symmetric::stream_cipher::{random_iv, IvSizeUser, IV as CryptoIV}; -use nymsphinx::params::GatewayEncryptionAlgorithm; +use nym_sphinx::params::GatewayEncryptionAlgorithm; use rand::{CryptoRng, RngCore}; use thiserror::Error; diff --git a/gateway/gateway-requests/src/lib.rs b/gateway/gateway-requests/src/lib.rs index 345da1bbeb..a2404d6c4b 100644 --- a/gateway/gateway-requests/src/lib.rs +++ b/gateway/gateway-requests/src/lib.rs @@ -4,7 +4,7 @@ pub use nym_crypto::generic_array; use nym_crypto::hmac::HmacOutput; use nym_crypto::OutputSizeUser; -use nymsphinx::params::GatewayIntegrityHmacAlgorithm; +use nym_sphinx::params::GatewayIntegrityHmacAlgorithm; pub use types::*; pub mod authentication; diff --git a/gateway/gateway-requests/src/registration/handshake/shared_key.rs b/gateway/gateway-requests/src/registration/handshake/shared_key.rs index cea60afb1d..2f56c0ac97 100644 --- a/gateway/gateway-requests/src/registration/handshake/shared_key.rs +++ b/gateway/gateway-requests/src/registration/handshake/shared_key.rs @@ -9,7 +9,7 @@ use nym_crypto::generic_array::{ use nym_crypto::hmac::{compute_keyed_hmac, recompute_keyed_hmac_and_verify_tag}; use nym_crypto::symmetric::stream_cipher::{self, CipherKey, KeySizeUser, IV}; use nym_pemstore::traits::PemStorableKey; -use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; +use nym_sphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; use thiserror::Error; // shared key is as long as the encryption key and the MAC key combined. diff --git a/gateway/gateway-requests/src/registration/handshake/state.rs b/gateway/gateway-requests/src/registration/handshake/state.rs index c85c0fd3c5..97f88c570a 100644 --- a/gateway/gateway-requests/src/registration/handshake/state.rs +++ b/gateway/gateway-requests/src/registration/handshake/state.rs @@ -13,7 +13,7 @@ use nym_crypto::{ hkdf, symmetric::stream_cipher, }; -use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewaySharedKeyHkdfAlgorithm}; +use nym_sphinx::params::{GatewayEncryptionAlgorithm, GatewaySharedKeyHkdfAlgorithm}; use rand::{CryptoRng, RngCore}; use std::convert::{TryFrom, TryInto}; use tungstenite::Message as WsMessage; diff --git a/gateway/gateway-requests/src/types.rs b/gateway/gateway-requests/src/types.rs index 00631e1f49..4f2e2735d0 100644 --- a/gateway/gateway-requests/src/types.rs +++ b/gateway/gateway-requests/src/types.rs @@ -9,11 +9,11 @@ use coconut_interface::Credential; use nym_crypto::generic_array::typenum::Unsigned; use nym_crypto::hmac::recompute_keyed_hmac_and_verify_tag; use nym_crypto::symmetric::stream_cipher; -use nymsphinx::addressing::nodes::NymNodeRoutingAddressError; -use nymsphinx::forwarding::packet::{MixPacket, MixPacketFormattingError}; -use nymsphinx::params::packet_sizes::PacketSize; -use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::addressing::nodes::NymNodeRoutingAddressError; +use nym_sphinx::forwarding::packet::{MixPacket, MixPacketFormattingError}; +use nym_sphinx::params::packet_sizes::PacketSize; +use nym_sphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; +use nym_sphinx::DestinationAddressBytes; use serde::{Deserialize, Serialize}; use std::{ convert::{TryFrom, TryInto}, diff --git a/gateway/src/node/client_handling/active_clients.rs b/gateway/src/node/client_handling/active_clients.rs index 7eeefd2a65..d2de2cc5b5 100644 --- a/gateway/src/node/client_handling/active_clients.rs +++ b/gateway/src/node/client_handling/active_clients.rs @@ -3,7 +3,7 @@ use crate::node::client_handling::websocket::message_receiver::MixMessageSender; use dashmap::DashMap; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::DestinationAddressBytes; use std::sync::Arc; #[derive(Clone)] diff --git a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs index a86e89073a..a5a69e9980 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs @@ -10,7 +10,7 @@ use gateway_requests::iv::IVConversionError; use gateway_requests::types::{BinaryRequest, ServerResponse}; use gateway_requests::{ClientControlRequest, GatewayRequestsError}; use log::*; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; use rand::{CryptoRng, Rng}; use std::convert::TryFrom; use std::process; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index 96aa1bdcf3..9347f72cf5 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -20,7 +20,7 @@ use gateway_requests::{BinaryResponse, PROTOCOL_VERSION}; use log::*; use mixnet_client::forwarder::MixForwardingSender; use nym_crypto::asymmetric::identity; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::DestinationAddressBytes; use rand::{CryptoRng, Rng}; use std::convert::TryFrom; use std::sync::Arc; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/mod.rs b/gateway/src/node/client_handling/websocket/connection_handler/mod.rs index 7c42fee2b2..b11a8f21eb 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/mod.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/mod.rs @@ -5,7 +5,7 @@ use crate::node::storage::Storage; use gateway_requests::registration::handshake::SharedKeys; use gateway_requests::ServerResponse; use log::{trace, warn}; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::DestinationAddressBytes; use rand::{CryptoRng, Rng}; use task::TaskClient; use tokio::io::{AsyncRead, AsyncWrite}; diff --git a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs index 34d9808040..14c9725adc 100644 --- a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs +++ b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs @@ -10,10 +10,10 @@ use futures::StreamExt; use log::*; use mixnet_client::forwarder::MixForwardingSender; use mixnode_common::packet_processor::processor::ProcessedFinalHop; -use nymsphinx::forwarding::packet::MixPacket; -use nymsphinx::framing::codec::SphinxCodec; -use nymsphinx::framing::packet::FramedSphinxPacket; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::forwarding::packet::MixPacket; +use nym_sphinx::framing::codec::SphinxCodec; +use nym_sphinx::framing::packet::FramedSphinxPacket; +use nym_sphinx::DestinationAddressBytes; use std::collections::HashMap; use std::net::SocketAddr; use task::TaskClient; diff --git a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs index 608627f91f..e82014818f 100644 --- a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs +++ b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs @@ -5,7 +5,7 @@ use mixnode_common::packet_processor::error::MixProcessingError; pub use mixnode_common::packet_processor::processor::MixProcessingResult; use mixnode_common::packet_processor::processor::{ProcessedFinalHop, SphinxPacketProcessor}; use nym_crypto::asymmetric::encryption; -use nymsphinx::framing::packet::FramedSphinxPacket; +use nym_sphinx::framing::packet::FramedSphinxPacket; use thiserror::Error; #[derive(Error, Debug)] diff --git a/gateway/src/node/storage/mod.rs b/gateway/src/node/storage/mod.rs index cbb7c27f90..94e5b0c5dc 100644 --- a/gateway/src/node/storage/mod.rs +++ b/gateway/src/node/storage/mod.rs @@ -9,7 +9,7 @@ use crate::node::storage::shared_keys::SharedKeysManager; use async_trait::async_trait; use gateway_requests::registration::handshake::SharedKeys; use log::{debug, error}; -use nymsphinx::DestinationAddressBytes; +use nym_sphinx::DestinationAddressBytes; use sqlx::ConnectOptions; use std::path::Path; diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 13f098a51c..51ecfaffce 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -48,7 +48,7 @@ logging = { path="../common/logging" } mixnet-client = { path="../common/client-libs/mixnet-client" } mixnode-common = { path="../common/mixnode-common" } nonexhaustive-delayqueue = { path="../common/nonexhaustive-delayqueue" } -nymsphinx = { path="../common/nymsphinx" } +nym-sphinx = { path="../common/nymsphinx" } nym-pemstore = { path = "../common/pemstore", version = "0.1.0" } task = { path = "../common/task" } nym-types = { path = "../common/types" } @@ -59,5 +59,5 @@ version-checker = { path="../common/version-checker" } [dev-dependencies] tokio = { version="1.21.2", features = ["rt-multi-thread", "net", "signal", "test-util"] } -nymsphinx-types = { path = "../common/nymsphinx/types" } -nymsphinx-params = { path = "../common/nymsphinx/params" } +nym-sphinx-types = { path = "../common/nymsphinx/types" } +nym-sphinx-params = { path = "../common/nymsphinx/params" } diff --git a/mixnode/src/node/listener/connection_handler/mod.rs b/mixnode/src/node/listener/connection_handler/mod.rs index d09a78db2b..af72f29620 100644 --- a/mixnode/src/node/listener/connection_handler/mod.rs +++ b/mixnode/src/node/listener/connection_handler/mod.rs @@ -8,10 +8,10 @@ use crate::node::packet_delayforwarder::PacketDelayForwardSender; use crate::node::TaskClient; use futures::StreamExt; use log::{error, info}; -use nymsphinx::forwarding::packet::MixPacket; -use nymsphinx::framing::codec::SphinxCodec; -use nymsphinx::framing::packet::FramedSphinxPacket; -use nymsphinx::Delay as SphinxDelay; +use nym_sphinx::forwarding::packet::MixPacket; +use nym_sphinx::framing::codec::SphinxCodec; +use nym_sphinx::framing::packet::FramedSphinxPacket; +use nym_sphinx::Delay as SphinxDelay; use std::net::SocketAddr; use tokio::net::TcpStream; use tokio::time::Instant; diff --git a/mixnode/src/node/listener/connection_handler/packet_processing.rs b/mixnode/src/node/listener/connection_handler/packet_processing.rs index d2794eeebb..06580031a9 100644 --- a/mixnode/src/node/listener/connection_handler/packet_processing.rs +++ b/mixnode/src/node/listener/connection_handler/packet_processing.rs @@ -6,7 +6,7 @@ use mixnode_common::packet_processor::error::MixProcessingError; pub use mixnode_common::packet_processor::processor::MixProcessingResult; use mixnode_common::packet_processor::processor::SphinxPacketProcessor; use nym_crypto::asymmetric::encryption; -use nymsphinx::framing::packet::FramedSphinxPacket; +use nym_sphinx::framing::packet::FramedSphinxPacket; // PacketProcessor contains all data required to correctly unwrap and forward sphinx packets #[derive(Clone)] diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index da098bcdf9..c4958f8708 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -5,7 +5,7 @@ use crate::node::node_statistics::UpdateSender; use futures::channel::mpsc; use futures::StreamExt; use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; use std::io; use tokio::time::Instant; @@ -136,11 +136,11 @@ mod tests { use task::TaskManager; - use nymsphinx::addressing::nodes::NymNodeRoutingAddress; - use nymsphinx_params::packet_sizes::PacketSize; - use nymsphinx_params::PacketMode; - use nymsphinx_types::builder::SphinxPacketBuilder; - use nymsphinx_types::{ + use nym_sphinx::addressing::nodes::NymNodeRoutingAddress; + use nym_sphinx_params::packet_sizes::PacketSize; + use nym_sphinx_params::PacketMode; + use nym_sphinx_types::builder::SphinxPacketBuilder; + use nym_sphinx_types::{ crypto, Delay as SphinxDelay, Destination, DestinationAddressBytes, Node, NodeAddressBytes, SphinxPacket, DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, }; diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 9b34e00e01..feccd7bd42 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -85,7 +85,7 @@ nym-vesting-contract-common = { path = "../common/cosmwasm-smart-contracts/vesti nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common", features = ["dkg"] } multisig-contract-common = { path = "../common/cosmwasm-smart-contracts/multisig-contract" } nymcoconut = { path = "../common/nymcoconut" } -nymsphinx = { path = "../common/nymsphinx" } +nym-sphinx = { path = "../common/nymsphinx" } nym-pemstore = { path = "../common/pemstore" } task = { path = "../common/task" } topology = { path = "../common/topology" } diff --git a/nym-api/src/network_monitor/chunker.rs b/nym-api/src/network_monitor/chunker.rs index 0caaba0811..02d5ba796b 100644 --- a/nym-api/src/network_monitor/chunker.rs +++ b/nym-api/src/network_monitor/chunker.rs @@ -1,9 +1,9 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use nymsphinx::forwarding::packet::MixPacket; -use nymsphinx::message::NymMessage; -use nymsphinx::{ +use nym_sphinx::forwarding::packet::MixPacket; +use nym_sphinx::message::NymMessage; +use nym_sphinx::{ acknowledgements::AckKey, addressing::clients::Recipient, preparer::MessagePreparer, }; use rand_07::rngs::OsRng; diff --git a/nym-api/src/network_monitor/monitor/preparer.rs b/nym-api/src/network_monitor/monitor/preparer.rs index 7393b5c303..81bd295a19 100644 --- a/nym-api/src/network_monitor/monitor/preparer.rs +++ b/nym-api/src/network_monitor/monitor/preparer.rs @@ -9,8 +9,8 @@ use crate::nym_contract_cache::cache::NymContractCache; use log::info; use nym_crypto::asymmetric::{encryption, identity}; use nym_mixnet_contract_common::{Addr, GatewayBond, Layer, MixId, MixNodeBond}; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::forwarding::packet::MixPacket; use rand::seq::SliceRandom; use rand::{thread_rng, Rng}; use std::collections::{HashMap, HashSet}; diff --git a/nym-api/src/network_monitor/monitor/processor.rs b/nym-api/src/network_monitor/monitor/processor.rs index 81a1ff1fcb..3ae082a143 100644 --- a/nym-api/src/network_monitor/monitor/processor.rs +++ b/nym-api/src/network_monitor/monitor/processor.rs @@ -9,7 +9,7 @@ use futures::lock::{Mutex, MutexGuard}; use futures::{SinkExt, StreamExt}; use log::warn; use nym_crypto::asymmetric::encryption; -use nymsphinx::receiver::{MessageReceiver, MessageRecoveryError}; +use nym_sphinx::receiver::{MessageReceiver, MessageRecoveryError}; use std::mem; use std::sync::Arc; use thiserror::Error; diff --git a/nym-api/src/network_monitor/monitor/sender.rs b/nym-api/src/network_monitor/monitor/sender.rs index 4cf6fc33ce..432dd122e0 100644 --- a/nym-api/src/network_monitor/monitor/sender.rs +++ b/nym-api/src/network_monitor/monitor/sender.rs @@ -16,7 +16,7 @@ use gateway_client::error::GatewayClientError; use gateway_client::{AcknowledgementReceiver, GatewayClient, MixnetMessageReceiver}; use log::{debug, info, trace, warn}; use nym_crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH}; -use nymsphinx::forwarding::packet::MixPacket; +use nym_sphinx::forwarding::packet::MixPacket; use pin_project::pin_project; use std::mem; use std::num::NonZeroUsize; diff --git a/sdk/rust/nym-sdk/Cargo.toml b/sdk/rust/nym-sdk/Cargo.toml index 791828de4a..2fe416a829 100644 --- a/sdk/rust/nym-sdk/Cargo.toml +++ b/sdk/rust/nym-sdk/Cargo.toml @@ -12,7 +12,7 @@ nym-crypto = { path = "../../../common/crypto" } gateway-client = { path = "../../../common/client-libs/gateway-client" } gateway-requests = { path = "../../../gateway/gateway-requests" } network-defaults = { path = "../../../common/network-defaults" } -nymsphinx = { path = "../../../common/nymsphinx" } +nym-sphinx = { path = "../../../common/nymsphinx" } task = { path = "../../../common/task" } validator-client = { path = "../../../common/client-libs/validator-client", features = ["nyxd-client"] } diff --git a/sdk/rust/nym-sdk/src/mixnet.rs b/sdk/rust/nym-sdk/src/mixnet.rs index e79e75677a..5dafb6e94d 100644 --- a/sdk/rust/nym-sdk/src/mixnet.rs +++ b/sdk/rust/nym-sdk/src/mixnet.rs @@ -48,7 +48,7 @@ pub use client_core::{ }; pub use config::Config; pub use keys::{Keys, KeysArc}; -pub use nymsphinx::{ +pub use nym_sphinx::{ addressing::clients::{ClientIdentity, Recipient}, receiver::ReconstructedMessage, }; diff --git a/sdk/rust/nym-sdk/src/mixnet/client.rs b/sdk/rust/nym-sdk/src/mixnet/client.rs index 0b7c633ebc..fc5b216c64 100644 --- a/sdk/rust/nym-sdk/src/mixnet/client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/client.rs @@ -14,7 +14,7 @@ use client_core::{ config::{persistence::key_pathfinder::ClientKeyPathfinder, GatewayEndpointConfig}, }; use nym_crypto::asymmetric::identity; -use nymsphinx::{ +use nym_sphinx::{ addressing::clients::{ClientIdentity, Recipient}, receiver::ReconstructedMessage, }; diff --git a/sdk/rust/nym-sdk/src/mixnet/keys.rs b/sdk/rust/nym-sdk/src/mixnet/keys.rs index 74593410eb..350c673f73 100644 --- a/sdk/rust/nym-sdk/src/mixnet/keys.rs +++ b/sdk/rust/nym-sdk/src/mixnet/keys.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use client_core::client::key_manager::KeyManager; use gateway_requests::registration::handshake::SharedKeys; use nym_crypto::asymmetric::{encryption, identity}; -use nymsphinx::acknowledgements::AckKey; +use nym_sphinx::acknowledgements::AckKey; /// The set of keys used by the client. Identity, encryption and ack keys are generated at creating /// unless specified to loaded from storage or somehow explictly specified. The gateway shared key diff --git a/service-providers/common/Cargo.toml b/service-providers/common/Cargo.toml index e6787d2ee6..94c3bcc814 100644 --- a/service-providers/common/Cargo.toml +++ b/service-providers/common/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] build-information = { path = "../../common/build-information", features = ["serde"] } -nymsphinx-anonymous-replies = { path = "../../common/nymsphinx/anonymous-replies" } +nym-sphinx-anonymous-replies = { path = "../../common/nymsphinx/anonymous-replies" } async-trait = { workspace = true } log = { workspace = true } diff --git a/service-providers/common/src/lib.rs b/service-providers/common/src/lib.rs index 8331ea4775..5e1bba8943 100644 --- a/service-providers/common/src/lib.rs +++ b/service-providers/common/src/lib.rs @@ -6,7 +6,7 @@ use crate::interface::{ Request, RequestContent, Response, ResponseContent, ServiceProviderRequest, SupportedVersions, }; use async_trait::async_trait; -use nymsphinx_anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx_anonymous_replies::requests::AnonymousSenderTag; pub mod interface; diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index 88d0b8ad41..ac47ca41d0 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -40,7 +40,7 @@ nym-crypto = { path = "../../common/crypto" } logging = { path = "../../common/logging"} network-defaults = { path = "../../common/network-defaults" } nym-sdk = { path = "../../sdk/rust/nym-sdk" } -nymsphinx = { path = "../../common/nymsphinx" } +nym-sphinx = { path = "../../common/nymsphinx" } ordered-buffer = {path = "../../common/socks5/ordered-buffer"} proxy-helpers = { path = "../../common/socks5/proxy-helpers" } service-providers-common = { path = "../common" } diff --git a/service-providers/network-requester/src/cli/init.rs b/service-providers/network-requester/src/cli/init.rs index ee21450bec..fba12a7d1f 100644 --- a/service-providers/network-requester/src/cli/init.rs +++ b/service-providers/network-requester/src/cli/init.rs @@ -9,7 +9,7 @@ use crate::{ use clap::Args; use config::NymConfig; use nym_crypto::asymmetric::identity; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; use std::fmt::Display; use tap::TapFallible; diff --git a/service-providers/network-requester/src/cli/run.rs b/service-providers/network-requester/src/cli/run.rs index 98678fd910..0970c79975 100644 --- a/service-providers/network-requester/src/cli/run.rs +++ b/service-providers/network-requester/src/cli/run.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::Args; use config::NymConfig; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; const ENABLE_STATISTICS: &str = "enable-statistics"; diff --git a/service-providers/network-requester/src/core.rs b/service-providers/network-requester/src/core.rs index 5c4b7ca040..6dc0a7da00 100644 --- a/service-providers/network-requester/src/core.rs +++ b/service-providers/network-requester/src/core.rs @@ -13,8 +13,8 @@ use build_information::BinaryBuildInformation; use client_connections::LaneQueueLengths; use futures::channel::mpsc; use log::warn; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use proxy_helpers::connection_controller::{Controller, ControllerCommand, ControllerSender}; use proxy_helpers::proxy_runner::{MixProxyReader, MixProxySender}; use service_providers_common::interface::{ diff --git a/service-providers/network-requester/src/reply.rs b/service-providers/network-requester/src/reply.rs index a135c9b2e8..947951f06b 100644 --- a/service-providers/network-requester/src/reply.rs +++ b/service-providers/network-requester/src/reply.rs @@ -3,8 +3,8 @@ use client_connections::TransmissionLane; use nym_sdk::mixnet::InputMessage; -use nymsphinx::addressing::clients::Recipient; -use nymsphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_sphinx::addressing::clients::Recipient; +use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; use service_providers_common::interface::{ ControlRequest, ControlResponse, ProviderInterfaceVersion, RequestVersion, }; diff --git a/service-providers/network-requester/src/statistics/collector.rs b/service-providers/network-requester/src/statistics/collector.rs index 05f14932d1..989ddc5e46 100644 --- a/service-providers/network-requester/src/statistics/collector.rs +++ b/service-providers/network-requester/src/statistics/collector.rs @@ -6,7 +6,7 @@ use crate::core::new_legacy_request_version; use crate::reply::MixnetMessage; use async_trait::async_trait; use log::*; -use nymsphinx::addressing::clients::Recipient; +use nym_sphinx::addressing::clients::Recipient; use ordered_buffer::OrderedMessageSender; use proxy_helpers::proxy_runner::MixProxySender; use rand::RngCore;