Struct ReplayWindow
pub struct ReplayWindow {
pub last_accepted: u32,
pub last_accepted_time_ms: u64,
pub backward_bitmap: u8,
pub recent_mics: Deque<RecentMic, umsh_crypto::::replay::ReplayWindow::{constant#0}>,
}Expand description
Replay-detection window for secure traffic from one sender.
Fields§
§last_accepted: u32Highest accepted frame counter.
last_accepted_time_ms: u64Timestamp of the highest accepted frame.
backward_bitmap: u8Occupancy bitmap for the backward counter window.
recent_mics: Deque<RecentMic, umsh_crypto::::replay::ReplayWindow::{constant#0}>Accepted MICs retained for duplicate late-arrival checks.
Implementations§
§impl ReplayWindow
impl ReplayWindow
pub fn new() -> ReplayWindow
pub fn new() -> ReplayWindow
Create a fresh replay window.
pub fn check(&self, counter: u32, mic: &[u8], now_ms: u64) -> ReplayVerdict
pub fn check(&self, counter: u32, mic: &[u8], now_ms: u64) -> ReplayVerdict
Evaluate whether counter and mic are acceptable at now_ms.
pub fn is_acknowledgeable_duplicate(
&self,
counter: u32,
mic: &[u8],
now_ms: u64,
) -> bool
pub fn is_acknowledgeable_duplicate( &self, counter: u32, mic: &[u8], now_ms: u64, ) -> bool
Return whether this is an exact, recently accepted packet eligible for an idempotent duplicate acknowledgement.
This deliberately requires both the bounded counter distance and a matching retained MIC. Merely reusing an occupied counter does not prove that the receiver previously accepted this logical packet.
Trait Implementations§
§impl Clone for ReplayWindow
impl Clone for ReplayWindow
§fn clone(&self) -> ReplayWindow
fn clone(&self) -> ReplayWindow
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ReplayWindow
impl Debug for ReplayWindow
§impl Default for ReplayWindow
impl Default for ReplayWindow
§fn default() -> ReplayWindow
fn default() -> ReplayWindow
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReplayWindow
impl RefUnwindSafe for ReplayWindow
impl Send for ReplayWindow
impl Sync for ReplayWindow
impl Unpin for ReplayWindow
impl UnwindSafe for ReplayWindow
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)