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

remove identifiers from structs that are communicated #397

Merged
merged 9 commits into from
Jul 5, 2023

Conversation

conradoplg
Copy link
Contributor

@conradoplg conradoplg commented Jun 16, 2023

Sending identifiers inside the structs may be problematic because it's used as the source for pinpointing cheaters when there is an error in the protocol. Even if we got rid of that, callers could mistakenly look inside the struct to find the identifier of the cheater.

This moves identifiers out of structs, and changes the API so that the caller must specify the identifier of the package being fed into the API. This will make more likely that the caller will get the identifier from the right place (from whatever mapping they have between identifiers and authenticated channels) since there is no other obvious place they could grab identifiers from.

This also makes some code a lot more straightforward, and allowed getting rid of SignatureResponse struct, though I had to use a workaround to encode it with serde since it's mostly an exception, and had to introduce a SignatureShareHelper but that's completely private and invisible to the user.

@conradoplg conradoplg changed the title WIP of removing the identifier in structs that are communicated remove identifiers from structs that are communicated Jun 30, 2023
@conradoplg conradoplg marked this pull request as ready for review June 30, 2023 19:34
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch coverage: 60.71% and project coverage change: +0.23 🎉

Comparison is base (31913f4) 71.16% compared to head (47652a5) 71.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
+ Coverage   71.16%   71.40%   +0.23%     
==========================================
  Files          30       30              
  Lines        2719     2668      -51     
==========================================
- Hits         1935     1905      -30     
+ Misses        784      763      -21     
Impacted Files Coverage Δ
frost-core/src/frost/identifier.rs 66.21% <0.00%> (-1.84%) ⬇️
frost-ed25519/src/keys/dkg.rs 0.00% <0.00%> (ø)
frost-ed25519/src/lib.rs 64.34% <0.00%> (+1.93%) ⬆️
frost-ed448/src/keys/dkg.rs 0.00% <0.00%> (ø)
frost-ed448/src/lib.rs 62.01% <0.00%> (+1.86%) ⬆️
frost-p256/src/keys/dkg.rs 0.00% <0.00%> (ø)
frost-p256/src/lib.rs 64.38% <0.00%> (+1.71%) ⬆️
frost-rerandomized/src/lib.rs 0.72% <0.00%> (-0.04%) ⬇️
frost-ristretto255/src/keys/dkg.rs 0.00% <0.00%> (ø)
frost-ristretto255/src/lib.rs 64.56% <0.00%> (+1.97%) ⬆️
... and 6 more

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

Copy link
Contributor

@natalieesk natalieesk left a comment

Choose a reason for hiding this comment

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

Looks good!

@mergify mergify bot merged commit b2c605a into main Jul 5, 2023
15 checks passed
@mergify mergify bot deleted the remove-identifier branch July 5, 2023 10:39
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.

2 participants