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

Curve and subgroup checks #129

Open
JanBobolz opened this issue Aug 16, 2021 · 0 comments · May be fixed by #130
Open

Curve and subgroup checks #129

JanBobolz opened this issue Aug 16, 2021 · 0 comments · May be fixed by #130
Assignees
Labels
bug Something isn't working

Comments

@JanBobolz
Copy link
Member

As noted here, our implementation of BN, secp256k1, and supersingular curves do not check the curve equation, nor do they check if the given element is in the right subgroup.

This needs to be fixed.

The curve check can go into the WeierstrassCurve interface and called in the AbstractEllipticCurvePoint class during deserialization.

The subgroup check should happen in PairingSourceGroupImpl. The current PairingSourceGroupImpl::isMember in there may be a bit wonky because it uses the pow() function, which may optimize the exponentiation by taking the exponent mod size(). So something like the dedicated PairingSourceGroupImpl::cofactorMultiplication() seens to be much better for this use case.
It should be called in the PairingSourceGroupImpl::restoreElement() method (together with the check that the point is on the curve).

@JanBobolz JanBobolz added the bug Something isn't working label Aug 16, 2021
@rheitjoh rheitjoh linked a pull request Aug 17, 2021 that will close this issue
@rheitjoh rheitjoh linked a pull request Aug 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants