-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(streaming_encrypt): Implement single-pass streaming encryption
Refactors streaming_encrypt_from_file to use a single pass through the file while maintaining correct encryption. Key changes: - Collects all source hashes while reading chunks - Processes chunks 2+ immediately after getting their hashes - Stores first two chunks for processing after all hashes are available - Uses shrink_data_map to handle child map creation - Returns shrunk data map for consistency with encrypt() This maintains the streaming efficiency while ensuring correct encryption by: 1. Only reading each chunk once from disk 2. Keeping minimal data in memory 3. Preserving the encryption requirements (all hashes needed) 4. Properly handling the data map hierarchy The function now matches the behavior of encrypt() while being more memory efficient for large files.
- Loading branch information
Showing
3 changed files
with
240 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.