aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec
diff options
context:
space:
mode:
authorJ08nY2024-07-11 17:53:14 +0200
committerJ08nY2024-07-11 17:53:14 +0200
commit52fb26495a47fb80d66dc84f34a2494e4356516c (patch)
treef61625704bd199a910f1c61d669d4d1280888dd9 /pyecsca/ec
parent75e07957eabfb4129eefe8c2b4e34cf38f556b2a (diff)
downloadpyecsca-52fb26495a47fb80d66dc84f34a2494e4356516c.tar.gz
pyecsca-52fb26495a47fb80d66dc84f34a2494e4356516c.tar.zst
pyecsca-52fb26495a47fb80d66dc84f34a2494e4356516c.zip
Fix DeepSource issues.
Diffstat (limited to 'pyecsca/ec')
-rw-r--r--pyecsca/ec/formula/base.py6
-rw-r--r--pyecsca/ec/mod.py10
-rw-r--r--pyecsca/ec/params.py2
3 files changed, 4 insertions, 14 deletions
diff --git a/pyecsca/ec/formula/base.py b/pyecsca/ec/formula/base.py
index faccd97..d4c5ec8 100644
--- a/pyecsca/ec/formula/base.py
+++ b/pyecsca/ec/formula/base.py
@@ -8,7 +8,7 @@ from astunparse import unparse
from typing import List, Any, ClassVar, MutableMapping, Tuple, Union, Dict
from public import public
-from sympy import FF, symbols, Poly, parse_expr
+from sympy import FF, symbols, Poly
from pyecsca.ec.context import ResultAction
from pyecsca.ec import context
@@ -16,7 +16,7 @@ from pyecsca.ec.error import UnsatisfiedAssumptionError, raise_unsatisified_assu
from pyecsca.ec.mod import Mod, SymbolicMod
from pyecsca.ec.op import CodeOp, OpType
from pyecsca.misc.cfg import getconfig
-from pyecsca.misc.cache import sympify, simplify
+from pyecsca.misc.cache import sympify
@public
@@ -199,7 +199,7 @@ class Formula(ABC):
raise ValueError(
f"This formula couldn't be executed due to an unsupported assumption ({assumption_string})."
)
- numerator, denominator = expr.as_numer_denom()
+ numerator, _ = expr.as_numer_denom()
domain = FF(field)
poly = Poly(numerator, symbols(param), domain=domain)
roots = poly.ground_roots()
diff --git a/pyecsca/ec/mod.py b/pyecsca/ec/mod.py
index 4657190..4d841ff 100644
--- a/pyecsca/ec/mod.py
+++ b/pyecsca/ec/mod.py
@@ -248,10 +248,6 @@ class Mod:
def __rfloordiv__(self, other) -> "Mod":
return ~self * other
- @_check
- def __divmod__(self, divisor):
- raise NotImplementedError
-
def __bytes__(self) -> bytes:
raise NotImplementedError
@@ -448,9 +444,6 @@ class Undefined(Mod):
def __rfloordiv__(self, other):
return NotImplemented
- def __divmod__(self, divisor):
- return NotImplemented
-
def __bytes__(self):
raise NotImplementedError
@@ -546,9 +539,6 @@ class SymbolicMod(Mod):
def __rfloordiv__(self, other) -> "SymbolicMod":
return ~self * other
- def __divmod__(self, divisor) -> "SymbolicMod":
- return NotImplemented
-
def __bytes__(self):
return int(self.x).to_bytes((self.n.bit_length() + 7) // 8, byteorder="big")
diff --git a/pyecsca/ec/params.py b/pyecsca/ec/params.py
index d5477b6..6693581 100644
--- a/pyecsca/ec/params.py
+++ b/pyecsca/ec/params.py
@@ -229,7 +229,7 @@ def _create_params(curve, coords, infty):
raise ValueError(
f"This coordinate model couldn't be loaded due to an unsupported assumption ({assumption_string})."
)
- numerator, denominator = expr.as_numer_denom()
+ numerator, _ = expr.as_numer_denom()
poly = Poly(numerator, symbols(param), domain=k)
roots = poly.ground_roots()
for root in roots: