mlab-tests-suite-sha-helper
The groupant beside mlab/tests/suite.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | ../syntax.json |
| cost | symbolic source derived | invariant |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | executed bounded checks | tests |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
padding | padding | partial source derived model | padding |
word_schedule | word_schedule | partial source derived model | word_schedule |
compression | compression | partial source derived model | compression |
evidence | evidence | partial source derived model | evidence |
Model text
descriptant
mlab-tests-suite-sha-helper
Local SHA compression helper and abc self-check only.
Epoch 2026-10-31
Half-open source bytes [647,3277); bound by parent source hash and scoped byte hash. Model covers only this fragment; parent composition explains joins.
approximant
Scoped forward relation
Pad message, schedule words, perform 64 rounds/block with wrapping add, hex encode8 words; self-check abc known digest.
Domain and gap
Source-generated states within resource limits. Categorical relation has no executable percent surrogate.
invariant
Scoped invariant
Append0x80 then zero until56 mod64 then 64-bit length.
Cost
O(B) compression and padded input copy, fixed64-word schedule; u32 arithmetic wraps intentionally and giant bitlength conversion remains unsupported.
models
Scoped typed relations
behavior_complement
abc known digest excludes any changed output nibble for that input; this finite check does not exclude collisions or failures on untested messages.
reverse_reconstruction
Digest collision/preimage ambiguity is not resolved by one known vector; output length is64 hex characters.
padding
Append0x80 then zero until56 mod64 then 64-bit length.
word_schedule
Words16..63 use rotates7/18 and17/19 with wrapping sums.
compression
Eight working words fold into hash with wrapping addition.
evidence
Only abc vector selected; not frozen-data hashes.
tests
Evidence scope
Parent selected tests: sha256_self_check, parse_error_runs_nothing, wave30_synthetic_suite_boundaries. This fragment shares parent syntax and finite checks; no separate test count or complete fragment coverage claim. Assertion-control association and unexecuted paths are in parent tests.md and source-test-map.json.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/mlab/tests/suite.rs.groupant/sha-helper.groupant/