Skip to main content

encrypt_chunk

Function encrypt_chunk 

Source
pub fn encrypt_chunk(
    file_key: &[u8; 32],
    nonce_prefix: &[u8; 7],
    index: u32,
    is_last: bool,
    pt_chunk: &[u8],
) -> Vec<u8> ⓘ
Expand description

Encrypt a single plaintext chunk in isolation: the inverse of decrypt_chunk, and byte-identical to chunk index of encrypt_asset_with_prefix’s output for the same key and prefix. pt_chunk must be PLAINTEXT_CHUNK bytes unless is_last.