logo
pub fn encrypt(bytes: Bytes) -> Result<(DataMap, Vec<EncryptedChunk>)>
Expand description

Encrypts a set of bytes and returns the encrypted data together with the data map that is derived from the input data, and is used to later decrypt the encrypted data. Returns an error if the size is too small for self-encryption. Only files larger than 3072 bytes (3 * MIN_CHUNK_SIZE) can be self-encrypted. Smaller files will have to be batched together for self-encryption to work.