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

Update to IETF BLS draft 04 and add some input validations #103

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Sep 23, 2020

What was wrong?

Update to IETF BLS draft 04

How was it fixed?

  1. SK=0 (point at infinity PK) is disallowed in -04 spec. Update KeyGen, KeyValidate correspondingly.
  2. Add the missing KeyValidate to _CoreAggregateVerify: It wasn't a bug because _CoreAggregateVerify itself has checked pubkey_to_G1, but now it also needs to check the point at infinity PK.
  3. Add input validations APIs _is_valid_privkey, _is_valid_pubkey, _is_valid_message, and _is_valid_signature. Reasons:
    • To check input types strictly since Python is a dynamically-typed language.
    • To follow the spec description more tightly.
    • As a workaround for PopVerify-able checks. e.g., ensure PK is not the point at infinity in FastAggregateVerify.

Cute Animal Picture

moose-70254_640

@hwwhww hwwhww marked this pull request as ready for review September 24, 2020 17:31
@hwwhww hwwhww requested a review from CarlBeek September 24, 2020 17:31
Copy link
Collaborator

@CarlBeek CarlBeek left a comment

Choose a reason for hiding this comment

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

Aside from the validity of the point at infinity in the aggregate, this looks good to me. (To be clear, I both allowing it and disallowing it are fine with me as my reading of the specs has the behavior of Aggregate with the point at infinity as undefined.)

@hwwhww hwwhww merged commit aa9482d into master Sep 30, 2020
pacrob added a commit to pacrob/py_ecc that referenced this pull request Oct 29, 2023
* add pre-commit

* run pre-commit

* skip lint on README.md as it breaks template filling
@pacrob pacrob deleted the ietf_bls_v4 branch January 22, 2025 17:19
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