# The NAND, the keys and the System Menu: firmware and secrets, never shipped **The rule** (charter, licences point 9; CLAUDE.md): console makers' firmware is never shipped; a player's own copy may be loaded where the player supplies it. On the Wii that rule covers two different things: **firmware** (code and data Nintendo wrote) and **secrets** (keys). Both are identified in this repository by SHA-1 only. ## What exists, where it lives, what it is (DOC, WiiBrew pages named) | Item | Where | Per console? | Source | | --- | --- | --- | --- | | boot0 | mask ROM in Hollywood, ~1.3-1.5 KB | no | Hardware/Starlet; Boot process | | boot1 | NAND block 0 (up to 47 pages), its SHA-1 in OTP | revisions a-d | Boot process; Hardware/NAND | | boot2 | NAND blocks 1-7, two copies and block maps, a WAD-like title with ticket | no | Hardware/NAND | | IOS slots, MIOS, BC | NAND filesystem titles 1-3...1-255, 1-257, 1-256 | no | IOS; MIOS; BC | | System Menu | title 1-2 on NAND | region versions | System Menu | | NAND filesystem (SFFS) | clusters 0x40-0x7EFF, AES-encrypted and HMAC-signed; metadata (16 superblocks, FAT, FST) in clusters 0x7F00-0x7FFF, **unencrypted** | **yes** | Hardware/NAND | | OTP (128 bytes) | eFuses in Hollywood: boot1 hash, **common key**, NG id, **NG private key**, **NAND HMAC key**, **NAND AES key**, **RNG seed** | yes (except the boot1 hash and the common key) | Hardware/OTP | | SEEPROM (256 bytes) | 93C56 on Starlet GPIOs: MS and CA ids, NG key id and signature, boot2 and NAND generation counters, **Korean key**, PRNG seed | yes | Hardware/SEEPROM | | DSP IROM, DROM | in Hollywood (8 KB and 4 KB) | no | Hardware/Macronix DSP | | GameCube fonts | the MX23L4005's ROM ("two fontsets ... Yay0") | no | Hardware/MX23L4005 | | GameCube IPL | inside MIOS's PowerPC code | no | MIOS | | SD key, Nintendo's certificates and root public key | inside IOS and the System Menu; certificates also on discs and in tickets | no | Wii security | WiiBrew states that the common key "has been known publicly since April 2008" (Wii security). Being public does not make it ours to ship: it is Nintendo's secret, and the rule is about whose it is, not whether it leaked. ## What this repository keeps - **SHA-1s only**: of each firmware file the census meets (census.md), of each key a player might supply (the SHA-1 of the 16-byte common key, of the Korean key), so the board can **recognise** a correct key without containing it. A SHA-1 of a 128-bit key reveals nothing usable (a 2^128 search). The key SHA-1s are not filled in during Phase 0: they would have to be computed from the key, and the key is not fetched. They are entered by whoever first supplies one locally, from that key, and committed as hashes. - **The algorithms**, which are public standards: AES-128-CBC, SHA-1, HMAC-SHA-1, RSA-2048 and ECC (sect233r1, HYPOTHESIS: the curve name is not on the pinned pages) signature verification. The board's AES and SHA-1 engines are register-level models of Hollywood's engines (Hardware/AES Engine; Hardware/SHA-1 Engine) computing the standard functions. - **Layouts as data**: OTP's word map, SEEPROM's struct, the SFFS superblock, FAT and FST, boot2's block map, the WAD, TMD and ticket structures, the disc's partition table and hash tree, all from WiiBrew (facts only, re-expressed, cited). - **Never**: a key, a NAND image, an OTP or SEEPROM image, any Nintendo binary, a decrypted Nintendo file, a test that embeds one. ## What the player supplies (read in place, by path, never copied) | Variable (proposed) | What | Needed for | | --- | --- | --- | | `WII_COMMON_KEY` (a file of 16 bytes) | the common key | reading an encrypted disc image (an ISO) in HLE; nothing else in HLE | | `WII_KOREAN_KEY` | the Korean common key | Korean discs | | `WII_NAND` (BootMii `nand.bin`, 553,648,128 bytes with spare data) and `WII_KEYS` (BootMii `keys.bin`: OTP and SEEPROM) | the player's console | LLE IOS, the System Menu, the player's saves | Each is checked by SHA-1 (keys) or by its own structure (a NAND's superblock magic "SFFS" and generation against the SEEPROM's) before use; a mismatch refuses, naming the variable. The BootMii file sizes and layouts are HYPOTHESIS until a player's file is seen: they are BootMii's conventions (BootMii is fail0verflow's, closed source for the boot2 part and GPL for MINI), not Nintendo's. ## What it means for a reference specification 1. **The specification cannot test its crypto paths with Nintendo's keys, and does not need to.** Every path that decrypts or verifies is a standard algorithm keyed by data. The gate builds **synthetic test material with our own keys**: a test "common key", a test certificate chain, a disc image whose partition is encrypted with a test title key and hashed into a correct H0-H3 tree, a NAND image formatted with SFFS under a test NAND key and HMAC key, a SEEPROM and OTP with test values. These exercise the AES and SHA-1 engines, the DI path, ES's ticket decryption and the NAND filesystem with no Nintendo secret anywhere, and they can live in the repository because they are ours. What they cannot show is that the real keys are wired to the real places; that is one line per key, checked against the layouts above. 2. **CI never sees a commercial Wii disc's contents** unless the player's key is present (and CI never has it). CI's Wii-mode cases are homebrew programs (built from permissive sources, loaded straight into MEM1 as DOL or ELF, as homebrew loaders do) and the synthetic images. Commercial discs are local runs. 3. **Signature checks are configurable, never silently skipped.** ES's checks run against whatever certificate chain the board holds: the player's (from their NAND) or the test chain. A "no checks" switch exists for homebrew only, named and shown. 4. **LLE is a player's run, never a gate.** The System Menu, IOS and boot2 exist only in the player's NAND. The gate covers what the specification owns: the hardware models and the HLE. 5. **Save data**: SFFS saves are per-console encrypted; an HLE `/dev/fs` keeps saves in a host directory in plaintext (a named difference: the NAND's ciphertext is not modelled unless a NAND image is mounted). ## The System Menu The System Menu (title 1-2, versions in the census) is the first Broadway program after boot; it is "ONLY the graphical interface between boot and starting a game", nothing of it runs during a game (Wii architecture overview; System Menu). The board's default boot does **not** need it: a functional boot loads a disc's apploader or a homebrew DOL with the low-memory globals set (Memory map: 0x80000000-0x800000FC, 0x80003000 on) as the System Menu leaves them. The globals list is the HLE boot's contract (U10 for the values the page leaves as "?"). Running the real System Menu is LLE, from the player's NAND.