Struct cosmian_crypto_core::XChaCha20Poly1305
source · pub struct XChaCha20Poly1305(/* private fields */);
Implementations§
source§impl XChaCha20Poly1305
impl XChaCha20Poly1305
sourcepub const KEY_LENGTH: usize = 32usize
pub const KEY_LENGTH: usize = 32usize
Use a 256-bit key.
sourcepub const MAC_LENGTH: usize = 16usize
pub const MAC_LENGTH: usize = 16usize
Use a 128-bit MAC tag.
sourcepub const NONCE_LENGTH: usize = 24usize
pub const NONCE_LENGTH: usize = 24usize
Use a 192-bit nonce.
Trait Implementations§
source§impl Debug for XChaCha20Poly1305
impl Debug for XChaCha20Poly1305
source§impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
source§impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
type Nonce = Nonce<{ Self::NONCE_LENGTH }>
source§fn encrypt_in_place_detached(
&self,
nonce: &Self::Nonce,
plaintext: &mut [u8],
aad: Option<&[u8]>,
) -> Result<Vec<u8>, CryptoCoreError>
fn encrypt_in_place_detached( &self, nonce: &Self::Nonce, plaintext: &mut [u8], aad: Option<&[u8]>, ) -> Result<Vec<u8>, CryptoCoreError>
Encrypts a message in place using a secret key and a public nonce in
detached mode: the tag authenticating both the confidential
message and non-confidential data, are returned separately Read more
source§impl DemStream<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
impl DemStream<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for XChaCha20Poly1305
type Nonce = Nonce<{ Self::NONCE_LENGTH }>
source§fn into_aead_stream_backend(self) -> XChaCha20Poly1305Lib
fn into_aead_stream_backend(self) -> XChaCha20Poly1305Lib
Returns the
RustCrypto
Aead in place backend algorithm with stream
capabilitiesfn into_stream_encryptor_be32( self, nonce: &Self::Nonce, ) -> EncryptorBE32<RustCryptoBackend>
fn into_stream_decryptor_be32( self, nonce: &Self::Nonce, ) -> DecryptorBE32<RustCryptoBackend>
fn into_stream_encryptor_le31( self, nonce: &Self::Nonce, ) -> EncryptorLE31<RustCryptoBackend>
fn into_stream_decryptor_le31( self, nonce: &Self::Nonce, ) -> DecryptorLE31<RustCryptoBackend>
source§impl Deref for XChaCha20Poly1305
impl Deref for XChaCha20Poly1305
source§impl Instantiable<{ Self::KEY_LENGTH }> for XChaCha20Poly1305
impl Instantiable<{ Self::KEY_LENGTH }> for XChaCha20Poly1305
Auto Trait Implementations§
impl Freeze for XChaCha20Poly1305
impl RefUnwindSafe for XChaCha20Poly1305
impl Send for XChaCha20Poly1305
impl Sync for XChaCha20Poly1305
impl Unpin for XChaCha20Poly1305
impl UnwindSafe for XChaCha20Poly1305
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