aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sca/test_zvp.py
diff options
context:
space:
mode:
authorJ08nY2023-07-29 16:08:03 +0200
committerJ08nY2023-07-29 16:08:03 +0200
commit58b3e0f862ab13f7125d40c9360b4b348366370a (patch)
treee6dc34a67e75585ed0125e133d6c7bc8e21dc2d4 /test/sca/test_zvp.py
parentb003b1d2437b842beafca0f13bea368c92a422fe (diff)
downloadpyecsca-58b3e0f862ab13f7125d40c9360b4b348366370a.tar.gz
pyecsca-58b3e0f862ab13f7125d40c9360b4b348366370a.tar.zst
pyecsca-58b3e0f862ab13f7125d40c9360b4b348366370a.zip
Add ZVP formula unroll.
Diffstat (limited to 'test/sca/test_zvp.py')
-rw-r--r--test/sca/test_zvp.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/sca/test_zvp.py b/test/sca/test_zvp.py
new file mode 100644
index 0000000..a6ce015
--- /dev/null
+++ b/test/sca/test_zvp.py
@@ -0,0 +1,21 @@
+from unittest import TestCase
+
+from pyecsca.ec.model import ShortWeierstrassModel
+from pyecsca.sca.re.zvp import unroll_formula
+
+
+class ZVPTests(TestCase):
+ def setUp(self):
+ self.model = ShortWeierstrassModel()
+ self.coords = self.model.coordinates["projective"]
+ self.add = self.coords.formulas["add-2007-bl"]
+ self.dbl = self.coords.formulas["dbl-2007-bl"]
+ self.neg = self.coords.formulas["neg"]
+
+ def test_unroll(self):
+ results = unroll_formula(self.add, 11)
+ self.assertIsNotNone(results)
+ results = unroll_formula(self.dbl, 11)
+ self.assertIsNotNone(results)
+ results = unroll_formula(self.neg, 11)
+ self.assertIsNotNone(results)