Skip to content

Conversation

@p4u
Copy link

@p4u p4u commented Jan 8, 2026

  • Added BLS12-377 curve implementation with correct parameters.
  • Updated build_f2m.js to support square root for q % 4 == 1 (general norm-based algorithm), required for BLS12-377 G2.
  • Cleaned up build_curve_jacobian_a0.js.

- Added BLS12-377 curve implementation with correct parameters.
- Updated build_f2m.js to support square root for q % 4 == 1 (general norm-based algorithm), essential for BLS12-377 G2.
- Cleaned up build_curve_jacobian_a0.js.
@p4u
Copy link
Author

p4u commented Jan 8, 2026

Add an if/else (q % 4n === 3n) block because of the different properties of the base field modulus $q$.

Curves BN128 and BLS12-381 have a modulus $q$ where $q \equiv 3 \pmod 4$. But BLS12-377 has a modulus $q \equiv 1 \pmod 4$.

The if block preserves the performance optimization for existing curves ($3 \pmod 4$), while the else block adds the necessary support for BLS12-377 ($1 \pmod 4$) by employing the generic Tonelli-Shanks algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant