keep-starknet-strange / garaga

State-of-the-art Elliptic Curve operations and SNARKS verification for Cairo & Starknet 🐺.
MIT License
170 stars 37 forks source link

Efficient hint computation for bls curves #131

Closed akinovak closed 2 weeks ago

akinovak commented 2 weeks ago

Pull Request type

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

feltroidprime commented 2 weeks ago

Perfect Thank you very much!