katzenpost / docs

specification and design documents
Creative Commons Attribution Share Alike 4.0 International
53 stars 14 forks source link

Specify notation for defining protocol structures #1

Closed cfcs closed 7 years ago

cfcs commented 7 years ago

The "wire protocol" is specified in some sort of pseudo-code.

It would be nice to have it written in a formal, clearly specified language so you don't have to guess what is up, and/or copy-paste constraints from the (comments?) after the //: https://github.com/Katzenpost/docs/blob/master/specs/wire-protocol.txt#L184-L195

Other example: https://github.com/Katzenpost/docs/blob/master/specs/wire-protocol.txt#L138 (I assume opaque is also an 8-bit array here, but I would prefer to not have to guess).

If you want to go with the C-like feel, there's Trunnel by Nick Mathewson, alternatively something with wider support like XDR or ASN.1 could be used (which takes away some of your freedom for defining the bits-and-bytes), or ASN.1 ECN, which there's poor support for using open source tooling, but at least there's a spec that can be parsed by a human.

Yawning commented 7 years ago

The "C" style Presentation Language as described in [RFC5246] Section 4 is used to represent data structures, except for cryptographic attributes, which are specified as opaque byte vectors.