Struct keynesis::noise::X[][src]

pub struct X<DH, H, RNG> where
    H: Hash
{ /* fields omitted */ }

One-Way Handshake Noise X

Implementations

impl<DH, H, RNG> X<DH, H, RNG> where
    DH: Dh,
    H: Hash
[src]

pub fn new(rng: RNG, prologue: &[u8]) -> Self[src]

impl<DH, H, RNG> X<DH, H, RNG> where
    RNG: RngCore + CryptoRng,
    DH: Dh,
    H: Hash
[src]

pub fn send(
    self,
    s: &DH,
    rs: &PublicKey,
    payload: impl AsRef<[u8]>,
    mut output: impl Write
) -> Result<(), HandshakeStateError>
[src]

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.

impl<DH, H, RNG> X<DH, H, RNG> where
    DH: Dh,
    H: Hash
[src]

pub fn receive(
    self,
    s: &DH,
    input: &[u8]
) -> Result<(PublicKey, Box<[u8]>), HandshakeStateError>
[src]

receive a one-way handshake with an unknown

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
[src]

impl<DH, H, RNG> Send for X<DH, H, RNG> where
    DH: Send,
    H: Send,
    RNG: Send,
    <H as Hash>::HASH: Send
[src]

impl<DH, H, RNG> Sync for X<DH, H, RNG> where
    DH: Sync,
    H: Sync,
    RNG: Sync,
    <H as Hash>::HASH: Sync
[src]

impl<DH, H, RNG> Unpin for X<DH, H, RNG> where
    DH: Unpin,
    H: Unpin,
    RNG: Unpin,
    <H as Hash>::HASH: Unpin
[src]

impl<DH, H, RNG> UnwindSafe for X<DH, H, RNG> where
    DH: UnwindSafe,
    H: UnwindSafe,
    RNG: UnwindSafe,
    <H as Hash>::HASH: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,