Expand description
The fields of a code’s storage part (D13). coven-storage decides what
they mean; this module packs them with the format’s own primitives (D2),
so a storage part has one encoding and a reader refuses a truncated or
malformed one. Every owned buffer erases on drop.
Structs§
- Field
Reader - Reads one storage part’s fields in the order they were packed. Every
length is checked against what remains before it is allocated, and
FieldReader::finishrefuses trailing bytes. - Field
Writer - Writes one storage part’s fields in order.
packruns the same fields twice: once to count their bytes, then into a buffer of exactly that size, so no secret is left behind in a grown allocation.
Constants§
- MAX_
STORAGE - The largest storage part a restore or invite code carries.
Functions§
- pack
- Pack the fields
putwrites into one buffer erased on drop and allocated once.putmust write the same fields both times it runs.