pub struct TransportState { /* private fields */ }Expand description
A Noise transport session: one ciphertext per message.
The nonce advances with every message in each direction; a repeated or reordered ciphertext fails authentication. Payloads are not fragmented at this layer, so a caller that needs to send more than a single Noise message can carry has to split the data itself.
Implementations§
Source§impl TransportState
impl TransportState
Sourcepub fn suite(&self) -> Suite
pub fn suite(&self) -> Suite
Returns the cipher suite these keys were derived under.
A re-handshake must use it again, and so must anything the specification seals with the suite’s AEAD, such as a pairing payload.
Sourcepub fn handshake_hash(&self) -> &[u8; 32]
pub fn handshake_hash(&self) -> &[u8; 32]
Returns the handshake hash h of the handshake these keys came from.
Noise finalises h when the second handshake message is processed, and nothing after that
changes it. Sendspin uses it once: a re-handshake
mixes the previous handshake’s h in as its prologue, so a second handshake that reuses
these keys must be built with this value. It is a transcript hash, not key material, but it
must still never be logged.