Closed dark64 closed 3 years ago
Do you think it makes sense to instead try to construct these by deserializing from the relevant bytes? I feel like that's less error prone and less likely to cause bugs.
I managed to do this using the FromBytes
trait. I guess my proposed change is not needed after all, so I'm closing this. Thanks for the help! :+1:
This PR adds
from_xy_checked
function toAffineCurve
trait which can be used to create a point from raw X and Y coordinates. This function returns aResult
as on-curve check is performed.We are in process of adding zexe as a backend to ZoKrates project and this is currently a block for us. As we work with raw x and y coordinates we need to have a way to construct associated
G1Affine
andG2Affine
types fromPairingEngine
trait. This change would enables us to do so.As a reference, this is supported for bellman in the pairing_ce crate. Any feedback is appreciated on this.