pub enum AttackerModel {
SharedHardware,
PostQuantumSentinel,
AdjacentNetwork,
RemoteNetwork,
Research,
Custom {
threshold_ns: f64,
},
}Expand description
Attacker model determines the minimum effect threshold (θ) for leak detection.
Choose based on your threat model - this is the most important configuration choice. There is no single correct threshold; your choice is a statement about who you’re defending against.
§Sources
- Crosby et al. (2009): “Opportunities and Limits of Remote Timing Attacks.” Reports ~100ns LAN accuracy, 15–100μs internet accuracy.
- Van Goethem et al. (2020): “Timeless Timing Attacks” (USENIX Security). Achieved 100ns accuracy over the internet using HTTP/2 request multiplexing.
- Flush+Reload, Prime+Probe literature: Documents cycle-level timing attacks on shared hardware (SGX, cross-VM, containers).
Variants§
Attacker shares physical hardware with the target.
θ = 2 cycles (~0.6ns @ 3GHz)
Use for: SGX enclaves, cross-VM on shared cache, co-located containers, hyperthreading neighbors, shared hosting.
Sources: Flush+Reload, Prime+Probe literature
PostQuantumSentinel
Catch KyberSlash-class timing leaks in post-quantum cryptography.
θ = 10 cycles (~3.3ns @ 3GHz)
Use for: ML-KEM (Kyber), ML-DSA (Dilithium), and other lattice-based cryptography where ~20 cycle leaks have been shown exploitable.
This provides a 2x safety margin: set θ at 10 cycles to reliably catch 20+ cycle leaks.
Sources: KyberSlash (Jancar et al. 2024)
AdjacentNetwork
Attacker on same local network, or using HTTP/2 concurrent requests.
θ = 100ns
Use for: Internal services, microservices, or any HTTP/2 endpoint.
Note: “Timeless Timing Attacks” (USENIX 2020) achieved 100ns over the internet using HTTP/2 request multiplexing. The LAN/WAN distinction is weaker than previously thought.
Sources: Crosby et al. 2009 (LAN), Van Goethem et al. 2020 (HTTP/2)
RemoteNetwork
Attacker over the internet using traditional timing techniques.
θ = 50μs
Use for: Public APIs without HTTP/2, legacy services, high-jitter paths.
Sources: Crosby et al. 2009 (15-100μs range)
Research
Detect any measurable timing difference.
θ → 0 (clamped to timer resolution)
Warning: Will flag tiny, unexploitable differences. Not for CI. Use for: Profiling, debugging, academic analysis, finding any leak.
Custom
Custom threshold in nanoseconds.
Implementations§
Source§impl AttackerModel
impl AttackerModel
Sourcepub fn to_threshold_ns(&self) -> f64
pub fn to_threshold_ns(&self) -> f64
Convert attacker model to threshold in nanoseconds.
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a human-readable description of this attacker model.
Trait Implementations§
Source§impl Clone for AttackerModel
impl Clone for AttackerModel
Source§fn clone(&self) -> AttackerModel
fn clone(&self) -> AttackerModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttackerModel
impl Debug for AttackerModel
Source§impl Default for AttackerModel
impl Default for AttackerModel
Source§fn default() -> AttackerModel
fn default() -> AttackerModel
Source§impl PartialEq for AttackerModel
impl PartialEq for AttackerModel
impl Copy for AttackerModel
impl StructuralPartialEq for AttackerModel
Auto Trait Implementations§
impl Freeze for AttackerModel
impl RefUnwindSafe for AttackerModel
impl Send for AttackerModel
impl Sync for AttackerModel
impl Unpin for AttackerModel
impl UnwindSafe for AttackerModel
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.