pub struct X<DH, H, RNG> where
H: Hash, { /* private fields */ }
Expand description
One-Way Handshake Noise X
Implementations
sourceimpl<DH, H, RNG> X<DH, H, RNG> where
RNG: RngCore + CryptoRng,
DH: Dh,
H: Hash,
impl<DH, H, RNG> X<DH, H, RNG> where
RNG: RngCore + CryptoRng,
DH: Dh,
H: Hash,
sourcepub fn send(
self,
s: &DH,
rs: &PublicKey,
payload: impl AsRef<[u8]>,
output: impl Write
) -> Result<(), HandshakeStateError>
pub fn send(
self,
s: &DH,
rs: &PublicKey,
payload: impl AsRef<[u8]>,
output: impl Write
) -> Result<(), HandshakeStateError>
establish a one-way handshake with an already known PublicIdentity
and send the given payload too.
This is not the strongest way to establish a channel with another
peer. However it is strong enough encryption scheme as long as the
peer’s PrivateIdentity
is not compromised. This is why we are not
allowing a TransportState to be built with this function.
This is an asymmetric encryption scheme. Once the message has been sent, we won’t be able to decode it back.
Auto Trait Implementations
impl<DH, H, RNG> RefUnwindSafe for X<DH, H, RNG> where
DH: RefUnwindSafe,
H: RefUnwindSafe,
RNG: RefUnwindSafe,
<H as Hash>::HASH: RefUnwindSafe,
impl<DH, H, RNG> Send for X<DH, H, RNG> where
DH: Send,
H: Send,
RNG: Send,
<H as Hash>::HASH: Send,
impl<DH, H, RNG> Sync for X<DH, H, RNG> where
DH: Sync,
H: Sync,
RNG: Sync,
<H as Hash>::HASH: Sync,
impl<DH, H, RNG> Unpin for X<DH, H, RNG> where
DH: Unpin,
H: Unpin,
RNG: Unpin,
<H as Hash>::HASH: Unpin,
impl<DH, H, RNG> UnwindSafe for X<DH, H, RNG> where
DH: UnwindSafe,
H: UnwindSafe,
RNG: UnwindSafe,
<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