[noise] NLS implementation in Go

Trevor Perrin trevp at trevp.net
Thu May 24 21:46:41 PDT 2018


On Thu, May 24, 2018 at 8:18 PM, Gerardo Di Giacomo <gedigi at live.com> wrote:
>
> I'm not sure if anybody else is looking at this and has an opinion, but from my initial investigation, having a single protobuf seems to be an simpler approach.

I think I see your point, let me try to spell out a protobuf naming
you might be happier with.

(It's worth emphasizing that none of this affects bytes on the wire,
it's just spec notation).


Right now, we have an all-inclusive proto that defines all possible
fields any NLS handshake payload could use:

message NoiseLingoHandshakePayload {
    repeated string evidence_request_type = 1;
    repeated string evidence_blob_type = 2;
    repeated bytes evidence_blob = 3;
    bytes psk_id = 4;
    NoiseLingoTransportOptions transport_options = 5;
}


Profiles like NoiseLink, NoiseZeroLink, etc, take a subset of those
fields for their handshake payloads, and the protos are named like:

NoiseZeroLink:
 -> NoiseZeroLinkHandshakePayloadRequest1
 <- NoiseZeroLinkHandshakePayloadResponse1

NoiseLink:
 ->
 <- NoiseLinkHandshakePayloadResponse1
 -> NoiseLinkHandshakePayloadRequest2

The first and second payloads in NoiseLink/NoiseZeroLink serve the
same role and have the same contents.  So I think you're asking
whether we should just have a single proto for them, like:

NoiseZeroLink:
 -> NoiseLinkPayload1
 <- NoiseLinkPayload2

NoiseLink:
 ->
 <- NoiseLinkPayload1
 -> NoiseLinkPayload2

These names no longer indicate the exact profile (since NoiseLink
protos are used with NoiseZeroLink), nor do they indicate the
round-trip number.  But on the other hand, they're simpler and
shorter.

Extending this to other NLS profiles, we'd get something like:

NoiseTinyLink:
 -> NoiseTinyLinkPayload1
 <- NoiseTinyLinkPayload2
 -> NoiseTinyLinkPayload3

NoiseAnonBox
 -> NoiseAnonBoxPayload1

NoiseAuthBox
 -> NoiseAuthBoxPayload1


I think the simpler and shorter names are better, so this would be
worth changing.  What do other people think?  Are there other
proposals?

Trevor


More information about the Noise mailing list