Skip to content

Commit

Permalink
Update handshakestate.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dastansam authored and MathJud committed Oct 26, 2024
1 parent 1f9c642 commit 658f122
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions noise-protocol/src/handshakestate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ where
pub fn get_pattern(&self) -> &HandshakePattern {
&self.pattern
}

/// Get the message index of this [`HandshakeState`].
pub fn get_index(&self) -> usize {
self.message_index
}

/// Set the message index of this [`HandshakeState`] manually.
pub fn set_index(&mut self, index: usize) {
self.message_index = index;
}

/// Check whether it is our turn to send in the handshake state.
pub fn is_write_turn(&self) -> bool {
Expand Down

0 comments on commit 658f122

Please sign in to comment.