Struct crypto_secretstream::Stream
source · pub struct Stream { /* private fields */ }
Expand description
AEAD for libsodium’s secretstream. Better to use PushStream
& PullStream
as these
take care of rekeying and computing the next nonce.
Implementations§
Trait Implementations§
source§impl AeadCore for Stream
impl AeadCore for Stream
§type NonceSize = <StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>> as IvSizeUser>::IvSize
type NonceSize = <StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>> as IvSizeUser>::IvSize
The length of a nonce.
§type CiphertextOverhead = <Poly1305 as BlockSizeUser>::BlockSize
type CiphertextOverhead = <Poly1305 as BlockSizeUser>::BlockSize
The upper bound amount of additional space required to support a
ciphertext vs. a plaintext.
source§impl AeadInPlace for Stream
impl AeadInPlace for Stream
source§fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag<Self>>
fn encrypt_in_place_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: &mut [u8] ) -> Result<Tag<Self>>
Encrypt the data in-place, returning the authentication tag
source§fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: &mut [u8],
mac: &Tag<Self>
) -> Result<()>
fn decrypt_in_place_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: &mut [u8], mac: &Tag<Self> ) -> Result<()>
Decrypt the message in-place, returning an error in the event the provided
authentication tag does not match the given ciphertext (i.e. ciphertext
is modified/unauthentic)
Auto Trait Implementations§
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
Blanket Implementations§
source§impl<Alg> Aead for Algwhere
Alg: AeadInPlace,
impl<Alg> Aead for Algwhere Alg: AeadInPlace,
source§impl<Alg> AeadMut for Algwhere
Alg: AeadMutInPlace,
impl<Alg> AeadMut for Algwhere Alg: AeadMutInPlace,
source§impl<Alg> AeadMutInPlace for Algwhere
Alg: AeadInPlace,
impl<Alg> AeadMutInPlace for Algwhere Alg: AeadInPlace,
source§fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn encrypt_in_place( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut impl Buffer ) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
source§fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
fn encrypt_in_place_detached( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8] ) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
source§fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn decrypt_in_place( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut impl Buffer ) -> Result<(), Error>
Decrypt the message in-place, returning an error in the event the
provided authentication tag does not match the given ciphertext. Read more
source§fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadCore>::TagSize>
) -> Result<(), Error>
fn decrypt_in_place_detached( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8], tag: &GenericArray<u8, <Alg as AeadCore>::TagSize> ) -> Result<(), Error>
Decrypt the data in-place, returning an error in the event the provided
authentication tag does not match the given ciphertext (i.e. ciphertext
is modified/unauthentic)
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