diff options
| author | J08nY | 2024-01-25 19:11:18 +0100 |
|---|---|---|
| committer | J08nY | 2024-01-25 19:11:18 +0100 |
| commit | 63da9293c39817cd7fe746cbd31e42f13f831091 (patch) | |
| tree | 6d440f8edcce3df694dddb08893646c0a8e0d937 /pyecsca | |
| parent | cbfcfb3433dd6030db5a253d291985706bd0dc9a (diff) | |
| download | pyecsca-63da9293c39817cd7fe746cbd31e42f13f831091.tar.gz pyecsca-63da9293c39817cd7fe746cbd31e42f13f831091.tar.zst pyecsca-63da9293c39817cd7fe746cbd31e42f13f831091.zip | |
Fix OpResult repr.
Diffstat (limited to 'pyecsca')
| -rw-r--r-- | pyecsca/ec/formula/base.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pyecsca/ec/formula/base.py b/pyecsca/ec/formula/base.py index a9402f1..429f4c1 100644 --- a/pyecsca/ec/formula/base.py +++ b/pyecsca/ec/formula/base.py @@ -43,9 +43,13 @@ class OpResult: return self.name def __repr__(self): - # TODO: This repr is broken for square and neg and inv. char = self.op.op_str - parents = char.join(str(parent) for parent in self.parents) + if self.op == OpType.Inv: + parents = "1" + char + str(self.parents[0]) + elif self.op == OpType.Neg: + parents = char + str(self.parents[0]) + else: + parents = char.join(str(parent) for parent in self.parents) return f"{self.name} = {parents}" |
