confium_net_noise/lib.rs
1//! Noise_XX encrypted transport for Confium coordinator sessions.
2//!
3//! `noise://host:port` URLs address a peer reachable over TCP with a
4//! Noise_XX (`Noise_XX_25519_ChaChaPoly_BLAKE2s`) handshake protecting
5//! the session. Both sides exchange static keys during the handshake;
6//! after it completes every frame is encrypted and authenticated by
7//! the Noise state machine.
8//!
9//! URL parameters:
10//!
11//! - `key=<hex>` — the local static private key (32 bytes, hex). When
12//! absent an ephemeral key is generated, giving transport encryption
13//! with trust-on-first-use identity.
14//! - `pinned=<hex>` — SHA-256 fingerprint of the expected remote
15//! static key (32 bytes, hex). When present the handshake aborts
16//! unless the peer's static key hashes to exactly this value.
17//!
18//! Message framing matches the TCP transport: one 4-byte big-endian
19//! length-prefixed frame per `send`, so the
20//! "one `send` observed as one `recv` payload" contract holds.
21//!
22//! # Schemes
23//!
24//! - `noise` — Noise_XX over TCP.
25
26#![forbid(unsafe_code)]
27
28pub mod keys;
29pub mod kind;
30pub mod transport;
31
32pub use keys::NoiseIdentity;
33pub use kind::NoiseTransportKind;
34pub use transport::NoiseListener;
35pub use transport::NoiseTransport;
36
37use confium_net::register_transport;
38
39register_transport!(NoiseTransportKind);