diff --git a/common/client-libs/mixnet-client/src/client.rs b/common/client-libs/mixnet-client/src/client.rs index bb3a645c82..720bf1ab9d 100644 --- a/common/client-libs/mixnet-client/src/client.rs +++ b/common/client-libs/mixnet-client/src/client.rs @@ -1,12 +1,12 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crate::client::identity::SECRET_KEY_LENGTH; +use crate::client::encryption::{PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE}; use futures::channel::mpsc; use futures::StreamExt; use log::*; use nym_client_core::client::topology_control::accessor::TopologyAccessor; -use nym_crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH}; +use nym_crypto::asymmetric::encryption; use nym_noise::upgrade_noise_initiator; use nym_sphinx::addressing::nodes::NymNodeRoutingAddress; use nym_sphinx::framing::codec::NymCodec; @@ -64,8 +64,8 @@ pub struct Client { conn_new: HashMap, config: Config, topology_access: TopologyAccessor, - public_id_key: [u8; PUBLIC_KEY_LENGTH], - private_id_key: [u8; SECRET_KEY_LENGTH], + public_id_key: [u8; PUBLIC_KEY_SIZE], + private_id_key: [u8; PRIVATE_KEY_SIZE], } struct ConnectionSender { @@ -86,7 +86,7 @@ impl Client { pub fn new( config: Config, topology_access: TopologyAccessor, - id_key: &identity::KeyPair, + id_key: &encryption::KeyPair, ) -> Client { Client { conn_new: HashMap::new(), diff --git a/common/client-libs/mixnet-client/src/forwarder.rs b/common/client-libs/mixnet-client/src/forwarder.rs index 7b3d48d17c..85c1f42a11 100644 --- a/common/client-libs/mixnet-client/src/forwarder.rs +++ b/common/client-libs/mixnet-client/src/forwarder.rs @@ -6,7 +6,7 @@ use futures::channel::mpsc; use futures::StreamExt; use log::*; use nym_client_core::client::topology_control::accessor::TopologyAccessor; -use nym_crypto::asymmetric::identity; +use nym_crypto::asymmetric::encryption; use nym_sphinx::forwarding::packet::MixPacket; use std::time::Duration; @@ -29,7 +29,7 @@ impl PacketForwarder { maximum_connection_buffer_size: usize, use_legacy_version: bool, topology_access: TopologyAccessor, - id_key: &identity::KeyPair, + sphinx_key: &encryption::KeyPair, shutdown: nym_task::TaskClient, ) -> (PacketForwarder, MixForwardingSender) { let client_config = Config::new( @@ -44,7 +44,7 @@ impl PacketForwarder { ( PacketForwarder { - mixnet_client: Client::new(client_config, topology_access, id_key), + mixnet_client: Client::new(client_config, topology_access, sphinx_key), packet_receiver, shutdown, }, diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index 24cb4ae3b5..e524411441 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -201,7 +201,7 @@ impl Gateway { self.config.debug.maximum_connection_buffer_size, self.config.debug.use_legacy_framed_packet_version, topology_access, - &self.identity_keypair, + &self.sphinx_keypair, shutdown, ); diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index 051c5cadff..7ffb9e5886 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -192,7 +192,7 @@ impl MixNode { ); let mut packet_forwarder = DelayForwarder::new( - nym_mixnet_client::Client::new(client_config, topology_access, &self.identity_keypair), + nym_mixnet_client::Client::new(client_config, topology_access, &self.sphinx_keypair), node_stats_update_sender, shutdown, );