info and convert on byte arrays #
describeShares and convertShares (in Pipeline) read every share with decodeShare, whose
payload is a list (24 bytes per payload byte). Neither needs it: info only reports the
payload's length, and convert writes the payload back out.
describeSharesBytes and convertSharesBytes read the shares with decodePackedForm instead.
convertSharesBytes returns the UTF-8 bytes of each converted share. Both are proven to return
exactly what the list versions return (describeSharesBytes_eq, convertSharesBytes_eq).
What info reads from a packed record (infoOf, without the payload list).
Equations
Instances For
What info needs from one share: whether it is in the hex form, and what was read from it
(or the error). The payload is not kept.
Equations
- QedShare.Cli.infoOfText label s = ((QedShare.Cli.decodePackedForm label s).fst, Except.map QedShare.Cli.infoPacked (QedShare.Cli.decodePackedForm label s).snd)
Instances For
infoOfText on the UTF-8 bytes of the text (infoOfBytes_eq).
Equations
- QedShare.Cli.infoOfBytes label bs h = ((QedShare.Cli.decodeBytes label bs h).fst, Except.map QedShare.Cli.infoPacked (QedShare.Cli.decodeBytes label bs h).snd)
Instances For
describeShares, reading the shares into byte arrays (describeSharesBytes_eq).
Equations
- QedShare.Cli.describeSharesBytes inputs = QedShare.Cli.describeDecoded (List.map (fun (x : String × String) => (x.fst, QedShare.Cli.infoOfText x.fst x.snd)) inputs)
Instances For
Convert one share that was already read: the UTF-8 bytes of the share in the given form, or the error from reading it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
convertShares on shares that were already converted one by one with convertPacked: all
of them, or the first error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
convertShares on byte arrays: the UTF-8 bytes of each share in the given form
(convertSharesBytes_eq).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equality with the list versions #
infoOfBytes is infoOfText on the text with those bytes.
What info reads is the same from the packed record.
describeSharesBytes computes exactly describeShares. For every list of labelled
share strings, info on byte arrays returns the same lines and the same flag, or the same
error.
The UTF-8 bytes of a hex share, written from the packed record.
convertSharesBytes computes exactly convertShares. For every form and list of
labelled share strings, convert on byte arrays returns the UTF-8 bytes of the shares
convertShares returns, or the same error.