Expand description
Chunk-level encryption with per-chunk nonces for CHIE Protocol.
This module provides:
- Per-chunk encryption with unique nonces
- Chunk key derivation from master key
- Streaming chunk encryption/decryption
Structs§
- Chunk
Decryptor - Chunk decryptor for streaming decryption.
- Chunk
Encryptor - Chunk encryptor for streaming encryption.
- Encrypted
Chunk - Encrypted chunk with metadata.
Enums§
- Chunk
Encryption Error - Chunk encryption error.
Constants§
- ENCRYPTED_
CHUNK_ SIZE - Default chunk size for encryption (256 KB).
- NONCE_
SIZE - Nonce size (12 bytes for ChaCha20-Poly1305).
Functions§
- decrypt_
chunk - Decrypt a single chunk.
- decrypt_
content - Decrypt chunks to a writer.
- derive_
chunk_ key - Derive a chunk-specific key from the master key.
- derive_
chunk_ nonce - Derive a deterministic nonce for a chunk.
- encrypt_
chunk_ with_ index - Encrypt a single chunk with a specific index.
- encrypt_
content - Encrypt content from a reader to encrypted chunks.