pub trait NonceCache: Send + Sync {
// Required method
fn check_and_insert(&self, nonce: &[u8; 16]) -> bool;
}Expand description
Replay protection cache interface.
Implementations should maintain a cache of recently seen nonces to prevent replay attacks.
Required Methods§
Sourcefn check_and_insert(&self, nonce: &[u8; 16]) -> bool
fn check_and_insert(&self, nonce: &[u8; 16]) -> bool
Check if a nonce has been seen before, and if not, mark it as seen.
Returns true if the nonce is fresh (not seen before).
Returns false if the nonce has already been used.