osdp/secure/mod.rs
1//! Secure Channel — Annex D.
2//!
3//! # Spec: Annex D
4//!
5//! Three layers:
6//!
7//! 1. [`crypto`] — primitives: AES-128, key derivation, cryptograms.
8//! 2. [`mac`] — CBC-MAC with the S-MAC1/S-MAC2 swap on the final block.
9//! 3. [`session`] — type-state machine wrapping the above into a usable API.
10//!
11//! Padding is described in [`pad`].
12
13pub mod cipher;
14pub mod crypto;
15pub mod frame;
16pub mod mac;
17pub mod pad;
18pub mod session;
19
20pub use frame::{Direction, seal, unseal};
21pub use session::{Challenged, Cryptogrammed, Disconnected, Secure, Session};
22
23/// Default install key (`SCBK-D`): bytes `0x30..=0x3F`.
24///
25/// # Spec: Annex D.8
26pub const SCBK_D: [u8; 16] = [
27 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
28];