Struct ring_compat::aead::ChaCha20Poly1305
source · pub struct ChaCha20Poly1305(/* private fields */);
Available on crate feature
aead
only.Expand description
ChaCha20Poly1305
Trait Implementations§
source§impl AeadCore for ChaCha20Poly1305
impl AeadCore for ChaCha20Poly1305
source§impl AeadInPlace for ChaCha20Poly1305
impl AeadInPlace for ChaCha20Poly1305
source§fn encrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
fn encrypt_in_place_detached( &self, nonce: &GenericArray<u8, Self::NonceSize>, associated_data: &[u8], buffer: &mut [u8] ) -> Result<Tag, Error>
Encrypt the data in-place, returning the authentication tag
source§fn decrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
fn decrypt_in_place( &self, nonce: &GenericArray<u8, Self::NonceSize>, associated_data: &[u8], buffer: &mut dyn 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(
&self,
_nonce: &GenericArray<u8, Self::NonceSize>,
_associated_data: &[u8],
_buffer: &mut [u8],
_tag: &Tag
) -> Result<(), Error>
fn decrypt_in_place_detached( &self, _nonce: &GenericArray<u8, Self::NonceSize>, _associated_data: &[u8], _buffer: &mut [u8], _tag: &Tag ) -> Result<(), Error>
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)
source§impl KeyInit for ChaCha20Poly1305
impl KeyInit for ChaCha20Poly1305
§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
Auto Trait Implementations§
impl RefUnwindSafe for ChaCha20Poly1305
impl Send for ChaCha20Poly1305
impl Sync for ChaCha20Poly1305
impl Unpin for ChaCha20Poly1305
impl UnwindSafe for ChaCha20Poly1305
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