Security › hash-31 · Constant-time review · Performance: x86_1 · arm_1
The ZC-DMC Hash Function (hash-31)
| Candidate | The ZC-DMC Hash Function |
|---|---|
| Family | Symmetric (feed-forward sponge) |
| Archive | ZC-DMC.zip (SHA-256: b6da323d388d3411b882228152f25626999502b8c246cc0c9b64a0a9d72eaaac) |
| Specification | hash-31-spec.pdf PDF |
| Performance | x86_1 · arm_1 |
hash-31-1: Cross-domain distinguisher between ZC-1536-512 and ZC-1536-768
| Severity | Medium |
|---|---|
| Scope | design |
| Status | Confirmed |
| Affected | Specified ZC-DMC-1536-512 and ZC-DMC-1536-768 construction |
| Discovery | Moderate |
| Exploitation | Moderate |
| Credit | Tsinghua Hash Lab cuihr26@mails.tsinghua.edu.cn |
| Date | 2026-09-22 |
Original source: CryptHashForum report
The two instances share the same 1536-bit permutation and zero initial state, while moving the rate/capacity feed-forward boundary. Further extension to Tsinghua Hash Lab's analysis: take a common first 704-bit block (zero-extended to 960 bits for the 512 profile), then a zero block. After these two absorptions the states differ only at bits 704–959, by D = P(B1)[704:960]. Putting D in that region of the 512 profile's third block makes both final permutation inputs equal. Feed-forward leaves their first 704 state bits equal, so the first 64-bit squeeze blocks agree. The first-block counter value 13 gives the four-bit suffix needed to make both final blocks valid under the mandatory M || 01 || 10*1 padding.
The official 512- and 768-bit CryptHash libraries return the same first eight digest bytes, 7a07b396b47dfec4, for the constructed messages. A one-bit control differs. This is a cross-profile distinguisher (ideal probability 2^-64), not a same-instance or full-digest collision.
Follow-up analysis: the Iphe Algorithm Group's cross-rate note, posted by 崔灏睿 on 2026-09-23 gives an independent three-block ZC-DMC witness. The ZC-DMC team's response on 2026-09-23 acknowledges the relation; this report concerns the archived zero-IV submission.
Proposed fixes
The ZC-DMC team's response proposes distinct three-bit IV tags for the profiles. This section records the proposal without evaluating it.
Reproducing
Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).
From the repository root, run make -C hash-31 exploit. The witness uses only the two official archived hash libraries for its verdict and prints CONFIRMED hash-31-1.
hash-31-2: Message modification gives a conditional 2^288 collision estimate
| Severity | Critical |
|---|---|
| Scope | design |
| Status | Lead |
| Affected | ZC-DMC-1536-768 and -1024; full-round attacks remain conditional |
| Discovery | Non-trivial |
| Exploitation | Conditional 2^288 later-round candidate tests for -768 after affine three-round message modification; no full-round collision |
| Credit | Qinghe Crypto Group; three-round message-modification extension by Markku-Juhani O. Saarinen markku-juhani.saarinen@tuni.fi, with AI assistance |
| Date | 2026-09-29 |
Original source: Qinghe Crypto Group's CryptHash Forum post
For ZC-1536, the input difference Delta A_0[0] = 0x1111111111111111 survives the linear layer. At each of its 16 active bit positions, the sequential χ mapping preserves the difference exactly when the two other input bits are 0,1, a probability of 1/4; the one-round trail therefore has weight 32. Capacity-only feed-forward leaves this rate difference unchanged, after which a message-block difference can cancel it and merge the states.
The original post's independent-round model gives 2^224, 2^352, and 2^384 for 7, 11, and 12 rounds. Further extension: rate-only linear message modification enforces the first three rounds. For ZC-DMC-1536-768, a prefix satisfying 16 capacity conditions and a valid-message collision of the four-round reduced hash were demonstrated from the zero IV; the next block cancels the remaining rate difference. For -1024, the analogous systems are soluble on tested chaining states with 32 capacity conditions imposed, but a prefix reaching one was not constructed. Assuming independent 2^-32 transitions over rounds 4–12 gives about 2^288 accepted pairs needed for a collision. The independence and full-round steps remain open. For the -768 rate, each prefix costs about 2^16 trials and its affine solution space has 153 free bits; all 300 sampled pairs held the first three rounds. Sampling from that space adds only polynomial work per pair, while fresh prefixes supply further spaces. The conditional 2^288 later-round test estimate is therefore below the 384-bit collision target, hence Critical / Lead. No full-round collision was demonstrated.
Follow-up: Niu, Peyrin, Zhang, and Zhou's issue #36, posted 2026-11-01, supplies reachable first-three-round certificates for the full-schedule -768 and 11-round -512 DM/DMC cases. Its attached verifier reconstructs them and proves at least 2^415 distinct three-round pairs for each -768 certificate. That is enough candidate supply, but its specified sampler uses at most 2^64 three-round proposals per accepted pair in expectation. For that separate sampler, 2^288 accepted pairs could take up to 2^352 proposals in expectation before full-round tests. This does not price the affine message-modification generator above. The issue's 11-round -512 count of 2^255 accepted candidates likewise is not a below-birthday work bound with that sampler. No full-round collision is shown.
Reproducing
Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).
python3 security/zc_iterative_differential.py
The certificate exhausts the three-bit χ inputs and checks both reported masks against the linear rotations: the 16-active-position mask used above has weight 32 per round, while the all-ones mask used for the reported ZC-1280 reduced-round trail has 64 active positions and weight 128 per round. It then prints the unresolved multi-round limitation.
Run python3 security/zc_message_modification.py for the extension's rate-only systems and a replay of the reduced-round collision against the submitted permutation. The witness does not rerun the long search. Its reduced permutation uses the reference code's last-four-round constants, not the first four rounds of the full schedule.
hash-31-3: An 8-column iterative trail gives an estimated 2^125 collision
| Severity | Critical |
|---|---|
| Scope | design |
| Status | Lead |
| Affected | ZC-DMC-1536-512 and -768 |
| Discovery | Non-trivial |
| Exploitation | Estimated 2^125.1 (-512) and 2^129 (-768) work, conditional on independence over ten probabilistic rounds; collisions executed for three and four rounds only |
| Credit | Markku-Juhani O. Saarinen markku-juhani.saarinen@tuni.fi, with AI assistance |
| Date | 2026-10-31 |
Fix a bit position z and let D have plane 0 active on the odd lanes and plane 2 active on the even lanes, all at z. The plane-2 ρ offset (5, 0) has no z-rotation, so after the first ρ the active bits share columns, θ sees zero column parity, and the second ρ maps the even lanes back onto themselves: the linear layer fixes D exactly. Each active χ column keeps its difference with probability 1/4; consecutive rounds are correlated, and the measured rate is 2^-12 per round from every start round.
In the first block, a rate difference on plane 0 at z becomes W (planes 0 and 2, all lanes) and then D. After a prefix fixes 9 (-512) or 13 (-768) capacity bits, message modification makes the first two rounds free, so the block costs about 2^120. The second block cancels the rate part of D and follows D → D for all twelve rounds; its output difference is rate-only, and a third message block cancels it. Its own 5 or 9 capacity conditions repeat the first block 2^5 or 2^9 times, giving about 2^125.1 and 2^129 against collision targets of 2^256 and 2^384.
The 2^-12 rate was measured for single rounds at every start and for windows of up to four rounds; independence across ten consecutive probabilistic rounds is assumed. No full-round collision was attempted.
Reproducing
Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).
sh security/zc_column_trail.sh
The script checks that the reference linear layer fixes the trail patterns at every z and measures the one-round rate at each start round. It then finds fresh three-round collisions for ZC-DM and ZC-DMC at -512 and -768 from the zero IV with padding, replays stored four-round -512 collisions, and checks every pair with the independent Python mode model. The full twelve-round digests differ. It uses the reference code's last-R-round convention and runs in about 10 seconds.
hash-31-4: Sparse ZC-1280 trail gives a conditional 2^144 collision estimate
| Severity | Critical |
|---|---|
| Scope | design |
| Status | Lead |
| Affected | ZC-DMC-1280-512; the 768- and 1024-bit-output instances are not covered |
| Discovery | Non-trivial |
| Exploitation | Conditional 2^144 candidate trials with polynomial generation and storage; no twelve-round collision |
| Credit | Zhongfeng Niu, Thomas Peyrin, Liu Zhang, and Chunning Zhou |
| Date | 2026-11-02 |
Original source: Niu, Peyrin, Zhang, and Zhou's issue #37 Follow-up source: CryptHash Forum post
The ZC-1280-512 state has a 704-bit rate. The reported difference occupies eight distinct χ columns wholly in that rate and is fixed by the submitted linear layer. Each column requires two bit conditions for the difference to persist, giving an exact one-round rate of 2^-16 on a uniform state. A common legal prefix from the zero IV fixes eight capacity conditions; the next message block selects the rate bits. An exact affine construction then enforces the first three rounds, leaving a 274-dimensional family, or 2^273 distinct unordered message pairs. Sampling it costs polynomial work per pair.
ZC-DMC feeds back only capacity bits. After twelve successful rounds, the two chaining states still differ by the rate-only difference. A later message-block difference cancels it and merges the states; identical padding then gives a full-digest collision. If each of the nine remaining rounds independently passes its 16-bit condition with conditional probability 2^-16 on the constructed family, the expected cost is 2^144 candidates, below the 2^256 digest birthday bound. That tail probability has not been established for this generated distribution; the estimate is therefore a Lead, not a completed full-round attack. The attachment demonstrates a valid four-round collision and confirms that the same messages have different twelve-round digests.
Reproducing
Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).
python3 security/zc1280_issue37.py
The hash-pinned attachment verifier checks the entire three-round affine family and the reduced-round collision, including the later-block merge and padding. The wrapper compares both saved messages' full twelve-round digests against the submitted native C hash. These checks establish the opening and reduced example, not the remaining-round probability or a full-round collision.
hash-31-5: Six round constants are applied in a different order from Table 1.1
| Severity | Low |
|---|---|
| Scope | implementation |
| Status | Confirmed |
| Affected | All six ZC-DMC instances (ZC-1280 and ZC-1536 at 512, 768 and 1024 bits); reference implementation and the shared permutation headers |
| Discovery | Moderate |
| Exploitation | An implementation that follows the specification computes a different function and reproduces none of the KATs; the twelve constants stay distinct, and no security consequence was identified |
| Credit | Markku-Juhani O. Saarinen markku-juhani.saarinen@tuni.fi, with AI assistance, in this candidate's specification notes of 2026-09-21; independently reported by Zhiqiang Yang, Lin Ao, Yue Li, Xin Yi, Ling Song and Lei Wang, using the CryptVerify tool (Cryptol and SAW) |
| Date | 2026-11-19 |
Follow-up source: Yang et al.'s formal verification report, finding 4
Table 1.1 (physical p. 9) lists the twelve round constants, and ι XORs c_i into A0[0] in round i = −11, …, 0 (Algorithms 1 and 2, Figure 1.3). The shared permutation headers (lib/low/ZuD-1280/ZuD1280.h:25–36, ZuD-1536/ZuD1536.h:25–36) define rc8, rc7, rc6 = 0x120, 0x14, 0x60 and rc4, rc3, rc2 = 0x380, 0xF0, 0x1A0, and the permutation applies rc12 down to rc1. So c_−7, c_−6, c_−5 and c_−3, c_−2, c_−1 are each rotated by one position against the table's 0x60, 0x120, 0x14 and 0xF0, 0x1A0, 0x380; the other six constants agree.
As shipped, every instance reproduces all 4,097 KAT_2_12 vectors. With only those six definitions put in the Table 1.1 order, every instance reproduces none.
Reproducing
Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).
sh hash-31/reproduce_spec_mismatch.sh
The witness regenerates each KAT_2_12 file with the shipped NGCC generator and uses it only if its canonical SHA-256 equals the official file's entry in hash-31/kat.sha256.