The SHA-256 compression function uses sixty-four rounds over eight 32-bit registers and a deterministic expansion of sixteen input words into sixty-four round words [1]. There is no single privileged algebraic encoding of these operations for satisfiability or formal analysis: equivalent descriptions can expose different variables, nonlinear expression depths, and opportunities for common-subexpression elimination. This distinction matters when formulating fixed-target state reachability and internal-state constraints.
The alternative “unrolled” representation of SHA-256 is not new. Indesteege, Mendel, Preneel, and Rechberger derive the \(A_i\)-only state description and its message-modification equation in their SAC 2008 work [2]. Mendel, Nad, and Schläffer subsequently develop automated local-collision methods for reduced SHA-256 [3]. We adopt the established coordinates rather than claim their rediscovery as a contribution.
Research question. Do different, logically equivalent state-coordinate encodings lead to meaningfully different constraint representations, and, after bit-blasting and optimization, different solver performance? We compare four baseline formulations—explicit eight-register, forward compact two-sequence, \(A\)-only state-first, and \(b\)-control-first with residual constraints—plus a fifth, factored \((a,b)\) residual pilot designed to keep operator depth bounded.
Contribution and scope. This draft gives (i) a unified, verifiable derivation of the known scalar and \(A\)-only representations; (ii) an exact triangular parameterization and schedule-residual account, presented as a systematization of known message modification; (iii) a reproducible word-level DAG audit of the four baselines and the factored fifth encoding, with planted-witness consistency checks; and (iv) a three-seed exploratory Z3 pilot and a design for more extensive solver benchmarks. We do not infer improved cryptanalysis from the number of declared words or from these symbolic counts. Neither a new SHA-256 collision nor a practical full-round fixed-target inversion is claimed.
All word additions and subtractions are in \(\mathcal{W}=\mathbb{Z}/2^{32}\mathbb{Z}\). Write \(\operatorname{ROTR}_n\) for 32-bit rotation and \(\operatorname{SHR}_n\) for logical right shift. The SHA-256 functions are
\[ \begin{aligned} \Sigma_0(x)&=\operatorname{ROTR}_{2}(x)\oplus\operatorname{ROTR}_{13}(x)\oplus\operatorname{ROTR}_{22}(x),\\ \Sigma_1(x)&=\operatorname{ROTR}_{6}(x)\oplus\operatorname{ROTR}_{11}(x)\oplus\operatorname{ROTR}_{25}(x),\\ \sigma_0(x)&=\operatorname{ROTR}_{7}(x)\oplus\operatorname{ROTR}_{18}(x)\oplus\operatorname{SHR}_{3}(x),\\ \sigma_1(x)&=\operatorname{ROTR}_{17}(x)\oplus\operatorname{ROTR}_{19}(x)\oplus\operatorname{SHR}_{10}(x),\\ \operatorname{Ch}(x,y,z)&=(x\wedge y)\oplus(\neg x\wedge z),\\ \operatorname{Maj}(x,y,z)&=(x\wedge y)\oplus(x\wedge z)\oplus(y\wedge z). \end{aligned} \]Let \((A_i,B_i,C_i,D_i,E_i,F_i,G_i,H_i)\) be the registers before round \(i\). For round constant \(K_i\) and round word \(W_i\) the conventional transition [1] is
\[ \begin{aligned} T_{1,i}&=H_i+\Sigma_1(E_i)+\operatorname{Ch}(E_i,F_i,G_i)+K_i+W_i,\\ T_{2,i}&=\Sigma_0(A_i)+\operatorname{Maj}(A_i,B_i,C_i),\\ (A_{i+1},B_{i+1},C_{i+1},D_{i+1})&=(T_{1,i}+T_{2,i},A_i,B_i,C_i),\\ (E_{i+1},F_{i+1},G_{i+1},H_{i+1})&=(D_i+T_{1,i},E_i,F_i,G_i). \end{aligned} \label{eq:standard} \]For an ordinary 512-bit block, \(W_0,\dots,W_{15}\) are its sixteen words, and
For analyses with \(r<64\), we take the first \(r\) standard constants and schedule words. If \(r\leq16\), \(W_0,\ldots,W_{r-1}\) are unconstrained round words.
Prior-art attribution. Equations (2)–(3) are a reindexing of the standard unrolled SHA-256 round identities; Indesteege et al. give the corresponding \(A\)-only state and message-word equations in their Equations (12)–(14) [2]. Our notation makes the intermediate \(E\)-sequence explicit and places the message-schedule residuals in the same coordinate system. The following equivalence theorem is included for completeness, not as a claim to invent the recurrence.
Define sequences \(a_0,\ldots,a_{r+3}\) and \(b_0,\ldots,b_{r+3}\) by
In particular, for the fixed initial chaining state \(h=(h_0,\ldots,h_7)\),
The two scalar identities for each \(0\leq i Equivalently, (2) may be displayed in the five-tap form
Fix an initial state \(h\) throughout this section and define controlled inputs
\[ u_i:=b_{i+4},\qquad 0\leq iFor \(16\leq i An arbitrary scalar trajectory is a legal SHA-256 message trajectory through \(r\) rounds exactly when every \(\operatorname{R}_i\) vanishes. The theorem is a restatement of the deterministic SHA-256 message expansion in scalar coordinates. Its useful analytical consequence is that the \(r-16\) schedule residuals are sequentially solvable when controls are ordered forward, even though a solver enforcing a prescribed terminal state may face a coupled, nonlinear system. The scalar coordinates also give a simple deterministic backward identity. Solving (4) for the word four steps earlier yields The peeling statement should not be confused with solving a prescribed fixed-target SHA-256 instance. For a fixed initial IV \(h\) and an \(r\)-round legal schedule, the message selects a point in \(\mathcal{W}^{16}\). Imposing a specified eight-word terminal register state adds eight coupled conditions on those choices. A count of input and output words does not by itself prove that a particular target is reachable, nor that finding an input is efficient. For the one-block compression function, write the final state before feed-forward as \(S_r(h,M)\) and define Addition is wordwise modulo \(2^{32}\). A NIST-IV compression fixed point requires \(S_{64}(\mathrm{IV}_{\mathrm{NIST}},M)=0\). An internal-state fixed point instead requires \(S_{64}(\mathrm{IV}_{\mathrm{NIST}},M)=\mathrm{IV}_{\mathrm{NIST}}\). Neither is established here. Full SHA-256 hashing also requires standard padding and length encoding [1]. The five encodings express the same fixed-IV, \(r\)-round state-reachability problem: a complete terminal working state is prescribed from an independently evaluated legal SHA-256 message, and all round words beyond the first sixteen must obey the standard schedule. Four are the original baseline models; the fifth is a factored-control pilot proposed by the dependency-depth audit. The following declarations specify precisely which words are solver-level inputs and which are derived expression-DAG nodes. All word arithmetic is exact modulo \(2^{32}\). Declared-word counts exclude constants and derived DAG nodes, and do not predict the number of variables after SMT lowering or bit-blasting. The factory hashes only syntactically identical expressions; it does not perform algebraic normalization or semantic common-subexpression elimination. Bounded versus recursive expression depth.
In the \(A\)-only encoding, every updated \(a_k\) is a declared variable. Consequently, a derived \(b_k\) depends on a bounded five-word \(a\)-window rather than a chain of earlier derived \(a\)-words; \(W_i\) and its schedule-residual expression likewise have bounded nesting. Under our exact builder and depth convention, the maximum reachable depth is 16 for \(19\le r\le64\). For unfactored control-first, however, each derived \(a_k\) recursively depends on earlier derived \(a\)-words. The measured longest chain has depth exactly \(5r\) for \(16\le r\le64\) (depths 80, 95, 120, 160, and 320 in Table 1). These are syntactic word-level operator depths, not proofs of solver propagation complexity; a solver may introduce shared intermediate variables and flatten both descriptions. Boundary-based dead-node elimination.
At \(r=16\) there are no message-schedule residual equations. In the \(A\)-only model the terminal \(a\)-words are declared directly, and only the four terminal \(b\)-expressions need to be evaluated; the reconstructed \(W_i\) do not enter any constraint and are removed by reachability pruning. This gives 49 reachable operator nodes, versus 193 in unfactored control-first and 417 in forward \((a,b)\). At \(r=19\), the schedule constraints reactivate more of the early scalar trajectory, but \(A\)-only still uses 425 nodes against 436 control-first nodes. This is a property of the specific boundary problem and expression construction, related to backward terminal peeling; it is not a general proof that \(A\)-only SAT instances will be smaller. Convergence of reachable operator counts, not DAG isomorphism.
At \(r=24,32,64\), the forward compact, \(A\)-only, and unfactored control-first models each have exactly 729, 1041, and 2289 reachable word-operator nodes, respectively. The equality also holds componentwise for addition/subtraction, Boolean AND, XOR, rotations, shifts, and complement. An additional deterministic sweep for every integer \(16\le r\le64\) shows that the \(A\)-only and control-first totals first coincide at \(r=20\), while the forward compact model joins them at \(r=24\), and the equalities persist through \(r=64\). These are equal operation histograms under the present builder, not identical node sets and not a graph-isomorphism theorem. In particular, different maximum depths rule out operator-label-preserving DAG isomorphism. The observed convergence suggests that, once enough schedule equations are active, reachability pruning removes little of the derived expressions; the effect of the variable/equality partition and compiled representation still needs direct solver measurement. Schedule-tap omissions and an exact operation-count identity.
For a truncated instance ending after round \(r\), define the set of round-word indices appearing explicitly in at least one active schedule equality and its complement among the sixteen independently specified message words: The index \(i\) is included because \(W_i\) occurs on the left of the schedule equality; the other four indices are precisely the right-hand-side schedule taps. The set \(\mathcal U_r\) records explicit schedule non-incidence, not independence of the corresponding message words from the final chaining state. The result is a source-level projection/pruning property, not a generic circuit-complexity lower bound, a demonstration of cryptanalytic “shielding” of state differences, or an SMT speedup. In particular, a \(W_m\) omitted from the explicit residuals can still affect the terminal state through the forward recurrence. This suggests a concrete benchmark question: does the syntactic pruning survive preprocessing and bit-blasting across solver implementations? Factored controls: a fifth encoding hypothesis.
The measured depth contrast motivates an intermediate encoding: retain both \(a_k\) and \(b_k\) as explicit state variables, enforce the five-tap equality at each step, but eliminate independent \(W_i\) variables by reconstructing round words from those states. This introduces \(2r\) primary words and \(2r-8\) equalities, while limiting the measured maximum operator depth to 11 for \(19\le r\le64\). It has exactly the same reachable operator counts as unfactored control-first for every tested \(r\in[16,64]\), despite different dependency depths. This is a testable design trade-off between explicit equalities and deeply substituted expressions, not evidence of a SAT/SMT speedup. Audit and validity checks.
The original four-encoding artifact was supplemented with a fifth-model pilot. Five planted legal-message witnesses per model and round count, for \(r\in\{16,19,24,32,64\}\), satisfy every equation (125 model evaluations). For \(r>16\), modifying the expanded word \(W_{16}\) yields incompatible schedules rejected by every model (100 checks). A separate deterministic scan of round counts 16 through 64 checks the operation-count convergence and depth patterns. These checks are semantic consistency tests on planted reachable states; they do not establish equivalence for every possible assignment by exhaustive enumeration, nor do they measure CNF complexity. Planned solver benchmark.
Compare all five encodings on paired fixed-target and independently defined internal-trajectory tasks, using at least fifty planted seeds per round count with identical targets, solver versions, settings, and machine. Record preprocessing statistics, auxiliary bit variables and clauses after lowering, solver wall time, median and interquartile range, and PAR-2 with prespecified timeout handling. Include explicit SAT, UNSAT, and unknown outcomes; independently replay any candidate witnesses. Particular attention should go to \(A\)-only versus unfactored and factored control-first: identical pre-lowering operation counts do not settle the trade-off between recursive depth, explicit constraints, and solver learning. The accompanying Python artifact implements both the scalar construction and a conventional eight-register forward replay. A separate test harness reimplements the conventional round core, independently feeds legal expanded schedules into both representations, generates arbitrary control trajectories, and checks final SHA-256 digests against the Python standard-library Test protocol.
A fixed PRNG seed of Explicit schedule-incompatibility example.
For \(r=19\), seed They are nonzero; the controlled trajectory is not a valid 19-round message-schedule trajectory. This counterexample makes the distinction between round invertibility and legal-message compatibility concrete. Computational-complexity interpretation.
State reconstruction and round-word reconstruction each require \(O(r)\) word operations and \(O(r)\) storage. Completion of the valid schedule also requires \(O(r)\) operations, as does the standard schedule expansion. The coordinate transformation by itself therefore does not yield an asymptotically faster general SHA-256 evaluation algorithm or a shortcut to the fixed-target boundary condition. The preceding audit concerns source-level DAG complexity. We also performed a small, independent QF_BV runtime pilot to test whether the different encodings exploit the fixed-state boundary in practice. The source-derived quantities in this subsection are evaluated for full 32-bit words, the standard NIST IV, and the official expanded-message schedule. For \(r=18,19,20\), the threshold \(h=r-8\) is respectively \(10,11,12\). A separate direct-reconstruction implementation recovered the exact original sixteen message words in 140 of 140 planted tests (20 seeds for each \(r=18,\ldots,24\)), after which ordinary SHA-256 forward replay and message expansion were checked. This is a correctness experiment for the proposition, not a preimage attack: the terminal target was produced from a planted message. Solver protocol.
We used Z3 4.13.3, one process at a time, with a one-second wall-clock cutoff, three independent planted-message seeds (20261031–20261033), and the At each exact boundary-completion threshold \(h=r-8\), the forward compact, \(A\)-only, and factored residual encodings solved all three seeds. Their median successful runtimes, respectively, were 17, 23, and 22 ms at \((r,h)=(18,10)\); 19, 22, and 21 ms at \((19,11)\); and 18, 26, and 24 ms at \((20,12)\). At \((18,12)\) all five encodings succeeded, with median times of 426 ms (eight-register), 17 ms (forward compact), 21 ms (\(A\)-only), 100 ms (unfactored control-first), and 23 ms (factored residual). Below the direct-completion threshold, the \(A\)-only encoding recovered one of three \(r=20,h=11\) instances in 398 ms; no solver success was observed in the other tested below-threshold cells at this cutoff. Why the terminal mask matters.
At \(r=18\) with \(h\in\{12,15\}\), a supplementary experiment compared fixing only \(A,E\) with fixing all eight terminal registers, for the \(A\)-only and factored residual models. For every such three-seed group, the full eight-register target produced 3/3 verified solutions (median 20–23 ms), whereas the \(A,E\)-only target produced 0/3 under the one-second cutoff. This observation is consistent with exact backward peeling enabling constant propagation; the runtimes alone do not establish that this is the only solver-internal cause. Limits of the runtime evidence.
Across 204 pilot trials there were 73 independently verified SAT outcomes and 131 timeouts. The instances have planted reachable targets and planted prefix hints; they are not unassisted preimage problems. Three seeds, a one-second limit, a single SMT solver and machine, and lack of bit-blast statistics are inadequate for a publishable performance ranking. A larger paired multi-solver experiment with calibrated timeouts, resource-use measurements, and at least fifty seeds is still needed. Our formal results show exact equivalence and a convenient parameterization, but do not establish an efficient 64-round attack. Several limitations are explicit: Natural follow-up questions are whether the scalar representation exposes useful conditional gate invariants; whether a hybrid linear/nonlinear decomposition reduces solver propagation cost; and whether it yields a demonstrably smaller independent nonlinear core under additional boundary constraints. Those are research hypotheses, not consequences of Theorem 5.2. The unrolled SHA-256 state coordinates known from prior collision research admit a compact, triangular control-to-round-word description and a sequential schedule-completion interpretation. We have instantiated five equivalent fixed-terminal encodings and checked their satisfiable planted instances. A source-level DAG audit demonstrates differences in declared variables, equality counts, and expression depth, but these are not substitutes for compiled CNF statistics or solver run distributions. An exact two-boundary reconstruction threshold explains a sharp change in the limited hinted-target pilot, but a much larger paired five-encoding benchmark against the established \(A\)-only baseline is needed to assess solver efficiency. The supplied archive includes the hint-transition solver runner, clean per-trial CSV, summary tables, exact reconstruction tests, and source-level audit scripts and CSV outputs ( This is a pre-submission working draft. Author attribution and any disclosure of computational resources, affiliations, acknowledgements, or repository DOI should be supplied by the submitting author. The present results should not be described as a successful collision attack or as an independently established cryptanalytic security break.6. Terminal-state reconstruction and boundary constraints
7. Source-level encoding audit and factored pilot
\(r\) Encoding Vars Eq Ops Depth 16 8-register 144 136 416 8 16 forward \((a,b)\) 48 40 417 5 16 \(A\)-only 16 8 49 5 16 control-first 16 8 193 80 19 8-register 171 163 533 8 19 forward \((a,b)\) 57 49 534 6 19 \(A\)-only 19 11 425 16 19 control-first 19 11 436 95 24 8-register 216 208 728 8 24 forward \((a,b)\) 72 64 729 6 24 \(A\)-only 24 16 729 16 24 control-first 24 16 729 120 32 8-register 288 280 1040 8 32 forward \((a,b)\) 96 88 1041 6 32 \(A\)-only 32 24 1041 16 32 control-first 32 24 1041 160 64 8-register 576 568 2288 8 64 forward \((a,b)\) 192 184 2289 6 64 \(A\)-only 64 56 2289 16 64 control-first 64 56 2289 320 Factory with a fixed initial state and eight prescribed terminal words. For every integer \(16\le r\le64\),
\(r\) \(|\mathcal U_r|\) \(F_r-C_r\) \(\mathcal U_r\) 16 16 224 \(0,1,\ldots,15\) 17 12 168 \(2:8,\,10:13,\,15\) 18 9 126 \(3:8,\,11:13\) 19 7 98 \(4:8,\,12,13\) 20 5 70 \(5:8,\,13\) 21 3 42 \(6,7,8\) 22 2 28 \(7,8\) 23 1 14 \(8\) 24 0 0 \(\varnothing\)
\(r\) Vars Eq Ops Depth 16 32 24 193 5 19 38 30 436 11 24 48 40 729 11 32 64 56 1041 11 64 128 120 2289 11 8. Algorithms and reproducible validation
hashlib implementation for several padded messages.# Listing 1: State-first reconstruction for r arbitrary round words. All arithmetic is mod 2^32.
input: IV h, controls u[0..r-1]
a[0..3], b[0..3] := reversed halves of h
for k = 4 .. r+3:
b[k] := u[k-4]
a[k] := b[k] - a[k-4] + Sigma0(a[k-1]) + Maj(a[k-1], a[k-2], a[k-3])
for i = 0 .. r-1:
W[i] := b[i+4] - K[i] - a[i] - b[i] - Sigma1(b[i+3]) - Ch(b[i+3], b[i+2], b[i+1])
output: a, b, W# Listing 2: Sequential legal-schedule completion from sixteen controls.
input: IV h, initial controls u[0..15], round count r >= 16
reconstruct a, b, W for the first 16 rounds
for i = 16 .. r-1:
wanted := W[i-16] + sigma0(W[i-15]) + W[i-7] + sigma1(W[i-2])
u[i] := wanted - Phi_i(u[0..i-1])
compute a[i+4], b[i+4], W[i] from the scalar equations
assert W[i] == wanted
output: schedule-compatible trajectory20261031 generates 25 valid-message and 25 arbitrary-control test cases for each of \(r\in\{1,4,8,16,17,19,32,64\}\). The tests cover (a) round-trip reconstruction from a legal message, (b) forward replay of arbitrary controls using their reconstructed \(W\), (c) the exact unit-diagonal perturbation property, and (d) agreement between the schedule-validity predicate and explicit expansion. The full-digest reference check uses messages of lengths 0, 3, 6, 55, 56, 120 bytes, covering single- and multiple-block padding cases. Tests are deterministic and use no external packages.
Validation category Trials Result Valid-message round-trip (scalar versus standard rounds) 200 Pass Arbitrary-control round replay 200 Pass Exact triangular, unit-diagonal perturbation 200 Pass Schedule residual versus expansion consistency 200 Pass Full SHA-256 digests versus hashlib6 Pass 2026, otherwise random controls, and overrides \(b_{13}=\mathtt{00000000}\), \(b_{14}=\mathtt{FFFFFFFF}\), the reconstructed round words replay exactly in the conventional round engine. However, their three schedule residuals are8.1. Exploratory solver pilot and an exact hint threshold
definitions shared-expression SMT-LIB2 output. For each \(r\in\{18,19,20\}\) and \(h\in\{9,10,11,12\}\), exactly \(W_0,\ldots,W_{h-1}\) were fixed to their planted values, together with all eight terminal register words. The remaining message and state variables were not pinned. Five encodings were paired on precisely the same terminal target and prefix. Every reported satisfying model was independently reconstructed into \(W_0,\ldots,W_{15}\) and verified by conventional SHA-256 expansion and forward replay. The 180-trial grid was augmented with 24 selected terminal-mask comparisons.
Rounds Prefix \(h\) Eight-reg. Forward \((a,b)\) \(A\)-only Control-first Factored \((a,b)\) 18 9 0/3 0/3 0/3 0/3 0/3 18 10 0/3 3/3 3/3 0/3 3/3 18 11 0/3 3/3 3/3 0/3 3/3 18 12 3/3 3/3 3/3 3/3 3/3 19 9 0/3 0/3 0/3 0/3 0/3 19 10 0/3 0/3 0/3 0/3 0/3 19 11 0/3 3/3 3/3 0/3 3/3 19 12 0/3 3/3 3/3 0/3 3/3 20 9 0/3 0/3 0/3 0/3 0/3 20 10 0/3 0/3 0/3 0/3 0/3 20 11 0/3 0/3 1/3 0/3 0/3 20 12 0/3 3/3 3/3 0/3 3/3 10. Limitations and research questions
11. Conclusion
Reproducibility statement
four_encoding_audit.py, five_encoding_pilot.py, and the corresponding count/scan CSV files), the earlier sha256_reversible_state_control.py, and the functional-validation harness. Reproduce the baseline audit with python four_encoding_audit.py --outdir . --trials 5 and the fifth-model pilot with python five_encoding_pilot.py; no external Python packages are required. The extended audit tests 125 legal model evaluations and 100 incompatible schedules across rounds 16, 19, 24, 32, and 64. Reported symbolic counts depend on the explicitly documented encoding policy and cannot be compared directly to bit-blasted solver statistics.Disclosure and manuscript status
References