Struct dryoc::dryocstream::DryocStream
source · pub struct DryocStream<Mode> { /* private fields */ }
Expand description
Secret-key authenticated encrypted streams
Implementations§
source§impl<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.
source§impl 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
.
source§impl 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§
source§impl<Mode: Clone> Clone for DryocStream<Mode>
impl<Mode: Clone> Clone for DryocStream<Mode>
source§fn clone(&self) -> DryocStream<Mode>
fn clone(&self) -> DryocStream<Mode>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Mode> Drop for DryocStream<Mode>
impl<Mode> Drop for DryocStream<Mode>
source§impl<Mode: PartialEq> PartialEq for DryocStream<Mode>
impl<Mode: PartialEq> PartialEq for DryocStream<Mode>
source§fn eq(&self, other: &DryocStream<Mode>) -> bool
fn eq(&self, other: &DryocStream<Mode>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Mode> Zeroize for DryocStream<Mode>
impl<Mode> Zeroize for DryocStream<Mode>
impl<Mode: Eq> Eq 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more