code wiki / (root) / nx_attest_silicon.nx

nx_attest_silicon.nx

buildroot/runtime/nx_attest_silicon.nx

13610 B322 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic attest
docsdependenciesstructsconstsfunctions

about

nx_attest_silicon.nx -- per-chip trust declaration. Per [[feedback-captain-moroni-doctrine]] Phase M4 and [[feedback-reclamation-doctrine-captain-moroni]]: every supported chip declares its known threat surface (Intel ME, AMD PSP, Apple T2, Qualcomm baseband, vendor BMC) + the mitigations available against that surface + the resulting trust ceiling. This is the LOOKUP TABLE that turns the reclamation doctrine into runtime data: given a chip family, what xenocells need to be instantiated, what budget caps apply, what operations remain unsafe even after all mitigations are applied. Composes: nx_xenocell -- the threat surfaces listed here become xenocells the substrate instantiates nx_organism -- xenocells from attest_silicon get registered with the organism so they're counted in host pressure aggregation nx_budget -- trust ceiling influences how much RAM/VRAM budget the substrate will accept declarations for (low-trust hardware refuses big budgets) nx_reclaim -- the composed operation that consumes this attestation to produce a safety envelope V1 ships a hard-coded chip family enum + threat-surface bitmask + trust_score per family. V2 will read from a content-addressed chip-attestation database (peer-sharable so the community can extend coverage without recompiling substrate). Gap list (V1 honest perf verdict): - chip family enum is HARDCODED (V2 makes it data-driven) - no actual silicon probe to AUTO-DETECT chip family (the host OS's /proc/cpuinfo or DMI tables are queued; today the caller supplies the chip family ID) - mitigation_applied is a bitmask; partial application not representable (mitigation either applied or not) - sovereign-Nishi silicon entry is a stub genealogy_id: cardinal_2026-05-07_captain_moroni_doctrine +

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_tier.nx nx_attest_silicon.nx nx_attest_silicon_test.nx nx_reclaim.nx nx_reclaim_test.nx nx_sovereign_compose_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_attest_silicon_test.nxnx_reclaim.nxnx_reclaim_test.nxnx_sovereign_compose_test.nx

structs

118struct NxSiliconAttestation

consts

56const NX_MAGIC_1024: i64 = 1024
65const NX_CHIP_UNKNOWN: nx_int = 0
66const NX_CHIP_INTEL_ME: nx_int = 1
67const NX_CHIP_AMD_PSP: nx_int = 2
68const NX_CHIP_APPLE_T2: nx_int = 3
69const NX_CHIP_APPLE_SECURE_ENCLAVE: nx_int = 4
70const NX_CHIP_QUALCOMM_BASEBAND: nx_int = 5
71const NX_CHIP_MEDIATEK_MODEM: nx_int = 6
72const NX_CHIP_BROADCOM_WIFI: nx_int = 7
73const NX_CHIP_VENDOR_BMC: nx_int = 8 // server out-of-band
74const NX_CHIP_NXP_SE: nx_int = 9 // smartcard SE
75const NX_CHIP_INFINEON_TPM: nx_int = 10
76const NX_CHIP_RISCV_OPEN: nx_int = 11 // SiFive/T-Head/etc open RISC-V
77const NX_CHIP_SOVEREIGN_NISHI: nx_int = 12
78const NX_CHIP_N_FAMILIES: nx_int = 13
86const NX_TS_NONE: nx_int = 0
87const NX_TS_RAM_READ: nx_int = 1 // can read user RAM out-of-band
88const NX_TS_DMA: nx_int = 2 // direct memory access bypass
89const NX_TS_NET_EGRESS: nx_int = 4 // can phone home
90const NX_TS_RADIO_ACTIVATE: nx_int = 8 // can turn on transponder
91const NX_TS_FIRMWARE_PERSIST: nx_int = 16 // survives OS reinstall
92const NX_TS_MICROCODE_PATCH: nx_int = 32 // can flash CPU microcode
93const NX_TS_BOOT_INTERPOSE: nx_int = 64 // pre-OS boot hook
94const NX_TS_KEY_ESCROW: nx_int = 128 // vendor holds master keys
102const NX_MIT_NONE: nx_int = 0
103const NX_MIT_ME_CLEANER_HAP: nx_int = 1 // me_cleaner + HAP bit
104const NX_MIT_COREBOOT: nx_int = 2 // libreboot/coreboot
105const NX_MIT_EGRESS_FILTER: nx_int = 4 // host firewall vendor endpoints
106const NX_MIT_KILL_SWITCH: nx_int = 8 // physical disconnect
107const NX_MIT_SILICON_TRUST_ENF: nx_int = 16 // per-cell trust enforced
108const NX_MIT_CRYPTO_COMPART: nx_int = 32 // hardware-security-key
109const NX_MIT_MEMORY_HYGIENE: nx_int = 64 // swap-encrypt + no-hibernate
110const NX_MIT_DMA_DISCIPLINE: nx_int = 128 // IOMMU + thunderbolt off

functions

129func nx_chip_family_is_valid(f: nx_int) -> nx_int
called by 2: mainnx_reclaim
140func nx_chip_threat_surface(f: nx_int) -> nx_int
183func nx_chip_available_mitigations(f: nx_int) -> nx_int
called by 1: nx_attestation_new
223func nx_chip_base_trust_q10(f: nx_int) -> nx_int
246func nx_attestation_new(chip_family: nx_int, name: *u8) -> *NxSiliconAttestation
259func nx_attestation_apply_mitigation(a: *NxSiliconAttestation,
called by 1: main
272func _popcount8(x: nx_int) -> nx_int
292func nx_attestation_effective_trust_q10(a: *NxSiliconAttestation) -> nx_int
307func nx_attestation_safe_for_secrets(a: *NxSiliconAttestation) -> nx_int
319func nx_attestation_safe_for_gameplay(a: *NxSiliconAttestation) -> nx_int