[noise] NLS implementation in Go

Trevor Perrin trevp at trevp.net
Thu May 24 09:31:02 PDT 2018


On Thu, May 24, 2018 at 11:43 AM, Gerardo Di Giacomo <gedigi at live.com> wrote:
> Hello,
>
> While working on the payload management for NoiseLink and NoiseZeroLink I've noticed something a little confusing.
>
> NoiseLink (XX) defines:
>
> message NoiseLinkHandshakePayloadResponse1 {
>   repeated string evidence_request_type = 1;
>   repeated string evidence_blob_type = 2;
>   repeated bytes evidence_blob = 3;
> }
>
> message NoiseLinkHandshakePayloadRequest2 {
>   repeated string evidence_blob_type = 2;
>   repeated bytes evidence_blob = 3;
> }
>
> While NoiseZeroLink (IK) defines:
>
> message NoiseZeroLinkHandshakePayloadRequest1 {
>   repeated string evidence_request_type = 1;
>   repeated string evidence_blob_type = 2;
>   repeated bytes evidence_blob = 3;
> }
>
> message NoiseZeroLinkHandshakePayloadResponse1 {
>   repeated string evidence_blob_type = 2;
>   repeated bytes evidence_blob = 3;
> }
>
> It is a little confusing to me in which moment of the handshake these should be sent (although there's a little description in paragraph 3.3), and the names don't help. NoiseLinkHandshakePayloadResponse1 contains the evidence_request_type and according to 3.3 it should be sent by a client that wants a blob from the server, yet it's called "Response".

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



> Since they have the same fields, why defining the same two structures twice with different names?
[...]
>
> Or, for sake of simplicity and to avoid having to parse the same type of data in 4 different situations, would it make sense to have a single structure for payloads (for both XX and IK, and for both requests and responses) that contains all 3 fields? They already share the same NegotiationData structures.

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?

(Looking at the draft NLS spec from the wiki:
https://github.com/noiseprotocol/nls_spec/blob/rev2/output/nls.pdf )

Trevor


More information about the Noise mailing list