Skip to content

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

Merged
garyschulte merged 3 commits intobesu-eth:mainfrom
garyschulte:bugfix/trim-edge-case
Jul 11, 2024
Merged

gnark-crypto, eip-196: malformed input handling#188
garyschulte merged 3 commits intobesu-eth:mainfrom
garyschulte:bugfix/trim-edge-case

Conversation

@garyschulte
Copy link
Copy Markdown
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
Copy Markdown

@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 besu-eth:main Jul 11, 2024
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