-
Notifications
You must be signed in to change notification settings - Fork 168
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
Optimize BDN Signature/Key Aggregation #546
Conversation
🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer. |
0f25cd6
to
6b09955
Compare
🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer. |
CountEnabled and IndexOfNthEnabled are both O(n) in the size of the mask, making this loop n^2. The BLS operations still tend to be the slow part, but the n^2 factor will start to show up with thousands of keys.
This new mask will pre-compute reusable values, speeding up repeated verification and aggregation of aggregate signatures (mostly the former).
6b09955
to
9acfb6f
Compare
🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer. |
🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer. |
sign/bdn/bdn.go
Outdated
} | ||
|
||
coefs, err := hashPointToR(mask.Publics()) | ||
func (scheme *Scheme) AggregateSignatures(sigs [][]byte, mask Mask) (kyber.Point, error) { |
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.
Note: this is technically a breaking change if someone is abstracting over Scheme via an interface. I'm happy to explore alternatives (e.g., add a new function, etc.) if that's an issue.
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.
We are in the process of preparing a V4 release anyway 👍
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.
In that case.... I can drop the interface and switch to a BDN specific mask if that works better for you (not sure how much breaking you want).
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.
Yes, that would be totally fine by me. Actually Mask seems to only be used in bdn
anyway, I'd be fine with it also being in internal or so, and have BDN expose the methods required to extract the list of participants from an aggregate signature.
Summoning @pierluca and @K1li4nL in case they have other opinions
Quality Gate passedIssues Measures |
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.
@Stebalien Now that we have the notion of Scheme
for bdn
, I wonder if the masks shouldn't just be embedded in these and just have new exported methods on the Scheme
to manage participants and public keys, as well as a method taking an aggregate signature and returning the list of participants or so?
IMO, it's best to keep scheme independent of the participants. But I can make |
Quality Gate passedIssues Measures |
d3d39e2
to
b664250
Compare
b664250
to
39ccfaa
Compare
@AnomalRoil I've moved Mask into BDN and removed the abstraction. This is significantly cleaner. |
@AnomalRoil could you give this a final review? I think Steb has addressed your last outstanding comments |
It's probably going to take a while for upstream to merge the changes so we're importing just the changed package (BDN) and the new package (Gnark) into this repo. That way we avoid forking the entire repo but can still import our changes. Any changes to these pacakges should be submitted as PRs to upstream _first_, then backported to this repo. Includes: - dedis/kyber#546 - dedis/kyber#551 - dedis/kyber#553
It's probably going to take a while for upstream to merge the changes so we're importing just the changed package (BDN) and the new package (Gnark) into this repo. That way we avoid forking the entire repo but can still import our changes. Any changes to these pacakges should be submitted as PRs to upstream _first_, then backported to this repo. Includes: - dedis/kyber#546 - dedis/kyber#551 - dedis/kyber#553
Honestly, no rush; our deadlines aren't your deadlines. Given the interface-based decoupling in kyber, we were able to pretty cleanly vendor just the BDN package so we're not blocked on any of our PRs. |
Quality Gate passedIssues Measures |
It's probably going to take a while for upstream to merge the changes so we're importing just the changed package (BDN) and the new package (Gnark) into this repo. That way we avoid forking the entire repo but can still import our changes. Any changes to these pacakges should be submitted as PRs to upstream _first_, then backported to this repo. Includes: - dedis/kyber#546 - dedis/kyber#551 - dedis/kyber#553
Originally filed against drand's fork as drand#60 and drand#61.
This set of patches:
I've also added some test fixtures for BDN at @AnomalRoil's request and added a benchmark for the CachedMask.