Expand description
Incremental content verification with streaming hash.
This module provides streaming hash verification for large content, allowing verification to proceed incrementally as chunks arrive without needing to buffer the entire content in memory.
§Features
- Streaming hash computation (BLAKE3)
- Incremental verification without full buffering
- Merkle tree-based chunk verification
- Progress tracking for long-running verification
- Memory-efficient verification of large files
- Resumable verification from checkpoints
§Example
use chie_core::streaming_verification::{StreamingVerifier, VerificationProgress};
// Create a verifier with expected root hash
let expected_hash = [0u8; 32];
let mut verifier = StreamingVerifier::new(expected_hash);
// Feed chunks incrementally
let chunk1 = b"Hello, ";
let chunk2 = b"World!";
verifier.update(chunk1);
verifier.update(chunk2);
// Finalize and verify
let result = verifier.finalize()?;
if result.verified {
println!("Content verified successfully!");
}Structs§
- Merkle
Verifier - Merkle tree-based chunk verifier for parallel verification
- Streaming
Verifier - Streaming content verifier using BLAKE3
- Verification
Checkpoint - Checkpoint for resumable verification
- Verification
Progress - Progress information for streaming verification
- Verification
Result - Result of verification
Enums§
- Verification
Error - Errors that can occur during streaming verification