pub struct HeaderProtector { /* private fields */ }Available on crate feature
std only.Expand description
Per-direction, session-stable header-protection keys plus the negotiated cipher suite (which selects AES-256-ECB vs ChaCha20 for the mask). Derived once from the initial session secret and held for the session’s lifetime; see the module docs for why this does not rotate with the AEAD epoch.
Implementations§
Source§impl HeaderProtector
impl HeaderProtector
Sourcepub fn derive(suite: CipherSuite, initial_secret: &[u8; 32], swap: bool) -> Self
pub fn derive(suite: CipherSuite, initial_secret: &[u8; 32], swap: bool) -> Self
Derive the per-direction HP keys from the initial session secret. swap
(= the session’s is_server flag) swaps send/recv so one peer’s send
key equals the other peer’s recv key — mirroring the AEAD key layout in
CryptoSession::build.
Sourcepub fn cipher_suite(&self) -> CipherSuite
pub fn cipher_suite(&self) -> CipherSuite
The negotiated cipher suite (drives the mask primitive). Exposed for diagnostics / tests.
Trait Implementations§
Source§impl Drop for HeaderProtector
impl Drop for HeaderProtector
Auto Trait Implementations§
impl Freeze for HeaderProtector
impl RefUnwindSafe for HeaderProtector
impl Send for HeaderProtector
impl Sync for HeaderProtector
impl Unpin for HeaderProtector
impl UnsafeUnpin for HeaderProtector
impl UnwindSafe for HeaderProtector
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