1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 ZeroDDS Contributors
//! Crate `zerodds-security-rtps`. Safety classification: **SAFE** (reiner Wire-Format-Adapter; die eigentliche Crypto delegiert an ein [`CryptographicPlugin`]).
//!
//! Secure-Submessage-Wrapper (OMG DDS-Security 1.1 §7.3.6) +
//! RTPS-Header-AAD-Codec (§9.5).
//!
//! ## Schichten-Position
//!
//! Layer 4 — Core Services. Konsumiert `zerodds-security` (SPI) +
//! `zerodds-rtps` (RTPS-Submessage-Layout). Wird vom DCPS-Runtime via
//! `Box<dyn CryptographicPlugin>` und dem Inbound/Outbound-Datapath
//! genutzt.
//!
//! ## Public API (Stand 1.0.0-rc.1)
//!
//! Nimmt eine oder mehrere plain-RTPS-Submessages (als opaque Bytes)
//! und wrapped sie in:
//!
//! ```text
//! SEC_PREFIX | SEC_BODY (ciphertext) | SEC_POSTFIX
//! ```
//!
//! Auf Empfaenger-Seite macht `decode_secured_submessage` den Schritt
//! rueckwaerts: SEC_BODY extrahieren, durch den Crypto-Plugin schicken,
//! plaintext zurueckgeben.
//!
//! - Submessage-IDs + -Flags gemaess Spec §7.3.6.
//! - `encode_secured_submessage` + `decode_secured_submessage` mit
//! `&mut dyn CryptographicPlugin`-Callback — damit AES-GCM, HMAC,
//! oder zukuenftige Backends austauschbar sind.
//! - SRTPS-Wrap (§9.5 RTPS-Message-Protection): `SRTPS_PREFIX` + `SRTPS_POSTFIX`-Codec.
//! - Receiver-Specific-MAC-Liste im POSTFIX (`MAX_RECEIVER_MACS`): pro
//! Remote-Reader ein 16-byte MAC; Single-Receiver-Pfade lassen die
//! Liste leer (Spec §7.3.6.3 erlaubt das).
//! - Little-Endian-Submessage-Header (`0x01` flag).
//!
//! ## Nicht-Ziele
//!
//! - Big-Endian-Submessage-Header — Spec erlaubt beide; alle Vendoren
//! nutzen LE per Default. Re-Add additiv bei Major-2.0.
extern crate alloc;
pub use ;
pub use ;
pub use ;