gnark
gnark copied to clipboard
Feat: 4-dimensional fake GLV
Description
https://ethresear.ch/t/fake-glv-you-dont-need-an-efficient-endomorphism-to-implement-glv-like-scalar-multiplication-in-snark-circuits/20394/7
Type of change
- [x] New feature (non-breaking change which adds functionality)
How has this been tested?
Correctness tests are implemented in emulated/sw_emulated/point_test.go
and native/sw_bls12377/g1_test.go
.
How has this been benchmarked?
All benchmarks are in plonkish constraints (scs):
-
Scalar muls (EMULATED)
-
Secp256k1:
- old: 385,461
- new: 285,176
-
BN254:
- old: 381,467
- new: 282,215
-
BW6-761:
- old: 1,367,067
- new: 1,017,381
-
-
Scalar muls (NATIVE)
- BLS12-377:
- Old: 3,587
- New (+10): 3,615
- New (+9): 3,567
- New (+6): 3,423
- BLS12-377:
-
Precompiles:
- ECRECOVER:
- Old: 459,065
- New: 459,058
- ECMUL:
- Old: 384,782
- New: 283,076
- ECRECOVER:
-
Recursion:
- Emulated:
- Old: 28,206,642
- New: 27,157,691
- Native:
- Old: 300,262
- New: 300,022
- Emulated:
Checklist:
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I did not modify files generated from templates
- [x]
golangci-lint
does not output errors locally - [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules