pub struct XChachaPoly;Expand description
An implementation of XChaChaPoly
Implementations§
Source§impl XChachaPoly
impl XChachaPoly
Sourcepub fn cipher() -> Box<dyn Cipher>
pub fn cipher() -> Box<dyn Cipher>
Creates a Cipher instance with XChachaPolyIetf as underlying cipher
Sourcepub fn aead_cipher() -> Box<dyn AeadCipher>
pub fn aead_cipher() -> Box<dyn AeadCipher>
Creates a AeadCipher instance with XChachaPolyIetf as underlying AEAD cipher
Trait Implementations§
Source§impl AeadCipher for XChachaPoly
impl AeadCipher for XChachaPoly
Source§fn seal(
&self,
buf: &mut [u8],
plaintext_len: usize,
ad: &[u8],
key: &[u8],
nonce: &[u8],
) -> Result<usize, Box<dyn Error + 'static>>
fn seal( &self, buf: &mut [u8], plaintext_len: usize, ad: &[u8], key: &[u8], nonce: &[u8], ) -> Result<usize, Box<dyn Error + 'static>>
AEAD-seals
plaintext_len bytes in-place in buf together with ad using key and
nonce and returns the ciphertext lengthSource§fn seal_to(
&self,
buf: &mut [u8],
plaintext: &[u8],
ad: &[u8],
key: &[u8],
nonce: &[u8],
) -> Result<usize, Box<dyn Error + 'static>>
fn seal_to( &self, buf: &mut [u8], plaintext: &[u8], ad: &[u8], key: &[u8], nonce: &[u8], ) -> Result<usize, Box<dyn Error + 'static>>
AEAD-seals
plaintext into buf together with ad using key and nonce and returns the
ciphertext lengthSource§impl Cipher for XChachaPoly
impl Cipher for XChachaPoly
Source§fn info(&self) -> CipherInfo
fn info(&self) -> CipherInfo
Returns information about the cipher
Source§fn encrypted_len_max(&self, plaintext_len: usize) -> usize
fn encrypted_len_max(&self, plaintext_len: usize) -> usize
Predicts the maximum encrypted length for
plaintext_len bytesSource§fn encrypt(
&self,
buf: &mut [u8],
plaintext_len: usize,
key: &[u8],
nonce: &[u8],
) -> Result<usize, Box<dyn Error + 'static>>
fn encrypt( &self, buf: &mut [u8], plaintext_len: usize, key: &[u8], nonce: &[u8], ) -> Result<usize, Box<dyn Error + 'static>>
Encrypts
plaintext_len bytes in-place in buf using key and nonce and returns the
ciphertext lengthSource§fn encrypt_to(
&self,
buf: &mut [u8],
plaintext: &[u8],
key: &[u8],
nonce: &[u8],
) -> Result<usize, Box<dyn Error + 'static>>
fn encrypt_to( &self, buf: &mut [u8], plaintext: &[u8], key: &[u8], nonce: &[u8], ) -> Result<usize, Box<dyn Error + 'static>>
Encrypts
plaintext into buf using key and nonce and returns the ciphertext lengthAuto Trait Implementations§
impl Freeze for XChachaPoly
impl RefUnwindSafe for XChachaPoly
impl Send for XChachaPoly
impl Sync for XChachaPoly
impl Unpin for XChachaPoly
impl UnwindSafe for XChachaPoly
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