aboutsummaryrefslogtreecommitdiff
path: root/pyecsca
diff options
context:
space:
mode:
authorJ08nY2025-07-29 17:52:46 +0200
committerJ08nY2025-07-29 17:52:46 +0200
commit682bd9121a2dad23cadd31d92f295670e856e6e0 (patch)
tree95ea0bd46ee5243081e1a6e1be49dd52b01c5d20 /pyecsca
parentd136db07b5ed8fbb8490b24a4f42331afacd5939 (diff)
downloadpyecsca-682bd9121a2dad23cadd31d92f295670e856e6e0.tar.gz
pyecsca-682bd9121a2dad23cadd31d92f295670e856e6e0.tar.zst
pyecsca-682bd9121a2dad23cadd31d92f295670e856e6e0.zip
Diffstat (limited to 'pyecsca')
-rw-r--r--pyecsca/ec/formula/fake.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pyecsca/ec/formula/fake.py b/pyecsca/ec/formula/fake.py
index d9e8545..c85f607 100644
--- a/pyecsca/ec/formula/fake.py
+++ b/pyecsca/ec/formula/fake.py
@@ -89,9 +89,15 @@ class FakePoint(Point):
"""Just a fake point."""
def __init__(self, model): # noqa: We initialize everything here
- self.coords = _fake_coords(model)
self.coordinate_model = model
- self.field = 0
+
+ @property
+ def field(self):
+ return 0
+
+ @property
+ def coords(self):
+ return _fake_coords(self.coordinate_model)
def __str__(self):
return f"FakePoint{id(self)}"
@@ -110,3 +116,9 @@ class FakePoint(Point):
def __deepcopy__(self, memo):
return self
+
+ def __getstate__(self):
+ return {"model": self.coordinate_model}
+
+ def __setstate__(self, state):
+ self.coordinate_model = state["model"]