Repository navigation
Compare buffer lengths in SMT buffer equality - #1204
Merged
Merged
Conversation
PEq on buffers was encoded as array equality only, so buffers differing only in length (e.g. all-zero revert data of 31 vs 32 bytes) compared equal and the equivalence checker missed the difference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
PEqon buffers was encoded in SMT as array equality only, ignoring length. Buffers that differ only in length then compared equal:revert(4, 32)vsmstore(31, byte(0, iszero(calldataload(0)))); revert(32, 31)was reported equivalent, although one reverts with 32 zero bytes and the other with 31. Found byeq-fuzz-cex-replays.The encoding now also asserts that the buffer lengths are equal. This matches
peqon concrete buffers and the keccak injectivity assumptions. Return data was affected the same way; both cases have regression tests.Checklist