Checksums with Separators (and Typing)
A hash is secure if its input could be parsed unambiguously. Purpose-specific symbols may be used, but a common way of doing this more generally is with length prefixes or postfixes. This works when the lengths line up to an end of the document.
We can simulate separators as an afterthought by inserting them after a block, as long as we also do this at the end if we used a separator at least once. This will make the separators a chained list, and so parsing is unambiguous. We can insert a separator at the end, even if it is just for the _hash_finish()
computation and not for the kipt_sum
as stored.
Bonus material: We can add typing or flags for a block, to distinguish it in terms of typing.
This is not suitable for protocol standardisation, perhaps, and certainly not to mimic standard procedures, but it does make KIP uses unique and unambiguously secure without too much effort; certainly the work is not cryptographic in nature, but more in line with a programmer's mindset.
Call the new operation kipsum_mark (ctx,sumid,opt_typing)
or so.