pub struct AdversaryModel {
pub adversary_type: AdversaryType,
pub capabilities: AdversaryCapabilities,
pub compromised_nodes: HashSet<[u8; 32]>,
pub observed_flows: Vec<ObservedFlow>,
}Expand description
Simulated adversary acting on network traffic.
Fields§
§adversary_type: AdversaryType§capabilities: AdversaryCapabilities§compromised_nodes: HashSet<[u8; 32]>Set of compromised node IDs.
observed_flows: Vec<ObservedFlow>Observed traffic flows.
Implementations§
Source§impl AdversaryModel
impl AdversaryModel
pub fn new(adversary_type: AdversaryType) -> Self
Sourcepub fn compromise_node(&mut self, node_id: [u8; 32])
pub fn compromise_node(&mut self, node_id: [u8; 32])
Compromise a specific relay node.
Sourcepub fn is_compromised(&self, node_id: &[u8; 32]) -> bool
pub fn is_compromised(&self, node_id: &[u8; 32]) -> bool
Check if a node is compromised.
Sourcepub fn observe_flow(&mut self, flow: ObservedFlow)
pub fn observe_flow(&mut self, flow: ObservedFlow)
Observe a traffic flow.
Sourcepub fn correlate_flows(&self, a: &ObservedFlow, b: &ObservedFlow) -> f64
pub fn correlate_flows(&self, a: &ObservedFlow, b: &ObservedFlow) -> f64
Attempt to correlate two flows (by timing patterns).
Sourcepub fn circuit_compromise_probability(&self, path_length: usize) -> f64
pub fn circuit_compromise_probability(&self, path_length: usize) -> f64
Evaluate circuit anonymity: probability of deanonymization.
Sourcepub fn observed_count(&self) -> usize
pub fn observed_count(&self) -> usize
Total observed flow count.
Auto Trait Implementations§
impl Freeze for AdversaryModel
impl RefUnwindSafe for AdversaryModel
impl Send for AdversaryModel
impl Sync for AdversaryModel
impl Unpin for AdversaryModel
impl UnsafeUnpin for AdversaryModel
impl UnwindSafe for AdversaryModel
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