Skip to main content

Crate ton_net_adnl

Crate ton_net_adnl 

Source
Expand description

ADNL transport for ton-net: the encrypted link to a liteserver.

ADNL is the transport TON nodes speak. This crate opens and runs a liteserver session over it, split along the sans-I/O seam of NET-ADR-002:

  • The protocol core is pure. client_handshake builds the 256-byte handshake packet and derives the session ciphers, and SessionCiphers seals and opens the stream frames. These are synchronous functions over bytes, tested against fixed vectors, with no socket and no clock.
  • I/O lives behind the Transport seam. It moves ordered bytes and nothing more; TcpTransport implements it over TCP. A browser transport is added later without touching the core.
  • AdnlConnection is the async surface. It draws the per-session randomness from a CSPRNG, completes the handshake over a transport, and runs a query to its answer.

AdnlConnection speaks the ADNL message layer: it wraps a query with an id and matches the answer. The liteserver methods that build the query and decode the answer live in ton-net-lite.

This is an internal crate of the ton-net client.

Re-exports§

pub use connection::AdnlConnection;
pub use connection::AdnlError;
pub use frame::FrameError;
pub use frame::SessionCiphers;
pub use handshake::client_handshake;
pub use handshake::Handshake;
pub use handshake::HandshakeError;
pub use handshake::HandshakeSecrets;
pub use transport::TcpTransport;
pub use transport::Transport;
pub use transport::TransportError;

Modules§

connection
The async connection driver: a liteserver session over a transport.
frame
ADNL stream framing: sealing and opening one frame.
handshake
The ADNL handshake: opening an encrypted session with a liteserver.
transport
The transport seam and its native TCP implementation.