aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/ec/formula.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/ec/formula.py')
-rw-r--r--pyecsca/ec/formula.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pyecsca/ec/formula.py b/pyecsca/ec/formula.py
index 441953e..f80e9fa 100644
--- a/pyecsca/ec/formula.py
+++ b/pyecsca/ec/formula.py
@@ -8,6 +8,7 @@ from .op import Op, CodeOp
class Formula(object):
+ """A formula operating on points."""
name: str
coordinate_model: Any
meta: MutableMapping[str, Any]
@@ -22,6 +23,7 @@ class Formula(object):
@property
def output_index(cls):
+ """The starting index where this formula stores its outputs."""
raise NotImplementedError
@@ -61,6 +63,11 @@ class EFDFormula(Formula):
def output_index(cls):
return max(cls.num_inputs + 1, 3)
+ def __eq__(self, other):
+ if not isinstance(other, EFDFormula):
+ return False
+ return self.name == other.name and self.coordinate_model == other.coordinate_model
+
@public
class AdditionFormula(Formula):