Module chain

Source
Expand description

HMAC-SHA256 hash chain for tamper-evident audit records.

Each record’s hash is HMAC(root_key, prev_hash || canonical_json(record)). Genesis records use prev_hash = [0; 32].

Structs§

ChainId
A unique identifier for one chain (helps when multiple chains coexist).
HashChain
A live hash chain: holds the root key and current head hash.

Enums§

ChainLoadError
Errors returned by HashChain::load_head_from_file.

Constants§

HASH_LEN
Length of a chain hash in bytes (32 = SHA-256 output).