From dfc9e7c0b7391e47580fa1f9f24093c8cbb4f5c8 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 16 Jul 2018 22:28:22 -0700 Subject: [PATCH] fixup extendedpoint validity check --- src/edwards.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/edwards.rs b/src/edwards.rs index df2f8c8..08eff32 100644 --- a/src/edwards.rs +++ b/src/edwards.rs @@ -271,9 +271,11 @@ impl Identity for EdwardsPoint { // ------------------------------------------------------------------------ impl ValidityCheck for EdwardsPoint { - // XXX this should also check that T is correct fn is_valid(&self) -> bool { - self.to_projective().is_valid() + let point_on_curve = self.to_projective().is_valid(); + let on_segre_image = (&self.X * &self.Y) == (&self.Z * &self.T); + + point_on_curve && on_segre_image } }