-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Solidity-compatible hashes #123
Comments
@julienbrs will work on it |
Start working on it too. |
@julio4 kindly assign me this issue |
@julio4 where is the best place for me to test the bug? |
You need to add a new test that specifically verify this case |
Should I add it under listings/testing_how_to directory? |
This is a bug with the solidity-compatible hashes example, so you should fix the bug and add tests directly in this listing directory. |
Hello @julio4 I need little clarity |
There is a problem with the example of solidity-compatible hashes. The way it's currently done is that it calls
keccak_u256s_be_inputs
to hash a span composed of u256 words - however this function expects only full u256 words!Consider the following:
If you run the tests, you'll notice that it works for the full u256 word (with all bits set) but not for the word that is not full.
This is a bit tricky, but basically what you should do instead is:
n
with the first u64 word of the inputn+1
See how it's implemented in Alexandria for bytes inputs, or Herodotus for u64-words inputs.
The text was updated successfully, but these errors were encountered: