Struct dryoc::dryocstream::DryocStream
source · pub struct DryocStream<Mode> { /* private fields */ }
Expand description
Secret-key authenticated encrypted streams
Implementations
sourceimpl<M> DryocStream<M>
impl<M> DryocStream<M>
sourcepub fn rekey(&mut self)
pub fn rekey(&mut self)
Manually rekeys the stream. Both the push and pull sides of the stream need to manually rekey if you use this function (i.e., it’s not handled by the library).
Automatic rekeying will occur normally, and you generally shouldn’t need to manually rekey.
Refer to the libsodium docs for details.
sourceimpl DryocStream<Push>
impl DryocStream<Push>
sourcepub fn init_push<Key: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES>, Header: NewByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES>>(
key: &Key
) -> (Self, Header)
pub fn init_push<Key: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES>, Header: NewByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES>>(
key: &Key
) -> (Self, Header)
Returns a new push stream, initialized from key
.
sourceimpl DryocStream<Pull>
impl DryocStream<Pull>
sourcepub fn init_pull<Key: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES>, Header: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES>>(
key: &Key,
header: &Header
) -> Self
pub fn init_pull<Key: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES>, Header: ByteArray<CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES>>(
key: &Key,
header: &Header
) -> Self
Returns a new pull stream, initialized from key
and header
.
Trait Implementations
sourceimpl<Mode: Clone> Clone for DryocStream<Mode>
impl<Mode: Clone> Clone for DryocStream<Mode>
sourcefn clone(&self) -> DryocStream<Mode>
fn clone(&self) -> DryocStream<Mode>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<Mode> Drop for DryocStream<Mode>
impl<Mode> Drop for DryocStream<Mode>
sourceimpl<Mode: PartialEq> PartialEq<DryocStream<Mode>> for DryocStream<Mode>
impl<Mode: PartialEq> PartialEq<DryocStream<Mode>> for DryocStream<Mode>
sourcefn eq(&self, other: &DryocStream<Mode>) -> bool
fn eq(&self, other: &DryocStream<Mode>) -> bool
sourceimpl<Mode> Zeroize for DryocStream<Mode>where
PhantomData<Mode>: Zeroize,
Mode: Zeroize,
impl<Mode> Zeroize for DryocStream<Mode>where
PhantomData<Mode>: Zeroize,
Mode: Zeroize,
impl<Mode: Eq> Eq for DryocStream<Mode>
impl<Mode> StructuralEq for DryocStream<Mode>
impl<Mode> StructuralPartialEq for DryocStream<Mode>
Auto Trait Implementations
impl<Mode> RefUnwindSafe for DryocStream<Mode>where
Mode: RefUnwindSafe,
impl<Mode> Send for DryocStream<Mode>where
Mode: Send,
impl<Mode> Sync for DryocStream<Mode>where
Mode: Sync,
impl<Mode> Unpin for DryocStream<Mode>where
Mode: Unpin,
impl<Mode> UnwindSafe for DryocStream<Mode>where
Mode: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more