Skip to content

Commit

Permalink
Fix isTorsionFree bug
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 13, 2023
1 parent 6609dba commit b10a80d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ class ExtendedPoint {
}

isTorsionFree(): boolean {
return this.multiplyUnsafe(CURVE.l).equals(ExtendedPoint.ZERO);
let p = this.multiplyUnsafe(CURVE.l / 2n).double();
if (CURVE.l % 2n) p = p.add(this);
return p.equals(ExtendedPoint.ZERO);
}

// Converts Extended point to default (x, y) coordinates.
Expand Down

0 comments on commit b10a80d

Please sign in to comment.