dkg / draft-rivest-sexp

0 stars 0 forks source link

confusing `base-64-raw` ABNF #12

Open dkg opened 1 year ago

dkg commented 1 year ago

in the "basic transport" section, we see:

base-64-raw    =  "{" 3*base-64-char "}"

but in the advanced transport, we see:

base-64-raw    =  [decimal] "{" 1*(base-64-char / whitespace) "}"
                     ; at least 3 base-64-char

why why is one of them limited to 3 chars explicitly, but the other explicitly limited to 1, but has a comment that says 3?

why is 3 a magic number here anyway?

d3e3e3 commented 7 months ago

I agree that this is problematic. Marc Petit-Huguenin did almost all of the current ABNF and I will bring this to his attention.

d3e3e3 commented 7 months ago

I have consulted Marc. 3 is the magic number because, assuming canonical S-expressions are being encoded in base-64, the minimum length is 2 bytes: either "()" or "0:". This encodes into 3 base-64 characters usually followed by an "=".

d3e3e3 commented 7 months ago

The ABNF has been substantially cleaned up and improved.