-
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
Validate s value in signature #75
Comments
After looking into this some, it looks like disallowing EIP-2 (the Homestead hard fork EIP) states:
Further elaboration in EIP-2:
|
Thanks for hunting this down. |
I think this should stay open because this library is used outside of the context of the ecrecover precompile, right? |
Hm. So maybe you're arguing that there should be an API specifically for signatures that follow the ethereum transaction signature rules? My presumption was that the normal, basic rule is correct for this base library. Then tighter rules, like the transaction signature, should be applied at other layers (like eth-account and/or py-evm). |
Ah, okay. Applying at higher levels makes sense to me! |
* new issue and pr templates
What was wrong?
It appears that s is validated against
secpk1_n
but should be validated againsts < secpk1_n / 2 + 1
.How can it be fixed?
s == secpk1_n / 2 + 1
that should fail validation, for the test to pass.s == secpk1_n // 2 + 1
that should succeed validation.eth-keys/eth_keys/validation.py
Lines 108 to 111 in dd4f00a
The text was updated successfully, but these errors were encountered: