diff options
| -rw-r--r-- | pyecsca/ec/mod/flint.py | 10 | ||||
| -rw-r--r-- | test/sca/test_epa.py | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/pyecsca/ec/mod/flint.py b/pyecsca/ec/mod/flint.py index 890d727..becfeea 100644 --- a/pyecsca/ec/mod/flint.py +++ b/pyecsca/ec/mod/flint.py @@ -21,9 +21,9 @@ try: if (int(_major), int(_minor)) >= (0, 5): has_flint = True else: - flint = None + flint = None # type: ignore except ImportError: - flint = None + flint = None # type: ignore if has_flint: @@ -32,7 +32,7 @@ if has_flint: def _fmpz_ctx(n: Union[int, flint.fmpz_mod_ctx]) -> flint.fmpz_mod_ctx: if type(n) is flint.fmpz_mod_ctx: return n - return flint.fmpz_mod_ctx(n) + return flint.fmpz_mod_ctx(n) # type: ignore @lru_cache def _fmpz_is_prime(x: flint.fmpz) -> bool: @@ -67,8 +67,8 @@ if has_flint: self._ctx = _fmpz_ctx(n) self.x = self._ctx(x) else: - self._ctx = n - self.x = x + self._ctx = n # type: ignore + self.x = x # type: ignore @property def n(self) -> flint.fmpz: diff --git a/test/sca/test_epa.py b/test/sca/test_epa.py index 23828b4..cab2f03 100644 --- a/test/sca/test_epa.py +++ b/test/sca/test_epa.py @@ -350,7 +350,8 @@ def test_independent_check_inputs(secp128r1, mult): assert ( check_inputs == last_check_inputs ), f"Failed for {check_condition}, precomp_to_affine={precomp_to_affine}, scalar={scalar}, mult={mult_class.__name__}" - last_check_inputs = check_inputs + else: + last_check_inputs = check_inputs @pytest.mark.parametrize("check_condition,precomp_to_affine,multiples_kind", [ |
