* write an initial 0x01 version byte, and check it on read;
* use little-endian byte order for lengths;
* add length fields before the selectors and the permutation commitments,
and check their consistency with the expected lengths on read;
* do not write an extra byte for a selector bit vector if the number of
bits is a multiple of 8;
* ensure that original I/O errors are preserved.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>