-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Target
Severity:
- Impact: Low
- Likelihood: Low
Description:
The functions g1_normalize_to_affine and g2_normalize_to_affine normalizes the projective points to affine. This method however does not take into account the point at infinity and will cause unwanted panic while trying to convert a point at infinity projective point to affine since the point and infinity has z component 0 and Fq::inverse_montgomery (or Fq2::inverse_montgomery) will panic for 0. Same issue has been raised earlier here: https://github.com/zenith-security/2025-11-alpen-labs/issues/1. It should be noted that the arkworks handles the point and infinity conversion i.e., converting a infinity point from projective coordinates to affine does not panic due to their Affine representation which can also represent points at infinity. Since the circuit implementation intended to follow the implementation compatible with arkworks, the edge cases should be compatible as well(in this case the point at infinity).
Recommendations:
Add explicit zero check in those functions to handle points at infinity as well so that unwanted panic can be avoided.
Client:
Zenith: