Skip to main content

typhoon/
lib.rs

1//! TYPHOON — Transfer Your Packets Hidden Over Observed Networks.
2//!
3//! An obfuscated UDP transport protocol designed to be statistically indistinguishable from
4//! generic network traffic. Each wire packet consists of an optional fake body, an optional fake
5//! header, an encrypted payload, and an encrypted tailer. Decoy packets (pure random bytes) are
6//! injected by the flow layer to obscure timing and volume patterns.
7//!
8//! # Entry points
9//!
10//! - **Client**: [`socket::ClientSocketBuilder`] → [`socket::ClientSocket`]
11//! - **Server**: [`socket::ListenerBuilder`] → [`socket::Listener`] → [`socket::ClientHandle`]
12//!
13//! # Feature flags
14//!
15//! | Flag | Description |
16//! |---|---|
17//! | `fast_software` | X25519 + XChaCha20-Poly1305 (default) |
18//! | `fast_hardware` | X25519 + AES-GCM-256 |
19//! | `full_software` | Classic McEliece + XChaCha20-Poly1305 |
20//! | `full_hardware` | Classic McEliece + AES-GCM-256 |
21//! | `server` | Server-side listener and session management |
22//! | `client` | Client-side socket and session management |
23//! | `debug` | Debug probe tools (requires `client` + `server`) |
24//! | `capture` | Per-packet trace logging to `typhoon::capture` at `TRACE` level |
25//! | `tokio` | Tokio async runtime |
26//! | `async-std` | async-std runtime |
27
28#[cfg(all(feature = "tokio", feature = "async-std"))]
29compile_error!("feature 'tokio' and feature 'async-std' cannot be enabled at the same time");
30
31#[cfg(not(any(feature = "tokio", feature = "async-std")))]
32compile_error!("one of the features 'tokio' and 'async-std' should be selected");
33
34#[cfg(not(any(feature = "full_software", feature = "full_hardware", feature = "fast_software", feature = "fast_hardware")))]
35compile_error!("one of the features 'full_software', 'full_hardware', 'fast_software' and 'fast_hardware' should be selected");
36
37#[cfg(all(feature = "fast_software", feature = "full_software"))]
38compile_error!("feature 'fast_software' and feature 'full_software' cannot be enabled at the same time");
39
40#[cfg(all(feature = "fast_hardware", feature = "full_hardware"))]
41compile_error!("feature 'fast_hardware' and feature 'full_hardware' cannot be enabled at the same time");
42
43#[cfg(all(feature = "fast_software", feature = "fast_hardware"))]
44compile_error!("feature 'fast_software' and feature 'fast_hardware' cannot be enabled at the same time");
45
46#[cfg(not(any(feature = "server", feature = "client")))]
47compile_error!("one of the features 'server' and 'client' should be selected");
48
49pub mod bytes;
50pub(crate) mod cache;
51pub(crate) mod capture;
52pub mod certificate;
53pub(crate) mod crypto;
54#[cfg(feature = "debug")]
55pub mod debug;
56pub mod defaults;
57pub mod flow;
58mod session;
59pub mod settings;
60pub mod socket;
61mod tailer;
62mod utils;