A memory-light recoverSecret for the executable #
recoverSecret (in Pipeline) is written for the proofs: every share it reads keeps its payload
as a List GF256, and the text of a share is turned into lists of characters while it is read.
A list costs 24 bytes of memory per element, so a 1 MiB secret needed about 35 MB per share:
700 MB for 20 shares.
recoverSecretBytes reads each share straight into a PackedRecord (decodePacked), whose
payload is a ByteArray (1 byte per byte). The checks, the interpolation (combineBytes), the
tag and token check (untagBytes) and the odd-share-out hint all work on byte arrays, and the
secret is returned as a byte array. Nothing as long as the secret is ever a list.
recoverSecretBytes_eq proves that it returns exactly what recoverSecret returns, for every
input: the same secret (as a byte array), or the same error. So everything proven about
recoverSecret holds for what the executable runs.
recoverSecretBytes is recoverPacked on the shares read by decodePacked. The executable
calls recoverPacked on shares it has read that way file by file, so the text of a share is
released as soon as it is read, before the next file is opened.