"""Verify the extracted evidence package; local reads only."""
from pathlib import Path
import hashlib
root = Path(__file__).resolve().parent
count = 0
for line in (root / 'SHA256SUMS.txt').read_text(encoding='utf-8').splitlines():
    expected, relative = line.split('  ', 1)
    target = (root / relative).resolve()
    if not target.is_relative_to(root):
        raise SystemExit('Unsafe manifest path')
    actual = hashlib.sha256(target.read_bytes()).hexdigest()
    if actual != expected:
        raise SystemExit('Mismatch: ' + relative)
    count += 1
print(f'PASS: {count} files match SHA-256')
