Skip to main content

encrypt_asset

Function encrypt_asset 

Source
pub fn encrypt_asset<R: Read, W: Write>(
    file_key: &[u8; 32],
    reader: R,
    writer: W,
) -> Result<AssetEncryption, StreamError>
Expand description

Encrypt reader to writer under file_key, returning the content metadata. Computes the ciphertext hash incrementally — the whole file is never buffered. Draws a fresh random nonce prefix.