toposware / frost

A fork of frost-dalek, made WASM compatible, and upgraded to Static ICE-FROST
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

Apply Tim Ruffin RFC review on aggregation speed-up #48

Closed Nashtare closed 1 year ago

Nashtare commented 1 year ago

This PR implements an optimization of the aggregate() method, that can yield up to 90% speed-up for this phase when running with large settings (i.e. 666-out-of-1000 for instance), and still yields nice reduction factors with smaller instances (3 times faster on my machine for 66-out-of-100).

It consists in computing the aggregated signature first, without verifying individual signatures, and verifying solely the aggregated signature. If the verification fails, then we proceed to individual signatures checks to identify the malicious participants, as was done previously.

It induces an API change though (the aggregate() method now takes the message_hash as argument). @atanmarko as you're working on the FROST integration, I'm tagging you as well in case this requires some coordination on the topos-node side.

Ref: https://mailarchive.ietf.org/arch/msg/cfrg/QQhyjvvcoaqLslaX3gWwABqHN-s/

codecov[bot] commented 1 year ago

Codecov Report

Base: 88.62% // Head: 87.25% // Decreases project coverage by -1.36% :warning:

Coverage data is based on head (33cad91) compared to base (1897d34). Patch coverage: 26.66% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #48 +/- ## ========================================== - Coverage 88.62% 87.25% -1.37% ========================================== Files 5 5 Lines 1240 1248 +8 ========================================== - Hits 1099 1089 -10 - Misses 141 159 +18 ``` | [Impacted Files](https://codecov.io/gh/toposware/frost/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toposware) | Coverage Δ | | |---|---|---| | [src/signature.rs](https://codecov.io/gh/toposware/frost/pull/48/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toposware#diff-c3JjL3NpZ25hdHVyZS5ycw==) | `81.57% <26.66%> (-6.41%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toposware). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toposware)

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