diff options
| author | J08nY | 2020-02-19 14:09:49 +0100 |
|---|---|---|
| committer | J08nY | 2020-02-19 14:09:49 +0100 |
| commit | dacf1e8950031ed01e5d3da0ad0934a209de0a41 (patch) | |
| tree | 64254ccf63e7efc7df26b3a6d2861e676648354f /test/ec | |
| parent | 3fc44b54ebe364a1c38cdc3e7f59b20b22fc2220 (diff) | |
| download | pyecsca-dacf1e8950031ed01e5d3da0ad0934a209de0a41.tar.gz pyecsca-dacf1e8950031ed01e5d3da0ad0934a209de0a41.tar.zst pyecsca-dacf1e8950031ed01e5d3da0ad0934a209de0a41.zip | |
Enforce coordinate model assumptions when loading curves.
Diffstat (limited to 'test/ec')
| -rw-r--r-- | test/ec/test_curves.py | 4 | ||||
| -rw-r--r-- | test/ec/test_mult.py | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/test/ec/test_curves.py b/test/ec/test_curves.py index 1f6a117..173aaf2 100644 --- a/test/ec/test_curves.py +++ b/test/ec/test_curves.py @@ -17,9 +17,9 @@ class CurvesTests(TestCase): ("other/E-222", "projective") ]) def test_get_params(self, name, coords): - group = get_params(*name.split("/"), coords) + params = get_params(*name.split("/"), coords) try: - assert group.curve.is_on_curve(group.generator) + assert params.curve.is_on_curve(params.generator) except NotImplementedError: pass diff --git a/test/ec/test_mult.py b/test/ec/test_mult.py index 2f4308e..6c89521 100644 --- a/test/ec/test_mult.py +++ b/test/ec/test_mult.py @@ -30,17 +30,17 @@ class ScalarMultiplierTests(TestCase): else: assert one.equals(other) - def do_basic_test(self, mult_class, group, base, add, dbl, scale, neg=None, **kwargs): - mult = mult_class(*self.get_formulas(group.curve.coordinate_model, add, dbl, neg, scale), + def do_basic_test(self, mult_class, params, base, add, dbl, scale, neg=None, **kwargs): + mult = mult_class(*self.get_formulas(params.curve.coordinate_model, add, dbl, neg, scale), **kwargs) - mult.init(group, base) + mult.init(params, base) res = mult.multiply(314) other = mult.multiply(157) - mult.init(group, other) + mult.init(params, other) other = mult.multiply(2) self.assertPointEquality(res, other, scale) - mult.init(group, base) - self.assertEqual(InfinityPoint(group.curve.coordinate_model), mult.multiply(0)) + mult.init(params, base) + self.assertEqual(InfinityPoint(params.curve.coordinate_model), mult.multiply(0)) @parameterized.expand([ ("scaled", "add-1998-cmo", "dbl-1998-cmo", "z"), |
