Skip to content

feat: split mutual_quine_ne into _sha and _pcrs variants - #2

Merged
hyperfinitism merged 1 commit into
mainfrom
docs/mutual-quine-ne-sha
Aug 7, 2026
Merged

feat: split mutual_quine_ne into _sha and _pcrs variants#2
hyperfinitism merged 1 commit into
mainfrom
docs/mutual-quine-ne-sha

Conversation

@hyperfinitism

Copy link
Copy Markdown
Member

Splits the Nitro Enclave example in two:

  • examples/mutual_quine_ne_pcrs (renamed from examples/mutual_quine_ne) — the full scheme, unchanged: each enclave rebuilds its peer's EIF in RAM and prints the peer's reference PCRs. Internal derivation names and the EIF name are deliberately kept, since they are substituted into the entrypoint and hence measured — the PCR values documented in its README remain valid (re-verified on the AArch64 Nitro host).
  • examples/mutual_quine_ne_sha (new) — two EIFs that differ in exactly one file (/app/node.nix); at runtime each enclave evaluates its quine node, reconstructs the peer's exact source, and prints its SHA-384 digest. Nothing is rebuilt inside the enclave: no eif_build, no payload of EIF build inputs, a shared bootstrap ramdisk (PCR1 identical across the two images), and ~2 GiB of enclave memory instead of ~8. The digests depend only on the template and the transpiler — not on flake.lock or the architecture.

Flake outputs are renamed/added accordingly: packages mutual-quine-ne-{sha,pcrs}-{nodes,eif1,eif2}, checks mutual-quine-ne-sha-verify-* / mutual-quine-ne-pcrs-verify-*.

Verified end to end on the parent VM (m6g.xlarge, AArch64) on 2026-08-07: nix flake check passes including the new _sha verify checks; both _sha enclaves booted on real hardware and printed exactly the SHA-384 digest of their peer's node file, with hypervisor-reported PCR0–2 matching each image's build-time pcr.json; and the rebuilt _pcrs images' pcr.json still match the README's documented values.

Split the Nitro Enclave example in two so the Kleene fixed point can be
demonstrated on real hardware independently of the reproducible-build
machinery:

- examples/mutual_quine_ne_pcrs (renamed from examples/mutual_quine_ne):
  the full scheme, unchanged - each enclave rebuilds its peer's EIF in
  RAM and prints the peer's reference PCRs. Internal derivation names
  and the EIF name are deliberately kept ("mutual-quine-ne"): they are
  substituted into the entrypoint and hence measured, so renaming them
  would invalidate the PCR values documented in its README.

- examples/mutual_quine_ne_sha (new): two EIFs that differ in exactly
  one file (/app/node.nix); at runtime each enclave evaluates its quine
  node, reconstructs the peer's exact source, and prints its SHA-384
  digest — chosen to match the digest family of Nitro PCRs, computed
  with coreutils sha384sum since builtins.hashString has no SHA-384.
  Nothing is rebuilt inside the enclave: no eif_build, no payload of
  EIF build inputs, a shared bootstrap ramdisk (so PCR1 is identical
  across the two images), and ~2 GiB of enclave memory instead of ~8.
  The digests depend only on the template and the transpiler, not on
  flake.lock or the architecture.

Signed-off-by: Takuma IMAMURA <takuma.imamura@acompany-ac.com>
@hyperfinitism hyperfinitism self-assigned this Aug 7, 2026
@hyperfinitism hyperfinitism added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 7, 2026
@hyperfinitism
hyperfinitism merged commit 894e6e4 into main Aug 7, 2026
1 check passed
@hyperfinitism
hyperfinitism deleted the docs/mutual-quine-ne-sha branch August 7, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant