[noise] NLS implementation in Go

Gerardo Di Giacomo gedigi at live.com
Thu May 24 13:18:16 PDT 2018


> On May 24, 2018, at 9:31 AM, Trevor Perrin <trevp at trevp.net> wrote:
> 
> The messages sent by Alice were labelled with "Request", and by Bob
> were labelled with "Response".  But I'm not sure that convention makes
> sense, and I agree it's confusing when the "evidence_request_type" is
> sent from Bob.
> 
> Maybe we should just use the names "Alice" instead of "Request", and
> "Bob" instead of "Response"?
> 
> NoiseLinkHandshakePayloadBob1
> NoiseLinkHandshakePayloadAlice2
> etc
I don't think it'll make it less confusing, unfortunately, maybe as confusing but in a different way :)

> We have a single structure that contains all fields in
> NoiseLingoHandshakePayload, so I thought it would be useful to name
> the NoiseLink and NoiseZeroLink protos to be explicit about what is
> sent when, even though some of the NoiseLink and NoiseZeroLink
> payloads are identical.  Seem reasonable, or you still think we should
> do something different?

It makes sense from a logical standpoint, but from an implementation standpoint it gets a little tricky. Protobuf is pretty rigid, and the marshalling/unmarshalling operations need the right structure. If you want to be compliant with the spec you'll have to pick the right request/response for both NoiseLink (NL) and NoiseZeroLink (NZL), but there is really no practical advantage to it. Since NL and NZL go hand-in-hand, it's much easier if we consider a payload as a "non-partisan" entity, so it can be marshalled/unmarshalled to/from a single protobuf.

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.

Thanks, Gerardo


More information about the Noise mailing list