Struct keynesis::noise::TransportReceiveHalf
source · [−]pub struct TransportReceiveHalf<H> where
H: Hash, { /* private fields */ }
Implementations
sourceimpl<H> TransportReceiveHalf<H> where
H: Hash,
impl<H> TransportReceiveHalf<H> where
H: Hash,
sourcepub fn noise_session(&self) -> &<H as Hash>::HASH
pub fn noise_session(&self) -> &<H as Hash>::HASH
unique identifier of the noise session
sourcepub fn remote_public_identity(&self) -> &PublicKey
pub fn remote_public_identity(&self) -> &PublicKey
get the remote’s public identity
sourcepub fn count_received(&self) -> u64
pub fn count_received(&self) -> u64
get the number of message received from the remote peer
this function will be a little tainted by the handshake state it also account for the number of times either encrypt or decrypt has been used during the handshake. This is because during the handshake the exchange is symmetrical while in the transport era the exchanges are asymmetrical.
sourcepub fn receive(
&mut self,
input: impl AsRef<[u8]>,
output: &mut [u8]
) -> Result<(), CipherStateError>
pub fn receive(
&mut self,
input: impl AsRef<[u8]>,
output: &mut [u8]
) -> Result<(), CipherStateError>
receive message from the remote peer
The output can have 16 bytes less than the input. This is because the MAC is appended in the input message so we can verify the message has not been tempered with.
Auto Trait Implementations
impl<H> RefUnwindSafe for TransportReceiveHalf<H> where
<H as Hash>::HASH: RefUnwindSafe,
impl<H> Send for TransportReceiveHalf<H> where
<H as Hash>::HASH: Send,
impl<H> Sync for TransportReceiveHalf<H> where
<H as Hash>::HASH: Sync,
impl<H> Unpin for TransportReceiveHalf<H> where
<H as Hash>::HASH: Unpin,
impl<H> UnwindSafe for TransportReceiveHalf<H> where
<H as Hash>::HASH: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more