diff options
| author | J08nY | 2023-11-15 11:46:16 +0100 |
|---|---|---|
| committer | J08nY | 2023-11-15 11:46:16 +0100 |
| commit | d183a542ffbe9cfc99cac0dcadf7f2953c01d84a (patch) | |
| tree | 0ac6b6a2eae0abfb6536b2fbba13b7dad3914b4a /test/sca/test_structural.py | |
| parent | fc0774b077905eb72b39ff4582c0e50a9072d296 (diff) | |
| download | pyecsca-d183a542ffbe9cfc99cac0dcadf7f2953c01d84a.tar.gz pyecsca-d183a542ffbe9cfc99cac0dcadf7f2953c01d84a.tar.zst pyecsca-d183a542ffbe9cfc99cac0dcadf7f2953c01d84a.zip | |
Diffstat (limited to 'test/sca/test_structural.py')
| -rw-r--r-- | test/sca/test_structural.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/test/sca/test_structural.py b/test/sca/test_structural.py index 7f53de6..be1f45f 100644 --- a/test/sca/test_structural.py +++ b/test/sca/test_structural.py @@ -15,75 +15,6 @@ from pyecsca.sca.re.structural import formula_similarity, formula_similarity_fuz import itertools -def test_formula_match(): - model = ShortWeierstrassModel() - coords = model.coordinates["jacobian"] - secp128r1 = get_params("secg", "secp224r1", "jacobian-3") - with as_file( - files(test.data.formulas).joinpath("dbl-boringssl-p224") - ) as meta_path, as_file( - files(test.data.formulas).joinpath("dbl-boringssl-p224.op3") - ) as op3_path: - bc_formula = DoublingEFDFormula( - meta_path, op3_path, "dbl-boringssl-p224", coords - ) - print() - for other_name, other_formula in coords.formulas.items(): - if not other_name.startswith("dbl"): - continue - print( - other_name, - "fuzz", - formula_similarity_fuzz(other_formula, bc_formula, secp128r1.curve, 1000), - "symbolic", - formula_similarity(other_formula, bc_formula), - ) - - -def test_formula_match1(): - model = MontgomeryModel() - coords = model.coordinates["xz"] - curve25519 = get_params("other", "Curve25519", "xz") - with as_file( - files(test.data.formulas).joinpath("dbl-bc-r1rv76-x25519") - ) as meta_path, as_file( - files(test.data.formulas).joinpath("dbl-bc-r1rv76-x25519.op3") - ) as op3_path: - bc_formula = DoublingEFDFormula( - meta_path, op3_path, "dbl-bc-r1rv76-x25519", coords - ) - print() - for other_name, other_formula in coords.formulas.items(): - if not other_name.startswith("dbl"): - continue - print( - other_name, - "fuzz", - formula_similarity_fuzz(other_formula, bc_formula, curve25519.curve, 1000), - "symbolic", - formula_similarity(other_formula, bc_formula), - ) - - -def test_efd_formula_match(): - model = ShortWeierstrassModel() - coords = model.coordinates["projective"] - secp128r1 = get_params("secg", "secp128r1", "projective") - print() - adds = list(filter(lambda tup: tup[0].startswith("add"), coords.formulas.items())) - for one, other in itertools.combinations_with_replacement(adds, 2): - one_name, one_formula = one - other_name, other_formula = other - print( - one_name, - other_name, - "fuzz", - formula_similarity_fuzz(one_formula, other_formula, secp128r1.curve, 1000), - "symbolic", - formula_similarity(one_formula, other_formula), - ) - - @pytest.mark.parametrize( "name,model,coords,param_spec,formula_type", [ |
