diff options
| author | J08nY | 2025-03-31 10:56:03 +0200 |
|---|---|---|
| committer | J08nY | 2025-03-31 10:56:03 +0200 |
| commit | 6a1b165c7ec1d27633c0d4ed1a840357b834e127 (patch) | |
| tree | f092a41170e0e40b4b8d4882f796205ff4f33e12 /pyecsca/ec/point.py | |
| parent | ebddd1ad1f031f653dff49e38b4d298f8b52bebd (diff) | |
| download | pyecsca-6a1b165c7ec1d27633c0d4ed1a840357b834e127.tar.gz pyecsca-6a1b165c7ec1d27633c0d4ed1a840357b834e127.tar.zst pyecsca-6a1b165c7ec1d27633c0d4ed1a840357b834e127.zip | |
Diffstat (limited to 'pyecsca/ec/point.py')
| -rw-r--r-- | pyecsca/ec/point.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pyecsca/ec/point.py b/pyecsca/ec/point.py index 1833f46..5a486bc 100644 --- a/pyecsca/ec/point.py +++ b/pyecsca/ec/point.py @@ -169,7 +169,9 @@ class Point: if not isinstance(other, Point) or isinstance(other, InfinityPoint): return False if self.coordinate_model.curve_model != other.coordinate_model.curve_model: - return False + raise ValueError("Can only compare points with the same curve model.") + if self.coordinate_model != other.coordinate_model: + raise ValueError("Can only compare points with the same coordinate model.") if "z" in self.coordinate_model.formulas: formula = self.coordinate_model.formulas["z"] self_mapped = formula(self.field, self) @@ -188,7 +190,9 @@ class Point: if not isinstance(other, Point) or isinstance(other, InfinityPoint): return False if self.coordinate_model.curve_model != other.coordinate_model.curve_model: - return False + raise ValueError("Can only compare points with the same curve model.") + if self.coordinate_model != other.coordinate_model: + raise ValueError("Can only compare points with the same coordinate model.") weights = sorted(self.coordinate_model.homogweights.items(), key=itemgetter(1)) lambdas: Set[Mod] = set() for var, weight in weights: |
