keep-starknet-strange / garaga

State-of-the-art Elliptic Curve operations and SNARKS verification for Cairo & Starknet 🐺.
https://felt.gitbook.io/garaga
MIT License
188 stars 47 forks source link

efficient lambda roots for bls #130

Closed akinovak closed 3 months ago

akinovak commented 3 months ago

Efficient hint computation for bls curves

Please check the type of change your PR introduces:

What is the current behavior?

Roots are computed with generic nth_root(x) function, which takes ~2s to compute all required hints for BLS curve.

What is the new behavior?

By exploiting the group structure and clearing any 27th root of unity (instead of just primitive) all roots are now being computed by simple modular inverse exponentiations. This substantially improves the efficiency of hints computation.

Does this introduce a breaking change?

Other information