mirror of
https://github.com/serai-dex/serai.git
synced 2025-04-22 22:18:15 +00:00
Use clearer identity check in equality
This commit is contained in:
parent
315d4fb356
commit
3655dc723f
2 changed files with 4 additions and 2 deletions
|
@ -46,7 +46,8 @@ impl ConstantTimeEq for Point {
|
|||
let y1 = self.y * other.z;
|
||||
let y2 = other.y * self.z;
|
||||
|
||||
(self.x.is_zero() & other.x.is_zero()) | (x1.ct_eq(&x2) & y1.ct_eq(&y2))
|
||||
// Both identity or equivalent over their denominators
|
||||
(self.z.is_zero() & other.z.is_zero()) | (x1.ct_eq(&x2) & y1.ct_eq(&y2))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ impl ConstantTimeEq for Point {
|
|||
let y1 = self.y * other.z;
|
||||
let y2 = other.y * self.z;
|
||||
|
||||
(self.x.is_zero() & other.x.is_zero()) | (x1.ct_eq(&x2) & y1.ct_eq(&y2))
|
||||
// Identity or equivalent
|
||||
(self.z.is_zero() & other.z.is_zero()) | (x1.ct_eq(&x2) & y1.ct_eq(&y2))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue