diff options
| author | vojtechsu | 2023-11-24 10:49:05 +0100 |
|---|---|---|
| committer | J08nY | 2023-12-05 14:06:07 +0100 |
| commit | 068dff3d7de2332ce04078dbd52fc928ac515726 (patch) | |
| tree | ca3834fce1efdb0755898c25fed611c7bd4a7578 /pyecsca | |
| parent | a5357921252b540a49fed3d1b952a23e9b393b34 (diff) | |
| download | pyecsca-068dff3d7de2332ce04078dbd52fc928ac515726.tar.gz pyecsca-068dff3d7de2332ce04078dbd52fc928ac515726.tar.zst pyecsca-068dff3d7de2332ce04078dbd52fc928ac515726.zip | |
Add ivs norm
Diffstat (limited to 'pyecsca')
| -rw-r--r-- | pyecsca/ec/formula_gen/metrics.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyecsca/ec/formula_gen/metrics.py b/pyecsca/ec/formula_gen/metrics.py index 5e5093d..45f51c2 100644 --- a/pyecsca/ec/formula_gen/metrics.py +++ b/pyecsca/ec/formula_gen/metrics.py @@ -39,6 +39,16 @@ def formula_similarity(one: Formula, other: Formula) -> Dict[str, float]: } +def ivs_norm(one: Formula): + one_unroll = unroll_formula(one) + one_results = {} + for name, value in one_unroll: + if name in one.outputs: + one_results[name] = value + one_polys = set(map(itemgetter(1), one_unroll)) + return one_polys + + def formula_similarity_abs(one: Formula, other: Formula) -> Dict[str, float]: if one.coordinate_model != other.coordinate_model: warnings.warn("Mismatched coordinate model.") |
