Module streaming_verification

Module streaming_verification 

Source
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§

MerkleVerifier
Merkle tree-based chunk verifier for parallel verification
StreamingVerifier
Streaming content verifier using BLAKE3
VerificationCheckpoint
Checkpoint for resumable verification
VerificationProgress
Progress information for streaming verification
VerificationResult
Result of verification

Enums§

VerificationError
Errors that can occur during streaming verification