diff --git a/Cargo.lock b/Cargo.lock index 92dd1ced9ae..86b5abd8825 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3047,7 +3047,6 @@ dependencies = [ "dotenv", "futures", "gateway-client", - "gateway-requests", "getset", "hex", "humantime-serde", diff --git a/gateway/gateway-requests/src/registration/handshake/mod.rs b/gateway/gateway-requests/src/registration/handshake/mod.rs index abcebf946e2..64d56f21294 100644 --- a/gateway/gateway-requests/src/registration/handshake/mod.rs +++ b/gateway/gateway-requests/src/registration/handshake/mod.rs @@ -3,6 +3,7 @@ use self::client::ClientHandshake; use self::error::HandshakeError; +#[cfg(not(target_arch = "wasm32"))] use self::gateway::GatewayHandshake; pub use self::shared_key::{SharedKeySize, SharedKeys}; use crypto::asymmetric::identity; @@ -14,6 +15,7 @@ pub(crate) type WsItem = Result; mod client; pub mod error; +#[cfg(not(target_arch = "wasm32"))] mod gateway; pub mod shared_key; mod state; @@ -36,6 +38,7 @@ where ClientHandshake::new(rng, ws_stream, identity, gateway_pubkey, coconut_credential).await } +#[cfg(not(target_arch = "wasm32"))] pub async fn gateway_handshake<'a, S>( rng: &mut (impl RngCore + CryptoRng), ws_stream: &'a mut S, diff --git a/gateway/gateway-requests/src/registration/handshake/state.rs b/gateway/gateway-requests/src/registration/handshake/state.rs index b3a347006f0..805c1b4eb2c 100644 --- a/gateway/gateway-requests/src/registration/handshake/state.rs +++ b/gateway/gateway-requests/src/registration/handshake/state.rs @@ -40,14 +40,17 @@ impl InitMessage { } } + #[cfg(not(target_arch = "wasm32"))] pub fn local_id_pubkey(&self) -> identity::PublicKey { identity::PublicKey::from_bytes(&self.local_id_pubkey).unwrap() } + #[cfg(not(target_arch = "wasm32"))] pub fn ephemeral_key(&self) -> encryption::PublicKey { encryption::PublicKey::from_bytes(&self.ephemeral_key).unwrap() } + #[cfg(not(target_arch = "wasm32"))] pub fn credential(&self) -> Credential { self.credential.clone().unwrap() } @@ -107,6 +110,7 @@ impl<'a, S> State<'a, S> { } } + #[cfg(not(target_arch = "wasm32"))] pub(crate) fn local_ephemeral_key(&self) -> &encryption::PublicKey { self.ephemeral_keypair.public_key() } @@ -124,6 +128,7 @@ impl<'a, S> State<'a, S> { } // this will need to be adjusted when REMOTE_ID_PUBKEY is removed + #[cfg(not(target_arch = "wasm32"))] pub(crate) fn parse_init_message(init_message: Vec) -> Result { match InitMessage::try_from(init_message.as_slice()) { Ok(init_message) => Ok(init_message), @@ -225,6 +230,7 @@ impl<'a, S> State<'a, S> { .map_err(|_| HandshakeError::InvalidSignature) } + #[cfg(not(target_arch = "wasm32"))] pub(crate) fn update_remote_identity(&mut self, remote_pubkey: identity::PublicKey) { self.remote_pubkey = Some(remote_pubkey) } diff --git a/validator-api/Cargo.toml b/validator-api/Cargo.toml index 83315061275..a19d46d2e16 100644 --- a/validator-api/Cargo.toml +++ b/validator-api/Cargo.toml @@ -47,7 +47,6 @@ coconut-rs = { git = "https://github.com/nymtech/coconut.git", branch = "0.4.0" config = { path = "../common/config" } crypto = { path = "../common/crypto" } gateway-client = { path = "../common/client-libs/gateway-client" } -gateway-requests = { path = "../gateway/gateway-requests" } mixnet-contract = { path = "../common/mixnet-contract" } nymsphinx = { path = "../common/nymsphinx" } topology = { path = "../common/topology" }