diff options
| author | J08nY | 2025-11-06 14:46:48 +0100 |
|---|---|---|
| committer | J08nY | 2025-11-06 14:46:48 +0100 |
| commit | 30db046c24709f46e816c4392a8b94bf9e056d15 (patch) | |
| tree | ce4bb7c8e723c8cda47d04f0f7e675e50c38e535 /pyecsca/sca/re/epa.py | |
| parent | 22282a02e22803ba2d61ce2af8bc465f872f292d (diff) | |
| download | pyecsca-30db046c24709f46e816c4392a8b94bf9e056d15.tar.gz pyecsca-30db046c24709f46e816c4392a8b94bf9e056d15.tar.zst pyecsca-30db046c24709f46e816c4392a8b94bf9e056d15.zip | |
Diffstat (limited to 'pyecsca/sca/re/epa.py')
| -rw-r--r-- | pyecsca/sca/re/epa.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pyecsca/sca/re/epa.py b/pyecsca/sca/re/epa.py index 41132ae..1a6b19f 100644 --- a/pyecsca/sca/re/epa.py +++ b/pyecsca/sca/re/epa.py @@ -1,7 +1,7 @@ """ Provides functionality inspired by the Exceptional Procedure Attack [EPA]_. """ -from typing import Callable, Literal, Union +from typing import Callable, Literal, Union, Optional from public import public @@ -18,7 +18,7 @@ def graph_to_check_inputs( precomp_to_affine: bool, use_init: bool = True, use_multiply: bool = True, - check_formulas: set[str] | None = None, + check_formulas: Optional[set[str]] = None, ) -> dict[str, set[tuple[int, ...]]]: """ Compute the inputs for the checks based on the context and output point. This function traverses the graph of points @@ -101,7 +101,7 @@ def graph_to_check_inputs( @public def evaluate_checks( - check_funcs: dict[str, Callable[[int, int], bool]], check_inputs: dict[str, set[tuple[int, ...]]] + check_funcs: dict[str, Union[Callable[[int, int], bool], Callable[[int], bool]]], check_inputs: dict[str, set[tuple[int, ...]]] ) -> bool: """ Evaluate the checks for each formula type based on the provided functions and inputs. @@ -132,7 +132,7 @@ def errors_out( precomp_ctx: MultipleContext, full_ctx: MultipleContext, out: Point, - check_funcs: dict[str, Callable[[int, int], bool] | Callable[[int], bool]], + check_funcs: dict[str, Union[Callable[[int, int], bool], Callable[[int], bool]]], check_condition: Union[Literal["all"], Literal["necessary"]], precomp_to_affine: bool, use_init: bool = True, |
