Firezone has released sanstun, a new sans-IO Rust implementation of the WireGuard state machine designed to improve performance and security through a parallel-friendly, idiomatic API.
Key Points
- sanstun separates IO and side effects from business logic, allowing for easier testing and better integration with Rust's ownership rules.
- The library removes internal buffering to simplify the interface and eliminate unnecessary memory allocations found in previous implementations.
- A core feature is the separation of bookkeeping from encryption, enabling developers to offload cryptographic operations to worker threads for higher throughput.
- The API enforces security invariants at compile-time, such as mandatory rate-limiting for incoming packets via the
Interface::receivefunction. - sanstun is available on crates.io and is released as open-source software under the Apache 2.0 license.