nx_game_manifest.nx
buildroot/runtime/nx_game_manifest.nx
about
nx_game_manifest.nx -- sovereign game-update manifest generator
(Steam depot-manifest / itch wharf equivalent, sovereign).
Reads content/games.versions, hashes each game's served wasm with
SHA-256 (FIPS 180-4, inlined from the canonical nx_sha256.nx -- the
crypto organs import the RV64 nx_syscalls.nx which collides with the
x86_64 file-I/O layer, so we inline the pure core; see
[[nishi-serving-syscall-dup-gotcha]]), and emits:
dist/api/games.json -- the registry (all games + latest + hash)
dist/api/games/<id>.json -- per-game manifest (versions + channels +
per-version sha256 + bytes + changelog)
The in-browser auto-update client (/assets/nx-update.js) channels off
these. SHA-256 already EXCEEDS Steam's SHA-1 depot hashes; Ed25519
signing is the next exceed rung. A known-answer test (sha256("abc"))
runs first -- a wrong hash aborts rather than publishing bad integrity.
Build: ./nxc2.exe --target x86_64 runtime/nx_game_manifest.nx > /tmp/gm.s
wsl bash -c "gcc -no-pie /tmp/gm.s -o /tmp/nx_game_manifest"
Run: cd nishi-pages && mkdir -p dist/api/games && /tmp/nx_game_manifest
nx_capability_claims:
needs: [x86_64_syscalls, sha256_fips_180_4]
provides: [game_update_manifest, content_hash_integrity,
version_channels, publish_registry]
safety: [sha256_KAT_gated, no_floating_point, json_escape_changelog]
verdict: [exit_0_ok, exit_9x_KAT_fail]
license: ORIGINAL (sha256 core: INDEPENDENT_REDERIVE nx_sha256.nx)
kind: nishi_pages_specialist
layer: L4 (crypto-integrity over L1 syscalls)
raci: [R=nishi_pages_builder, A=elder_west, C=nx_sha256_owner, I=conductor]
dependencies 1 imports · 0 importers
imports: nx_syscalls_x86_64.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 38 | struct Sha256 |
consts
| 33 | const K_MAGIC_65536: i64 = 65536 |
| 34 | const K_MAGIC_1024: i64 = 1024 |
| 35 | const K_MAGIC_8192: i64 = 8192 |
| 46 | const M32: i64 = 0xFFFFFFFF |
functions
| 48 | func sha256_k(i: i64) -> i64 called by 1: sha256_init |
| 116 | func blk_byte(c: *Sha256, n: i64) -> i64 called by 1: blk_word |
| 120 | func blk_set_byte(c: *Sha256, n: i64, v: i64) -> i64 |
| 125 | func blk_word(c: *Sha256, i: i64) -> i64 |
| 134 | func sha256_compress(c: *Sha256) -> i64 |
| 188 | func sha256_init(c: *Sha256) -> i64 |
| 205 | func sha256_update(c: *Sha256, bytes: *u8, n: i64) -> i64 |
| 220 | func sha256_final(c: *Sha256, out: *u8) -> i64 |
| 280 | func sha256_digest(bytes: *u8, n: i64, out: *u8) -> i64 |
| 291 | func mf_puts(buf: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 297 | func mf_putb(buf: *u8, off: i64, src: *u8, n: i64) -> i64 called by 1: main |
| 303 | func mf_putdec(buf: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 315 | func mf_hex(buf: *u8, off: i64, dig: *u8) -> i64 called by 1: main |
| 328 | func mf_jsesc(buf: *u8, off: i64, src: *u8, n: i64) -> i64 called by 1: main |
| 342 | func mf_split(buf: *u8, ls: i64, le: i64, foff: *i64, flen: *i64) -> i64 called by 1: main |
| 357 | func main() -> i64 |