commit 43ca6ac31f3d98bc6c6ab0591a0ca70c1e17ea0f
parent 81663b5f6487b54638039eb5c31fbf0586f67dd2
Author: Jared Tobin <jared@jtobin.io>
Date: Fri, 12 Dec 2025 08:02:08 +0400
test: equality refactor
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/Montgomery/Curve.hs b/test/Montgomery/Curve.hs
@@ -117,7 +117,7 @@ mul_matches a b =
in W.eq_vartime (W.to ((ia * ib) `mod` im)) (C.from (ma * mb))
inv_valid :: Q.NonZero C.Montgomery -> Bool
-inv_valid (Q.NonZero s) = C.inv s * s == 1
+inv_valid (Q.NonZero s) = C.eq_vartime (C.inv s * s) 1
tests :: TestTree
tests = testGroup "montgomery tests (curve)" [
diff --git a/test/Montgomery/Scalar.hs b/test/Montgomery/Scalar.hs
@@ -117,7 +117,7 @@ mul_matches a b =
in W.eq_vartime (W.to ((ia * ib) `mod` im)) (S.from (ma * mb))
inv_valid :: Q.NonZero S.Montgomery -> Bool
-inv_valid (Q.NonZero s) = S.inv s * s == 1
+inv_valid (Q.NonZero s) = S.eq_vartime (S.inv s * s) 1
tests :: TestTree
tests = testGroup "montgomery tests (scalar)" [