Repository navigation
test(match): rsum collision fixture rejects via strong-checksum gate - #3640
Merged
Merged
Conversation
Construct adversarial pairs of 700-byte blocks that share an identical rolling Adler digest (signed-byte interpretation) but have different content. Verify that DeltaSignatureIndex::find_match_bytes rejects the colliding window via the strong-checksum gate. This is the safety property that future probabilistic prefilters (e.g. a bithash) will depend on: even if the prefilter admits the rolling key, the strong-checksum stage must catch the mismatch. Includes a high-byte (>= 0x80) variant that exercises the signed-schar path from upstream checksum.c:285, providing additional regression coverage for the sign-extension fix in PR #3560. Construction: swap last 4 bytes [a, b, c, d] -> [d, c, b, a] when 3*(a-d) == c-b. Two solutions used: low-byte [0x01, 0x00, 0x03, 0x00] and high-byte [0x80, 0x86, 0x80, 0x82].
oferchen
force-pushed
the
test/zsync-rsum-collision-fixture-2078
branch
from
May 5, 2026 07:29
dfb37be to
d10efc7
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…3640) Construct adversarial pairs of 700-byte blocks that share an identical rolling Adler digest (signed-byte interpretation) but have different content. Verify that DeltaSignatureIndex::find_match_bytes rejects the colliding window via the strong-checksum gate. This is the safety property that future probabilistic prefilters (e.g. a bithash) will depend on: even if the prefilter admits the rolling key, the strong-checksum stage must catch the mismatch. Includes a high-byte (>= 0x80) variant that exercises the signed-schar path from upstream checksum.c:285, providing additional regression coverage for the sign-extension fix in PR #3560. Construction: swap last 4 bytes [a, b, c, d] -> [d, c, b, a] when 3*(a-d) == c-b. Two solutions used: low-byte [0x01, 0x00, 0x03, 0x00] and high-byte [0x80, 0x86, 0x80, 0x82].
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…3640) Construct adversarial pairs of 700-byte blocks that share an identical rolling Adler digest (signed-byte interpretation) but have different content. Verify that DeltaSignatureIndex::find_match_bytes rejects the colliding window via the strong-checksum gate. This is the safety property that future probabilistic prefilters (e.g. a bithash) will depend on: even if the prefilter admits the rolling key, the strong-checksum stage must catch the mismatch. Includes a high-byte (>= 0x80) variant that exercises the signed-schar path from upstream checksum.c:285, providing additional regression coverage for the sign-extension fix in PR #3560. Construction: swap last 4 bytes [a, b, c, d] -> [d, c, b, a] when 3*(a-d) == c-b. Two solutions used: low-byte [0x01, 0x00, 0x03, 0x00] and high-byte [0x80, 0x86, 0x80, 0x82].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Construct adversarial 700-byte block pairs that share an identical rolling Adler digest but have different content. Verify the strong-checksum gate in `DeltaSignatureIndex::find_match_bytes` rejects the colliding window.
Why
This is the safety property that probabilistic prefilters depend on: even if a prefilter (the current `tag_table`, or a future bithash) admits the rolling key, the strong-checksum stage must catch the mismatch. Pinning this down as a regression test is a prerequisite for the upcoming bithash work (#2061).
Construction
For a block of length `n >= 4`, swapping the last four bytes `[a, b, c, d]` -> `[d, c, b, a]` preserves both `s1` and `s2` iff `3 * (a - d) == c - b` (in plain integer arithmetic, since the values fit comfortably within the s2 weight range). Two concrete pairs:
The high-byte case exercises the signed-`schar` path from upstream `checksum.c:285` and adds redundant coverage for the sign-extension fix in PR #3560.
Tests
Six tests in `crates/match/tests/rsum_collision_fixture.rs`:
Closes
#2078