P05 — DICE Key-Layering Chain in Pure Software
Status
green· Claim PC5 · Corpus anchor L4 §1.1 device identity; registry opentitan “owner-deployable RoT PKI” · Effort S · Execution host external: omarchy
What it proves
PC5 — the TCG DICE construction (UDS → CDI → per-layer derived keys, IDEVID/LDEVID) is a standard, mechanically reproducible cryptographic chain that a user can implement in ~fifty lines of Python. The corpus marks this detail as an L4 §1.1 inference — this runbook turns the inference into a demonstration: when the gate prints, you will have derived the full chain in software and watched one flipped firmware byte change every key.
Why it matters
The same layering is what Caliptra’s “unique cryptographic identity via secure boot” and OpenTitan’s DICE IDEVID are built on, so this run also proves P02’s whole premise end-to-end. The corpus only lists this detail as an inference in L4 §1.1; a working chain is what turns that inference into evidence. If the chain were not reproducible in pure software, the book’s simplest demonstration of what “device identity” means would be gone.
Why this, not that
| We do (Y) | We don’t (X) | Because |
|---|---|---|
| Implement DICE math in pure Python | Run Caliptra’s whole RTL just to see identity | DICE is a construction, not a silicon artifact; proving the chain (HMAC layering of firmware measurements into CDI, then keys) is the clearest possible evidence of what “device identity” means |
Provide --flip to prove sensitivity to one firmware byte | Only show the happy path | The RoT promise is authenticity — change one byte of the measured firmware, and every derived key must change; that is the negative proof |
| Self-verify the ECDSA signatures at each layer | Stop at “here’s a derived hash” | Identity that never publishes a signed attestation would be insufficient; the signature check is the “attestation” output |
What you need
- Python 3.9+,
pip install cryptography. No TPM, no hardware. Runs anywhere, including the Linux server and this Mac.
How to run it
cd poc/P05-dice-layering— enter the runbook directory.pip3 install -r requirements.txt— install thecryptographydependency.python3 scripts/dice_layering.py— run the default chain: two layers, well-known UDS.python3 scripts/dice_layering.py --flip— NEGATIVE run: flip one byte of stage-1 firmware.
What “done” looks like
python3 scripts/dice_layering.py
# MUST print, one line per layer:
# POC-P05-OK-IDEVID: signature verified
# POC-P05-OK-LDEVID: signature verified
python3 scripts/dice_layering.py --flip
# MUST print:
# POC-P05-NEGATIVE: CDI changed after single-byte flipWhere the evidence goes
Copy into evidence/:
run_ok.txt— full output of the regular run.run_flip.txt— full output of the--fliprun.
What this does not prove
- The CDI-layering labels are matched to the TCG DICE spec’s terminology (“immutable root key”, layer-0 RO measurement, etc.) — cite the spec (TCG DICE Architectures) in the report, or the L4 §1.1 inference note, whichever is more defensible.
- This is not a shipping chip identity — it produces test keys. It proves the mechanism, which is what PC5 claims.