Skip to main content

NOISE_PATTERN

Constant NOISE_PATTERN 

Source
pub const NOISE_PATTERN: &str = "Noise_KK_25519_ChaChaPoly_BLAKE2s";
Expand description

The Noise handshake pattern, spelled once for both sides.

KK because both static keys are known in advance, which is the whole shape of this problem: the host generated the daemon’s key, so pre-knowledge is not an assumption to arrange but the starting condition. The alternatives are worse fits — XX transmits the statics during the handshake, which is what you want when the peers have never met, and it would let a responder present any key and be believed until a later check caught it. Under KK a wrong key fails the handshake itself.

25519_ChaChaPoly_BLAKE2s: all three have pure-Rust implementations in snow’s default resolver, which is what keeps the daemon’s build free of a C compiler. AES-GCM would pull that constraint back in on some targets for no security gain here.