Module streaming

Module streaming 

Source
Expand description

Streaming encryption for large content.

This module provides chunk-by-chunk encryption/decryption for processing large files without loading them entirely into memory.

Structs§

StreamDecryptor
Streaming decryptor for large content.
StreamEncryptor
Streaming encryptor for large content.

Enums§

StreamError
Streaming encryption error.

Constants§

AUTH_TAG_SIZE
Authentication tag size (16 bytes for Poly1305).
STREAM_CHUNK_SIZE
Default chunk size for streaming (256 KB).

Functions§

chunk_count
Calculate the number of chunks for a given data size.
decrypt_chunked
Decrypt encrypted chunks back into the original buffer.
encrypt_chunked
Encrypt an entire buffer in chunks, returning all encrypted chunks.
encrypted_chunk_size
Calculate the encrypted size of a chunk (plaintext + auth tag).