-
Notifications
You must be signed in to change notification settings - Fork 206
feat: Options for custom hash function and randomness source in MPC setup ceremonies #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thank you for the contribution! Am I understanding correctly that the hash and rand settings are global? Since the Also, please make sure to run |
// k is the maximum byte length needed to encode a value < q | ||
// b is the number of bits in the most significant byte of q-1 | ||
|
||
var bytes [{{mul 8 .NbWords}}]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use fieldPackage.Bytes
instead of the multiplication here.
Description
This PR adds support for custom hash functions and randomness sources in MPC setup ceremonies, as requested in issue #626. These changes enable in-SNARK verification of setup ceremonies and make debugging easier by allowing users to provide their own implementations.
The implementation includes:
SetRandomWithSource
method tofr.Element
Usage Examples
Custom Hash Function
Custom Randomness Source
Implementation Note
This implementation specifically addresses the feedback from the previous PR (#653):
Type of change
[x] New feature (non-breaking change which adds functionality)
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How has this been tested?
Fixes #626