Module entropy

Module entropy 

Source
Expand description

2026-09-25: OS entropy for per-process key salts; its caller is the SSM decode tier’s client salt (decode_client_salt in metrale-model-engine).

Owner: storage, tiered-cache core. Invariants:

  • random_u64 returns OS entropy or an error, never a fallback value.

Kept apart from tier::hash, which must return the same value for the same input forever; a salt must differ per process, so two clients of one model sharing a paging peer derive different keys.

Functions§

random_u64
2026-09-25: 8 bytes of OS entropy as a u64. Linux: libc::getrandom with no flags, retried on EINTR and partial reads. Other unix: /dev/urandom. Windows: the getrandom crate. A failure is an error.