pub struct AesGcmCrypto { /* private fields */ }Expand description
AES-GCM authenticated encryption provider.
Supports 128-bit and 256-bit keys with 12-byte nonces per CCSDS 355.0-B-2 Table 6-1. The GCM tag (16 bytes) is used as the MAC in the SDLS Security Trailer.
Implementations§
Trait Implementations§
Source§impl CryptoProvider for AesGcmCrypto
impl CryptoProvider for AesGcmCrypto
Source§fn encrypt(
&self,
_sa: &SecurityAssociation,
iv: &[u8],
aad: &[u8],
data: &mut [u8],
tag_out: &mut [u8],
) -> Result<usize, Error>
fn encrypt( &self, _sa: &SecurityAssociation, iv: &[u8], aad: &[u8], data: &mut [u8], tag_out: &mut [u8], ) -> Result<usize, Error>
Encrypt data in place (AEAD).
aad is additional
authenticated data (frame headers). The authentication
tag is written to tag_out. Returns padding byte count
(0 for GCM/CTR).Source§fn decrypt(
&self,
_sa: &SecurityAssociation,
iv: &[u8],
aad: &[u8],
data: &mut [u8],
tag: &[u8],
) -> Result<usize, Error>
fn decrypt( &self, _sa: &SecurityAssociation, iv: &[u8], aad: &[u8], data: &mut [u8], tag: &[u8], ) -> Result<usize, Error>
Decrypt data in place (AEAD). Verifies the authentication
tag against
aad and ciphertext. Returns padding byte
count.Source§fn compute_mac(
&self,
_sa: &SecurityAssociation,
_iv: &[u8],
_payload: &[u8],
_mac_out: &mut [u8],
) -> Result<(), Error>
fn compute_mac( &self, _sa: &SecurityAssociation, _iv: &[u8], _payload: &[u8], _mac_out: &mut [u8], ) -> Result<(), Error>
Compute a MAC for authentication-only mode. The
iv is
passed for algorithms that need it (e.g. GMAC).Auto Trait Implementations§
impl Freeze for AesGcmCrypto
impl RefUnwindSafe for AesGcmCrypto
impl Send for AesGcmCrypto
impl Sync for AesGcmCrypto
impl Unpin for AesGcmCrypto
impl UnsafeUnpin for AesGcmCrypto
impl UnwindSafe for AesGcmCrypto
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