diff options
| author | J08nY | 2020-02-19 18:29:53 +0100 |
|---|---|---|
| committer | J08nY | 2020-02-19 18:29:53 +0100 |
| commit | 5da1d167c203395103d220c450e29fece08f4198 (patch) | |
| tree | fdc8fb7f0fbf2d2aaab46c2cb8a90a8176058292 /test/test_render.py | |
| parent | f04c640c05e9ffe894f67194832623e28a8000f5 (diff) | |
| download | pyecsca-codegen-5da1d167c203395103d220c450e29fece08f4198.tar.gz pyecsca-codegen-5da1d167c203395103d220c450e29fece08f4198.tar.zst pyecsca-codegen-5da1d167c203395103d220c450e29fece08f4198.zip | |
Flesh out client, add implementation tests.
Diffstat (limited to 'test/test_render.py')
| -rw-r--r-- | test/test_render.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_render.py b/test/test_render.py new file mode 100644 index 0000000..eefa626 --- /dev/null +++ b/test/test_render.py @@ -0,0 +1,32 @@ +import tempfile +from unittest import TestCase + +from pyecsca.ec.configuration import HashType, RandomMod, Multiplication, Squaring, Reduction +from pyecsca.ec.curves import get_params +from pyecsca.ec.mult import LTRMultiplier + +from pyecsca.codegen.common import Platform, DeviceConfiguration +from pyecsca.codegen.render import render_and_build + + +class RenderTests(TestCase): + + def test_basic_build(self): + platform = Platform.HOST + hash_type = HashType.SHA1 + mod_rand = RandomMod.REDUCE + mult = Multiplication.BASE + sqr = Squaring.BASE + red = Reduction.BASE + params = get_params("secg", "secp128r1", "projective") + model = params.curve.model + coords = params.curve.coordinate_model + add = coords.formulas["add-1998-cmo"] + dbl = coords.formulas["dbl-1998-cmo"] + 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, platform, True, True, True) + temp = tempfile.mkdtemp() + render_and_build(config, temp, True) |
