# Firmware and keys: what we will not hold, and where the boundary goes Said plainly first: **a 3DS game cannot run on the bare hardware.** Every commercial title is an ARM11 user-mode program of Nintendo's operating system (Horizon: the ARM11 kernel, dozens of system modules, the ARM9's Process9, applets, shared fonts and data archives), loaded by that system from containers that are normally encrypted with keys that exist only inside the console (the boot ROMs' key material, the console-unique OTP, keys the boot ROM derives into the AES engine's keyslots). Everything in that chain is Nintendo's firmware or Nintendo's secret. This project ships none of it, commits none of it, reads none of it, and identifies it only by SHA-1. ## What exists, by kind (census.md has the counts) | Kind | Where it is met | What we do | | --- | --- | --- | | ARM9 and ARM11 boot ROMs (64 KB each) | No-Intro's "Nintendo 3DS (Decrypted)" set holds both as [BIOS] entries | SHA-1 in the census; never copied, never opened beyond hashing; a player may point the board at their own copy | | Console-unique OTP, NAND (eMMC) image, movable.sed, SecureInfo, LocalFriendCodeSeed | only on a player's console | never held; a player-supplied path only | | AES key material (keyX/keyY/normal keys of keyslots 04h-3Fh) | derived by the ARM9 boot ROM from its own data and the OTP (GBATEK "3DS Crypto - AES Key Generator" describes the procedure) | never written into the repository; the board's AES engine takes keys from the player's own key file, or from the player's boot ROM run LLE | | The two key-scrambler constants of the keyX/keyY hardware function | GBATEK prints both ("3DS Crypto - AES Registers") | **not copied** into the repository though published: they are Nintendo's secrets; the scrambler is specified as a function of (keyX, keyY, constant) and the constant comes with the player's keys (decision K3) | | System titles (kernel/FIRM, system modules, applets, shared fonts, data archives) | No-Intro's CDN set holds 388 of them as [BIOS] entries (6 GiB, 5,627 members, all with tickets); every cartridge image carries a system update partition (Old 3DS update in 2,100 of 2,147 images, New 3DS update in 615) | SHA-1 of the CDN members in census-firmware-3ds.txt; never extracted, never read; the board never mounts an image's partitions 6 and 7 | | The DSP's program (DSP1, ".cdc") | Nintendo's code, loaded by software onto the Teak (GBATEK "3DS Files - Sound DSP Binary") | never shipped; LLE runs the player's copy; HLE models what it does (dsp-teak.md) | | Games | the cartridge sets are **decrypted** dumps: all 2,158 images carry NCCH's NoCrypto flag and 2,155 show ExeFS's ".code" in the clear (census.md); the CDN set is encrypted (31 of 31 sampled first contents show no "NCCH" in the clear; 390 of 10,152 titles carry a ticket) | the player's own dumps, read in place; the board does not decrypt containers (decision K2) | ## What a reference specification can be, given all that The charter's specification defines hardware behaviour. On the 3DS that splits cleanly: 1. **The hardware** (n3ds-python, with arm11-python, arm946es-python, teak-python): the CPUs, the memory map, the PICA200, the DSP core and its peripherals, the AES/SHA/RSA engines as engines (modes, FIFOs, keyslot selection, the keyX/keyY function with its constant supplied), DMA engines, HID, I2C/SPI devices, LCD, cameras. This part needs **no Nintendo code at all to be tested**: bare-metal homebrew in the FIRM format (an ARM9 and an ARM11 entry point, built with the zlib/MIT/BSD homebrew toolchain: libctru's lower layers, citro3d, our own probes) runs on it from reset, as it would after a boot ROM. Its judges are homebrew hardware tests whose verdicts were captured on consoles (validation.md). 2. **The operating system** (a separate, functional-level model, decision K1): Horizon's kernel calls (SVCs), its IPC, and the services games call (fs, gsp, hid, dsp, apt, cfg, ptm, ndm, ac, ...), the applets (software keyboard, error display, Mii selector), and the shared font. This is **firmware**, so in the charter's terms it is a *functional model*, "what a program or block does" (charter, axis B), like the Super Game Boy's SNES program in gameboy-python: a modelling choice judged against a lower-level run where one exists. Here the lower-level run exists only on a player's console with their own firmware; we hold none, so **the HLE has no hardware-tier judge in this project** and its claims say so: "behaves as the titles in the slice list need", never "behaves as Horizon". 3. **Games** run on (1) under (2) from the player's decrypted dumps. ## The boundary: HLE of the OS services, LLE of the hardware **Recommendation (decision K1): HLE of the operating system, LLE of the hardware; the player-supplied LLE firmware path as an optional judge, never a requirement.** - *For HLE of the OS:* no Nintendo code is needed to run a decrypted game; the No-Intro cartridge sets are decrypted, so no key is needed either; the HLE layer is ours, MIT, and readable; it is how the 3DS has been made playable everywhere so far (an implementation fact about other projects, not evidence about the hardware). *Against:* it is a model of Nintendo's software reconstructed from documentation, so its fidelity has no judge we hold; a service's exact timing (how long `fs` takes, when `gsp` raises its interrupt) is a HYPOTHESIS; and its documentation comes largely through 3dbrew, which is set aside for its site's wishes (sources-3ds.md), leaving GBATEK, libctru's headers (zlib) and our own probes. - *For LLE of the firmware:* exact by construction once the hardware is exact. *Against:* needs the player's boot ROMs, NAND and OTP (or at least the boot ROMs and a NAND bootstrapped from a game's update partition, which is still Nintendo's firmware); runs hundreds of millions of instructions of OS before a game starts; every peripheral the OS touches must be modelled at register level first. - *The middle:* the hardware specification is LLE-capable from the start (nothing in it assumes the HLE), so a player who has their own firmware can run it, and the HLE layer can be checked against that run on the player's machine. The project itself never performs that run with firmware it holds, because it holds none. ## Keys, frankly - **No keys in the repository, ever**, including the published scrambler constants and the common key's derivations. The AES engine is specified so that its behaviour with any key is exact (FIPS-197 AES, the modes GBATEK lists: CCM, CTR, CBC, ECB, with the 3DS's FIFO and byte-order options), and its tests use our own keys with published AES test vectors (FIPS-197, NIST SP 800-38A/C). - **Games need no keys** in the HLE path when the dumps are decrypted (all of No-Intro's cartridge images are). Encrypted dumps (the CDN set, raw cartridge dumps) are out of scope unless the player supplies their own keys (decision K2). - An LLE boot computes keys from the player's boot ROM and OTP inside the emulated ARM9: the keys then exist only in the player's process memory, never in our files.