Skip to content
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

Add DKG support #129

Merged
merged 11 commits into from Oct 18, 2022
Merged

Add DKG support #129

merged 11 commits into from Oct 18, 2022

Conversation

conradoplg
Copy link
Contributor

Implements DKG per the FROST paper.

This required adding a new hash function to the Ciphersuite. I named it HDKG instead of H6 to avoid future collisions. I also made it optional by returning an Option, so that ciphersuites can return None if they don't need the DKG, and making returning None the default implementation so that ciphersuites don't even need to implement it if not needed.

I'm not super happy with the struct names, suggestions are welcome. Though I think that using "Round1/2" in them makes it a bit clearer for users than trying to come up with semantic names.

Based on #112

Closes #35 , #63

This was linked to issues Sep 28, 2022
@mpguerra mpguerra removed a link to an issue Sep 30, 2022
@mpguerra mpguerra linked an issue Sep 30, 2022 that may be closed by this pull request
3 tasks
Base automatically changed from per-signer-rho to main October 3, 2022 08:13
@conradoplg
Copy link
Contributor Author

@dconnolly I rebased and solved conflicts. I reproduced the issue you found, it was caused by a mistake in generate_secret_shares. My intention was for it to prepend the secret to the coefficient vector and return it, matching the spec. But it was returning the original vector, which caused problems when rebasing it here due to the refactorings.

I changed generate_secret_shares to return the full vector in 418500a, and that allowed me to simplify evaluate_polynomial in cb657a9

@mpguerra mpguerra requested a review from upbqdn October 11, 2022 12:28
@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2022

Codecov Report

Base: 83.54% // Head: 86.48% // Increases project coverage by +2.94% 🎉

Coverage data is based on head (fea60bb) compared to base (be43c4a).
Patch coverage: 96.39% of modified lines in pull request are covered.

❗ Current head fea60bb differs from pull request most recent head ae7145d. Consider uploading reports for the commit ae7145d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
+ Coverage   83.54%   86.48%   +2.94%     
==========================================
  Files          17       18       +1     
  Lines        1392     1769     +377     
==========================================
+ Hits         1163     1530     +367     
- Misses        229      239      +10     
Impacted Files Coverage Δ
frost-core/src/lib.rs 72.97% <0.00%> (-6.44%) ⬇️
frost-core/src/frost/keys.rs 80.81% <92.15%> (+1.04%) ⬆️
frost-core/src/frost/keys/dkg.rs 96.63% <96.63%> (ø)
frost-core/src/tests.rs 99.55% <99.25%> (-0.45%) ⬇️
frost-p256/src/lib.rs 73.46% <100.00%> (+1.20%) ⬆️
frost-ristretto255/src/lib.rs 74.32% <100.00%> (+2.47%) ⬆️
frost-core/src/error.rs 100.00% <0.00%> (+100.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

upbqdn
upbqdn previously approved these changes Oct 18, 2022
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks very good. I tried to thoroughly check if the implementation matches the spec and the paper. I just have a few very minor suggestions.

Note that running

cargo d --document-private-items

produces two warnings about unresolved links.

frost-core/src/frost/keys.rs Outdated Show resolved Hide resolved
frost-core/src/frost/keys.rs Outdated Show resolved Hide resolved
frost-core/src/frost/keys/dkg.rs Outdated Show resolved Hide resolved
frost-core/src/tests.rs Outdated Show resolved Hide resolved
frost-core/src/tests.rs Outdated Show resolved Hide resolved
Co-authored-by: Marek <mail@marek.onl>
conradoplg and others added 2 commits October 18, 2022 14:39
@conradoplg
Copy link
Contributor Author

The PR looks very good. I tried to thoroughly check if the implementation matches the spec and the paper. I just have a few very minor suggestions.

Note that running

cargo d --document-private-items

produces two warnings about unresolved links.

Thanks, great suggestions! I also fixed the warnings.

@conradoplg conradoplg removed the request for review from dconnolly October 18, 2022 18:53
@conradoplg conradoplg merged commit bceafae into main Oct 18, 2022
@conradoplg conradoplg deleted the dkg branch October 18, 2022 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

frost-ristretto255: implement frost-core's DKG concretely frost-core: Implement the generic DKG
3 participants