gnark
gnark copied to clipboard
MPC Generated Pedersen Keys
Description
Some circuits require that the pedersen key is MPC generated.
I'm opening this up as a draft PR as I'd like to gather some feedback on it! Additionally, it will require that encoding for [][]curve.G1Affine is supported in gnark-crypto. Once I've got the go ahead from one of the maintainers I'll proceed with the encoding work upstream and properly updating the templates.
This change involves adding a couple fields to both Phase2Evaluations and Phase2 which represent the G1 points of the Pedersen keys. Phase2.Contribute() then handles the MPC contributions like you'd expect.
Breaking changes include the addition of the new struct fields, as well as the change of arguments in ExtractKeys
Fixes
https://github.com/Consensys/gnark/issues/1046 https://github.com/Consensys/gnark/issues/1136
Type of change
- New feature
How has this been tested?
- ✅ TestEcdsa
Checklist:
- ✅ I have performed a self-review of my code
- ✅ I have commented my code, particularly in hard-to-understand areas
- ✅ I have made corresponding changes to the documentation
- ✅ I have added tests that prove my fix is effective or that my feature works
- 🚫 I did not modify files generated from templates
- ✅
golangci-lintdoes not output errors locally - ✅ New and existing unit tests pass locally with my changes
Just commenting here for a bump! @ivokub or @Tabaie Would love to get your thoughts.
Hi @ewoolsey apologies for the delay it's been very busy recently. Will review asap.
Hi @ewoolsey apologies for the delay it's been very busy recently. Will review asap.
All good, thanks so much for taking a look! I don't see any reason why this shouldn't be the default behaviour, but if you see any issues let me know!
@hussein-aitlahcen thanks so much for the initial review. If you think this is good to go ahead now then I'll go ahead and translate these changes into the templates.
@hussein-aitlahcen thanks so much for the initial review. If you think this is good to go ahead now then I'll go ahead and translate these changes into the templates.
Maybe @Tabaie could double check what we did please? I'm not a cryptographer :).
@Tabaie just bumping this one more time 👍
@Tabaie sorry just bumping this again ahah
Thanks so much for taking a look @Tabaie. Let me know if there's anything you need from me!