py-evm
py-evm copied to clipboard
Updates on subgroup check
trafficstars
What was wrong?
Come across the pairing precompile and find these 2 issues.
- TODO error message on pairing.
- Observed that the p1 subgroup check is missing.
I'm actually uncertain about the second issue and just keeping the diff there for better discussion. I'm seeing conflict signs of whether to do that check.
- The fixture tests have no case for the invalid p1 that's not in a subgroup.
- ~~Go-ethereum checks the p1 in subgroup~~ (sorry that's BLS, not bn)
How was it fixed?
- Fix the wording of the error message.
- Add a subgroup check for the p1.
Cute Animal Picture

Sorry, I checked the go-Ethereum again they don't check subgroup in bn256. https://github.com/ethereum/go-ethereum/blob/9efc1a847e53b63847f6f95e0857b1a6300786eb/crypto/bn256/cloudflare/bn256.go#L298