pub struct StrobeNkTransport { /* private fields */ }Expand description
Stateful transport — automatically increments nonces on each send/recv.
Obtain via StrobeNkHybridInitiator::finish() / StrobeNkHybridResponder::respond()
or the PQC equivalents.
Implementations§
Source§impl StrobeNkTransport
impl StrobeNkTransport
Sourcepub fn send(
&mut self,
aad: impl AsRef<[u8]>,
plaintext: impl AsRef<[u8]>,
ciphertext: impl AsMut<[u8]>,
) -> Result<(), Error>
pub fn send( &mut self, aad: impl AsRef<[u8]>, plaintext: impl AsRef<[u8]>, ciphertext: impl AsMut<[u8]>, ) -> Result<(), Error>
Encrypts plaintext into ciphertext (ciphertext || tag).
ciphertext.len() must equal plaintext.len() + TAG_LEN.
tx_nonce advances before encryption to prevent nonce reuse on retry.
Sourcepub fn recv(
&mut self,
aad: impl AsRef<[u8]>,
ciphertext: impl AsRef<[u8]>,
plaintext: impl AsMut<[u8]>,
) -> Result<(), Error>
pub fn recv( &mut self, aad: impl AsRef<[u8]>, ciphertext: impl AsRef<[u8]>, plaintext: impl AsMut<[u8]>, ) -> Result<(), Error>
Decrypts ciphertext (ciphertext || tag) into plaintext.
plaintext.len() must equal ciphertext.len() - TAG_LEN.
rx_nonce advances before decryption to prevent nonce reuse on retry.
Sourcepub fn into_stateless(self) -> StrobeNkStatelessTransport
pub fn into_stateless(self) -> StrobeNkStatelessTransport
Convert to a stateless transport (caller manages nonces). Is Sync.
Auto Trait Implementations§
impl Freeze for StrobeNkTransport
impl RefUnwindSafe for StrobeNkTransport
impl Send for StrobeNkTransport
impl Sync for StrobeNkTransport
impl Unpin for StrobeNkTransport
impl UnsafeUnpin for StrobeNkTransport
impl UnwindSafe for StrobeNkTransport
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