py-evm icon indicating copy to clipboard operation
py-evm copied to clipboard

Updates on subgroup check

Open ChihChengLiang opened this issue 5 years ago • 2 comments
trafficstars

What was wrong?

Come across the pairing precompile and find these 2 issues.

  1. TODO error message on pairing.
  2. 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?

  1. Fix the wording of the error message.
  2. Add a subgroup check for the p1.

Cute Animal Picture

image

ChihChengLiang avatar Aug 20 '20 14:08 ChihChengLiang

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

ChihChengLiang avatar Aug 20 '20 15:08 ChihChengLiang