pub struct ClearModeCrypto;Expand description
A no-op crypto provider for “clear mode” testing.
Per CCSDS 355.0-B-2, a clear-mode SA uses a no-op algorithm so the Security Header and Trailer are present but no actual crypto is performed. Useful for development and integration testing.
Trait Implementations§
Source§impl CryptoProvider for ClearModeCrypto
impl CryptoProvider for ClearModeCrypto
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 ClearModeCrypto
impl RefUnwindSafe for ClearModeCrypto
impl Send for ClearModeCrypto
impl Sync for ClearModeCrypto
impl Unpin for ClearModeCrypto
impl UnsafeUnpin for ClearModeCrypto
impl UnwindSafe for ClearModeCrypto
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