CRE::Audit::AuditLog
AuditLog is the append-only, tamper-evident write API used by the AuditSubscriber. Verification is split across three layers, each callable independently:
verify_hash_chain SHA-256 chain over (prev_hash || payload) verify_hmac_ratchet HMAC-SHA256 of every content_hash, with the ratcheting key replayed from the initial seed verify_batches Ed25519-signed Merkle-root batches
Together they answer 'has this log been mutated since it was written':
- hash chain catches edits to any single row (recompute everything),
- HMAC ratchet catches edits an attacker who recomputed hashes might have made (they don't have the seed key),
- Merkle batches give an external auditor an O(1) commitment to a range of entries that they can verify offline with a public key.
Constructors
Instance methods
Verify all sealed Merkle batches against a public key. Each batch commits to a Merkle root over content_hashes from start_seq..end_seq; we re-derive the root from the live entries and check the signature.
Backwards-compatible alias: returns true iff hash chain + HMAC ratchet both verify against the seed key the log was constructed with.
Verify only the SHA-256 chain. Catches tampering when an attacker didn't recompute hashes; doesn't catch tampering when they did.