pub struct MaskCatalog { /* private fields */ }Expand description
Mask catalog for automatic rotation (Patent 3 + Patent 9)
Holds a pool of pre-generated masks. When neural resonance detects that a mask is compromised by DPI, the catalog provides a replacement.
Implementations§
Source§impl MaskCatalog
impl MaskCatalog
pub fn new() -> Self
Sourcepub fn set_primary_mask_id(&self, mask_id: String)
pub fn set_primary_mask_id(&self, mask_id: String)
Set the primary mask ID (first mask loaded from disk)
Sourcepub fn register_mask(&self, mask: MaskProfile)
pub fn register_mask(&self, mask: MaskProfile)
Register a new mask (e.g., received via passive distribution or neural unpack)
Sourcepub fn mark_compromised(&self, mask_id: &str)
pub fn mark_compromised(&self, mask_id: &str)
Mark a mask as compromised — remove from rotation
Sourcepub fn remove_mask(&self, mask_id: &str)
pub fn remove_mask(&self, mask_id: &str)
Remove a mask from live rotation without marking it as compromised.
Sourcepub fn select_fallback(&self, current_mask_id: &str) -> Option<MaskProfile>
pub fn select_fallback(&self, current_mask_id: &str) -> Option<MaskProfile>
Select the best non-compromised mask, excluding current_mask_id
Sourcepub fn available_count(&self) -> usize
pub fn available_count(&self) -> usize
Get mask count
Sourcepub fn packet_layout(&self) -> (usize, usize, usize, usize)
pub fn packet_layout(&self) -> (usize, usize, usize, usize)
Get the primary packet layout for client->server traffic.
Returns (packet_mdh_len, handshake_mdh_len, eph_offset, eph_len).
Normal packets use only the protocol header, while the initial
handshake embeds eph_pub inside the MDH at eph_offset.
Sourcepub fn packet_mdh_bytes(&self) -> Vec<u8> ⓘ
pub fn packet_mdh_bytes(&self) -> Vec<u8> ⓘ
Get the regular MDH bytes used for server->client packets. Uses HeaderSpec for dynamic per-packet generation when available (Issue #30 fix).