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

Allow len(signatures) == 0 in aggregate function and len(pubkeys) == 0 in verify functions #2070

Closed
wants to merge 2 commits into from

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Sep 16, 2020

Based on #2068

Also suggested by @JustinDrake, we can go farther to allow empty aggregate signatures in the verification for phases 1+.

Issue

IETF BLS draft 2 requires (preconditions):

  1. len(signatures) >= 1 in Aggregate(signatures)
  2. len(pubkeys) >= 1 in -AggregateVerify functions.

For phase 1 light_client_signature and shard block proposer_signature_aggregate use cases, there are two phase 1 helper functions were added in #1812 to allow no-signatures case (len(signatures) == 0/len(pubkeys) == 0):

  1. optional_aggregate_verify
  2. optional_fast_aggregate_verify

Proposed solution

Some BLSv4 compatible wrappers are added in #2068.

If we implement wrappers to allow len(signatures) == 0 in Aggregate(signatures), we could also make -verify function wrappers allow len(pubkeys) == 0 and remove the optional_ helpers.

Note that it's a non-substantive change for phase 0.

@mratsim
Copy link
Contributor

mratsim commented Sep 16, 2020

BLS draft 2 requires n >= 1 so empty public keys sets are not allowed: https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-02#section-3.1.1

Similarly, aggregate requires >= 1 signatures: https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-02#section-2.8

See also our audit report where we allowed this by missing a check on the precondition: status-im/nim-blscurve#77

@hwwhww hwwhww mentioned this pull request Sep 16, 2020
2 tasks
@hwwhww
Copy link
Contributor Author

hwwhww commented Sep 17, 2020

Died with #2068 😄

@hwwhww hwwhww closed this Sep 17, 2020
@hwwhww hwwhww deleted the enable_no_signature branch February 21, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants