Skip to content

Commit

Permalink
Fix Initiator doc ex clippy err
Browse files Browse the repository at this point in the history
  • Loading branch information
rrybarczyk committed Sep 12, 2024
1 parent eded298 commit dc3b6c0
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions protocols/v2/noise-sv2/src/initiator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,23 @@
//! use noise_sv2::Initiator;
//! use const_sv2::INITIATOR_EXPECTED_HANDSHAKE_MESSAGE_SIZE;
//!
//! fn main() {
//! // Optionally, provide the responder's public key
//! let responder_pub_key: Option<XOnlyPublicKey> = None;
//! // Optionally, provide the responder's public key
//! let responder_pub_key: Option<XOnlyPublicKey> = None;
//!
//! // Create a new Initiator instance
//! let mut initiator = Initiator::new(responder_pub_key);
//! // Create a new Initiator instance
//! let mut initiator = Initiator::new(responder_pub_key);
//!
//! // Perform the first step of the handshake
//! let encoded_key = initiator.step_0().unwrap();
//! println!("Encoded ephemeral key: {:?}", encoded_key);
//! // Perform the first step of the handshake
//! let encoded_key = initiator.step_0().unwrap();
//! println!("Encoded ephemeral key: {:?}", encoded_key);
//!
//! // Simulate receiving a handshake message from the responder
//! let responder_message = [0u8; INITIATOR_EXPECTED_HANDSHAKE_MESSAGE_SIZE]; // Example message
//! // Simulate receiving a handshake message from the responder
//! let responder_message = [0u8; INITIATOR_EXPECTED_HANDSHAKE_MESSAGE_SIZE]; // Example message
//!
//! // Process the responder's message and complete the handshake
//! let noise_codec = initiator.step_2(responder_message);
//! // Process the responder's message and complete the handshake
//! let noise_codec = initiator.step_2(responder_message);
//!
//! println!("Handshake complete, ready for secure communication.");
//! }
//! println!("Handshake complete, ready for secure communication.");
//! ```
//!
//! ## Secure Data Erasure
Expand Down

0 comments on commit dc3b6c0

Please sign in to comment.