Skip to content

Commit

Permalink
docs: remove redundant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vbhattaccmu committed Nov 22, 2023
1 parent 29ab72b commit 9238db6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion client/src/server/initiator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use crate::{
utilities::{id2pubkey, pubkey2id, sha256, sha256_hmac},
};

/// Initiator struct represents the paricipant initiating the cryptographic protocol.
#[derive(Debug)]
pub struct Initiator {
/// A `H256` value representing a nonce used for cryptographic operations.
Expand Down
13 changes: 0 additions & 13 deletions client/src/server/networking/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ use crate::{
/// Tokio codec for Initiator
#[derive(Debug)]
pub struct Codec {
/// An instance of an Initiator.
initiator: Initiator,
/// Current InitiatorState
state: InitiatorState,
}

/// Current Initiator state of a connection between initiator and recipient.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum InitiatorState {
Auth,
Expand All @@ -39,22 +36,19 @@ pub enum InitiatorState {
Body,
}

/// Raw ingress values for the Initiator handshake protocol
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum IngressInitiatorValue {
AuthReceive(RecipientId),
Ack,
Message(Bytes),
}

/// `Initiator` message stream over TCP exchanging raw bytes
#[derive(Debug)]
pub struct MessageStream<Io> {
pub stream: Framed<Io, Codec>,
pub remote_id: RecipientId,
}

/// Raw egress values for the Initiator handshake protocol
#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum EgressInitiatorValue {
Expand All @@ -76,10 +70,6 @@ impl Codec {
}
}

/// impl for Decoding of frames exchanged between initiator and recipient.
/// The state machine is responsible for decoding frames exchanged between
/// an initiator and a recipient. It processes the incoming datain a loop
/// and transitions between different states based on the current state of the handshake.
impl Decoder for Codec {
type Item = IngressInitiatorValue;
type Error = io::Error;
Expand Down Expand Up @@ -146,7 +136,6 @@ impl Decoder for Codec {
}
}

/// impl for helper objects to write out messages as bytes.
impl Encoder<EgressInitiatorValue> for Codec {
type Error = io::Error;

Expand Down Expand Up @@ -206,7 +195,6 @@ where
}
}

/// impl for Stream trait for MessageStream
impl<Io> Stream for MessageStream<Io>
where
Io: Transport,
Expand All @@ -228,7 +216,6 @@ where
}
}

/// impl for Sink trait for MessageStream
impl<Io> Sink<Bytes> for MessageStream<Io>
where
Io: Transport,
Expand Down
2 changes: 0 additions & 2 deletions client/src/server/networking/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ pub type HeaderDataBytes = GenericArray<u8, U16>;

#[derive(Debug)]
pub struct MAC {
/// Secret key used for encryption and integrity checking.
secret: H256,
/// Keccak256 hasher used for generating the MAC.
hasher: Keccak256,
}

Expand Down
2 changes: 0 additions & 2 deletions client/src/server/networking/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use tokio_stream::StreamExt;

use crate::{error::HandshakeError, server::networking::*, types::*, utilities::pubkey2id};

/// Peer defines a struct which keeps the message stream between
/// initiator and recipient live throughout the lifetime of the handshake.
#[allow(unused)]
#[derive(Debug)]
pub struct Peer<Io> {
Expand Down

0 comments on commit 9238db6

Please sign in to comment.