-
Notifications
You must be signed in to change notification settings - Fork 238
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
Crypto part of the Groth's NIDKG #1182
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aniampio
reviewed
Apr 8, 2022
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.
The crypto looks good! Left a few minor comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alright, this [draft] pull request includes the first batch of work required for distributed key generation so that we could have our coconut credentials. This part focuses on the crypto-part of the problem. The implementation is based on Non-interactive distributed key generation and key resharing by Jens Groth paper. It is also further supported by the extremely helpful description provided by Ania and Alfredo available on our overleaf: https://www.overleaf.com/project/61fc031513021c2738dee13c.
Unfortunately in order to create this implementation, the bls12-381 curve library had to be forked and we will need to operate on the fork until zkcrypto/bls12_381#10 is resolved as we require being able to serialize curve elements inside
Gt
so that we could create the lookup table required for the baby-step giant-step algorithm used during chunk decryption. This also means that once DKG is incorporated into the coconut, the underlying curve library used there will need to be switched to the same fork.The PR also includes couple of benchmarks and those regarding dealing verification and share recovery should be of interest. I've run them on my local machine with ryzen 5900X and the relevant results are as follows:
3.43s * 19 * 4 = 260.7s ~ 4.35 minutes
)16.83 * 99 * 4 = 111 minutes
)The remaining work before this PR can be moved out of the draft includes:
- serialization implementation of the remaining data structures that are required for end-to-end operation (such asDecryptionKey
orDealing
),- implementation ofVKCombine
andVKVfy
algorithmsHowever, in its current state, I think all the existing crypto primitives are ready to get reviewed.