change to sphinx key initiator side

This commit is contained in:
Simon Wicky
2023-07-25 09:52:04 +02:00
parent 5d26fefaaa
commit c58331f9b0
4 changed files with 10 additions and 10 deletions
@@ -1,12 +1,12 @@
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// 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<NymNodeRoutingAddress, ConnectionSender>,
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(),
@@ -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,
},
+1 -1
View File
@@ -201,7 +201,7 @@ impl<St> Gateway<St> {
self.config.debug.maximum_connection_buffer_size,
self.config.debug.use_legacy_framed_packet_version,
topology_access,
&self.identity_keypair,
&self.sphinx_keypair,
shutdown,
);
+1 -1
View File
@@ -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,
);