Skip to main content

ClearModeCrypto

Struct ClearModeCrypto 

Source
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

Source§

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>

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>

Compute a MAC for authentication-only mode. The iv is passed for algorithms that need it (e.g. GMAC).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.