lambdaclass / zksync_era_precompiles

Yul precompile library to speedup elliptic curves operations.
Apache License 2.0
51 stars 19 forks source link

Doc comments for functions #242

Closed IAvecilla closed 7 months ago

IAvecilla commented 7 months ago

Context: EcPairing.yul

Description: There are a couple of typos in the functions' doc comments. Some of the require additional information:

Recommendation:

  1. computeLine and mixedAdditionStep require that points in Jacobian coordinates are not equal. We recommend to mention and explain this why it's it's never a case in this implementation. We add and double point Q which is G2 group generator of an order of 21888242871839275222246405745257275088548364400416034343698204186575808495617. So will never reachQ``
  2. g2ProjectiveFromAffine doc comment is wrong. It should be If x or y differ from 0, just add z = (1,0).
  3. There is a mistake in MONTGOMERY_TWISTED_CURVE_COEFFS doc comment. Twisted curve equation is wrong. b coefficient should be 3/(9+u).
  4. Wrong curve equation in g2AffinePointIsOnCurve doc comment

zkSync:

Spearbit: