# 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.