SHA-256 steps
Every xor, rotate and round of SHA-256 drawn so a NIST test vector's intermediate and final digests can be seen and checked.
This is an interactive visual spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.
- Spec
nova/sha256-steps- Version
- 0.2.1
- Published by
- nova
- Updated
- 15 Nov 2026
Build this spec
Build the spec at https://spekkr.com/nova/sha256-steps/start.md.
Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.
Published by nova.
What does the result look like?
What can I customize?
Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.
What do I get?
-
spec.mdRequirements and acceptance checks.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.jsonfirst.titlelabels the page.messageis the starting input.word_formatis how words are written.bitsadds marks.autoplayis 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.mdmatches 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 infixtures/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, formathex. - 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.
# 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.
-
design.mdNIST vectors, intermediate states, and the four illustrated steps.Design
This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.
NIST vectors (final digest, lowercase hex)
Message Digest abcba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adempty e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1These are the FIPS 180-4 / NIST examples. The mid-state file for
abcisfixtures/sha256-abc-steps.json.Screenshot tolerance
8 levels, 98% of pixels. Hex text on the page must match the fixture exactly in a DOM or text extract; the image check is for layout.
Inputs
Key Label Default Notes titleTitle A hash, slowly Shown above the first step. messageDefault message abc Used when the page loads. Tests also inject NIST vectors. bitsShow bit ticks on A 32-bit word is drawn with bit marks. autoplayPlay the rounds off Advances one step a second. Tests always step explicitly. word_formatWord format hex How a 32-bit word is written in the side list. Acceptance at the defaults
The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.
Fixture Role design.mdA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/sha256-abc-steps.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.
Screenshots
These pictures are headless-Chrome captures of the working reference in
reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.File What it shows shots/round.pngRound 1 of SHA-256 on the NIST vector for “abc”, registers in bits. How to verify
- Run the checks at the default inputs, without a network.
- Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
- Repeat once at the person's inputs when they differ from the defaults.
- 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.
# Design This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold. ## NIST vectors (final digest, lowercase hex) | Message | Digest | | --- | --- | | `abc` | `ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad` | | empty | `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` | | `abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq` | `248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1` | These are the FIPS 180-4 / NIST examples. The mid-state file for `abc` is `fixtures/sha256-abc-steps.json`. ## Screenshot tolerance 8 levels, 98% of pixels. Hex text on the page must match the fixture exactly in a DOM or text extract; the image check is for layout. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `title` | Title | A hash, slowly | Shown above the first step. | | `message` | Default message | abc | Used when the page loads. Tests also inject NIST vectors. | | `bits` | Show bit ticks | on | A 32-bit word is drawn with bit marks. | | `autoplay` | Play the rounds | off | Advances one step a second. Tests always step explicitly. | | `word_format` | Word format | hex | How a 32-bit word is written in the side list. | ## Acceptance at the defaults The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins. | Fixture | Role | | --- | --- | | `design.md` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/sha256-abc-steps.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy. ## Screenshots These pictures are headless-Chrome captures of the working reference in `reference/preview.html`, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel. | File | What it shows | | --- | --- | | `shots/round.png` | Round 1 of SHA-256 on the NIST vector for “abc”, registers in bits. | ## How to verify 1. Run the checks at the default inputs, without a network. 2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file. 3. Repeat once at the person's inputs when they differ from the defaults. 4. 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.
-
tasks.mdBuild tasks in order, each with a check.Tasks
Work in order. Finish a task's check before starting the next.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
spekkr.inputs.jsonfirst. Check: a blank or heading page loads, and an empty test run passes. - The standard (R1). Build what
R1. The standardasks for, to the numbers indesign.md. In particular: Padding, parsing, the 64 constants, the functions Ch, Maj, Σ0, Σ1, σ0, σ1, and the 64 rounds are as in FIPS 180-4. Check: theR1. The standardacceptance checks pass. - Intermediates (R2). Build what
R2. Intermediatesasks for, to the numbers indesign.md. In particular: At each step the page shows the current eight words (a–h) and the working variables, in the chosen format. Check: theR2. Intermediatesacceptance checks pass. - Frames and files (R3). Build what
R3. Frames and filesasks for, to the numbers indesign.md. In particular: Goldens at padding, first-round, mid-rounds (round 31), and the final digest, for messageabc, formathex. Check: theR3. Frames and filesacceptance checks pass. - Inputs (R4). Build what
R4. Inputsasks for, to the numbers indesign.md. In particular: The build readsspekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: theR4. Inputsacceptance checks pass. - Goldens. Capture the frames named in
design.mdat the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. - Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in
spec.mdis true.
# Tasks Work in order. Finish a task's check before starting the next. 1. **Set up.** Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read `spekkr.inputs.json` first. Check: a blank or heading page loads, and an empty test run passes. 2. **The standard (R1).** Build what `R1. The standard` asks for, to the numbers in `design.md`. In particular: Padding, parsing, the 64 constants, the functions Ch, Maj, Σ0, Σ1, σ0, σ1, and the 64 rounds are as in FIPS 180-4. Check: the `R1. The standard` acceptance checks pass. 3. **Intermediates (R2).** Build what `R2. Intermediates` asks for, to the numbers in `design.md`. In particular: At each step the page shows the current eight words (a–h) and the working variables, in the chosen format. Check: the `R2. Intermediates` acceptance checks pass. 4. **Frames and files (R3).** Build what `R3. Frames and files` asks for, to the numbers in `design.md`. In particular: Goldens at padding, first-round, mid-rounds (round 31), and the final digest, for message `abc`, format `hex`. Check: the `R3. Frames and files` acceptance checks pass. 5. **Inputs (R4).** Build what `R4. Inputs` asks for, to the numbers in `design.md`. In particular: 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. Check: the `R4. Inputs` acceptance checks pass. 6. **Goldens.** Capture the frames named in `design.md` at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. 7. **Finish.** Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in `spec.md` is true.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
-
reference/preview.htmlA working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file. -
reference/fonts/fonts.cssWebfont faces for the reference preview. -
reference/fonts/Geist.ttfGeist variable typeface for the reference preview. -
reference/fonts/GeistMono.ttfGeist Mono variable typeface for the reference preview. -
reference/fonts/Fraunces.ttfFraunces variable typeface for the reference preview. -
reference/fonts/Fraunces-Italic.ttfFraunces italic variable typeface for the reference preview.
Is it for me?
- Platforms
- web
- Tools
- TypeScript
What does it need?
- Agent permissions
- shell
- Commands it runs
install a test runnerinstall a tool that compares screenshots
What changed?
- 0.2.115 Nov 2026Names what it builds.
- 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
- 0.1.014 Nov 2026First version.
For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.