Struct cosmian_crypto_core::ChaCha20Poly1305
source · pub struct ChaCha20Poly1305(/* private fields */);
Implementations§
source§impl ChaCha20Poly1305
impl ChaCha20Poly1305
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 = 12usize
pub const NONCE_LENGTH: usize = 12usize
Use a 96-bit nonce.
Trait Implementations§
source§impl Debug for ChaCha20Poly1305
impl Debug for ChaCha20Poly1305
source§impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
source§impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
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<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
impl DemStream<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, ChaChaPoly1305<StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>>> for ChaCha20Poly1305
type Nonce = Nonce<{ Self::NONCE_LENGTH }>
source§fn into_aead_stream_backend(self) -> ChaCha20Poly1305Lib
fn into_aead_stream_backend(self) -> ChaCha20Poly1305Lib
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 ChaCha20Poly1305
impl Deref for ChaCha20Poly1305
source§impl Instantiable<{ Self::KEY_LENGTH }> for ChaCha20Poly1305
impl Instantiable<{ Self::KEY_LENGTH }> for ChaCha20Poly1305
Auto Trait Implementations§
impl Freeze for ChaCha20Poly1305
impl RefUnwindSafe for ChaCha20Poly1305
impl Send for ChaCha20Poly1305
impl Sync for ChaCha20Poly1305
impl Unpin for ChaCha20Poly1305
impl UnwindSafe for ChaCha20Poly1305
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