pub struct StatelessTransportState { /* private fields */ }
Expand description
A state machine encompassing the transport phase of a Noise session.
Implementations§
Source§impl StatelessTransportState
impl StatelessTransportState
Sourcepub fn write_message(&self, nonce: u64, pt: &mut [u8]) -> [u8; 16]
pub fn write_message(&self, nonce: u64, pt: &mut [u8]) -> [u8; 16]
Encrypts and authenticates a message using it’s sequence number.
To avoid messages being replayed, the caller must ensure that the nonce is never reused, and that the outgoing channel is rekeyed if the nonce equals u64::MAX.
Sourcepub fn read_message(
&self,
nonce: u64,
ct: &mut [u8],
tag: [u8; 16],
) -> Result<(), ReadError>
pub fn read_message( &self, nonce: u64, ct: &mut [u8], tag: [u8; 16], ) -> Result<(), ReadError>
Decrypts and authenticates a message using it’s sequence number.
To avoid messages being replayed, the caller must ensure that the nonce is never reused, and that the incoming channel is rekeyed if the nonce equals u64::MAX.
Sourcepub fn rekey_incoming(&mut self)
pub fn rekey_incoming(&mut self)
Rekeys the incoming channel.
Sourcepub fn rekey_outgoing(&mut self)
pub fn rekey_outgoing(&mut self)
Rekeys the outgoing channel.
Auto Trait Implementations§
impl Freeze for StatelessTransportState
impl RefUnwindSafe for StatelessTransportState
impl Send for StatelessTransportState
impl Sync for StatelessTransportState
impl Unpin for StatelessTransportState
impl UnwindSafe for StatelessTransportState
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