Conversation
|
Hi @Hakkush-07 -- why do we not do the subgroup check as in Bitvm2 suggested here ? It would only cost a |
|
If possible, could you also list the change in gate count after the change in this PR ? Thank you Edit: |
|
@Hakkush-07 -- If it can be helpful, I have been working on the same task here. |
|
We've discussed that further optimizations can be applied later, after having the code with the main formula, so LGTM |
|
So is the plan to go with this PR and not the more efficient linked PR, and change later? This seems like a bigger overall lift. |
I suggest we discuss this tomorrow: it's rather strange to manually transfer changes in gadgets between different forks when they are practically identical. |
This PR adds subgroup checks for G1 and G2 because we need to make sure Groth16 proof is in correct subgroup.
For G1, the r-torsion group is the same as the elliptic curve group. G1::is_on_curve added and that is enough. Also, when we are using compressed proofs, y coordinate is already calculated in the circuit, so no further action is needed.
For G2, the r-torsion group is a subgroup of the elliptic curve group. G2::is_r_torsion is added.
Only remaining thing to do is to use this G2::is_r_torsion for proof_b field of Groth16 proof.
Part of #76