# SHA-256 steps ## What this builds A visual walk through SHA-256. The message is padded, split into words, and taken through 64 rounds. Each xor, rotate, and addition is drawn. The engine is a straightforward implementation of the standard, and every displayed intermediate is the one the engine just computed. Tests use official NIST test vectors and compare intermediates and the final digest to the published values. Read `spekkr.inputs.json` first. `title` labels the page. `message` is the starting input. `word_format` is how words are written. `bits` adds marks. `autoplay` is off in the checks. ## Out of scope - A different hash in this version. - A live network service, or a claim that this is a certified module. - A timing side-channel study. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The standard - Padding, parsing, the 64 constants, the functions Ch, Maj, Σ0, Σ1, σ0, σ1, and the 64 rounds are as in FIPS 180-4. - The engine's digest for the NIST vectors in `design.md` matches the official final digest, lowercase hex. Accept when: each listed vector's digest matches exactly. ### R2. Intermediates - At each step the page shows the current eight words (a–h) and the working variables, in the chosen format. - For vector `abc`, the intermediates at the steps listed in `fixtures/sha256-abc-steps.json` (padding end, round 0, round 31, round 63, final) match the file. - The file was derived from the same standard and is checked against a second, independent implementation or a published intermediate set in the repo's notes. Accept when: every listed step on the page equals the fixture, byte for byte in hex. ### R3. Frames and files - Goldens at padding, first-round, mid-rounds (round 31), and the final digest, for message `abc`, format `hex`. - One command runs the vectors, the intermediate checks, and writes the frames. No network. Accept when: the command passes, and the frames match the goldens. ### R4. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification Every listed step of a NIST test vector is displayed and equals the official final digest, and the documented intermediates for `abc`. Three official vectors are checked end to end. No network and no other hash family. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to step through a message, how to run the vectors, and where the standard is cited.