aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec
diff options
context:
space:
mode:
authorJ08nY2023-02-12 23:02:54 +0100
committerJ08nY2023-02-12 23:02:54 +0100
commitf11268d7cb7f8749312c3d85f37451ebf84649ae (patch)
tree016a77ccd504dec885711c0de3d93d4a9c456954 /pyecsca/ec
parenta08a052db35e9b940b33b57750c5addf0f66facd (diff)
downloadpyecsca-f11268d7cb7f8749312c3d85f37451ebf84649ae.tar.gz
pyecsca-f11268d7cb7f8749312c3d85f37451ebf84649ae.tar.zst
pyecsca-f11268d7cb7f8749312c3d85f37451ebf84649ae.zip
Add __slots__ to Mods.
Diffstat (limited to 'pyecsca/ec')
-rw-r--r--pyecsca/ec/mod.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyecsca/ec/mod.py b/pyecsca/ec/mod.py
index 405ab19..63fabe2 100644
--- a/pyecsca/ec/mod.py
+++ b/pyecsca/ec/mod.py
@@ -147,6 +147,7 @@ class Mod:
x: Any
n: Any
+ __slots__ = ("x", "n")
def __new__(cls, *args, **kwargs):
if cls != Mod:
@@ -263,6 +264,7 @@ class RawMod(Mod):
x: int
n: int
+ __slots__ = ("x", "n")
def __new__(cls, *args, **kwargs):
return object.__new__(cls)
@@ -367,6 +369,7 @@ _mod_classes["python"] = RawMod
@public
class Undefined(Mod):
"""A special undefined element."""
+ __slots__ = ("x", "n")
def __new__(cls, *args, **kwargs):
return object.__new__(cls)
@@ -472,6 +475,7 @@ class SymbolicMod(Mod):
x: Expr
n: int
+ __slots__ = ("x", "n")
def __new__(cls, *args, **kwargs):
return object.__new__(cls)
@@ -580,6 +584,7 @@ if has_gmp:
x: gmpy2.mpz
n: gmpy2.mpz
+ __slots__ = ("x", "n")
def __new__(cls, *args, **kwargs):
return object.__new__(cls)