pub struct Stream { /* private fields */ }Available on crate feature
stream only.Expand description
STREAM[key](plaintext)
The STREAM construction for online authenticated encryption, instantiated with ChaCha20-Poly1305 in 64KiB chunks, and a nonce structure of 11 bytes of big endian counter, and 1 byte of last block flag (0x00 / 0x01).
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn encrypt<W: Write>(key: PayloadKey, inner: W) -> StreamWriter<W> ⓘ
pub fn encrypt<W: Write>(key: PayloadKey, inner: W) -> StreamWriter<W> ⓘ
Wraps STREAM encryption under the given key around a writer.
key must never be repeated across multiple streams. In age this is
achieved by deriving the key with HKDF from both a random file key and a
random nonce.
Sourcepub fn decrypt<R: Read>(key: PayloadKey, inner: R) -> StreamReader<R> ⓘ
pub fn decrypt<R: Read>(key: PayloadKey, inner: R) -> StreamReader<R> ⓘ
Wraps STREAM decryption under the given key around a reader.
key must never be repeated across multiple streams. In age this is
achieved by deriving the key with HKDF from both a random file key and a
random nonce.
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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