From ef39fba64cfbdf4ec4dff743985b2de896d1f062 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Mon, 18 Apr 2022 19:04:03 +0200 Subject: [PATCH] Simplify $name_affine.ct_eq(). By @ebfull's suggestion. --- src/curves.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/curves.rs b/src/curves.rs index 8f0c261..8efc206 100644 --- a/src/curves.rs +++ b/src/curves.rs @@ -755,10 +755,7 @@ macro_rules! new_curve_impl { impl ConstantTimeEq for $name_affine { fn ct_eq(&self, other: &Self) -> Choice { - let z1 = self.is_identity(); - let z2 = other.is_identity(); - - (z1 & z2) | ((!z1) & (!z2) & (self.x.ct_eq(&other.x)) & (self.y.ct_eq(&other.y))) + self.x.ct_eq(&other.x) & self.y.ct_eq(&other.y) } }