aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAndrej Bátora2023-10-18 14:21:58 +0200
committerGitHub2023-10-18 14:21:58 +0200
commita1911ee8acbcf875ed8889f5686cc34b05c236c2 (patch)
tree965bccac4ecac171fcda66f9f07b9ded4b1c7eec /test
parent56a48c2d056ec559a73c42ae2eed9caf7102b027 (diff)
parent9987dc7dd762c44c56cca8b80379bfdc0b515bb3 (diff)
downloadpyecsca-codegen-a1911ee8acbcf875ed8889f5686cc34b05c236c2.tar.gz
pyecsca-codegen-a1911ee8acbcf875ed8889f5686cc34b05c236c2.tar.zst
pyecsca-codegen-a1911ee8acbcf875ed8889f5686cc34b05c236c2.zip
Merge branch 'J08nY:master' into bugfix/simulator
Diffstat (limited to 'test')
-rw-r--r--test/test_regress.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/test_regress.py b/test/test_regress.py
new file mode 100644
index 0000000..d85d6f6
--- /dev/null
+++ b/test/test_regress.py
@@ -0,0 +1,49 @@
+import pytest
+from pyecsca.ec.configuration import (
+ HashType,
+ RandomMod,
+ Multiplication,
+ Squaring,
+ Reduction,
+ Inversion,
+)
+from pyecsca.ec.mult import LTRMultiplier
+
+from pyecsca.codegen.common import Platform, DeviceConfiguration
+from pyecsca.codegen.render import render_and_build
+
+
+@pytest.mark.xfail(reason="Issue not resolved yet.")
+def test_regress_5(secp128r1, tmp_path):
+ platform = Platform.HOST
+ hash_type = HashType.SHA1
+ mod_rand = RandomMod.REDUCE
+ mult = Multiplication.BASE
+ sqr = Squaring.BASE
+ red = Reduction.BASE
+ inv = Inversion.GCD
+ model = secp128r1.curve.model
+ coords = secp128r1.curve.coordinate_model
+ add = coords.formulas["add-2015-rcb"]
+ dbl = coords.formulas["dbl-2015-rcb"]
+ scl = coords.formulas["z"]
+ formulas = [add, dbl, scl]
+ scalarmult = LTRMultiplier(add, dbl, scl)
+ config = DeviceConfiguration(
+ model,
+ coords,
+ formulas,
+ scalarmult,
+ hash_type,
+ mod_rand,
+ mult,
+ sqr,
+ red,
+ inv,
+ platform,
+ True,
+ True,
+ True,
+ )
+ dir, elf_file, hex_file, res = render_and_build(config, str(tmp_path), True)
+ assert res.returncode == 0