Facts about the CLI pipeline #
Theorems about the pure CLI layer (QedShareCli.Pipeline), so that the code between the proven
core and the terminal is proven too, not only tested.
decodeShare_encodeRecord: every share the CLI writes, hex or words, is read back by the CLI's own reader (trimming, form detection, length limits, decoding) as the same record.
Characters #
A hex digit is never whitespace.
Hex-encoded bytes contain no whitespace.
n bytes are 2n hex digits.
trimWs keeps text whose first and last characters are not whitespace.
Text with no whitespace at all is kept by trimWs.
Either dropWhile p removes everything and every element passes p, or what is left has an
element that fails p.
Hex shares #
A hex share contains no whitespace.
A hex share has at most 61 + 2·(payload bytes) characters (tag, six dashes, set id, k,
x, payload, a 16-byte token and the checksum).
Word shares #
A word has at most 8 letters.
A word share has at least one word.
The number of bytes in a word share.
tokenLen is at most 16 bytes.
A word share contains no -, so it is never taken for a hex share.
A word share has at most 8192 characters (the limit decodeShare allows).
The CLI reads back what it writes. A share written as hex or as words by encodeRecord
is read by decodeShare (trimming, telling hex from words, length limits, decoding and every
check) as exactly the same record. Conditions: the token has the right length for the format, the
payload is no longer than a 1 MiB secret's, and, for words, at most 255 bytes.
Reading many shares #
What it means when combine accepts. If recoverSecret (what qedshare combine runs)
returns a secret, then each input string was read as a share record (one per input, in order),
the records agree on set id, threshold k and format, there are at least k of them, and the
secret is exactly what the core computes: combine on their shares, then the format's check
(Token.decode for qs3: the AMD tag and every share's token). So the core theorems about
combine and Token.decode, such as combine_detects_forgery_tok, apply to the CLI as it runs.
Splitting #
What makeShares returns. When it succeeds (in the qs3 format the CLI uses), the
parameters are valid, the secret is non-empty and within the limits, and the share strings are
the encoded shares at 1 … n of one split of E = Token.encode s G key, each with its token
G(x), for a token polynomial G with k coefficients and valid split randomness.