Skip to main content

write_header

Function write_header 

Source
pub fn write_header(
    out: &mut Vec<u8>,
    codec: CodecId,
    crypto: CryptoId,
    orig_len: u64,
)
Available on crate feature enc only.
Expand description

Appends the part of the header every entry has – the tag byte and the length varint – to out.

These are also the bytes a sealed entry’s AEAD tag covers as associated data, which is why they are reachable on their own: whoever seals a payload writes them first, hands them to the cipher, and then writes the entry with write_entry, which produces the same bytes again.