-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adds validity checks to BLS public keys #81
Conversation
Please add a test for the constructor. |
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.
Great work @brunoffranca. Thanks.
@pompon0 I don't see a way of creating a point outside the correct subgroup. If I think of anything meanwhile, I'll add it. |
So, there was a fatal flaw in the subgroup check. To check that a given point is in the correct subgroup, we don't multiply by the cofactor, we multiply by the order. I fixed that and found a way of testing it appropriately. |
What ❔
Added checks for the validity of our BLS public keys as recommended by this spec. Namely we check that the public key is not zero and that it is in the correct subgroup.
We do it redundantly in two places (when we decode a public key and when we verify a signature).
Why ❔
Invalid public keys are a security risk.