Skip to main content

encrypt_leaf

Function encrypt_leaf 

Source
pub fn encrypt_leaf(
    key: &DataKey,
    plaintext: &Plaintext,
    aad: &Aad,
    iv: Option<Iv>,
) -> Result<Option<EncryptedLeaf>, WireError>
Expand description

Encrypt one leaf.

None for iv draws a fresh one; pass a stash hit to reproduce previous bytes. An empty plaintext stays emptyisEmpty short-circuits both directions upstream, so an empty string is a fixed point of the format rather than a zero-length ciphertext.