[noise] Spec revision 32

Alex alex at centromere.net
Fri May 19 05:40:09 PDT 2017


On Fri, 19 May 2017 14:17:31 +0200
"Jason A. Donenfeld" <Jason at zx2c4.com> wrote:

> On Fri, May 19, 2017 at 2:14 PM, Alex <alex at centromere.net> wrote:
> > What this implies is that a general purpose Noise library simply
> > can't execute the instructions sequentially. You have to scan the
> > entire pattern, determine if there are any `psk` tokens, and then
> > change the *meaning* of the `e` token if you find any. Is this
> > correct?  
> 
> No, not really. All psk handshakes have "psk" in the handshake
> identifier. This means that you must know that psk is in use from the
> very beginning of the handshake, when the handshake identifier becomes
> the initial value of ck. Thus, you can determine at that early point
> what to do later on, without needing to "scan forward" or whatever it
> is that you dread having to do.

That solution couples the *meaning* of the `e` token with some
arbitrary string provided by the user (the handshake name), which I
argue is worse, because now I have to validate that the user didn't
make a mistake by forgetting to add "psk" to the pattern name after they
add a `psk` token -- which requires me to perform a static analysis
anyway.

Or I could just require that the user not make any mistakes and provide
no degree of safety whatsoever.

-- 
Alex


More information about the Noise mailing list