Expand description
Noise Protocol Implementations for FIPS
Implements Noise Protocol Framework patterns using secp256k1:
-
IK pattern: Used by FMP (link layer) for hop-by-hop peer authentication. The initiator knows the responder’s static key and sends its encrypted static in msg1. Two-message handshake.
-
XK pattern: Used by FSP (session layer) for end-to-end sessions. The initiator knows the responder’s static key but defers revealing its own identity until msg3, providing stronger identity hiding. Three-message handshake.
§IK Handshake Pattern (Link Layer)
<- s (pre-message: responder's static known)
-> e, es, s, ss (msg1: ephemeral + encrypted static)
<- e, ee, se (msg2: ephemeral)§XK Handshake Pattern (Session Layer)
<- s (pre-message: responder's static known)
-> e, es (msg1: ephemeral + DH with responder's static)
<- e, ee (msg2: ephemeral + DH)
-> s, se (msg3: encrypted static + DH)§Separation of Concerns
The IK pattern handles link-layer peer authentication — securing the direct link between neighboring nodes. The XK pattern handles session-layer end-to-end encryption between arbitrary network addresses, with stronger initiator identity protection.
Structs§
- Cipher
State - Symmetric cipher state for post-handshake encryption.
- Handshake
State - Handshake state for Noise IK and XK patterns.
- Noise
Session - Completed Noise session for transport encryption.
- Replay
Window - Sliding window for replay protection.
Enums§
- Handshake
Progress - Handshake state machine states.
- Handshake
Role - Role in the handshake.
- Noise
Error - Errors from Noise protocol operations.
- Noise
Pattern - Which Noise pattern is being used for this handshake.
Constants§
- EPOCH_
ENCRYPTED_ SIZE - Size of encrypted epoch (epoch + AEAD tag).
- EPOCH_
SIZE - Size of the startup epoch (random bytes for restart detection).
- HANDSHAKE_
MSG1_ SIZE - Size of IK handshake message 1: ephemeral (33) + encrypted static (33 + 16 tag) + encrypted epoch (8 + 16 tag).
- HANDSHAKE_
MSG2_ SIZE - Size of IK handshake message 2: ephemeral (33) + encrypted epoch (8 + 16 tag).
- MAX_
MESSAGE_ SIZE - Maximum message size for noise transport messages.
- PUBKEY_
SIZE - Size of a public key (compressed secp256k1).
- REPLAY_
WINDOW_ SIZE - Replay window size in packets (matching WireGuard).
- TAG_
SIZE - Size of the AEAD tag.
- XK_
HANDSHAKE_ MSG1_ SIZE - XK msg1: ephemeral only (33 bytes).
- XK_
HANDSHAKE_ MSG2_ SIZE - XK msg2: ephemeral (33) + encrypted epoch (8 + 16 tag) = 57 bytes.
- XK_
HANDSHAKE_ MSG3_ SIZE - XK msg3: encrypted static (33 + 16 tag) + encrypted epoch (8 + 16 tag) = 73 bytes.