mratsim / constantine

Constantine: modular, high-performance, zero-dependency cryptography stack for proof systems and blockchain protocols.
Other
272 stars 38 forks source link

Elliptic Curve: ⚠️ breaking❗ rename isInf/setinf to isNeutral/setNeutral and rename generator #399

Closed mratsim closed 6 days ago

mratsim commented 6 days ago

This PR is breaking internal API and curves_primitives API.

It:

Rationale

isInf/setInf are for points at infinity which are technically not on the elliptic curve. But in Constantine it is also conflated with the identity/neutral element. This is true for short Weierstrass curves but not true for Twisted Edwards curves as the neutral elements ARE on the curve.

To allow generic algorithm like scalar multiplication and multi-scalar-mul, we rename everything to isNeutral/setNeutral