fix PartialEq
impl for AffinePoint
and ProjectivePoint
#551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
PartialEq
implementation is fixed forAffinePoint
andProjectivePoint
Affine point representation
The
PartialEq
implementation is now not a simple derive but make the distinction between the infinity point and the other ones. For example (x: 1, y: 1, infinity: true) is considered equal to (x: 0, y: 0, infinity: true), if some reason such a scenario appears.Projective point representation
To check the equality of two points in projective representation, we have to multiply their respective x and y coordinates by their respective inverse of z in order to check the affine representation equality. For example, after some complex addition operation we could have:
Using the simple derivation of Eq and PartialEq traits that are in place at the moment, these points are not equal but, when multiplying them by their respective inverse of z they become:
An so finally they are equal