spacedls 0.4.0

no_std CCSDS 355.0-B-2 (SDLS) Space Data Link Security implementation
Documentation
mod auth;
mod authenc;
mod enc;
mod error;
mod format;
mod key;
mod mac;
mod param;
mod sa;
mod sequence_number;
mod spec;

pub(crate) mod sealed {
    pub trait Sealed {}
}

pub use auth::{AsAuth, AuthProvider};
pub use authenc::{AsAuthEnc, AuthEncProvider};
pub use enc::{AsEnc, EncProvider};
pub use error::{GenericDecryptError, GenericEncryptError, SaOperationError};
pub use format::{
    SDLSFrameFormat, SecurityHeader, SecurityTrailer, ValidIVLen, ValidMacLen, ValidPLLen,
    ValidSNLen,
};
pub use key::{
    BIT128, BIT192, BIT256, BIT384, BIT512, BIT1024, BIT2048, BIT4096, ConstKey, EmptyKey, Key,
};
pub use mac::{Mac, VerifyMacResult};
use param::WithKeySize;
pub use param::{AuthEncParams, AuthParams, EncParams};
pub use sa::SecurityAssociation;
pub use sequence_number::{ReplayInfo, SequenceNumber};
pub use spec::{AuthEncSpec, AuthSpec, EncSpec};
seq_macro::seq!(N in 0..=64 {
    #(pub use format::BYTE~N;)*
});

/// Sealed trait unifying all service providers. Cannot be implemented outside this crate.
pub trait ServiceProviderGeneric: sealed::Sealed {
    type Param: WithKeySize;
    const KIND: ServiceKind;
}

#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
/// Identifies the SDLS service kind at runtime (CCSDS 355.0-B-2 Section 2.3.1.3).
pub enum ServiceKind {
    Enc,
    Auth,
    AuthEnc,
}