aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/ec/curve.py
diff options
context:
space:
mode:
authorJ08nY2019-04-24 19:26:11 +0200
committerJ08nY2019-04-24 19:26:11 +0200
commit2a109ad4502bc7983c9fd4fc29a62b6f028762b0 (patch)
treeab0074015d3e2008fa0071efbfb49f2c224e78c7 /pyecsca/ec/curve.py
parentf4bcb085cfc9ddac71fe8bb82e8f6719309b2637 (diff)
downloadpyecsca-2a109ad4502bc7983c9fd4fc29a62b6f028762b0.tar.gz
pyecsca-2a109ad4502bc7983c9fd4fc29a62b6f028762b0.tar.zst
pyecsca-2a109ad4502bc7983c9fd4fc29a62b6f028762b0.zip
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})"