Struct cosmian_crypto_core::Aes128Gcm
source · pub struct Aes128Gcm(/* private fields */);
Expand description
Structure implementing SymmetricCrypto
and the DEM
interfaces based on
AES 128 GCM.
Implementations§
source§impl Aes128Gcm
impl Aes128Gcm
sourcepub const KEY_LENGTH: usize = 16usize
pub const KEY_LENGTH: usize = 16usize
Use a 128-bit AES key.
sourcepub const MAC_LENGTH: usize = 16usize
pub const MAC_LENGTH: usize = 16usize
Use a 128-bit MAC tag.
sourcepub const MAX_PLAINTEXT_LENGTH: u64 = 68_719_476_704u64
pub const MAX_PLAINTEXT_LENGTH: u64 = 68_719_476_704u64
Plaintext size (in bytes) restriction from the NIST https://csrc.nist.gov/publications/detail/sp/800-38d/final
sourcepub const NONCE_LENGTH: usize = 12usize
pub const NONCE_LENGTH: usize = 12usize
Use a 96-bit nonce.
Trait Implementations§
source§impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
impl Dem<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
source§impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
impl DemInPlace<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
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 }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
impl DemStream<{ Self::KEY_LENGTH }, { Self::NONCE_LENGTH }, { Self::MAC_LENGTH }, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for Aes128Gcm
type Nonce = Nonce<{ Self::NONCE_LENGTH }>
source§fn into_aead_stream_backend(self) -> Aes128GcmLib
fn into_aead_stream_backend(self) -> Aes128GcmLib
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>
Auto Trait Implementations§
impl Freeze for Aes128Gcm
impl RefUnwindSafe for Aes128Gcm
impl Send for Aes128Gcm
impl Sync for Aes128Gcm
impl Unpin for Aes128Gcm
impl UnwindSafe for Aes128Gcm
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