pub struct ChaCha20Poly1305Cipher { /* private fields */ }
Expand description
Implementation of ChaCha20-Poly1305 with enhanced type safety
Trait Implementations§
Source§impl AeadCipher for ChaCha20Poly1305Cipher
impl AeadCipher for ChaCha20Poly1305Cipher
Source§type Algorithm = ChaCha20Poly1305Algorithm
type Algorithm = ChaCha20Poly1305Algorithm
The algorithm this cipher implements
Source§type Key = SecretBytes<32>
type Key = SecretBytes<32>
Key type with appropriate size guarantee
Source§fn encrypt(&self) -> impl AeadEncryptOperation<'_, Self::Algorithm>
fn encrypt(&self) -> impl AeadEncryptOperation<'_, Self::Algorithm>
Begin encryption operation with operation pattern
Source§fn decrypt(&self) -> impl AeadDecryptOperation<'_, Self::Algorithm>
fn decrypt(&self) -> impl AeadDecryptOperation<'_, Self::Algorithm>
Begin decryption operation with operation pattern
Source§fn generate_key<R: RngCore + CryptoRng>(rng: &mut R) -> Result<Self::Key>
fn generate_key<R: RngCore + CryptoRng>(rng: &mut R) -> Result<Self::Key>
Generate a random key
Auto Trait Implementations§
impl Freeze for ChaCha20Poly1305Cipher
impl RefUnwindSafe for ChaCha20Poly1305Cipher
impl Send for ChaCha20Poly1305Cipher
impl Sync for ChaCha20Poly1305Cipher
impl Unpin for ChaCha20Poly1305Cipher
impl UnwindSafe for ChaCha20Poly1305Cipher
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