Skip to content

Curve and subgroup checks #129

Open
@JanBobolz

Description

@JanBobolz

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).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions