[noise] Machine-readable pattern list
Rhys Weatherley
rhys.weatherley at gmail.com
Thu Oct 6 17:03:43 PDT 2016
On Fri, Oct 7, 2016 at 6:50 AM, Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> On Oct 5, 2016 8:01 AM, "Trevor Perrin" <trevp at trevp.net> wrote:
> > Maybe, but if the only benefit here is that a tool that works with
> > text patterns can avoid scanning for "...", that's not that much of a
> > gain.
>
> Scanning for ... isn't even required; it's easier than that. You load the
> results into a temporary. If you hit a ..., everything prior is premessage
> and everything after is ordinary. If you never hit a ..., everything is
> ordinary. So this remains quite trivial to implement even when streaming
> byte by byte, without having to even scan out.
>
> In otherbwords, I agree with you.
>
OK, OK, I'll concede the point. :-)
Modified ABNF attached.
Cheers,
Rhys.
; Defined using the ABNF syntax from RFC 5234. The character set is
US-ASCII.
;
; The "pattern-file" element is intended for a pattern dictionary file that
; contains multiple pattern definitions.
;
; The "pattern-single" element is intended for applications that wish to
; provide an API to define the specific pattern to use in a handshake.
; Syntactic elements
pattern-file = *(wsp pattern) wsp
pattern-single = wsp pattern wsp
pattern = header wsp [pre-message wsp "..." wsp] messages
header = name wsp "(" wsp params wsp ")" wsp ":"
params = param *(wsp "," wsp param)
param = "e" / "s" / "re" / "rs"
pre-message = message-init [wsp message-resp] / message-resp
messages = *(message-pair wsp) message-init / message-pair
message-pair = message-init wsp message-resp
message-init = "->" wsp message-tokens
message-resp = "<-" wsp message-tokens
message-tokens = message-token *(wsp "," wsp message-token)
message-token = "e" / "s" / "ee" / "ss" / "se" / "es"
; Lexical tokens
name = "Noise_" name-component *("+" name-component)
name-component = 1*(ALPHA / DIGIT)
wsp = *(WSP / eol / comment)
comment = "//" *(VCHAR / WSP) eol
eol = CRLF / LF
; Imported from core ABNF (RFC 5234): VCHAR, WSP, CRLF, LF, ALPHA, DIGIT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://moderncrypto.org/mail-archive/noise/attachments/20161007/4528f3e8/attachment.html>
More information about the Noise
mailing list