diff options
Diffstat (limited to 'pyecsca/ec/group.py')
| -rw-r--r-- | pyecsca/ec/group.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyecsca/ec/group.py b/pyecsca/ec/group.py index af0dae2..6d8694d 100644 --- a/pyecsca/ec/group.py +++ b/pyecsca/ec/group.py @@ -6,6 +6,7 @@ from .point import Point @public class AbelianGroup(object): + """A (sub)group of an elliptic curve.""" curve: EllipticCurve generator: Point neutral: Point @@ -22,3 +23,8 @@ class AbelianGroup(object): def is_neutral(self, point: Point) -> bool: return self.neutral == point + + def __eq__(self, other): + if not isinstance(other, AbelianGroup): + return False + return self.curve == other.curve and self.generator == other.generator and self.neutral == other.neutral and self.order == other.order and self.cofactor == other.cofactor |
