aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec/op.py
diff options
context:
space:
mode:
authorJ08nY2020-07-01 23:08:43 +0200
committerJ08nY2020-07-01 23:09:30 +0200
commit2aa191c63c556857ee22e801c19ee9822016f7cc (patch)
tree8824b678714c71979c4f8579c9cf782a6fadcc5e /pyecsca/ec/op.py
parent3eaaed8ff2dfa36ad31884bc4cb0f45e0bf8f427 (diff)
downloadpyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.gz
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.zst
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.zip
Add random generation of points, speedup computation.
Diffstat (limited to 'pyecsca/ec/op.py')
-rw-r--r--pyecsca/ec/op.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/pyecsca/ec/op.py b/pyecsca/ec/op.py
index d0cec58..d72716d 100644
--- a/pyecsca/ec/op.py
+++ b/pyecsca/ec/op.py
@@ -107,16 +107,5 @@ class CodeOp(object):
def __call__(self, *args, **kwargs: Mod) -> Mod:
"""Execute this operation with kwargs."""
- loc = dict(kwargs)
- exec(self.compiled, {}, loc)
- return loc[self.result]
-
-
-@public
-class OperationAction(ResultAction):
- """An operation."""
- operation: CodeOp
-
- def __init__(self, operation: CodeOp):
- super().__init__()
- self.operation = operation
+ exec(self.compiled, {}, kwargs)
+ return kwargs[self.result]