pub struct ReplayWindow { /* private fields */ }Expand description
Sliding window for replay protection.
Tracks which packet counters have been received within a window of REPLAY_WINDOW_SIZE. Packets with counters below the window or already seen within the window are rejected.
Based on WireGuard’s anti-replay mechanism (RFC 6479 style).
Implementations§
Source§impl ReplayWindow
impl ReplayWindow
Sourcepub fn check(&self, counter: u64) -> bool
pub fn check(&self, counter: u64) -> bool
Check if a counter is valid (not replayed, not too old).
Returns true if the counter is acceptable, false if it should be rejected.
Does NOT update the window - call accept after successful decryption.
Trait Implementations§
Source§impl Clone for ReplayWindow
impl Clone for ReplayWindow
Source§fn clone(&self) -> ReplayWindow
fn clone(&self) -> ReplayWindow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplayWindow
impl Debug for ReplayWindow
Auto Trait Implementations§
impl Freeze for ReplayWindow
impl RefUnwindSafe for ReplayWindow
impl Send for ReplayWindow
impl Sync for ReplayWindow
impl Unpin for ReplayWindow
impl UnsafeUnpin for ReplayWindow
impl UnwindSafe for ReplayWindow
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more