Input sanitization - #3
Merged
Merged
Conversation
zemse
force-pushed
the
input-sanitization
branch
from
February 14, 2026 08:55
d8de025 to
d57c6ec
Compare
zemse
force-pushed
the
input-sanitization
branch
from
February 14, 2026 09:00
d57c6ec to
c66752f
Compare
zemse
added a commit
that referenced
this pull request
Jun 20, 2026
* add failing test case * ensure inputs are sanitized
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.
When inputs are larger than PRIME value (which is anyway an invalid case), it causes this implementation to overflow in some cases.
This PR ensures inputs are sanitised at entry point in both yul and huff contracts at a negligible cost (+24 gas for huff and +32 gas for yul).
E.g. The case hash_2 with type(uint256).max fails the test. After the fix, the test passes.