Skip to main content

encrypt_blob

Function encrypt_blob 

Source
pub fn encrypt_blob(
    key: &SecretKey,
    epoch: u32,
    plaintext: &[u8],
) -> Result<Vec<u8>, CryptError>
Expand description

Encrypts a blob deterministically for a given key epoch and plaintext.

The header remains cleartext, is authenticated as AAD, and the returned object’s content digest is suitable as its storage identity.

§Errors

Returns a CryptError if the plaintext is too large or encryption fails.