diff options
| -rw-r--r-- | pyecsca/ec/formula.py | 8 | ||||
| -rw-r--r-- | pyecsca/ec/mod.py | 2 | ||||
| -rw-r--r-- | pyecsca/ec/op.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/pyecsca/ec/formula.py b/pyecsca/ec/formula.py index 317788b..58978a7 100644 --- a/pyecsca/ec/formula.py +++ b/pyecsca/ec/formula.py @@ -375,15 +375,15 @@ class EFDFormula(Formula): ) self.code.append(CodeOp(code_module)) - @property + @cached_property def input_index(self): return 1 - @property + @cached_property def output_index(self): return max(self.num_inputs + 1, 3) - @property + @cached_property def inputs(self): return { var + str(i) @@ -392,7 +392,7 @@ class EFDFormula(Formula): ) } - @property + @cached_property def outputs(self): return { var + str(i) diff --git a/pyecsca/ec/mod.py b/pyecsca/ec/mod.py index a43db53..a974462 100644 --- a/pyecsca/ec/mod.py +++ b/pyecsca/ec/mod.py @@ -114,7 +114,7 @@ def miller_rabin(n: int, rounds: int = 50) -> bool: def _check(func): @wraps(func) def method(self, other): - if type(self) is not type(other): + if self.__class__ is not type(other): other = self.__class__(other, self.n) elif self.n != other.n: raise ValueError diff --git a/pyecsca/ec/op.py b/pyecsca/ec/op.py index b83562c..d948129 100644 --- a/pyecsca/ec/op.py +++ b/pyecsca/ec/op.py @@ -145,5 +145,5 @@ class CodeOp: def __call__(self, *args, **kwargs: Mod) -> Mod: """Execute this operation with :paramref:`.__call__.kwargs`.""" - exec(self.compiled, {}, kwargs) + exec(self.compiled, None, kwargs) return kwargs[self.result] |
