-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: constrain (r, s, v) signature values #259
Conversation
karmacoma-eth
commented
Mar 23, 2024
- BadElections in examples/simple
- test for EIP-2098 compact signatures
Sort of an integration test to make sure that the (v, r, s) values we generate can be encoded and decoded properly in ECDSA.tryRecover
(to their expected range)
+ document missing feature in our implementation of ecrecover
"""Extract bytes from calldata. Zero-pad if out of bounds.""" | ||
if data is None: | ||
return BitVecVal(0, size_bytes * 8) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a regression test that would fail without this fix? (it's not clear when None can be passed to this function.) also, does this fix the vm.etch(x, "")
case as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's related but separate from the vm.etch(x, "")
issue, we don't have a very nice way to deal with empty bytes in general. They get sometimes represented as bytes()
, sometimes as []
, sometimes as None
the test that revealed this issue is check_ecrecover_invalidCallReturnsNothing
, in the following line:
let succ := call(gas(), ECRECOVER_PRECOMPILE, 0, 0, 0, 0, 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. now i can see where None comes from. as you mentioned, i agree that we need a better way to handle nicely empty bytes. could you please open an issue about this to discuss further later?
replied to the question on the commit, but copying here just in case:
|