Struct X

Source
pub struct X<DH, H, RNG>
where H: Hash,
{ /* private fields */ }
Expand description

One-Way Handshake Noise X

Implementations§

Source§

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

Source

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

Source§

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

Source

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.

Source§

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

Source

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

receive a one-way handshake with an unknown

Auto Trait Implementations§

§

impl<DH, H, RNG> Freeze for X<DH, H, RNG>
where RNG: Freeze, <H as Hash>::HASH: Freeze, H: Freeze, DH: Freeze,

§

impl<DH, H, RNG> RefUnwindSafe for X<DH, H, RNG>

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V