code wiki / (root) / nx_game_manifest.nx

nx_game_manifest.nx

buildroot/runtime/nx_game_manifest.nx

17371 B481 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic game
docsdependenciesstructsconstsfunctions

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

nx_syscalls_x86_64.nx nx_game_manifest.nx

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

main sha256_digest sha256_init sha256_k sha256_update blk_set_byte sha256_compress blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ mf_puts mf_split mf_putb mf_jsesc mf_putdec mf_hex sys_openat_wr

structs

38struct Sha256

consts

33const K_MAGIC_65536: i64 = 65536
34const K_MAGIC_1024: i64 = 1024
35const K_MAGIC_8192: i64 = 8192
46const M32: i64 = 0xFFFFFFFF

functions

48func sha256_k(i: i64) -> i64
called by 1: sha256_init
116func blk_byte(c: *Sha256, n: i64) -> i64
called by 1: blk_word
120func blk_set_byte(c: *Sha256, n: i64, v: i64) -> i64
125func blk_word(c: *Sha256, i: i64) -> i64
called by 1: sha256_compress calls 1: blk_byte
134func sha256_compress(c: *Sha256) -> i64
called by 2: sha256_updatesha256_final calls 1: blk_word
188func sha256_init(c: *Sha256) -> i64
called by 1: sha256_digest calls 1: sha256_k
205func sha256_update(c: *Sha256, bytes: *u8, n: i64) -> i64
220func sha256_final(c: *Sha256, out: *u8) -> i64
280func sha256_digest(bytes: *u8, n: i64, out: *u8) -> i64
291func mf_puts(buf: *u8, off: i64, s: *u8) -> i64
called by 1: main
297func mf_putb(buf: *u8, off: i64, src: *u8, n: i64) -> i64
called by 1: main
303func mf_putdec(buf: *u8, off: i64, v: i64) -> i64
called by 1: main
315func mf_hex(buf: *u8, off: i64, dig: *u8) -> i64
called by 1: main
328func mf_jsesc(buf: *u8, off: i64, src: *u8, n: i64) -> i64
called by 1: main
342func mf_split(buf: *u8, ls: i64, le: i64, foff: *i64, flen: *i64) -> i64
called by 1: main
357func main() -> i64