Open enitrat opened 1 year ago
@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? Can't seem to find it
@julio4 where is the best place for me to test the bug? Can't seem to find it
You need to add a new test that specifically verify this case
Should I add it under listings/testing_how_to directory?
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 Am I supposed to replace the existing code on tests.cairo with the code snippet provided above?
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.