Expand description
Shared plumbing for handshakes based on the Noise-XX pattern.
The Noise static keys are generated per connection: they exist solely to give the pattern a
channel to bind to, and are never persisted. Node identity remains the Aleo account key, which
is bound to the session by signing the running Noise handshake hash - see binding_message.
Note that the transport keys a completed session yields are only used to carry the last handshake message, and are then dropped.
Structs§
- Noise
Session - A Noise-XX session over a stream.
- Pending
Session - A stream whose first Noise message has been read but not yet processed.
Enums§
- Handshake
Protocol - The handshake protocol a connection is speaking.
- Role
- The side of a Noise session; note that this is the side of the handshake, which for all current callers coincides with the side of the underlying TCP connection.
Constants§
- HANDSHAKE_
HASH_ LEN - The length of the handshake hash, i.e. the digest length of the hash function in
NOISE_PARAMS. - MAX_
NOISE_ MSG_ LEN - The maximum length of a single Noise message, as mandated by the specification.
- NOISE_
MAGIC - The prefix that marks a stream as speaking the Noise handshake.
- NOISE_
PARAMS - The Noise handshake pattern used by snarkOS.
Functions§
- binding_
message - Returns the message that a party must sign with its Aleo account key in order to bind that
identity to the Noise session identified by
handshake_hash. - detect_
handshake_ protocol - Determines which handshake protocol the peer is speaking by consuming the first
NOISE_MAGIC-sized chunk of the stream. - prepare_
framed - Frames the given stream with the given codec, pre-populating the read buffer with bytes that were consumed from the stream before it was framed.
- write_
noise_ magic - Announces to the peer that this side is about to perform a Noise handshake.