In g2ScalarMul
function in the EcPairing precompile, when performing scalar multiplication by 2, the function incorrectly passes the y-coordinate (yp1
) instead of the z-coordinate (zp1
) as the last parameter to g2JacobianDouble
. This incorrect coordinate usage corrupts the resulting point computation affecting the pairing-based cryptographic operations in the ZKSync Era protocol.
The impact of using yp1
instead of zp1
in the g2JacobianDouble
call is a severe because:
In Jacobian coordinates, a point (X:Y:Z) represents the affine point:
Using the wrong Z-coordinate (yp1
instead of zp1
) will result in completely incorrect affine points.
Consider a point P
on the G2
curve in Jacobian coordinates (X:Y:Z)
where:
When we double this point (multiply by 2), with the bug:
Let's say we have these values:
In the g2JacobianDouble
function, it performs calculations like:
The bug causes:
Wrong Z-coordinate multiplication: Y1*Z1
uses (zp0,yp1)
instead of (zp0,zp1)
This affects the computation of the new Z-coordinate (Z3
)
Since in Jacobian coordinates (X:Y:Z) represents the affine point (X/Z², Y/Z³), the error propagates exponentially
For example:
This leads to wrong Z-coordinate in the result. When converting back to affine coordinates (X/Z², Y/Z³), the point will be completely wrong. Any subsequent pairing calculations using this point will fail or produce invalid results
The impact is magnified because:
So the error in Z is amplified quadratically and cubically in the final affine coordinates.
Using the example above,
This shows how a single wrong/misplaced coordinate in the Jacobian double operation leads to completely invalid results in the G2 curve arithmetic, which would break any pairing-based cryptographic operations in the protocol.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.