commit d5377b6a24ba677861a8bac3ab88e0956473465f
parent 9b4726690a9435f20fb183937d13cf2dbc3ed3ad
Author: Jared Tobin <jared@jtobin.io>
Date: Fri, 19 Dec 2025 07:16:43 -0330
lib: constant-time wider eq instance
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/Data/Word/Wider.hs b/lib/Data/Word/Wider.hs
@@ -102,6 +102,9 @@ data Wider = Wider !(# Limb, Limb, Limb, Limb #)
instance Show Wider where
show = show . from
+instance Eq Wider where
+ Wider a == Wider b = C.decide (eq# a b)
+
instance Num Wider where
(+) = add
(-) = sub