aboutsummaryrefslogtreecommitdiff
path: root/test/ec/test_params.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ec/test_params.py')
-rw-r--r--test/ec/test_params.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ec/test_params.py b/test/ec/test_params.py
index 13e45ec..77f5418 100644
--- a/test/ec/test_params.py
+++ b/test/ec/test_params.py
@@ -3,7 +3,7 @@ from unittest import TestCase
from parameterized import parameterized
from pyecsca.ec.coordinates import AffineCoordinateModel
-from pyecsca.ec.params import get_params, load_params
+from pyecsca.ec.params import get_params, load_params, load_category, get_category
class DomainParameterTests(TestCase):
@@ -35,6 +35,13 @@ class DomainParameterTests(TestCase):
except NotImplementedError:
pass
+ @parameterized.expand([
+ ("anssi", "projective"),
+ ("brainpool", lambda name: "projective" if name.endswith("r1") else "jacobian")
+ ])
+ def test_get_category(self, name, coords):
+ get_category(name, coords)
+
def test_load_params(self):
params = load_params("test/data/curve.json", "projective")
try:
@@ -42,6 +49,10 @@ class DomainParameterTests(TestCase):
except NotImplementedError:
pass
+ def test_load_category(self):
+ category = load_category("test/data/curves.json", "yz")
+ self.assertEqual(len(category), 1)
+
@parameterized.expand([
("no_category/some", "else"),
("secg/no_curve", "else"),