aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/ec/curve.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/ec/curve.py')
-rw-r--r--pyecsca/ec/curve.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyecsca/ec/curve.py b/pyecsca/ec/curve.py
index 3c0b200..85081ea 100644
--- a/pyecsca/ec/curve.py
+++ b/pyecsca/ec/curve.py
@@ -39,6 +39,11 @@ class EllipticCurve(object):
loc = {**self.parameters, **point.to_affine().coords}
return eval(compile(self.model.equation, "", mode="eval"), loc)
+ def __eq__(self, other):
+ if not isinstance(other, EllipticCurve):
+ return False
+ return self.model == other.model and self.coordinate_model == other.coordinate_model and self.prime == other.prime and self.parameters == other.parameters
+
def __repr__(self):
params = ", ".join((f"{key}={val}" for key, val in self.parameters.items()))
return f"EllipticCurve([{params}] on {self.model} using {self.coordinate_model})"