aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJ08nY2023-12-11 15:02:46 +0100
committerJ08nY2023-12-11 15:02:46 +0100
commit9ca9f8e9b68ac90164a7cc2c9003dc2d8aa99c47 (patch)
tree18867b23c2d58b57a48addead19a400725c75f7e /test
parenta4e8613034748915d4402093c0de107985cf477d (diff)
downloadpyecsca-codegen-9ca9f8e9b68ac90164a7cc2c9003dc2d8aa99c47.tar.gz
pyecsca-codegen-9ca9f8e9b68ac90164a7cc2c9003dc2d8aa99c47.tar.zst
pyecsca-codegen-9ca9f8e9b68ac90164a7cc2c9003dc2d8aa99c47.zip
Add malloc filtering to trace transform function.
Diffstat (limited to 'test')
-rw-r--r--test/test_emulator.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_emulator.py b/test/test_emulator.py
index 93ca074..ab8bf73 100644
--- a/test/test_emulator.py
+++ b/test/test_emulator.py
@@ -231,3 +231,33 @@ def test_ecdsa(mult_name, mult_class, cli_runner, curve32):
True,
False,
)
+
+
+def test_tracing(cli_runner, curve32):
+ formulas = ["add-1998-cmo", "dbl-1998-cmo"]
+ with cli_runner.isolated_filesystem() as tmpdir:
+ cli_runner.invoke(
+ build_impl,
+ [
+ "--platform",
+ "STM32F3",
+ "--ecdsa",
+ "--ecdh",
+ "--red",
+ "MONTGOMERY",
+ "-D",
+ "BN_NON_CONST",
+ curve32.curve.model.shortname,
+ curve32.curve.coordinate_model.name,
+ *formulas,
+ f"ltr()",
+ ".",
+ ],
+ )
+ target = EmulatorTarget(curve32.curve.model, curve32.curve.coordinate_model, trace_config=TraceConfig(register=HammingWeight()))
+ target.connect(binary=join(tmpdir, "pyecsca-codegen-CW308_STM32F3.elf"))
+ target.set_params(curve32)
+ target.trace = []
+ target.scalar_mult(2355498743, curve32.generator)
+ trace = target.transform_trace()
+ assert trace is not None \ No newline at end of file