3 ms·
Since I didn't know the acronym: https://en.wikipedia.org/wiki/Type%E2%80%93length%E2%80%93value https://en.wikipedia.org/wiki/Type%E2%80%93length%E2%80%93va...
by gmac 3y ago
Since I didn't know the acronym: https://en.wikipedia.org/wiki/Type%E2%80%93length%E2%80%93value https://en.wikipedia.org/wiki/Type%E2%80%93length%E2%80%93va...
In fact, a key part of the subtls library is a simple class to make this relatively painless (it's currently just called `Bytes`, but perhaps something like `TLVCoder` would be a more informative).
It reserves space for the length field, and provides a callback to write it automatically once you're done writing the value: https://github.com/jawj/subtls/tree/main#navigating-the-code https://github.com/jawj/subtls/tree/main#navigating-the-code. It also enables the indented and annotated output options.