Closed weikengchen closed 3 years ago
The CI passes!
Should this serialize also the zero bit? I.e., by converting to SWAffine
and serializing that?
You mean the infinity
bit?
The current upstream implementation only to_constraint_fields x and y for Affine for SW. Should we also include the infinity bool? I intentionally removed this one since some PR (I forgot) starts to omit the infinity bool.
Ah, I misunderstood. So I double-read your comment and the code, now there are two action items:
Handle the case when z=0
. Now it would simply fail, but ideally we should do to_affine
like https://github.com/scipr-lab/zexe/blob/master/r1cs-std/src/groups/curves/short_weierstrass/mod.rs#L154 first, and convert it to filed gadgets from an affine.
Question: should we also to_constraint_field the infinity bit in SWAffine? Currently, it doesn't, but it seems safer to do so?
yes to both!
Done and CI passes. Please review it again. (The code is significantly shorter for ProjectiveVar!)
Closed temporarily. (The branch has been wrongly used for some other changes).
Will later push one to the arkworks's.
The previous PR https://github.com/scipr-lab/zexe/pull/278 does not include the case of SW
ProjectiveVar
(but onlyAffineVar
), but it is used in the main implementations ofPairingVar
for SW curves.So, when we are refactoring the Marlin gadgets, we discovered that
ToConstraintFieldGadget
for SWProjectiveVar
is needed. This PR provides so.