Skip to main content

verify_bundle_integrity

Function verify_bundle_integrity 

Source
pub fn verify_bundle_integrity(
    bundle_files: &HashMap<String, Vec<u8>>,
    expected_hash: Option<&str>,
) -> Result<bool, String>
Expand description

Zero-trust Merkle verification: recompute the CID and compare to the registry.

Delegates SHA-256 to the sha2 crate.

If expected_hash is None or empty (e.g., DRAFT capabilities that have not yet been compiled), verification is skipped and returns Ok(true).