Skip to content
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

gnark-crypto, eip-196: malformed input handling #188

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

garyschulte
Copy link
Contributor

@garyschulte garyschulte commented Jul 10, 2024

ECADD and ECMUL:

  • Treat short input as an error conditions on a per-parameter basis
  • Add test cases for point not on curve and point not in field for ECADD
  • pass output and error lengths for eip196 rather than static lengths

This change is consistent with reference tests and parameter parsing in other crypto implementations, and clarifies the edge cases (and language) described in the original eip:

https://eips.ethereum.org/EIPS/eip-196#test-cases

using this pr, clean run of besu#7626 :

  • referenceTest task
  • evmtool based exeution-spec-test main

Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte changed the title gnark-crypto, eip-196: treat both short input and long input as error conditions gnark-crypto, eip-196: treat short input as error condition Jul 10, 2024
… error and output length rather than static vals

Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte changed the title gnark-crypto, eip-196: treat short input as error condition gnark-crypto, eip-196: malformed input handling Jul 10, 2024
Signed-off-by: garyschulte <garyschulte@gmail.com>
Copy link

@pinges pinges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I like that we are getting rid of that edge case :-)

@garyschulte garyschulte merged commit 107c0e6 into hyperledger:main Jul 11, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants