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

How does point comparison work for the identity / point at infinity? #310

Open
matthiasgeihs opened this issue Aug 28, 2023 · 0 comments
Open

Comments

@matthiasgeihs
Copy link

Point equality is implemented as:

Point.prototype.eq = function eq(other) {
return this.getX().cmp(other.getX()) === 0;
};

The identity (aka point at infinity) is any point that has 0 in its z-coordinate:

Point.prototype.isInfinity = function isInfinity() {
// XXX This code assumes that zero is always zero in red
return this.z.cmpn(0) === 0;
};

How would point comparison give the correct result when comparing against the point at infinity?

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

No branches or pull requests

1 participant