Skip to main content

encode_parallel

Function encode_parallel 

Source
pub fn encode_parallel(
    shared_secret: &[u8],
    plaintext: &[u8],
    aad: &[u8],
    chunk_size: usize,
    pool: Option<&EntropyPool>,
) -> Result<KkParallelPacket>
Expand description

Encode a large payload in parallel by splitting it into chunks.

Each chunk is encrypted independently via encode_aead (or the pooled variant when a pool is provided). All chunks are processed in parallel using Rayon. A Merkle root over the chunk commitments binds the entire payload together.

ยงArguments

  • shared_secret - the pre-shared key
  • plaintext - the full payload to encrypt
  • aad - associated data, authenticated on every chunk
  • chunk_size - bytes per chunk (use PARALLEL_CHUNK_SIZE for default 1 MiB)
  • pool - optional EntropyPool for high-throughput paths