pub struct SharedKeyHandshake { /* private fields */ }Expand description
Simple secure_key protect with hash Idea is we serialize HandshakeData to bytes with bincode then concat it with secure_key and a seed Then compare received hash for ensuring two nodes have same secure_key at_ts timestamp is used for avoiding relay attach, if it older than HANDSHAKE_TIMEOUT then we reject
Trait Implementations§
fn create_request(&self, from: PeerId, to: PeerId, now: u64) -> Vec<u8> ⓘ
fn verify_request( &self, data: Vec<u8>, expected_from: PeerId, expected_to: PeerId, now: u64, ) -> Result<(), String>
fn create_response(&self, from: PeerId, to: PeerId, now: u64) -> Vec<u8> ⓘ
fn verify_response( &self, data: Vec<u8>, expected_from: PeerId, expected_to: PeerId, now: u64, ) -> Result<(), String>
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more