[go: up one dir, main page]

Trait NewStream

Source
pub trait NewStream<A>: StreamPrimitive<A>
where A: AeadInPlace, A::NonceSize: Sub<Self::NonceOverhead>, NonceSize<A, Self>: ArrayLength<u8>,
{ // Required method fn from_aead(aead: A, nonce: &Nonce<A, Self>) -> Self; // Provided method fn new(key: &Key<A>, nonce: &Nonce<A, Self>) -> Self where A: KeyInit, Self: Sized { ... } }
Available on crate feature stream only.
Expand description

Create a new STREAM from the provided AEAD.

Required Methods§

Source

fn from_aead(aead: A, nonce: &Nonce<A, Self>) -> Self

Create a new STREAM from the given AEAD cipher.

Provided Methods§

Source

fn new(key: &Key<A>, nonce: &Nonce<A, Self>) -> Self
where A: KeyInit, Self: Sized,

Create a new STREAM with the given key and nonce.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A> NewStream<A> for StreamBE32<A>
where A: AeadInPlace, A::NonceSize: Sub<U5>, <<A as AeadCore>::NonceSize as Sub<U5>>::Output: ArrayLength<u8>,

Source§

impl<A> NewStream<A> for StreamLE31<A>
where A: AeadInPlace, A::NonceSize: Sub<U4>, <<A as AeadCore>::NonceSize as Sub<U4>>::Output: ArrayLength<u8>,