aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJ08nY2021-01-06 17:32:27 +0100
committerJ08nY2021-01-06 17:32:27 +0100
commitbb3ad6b5edafb26309514a0d59e9ba8bc2d5c19f (patch)
treed93e1b469022fc5170f5b016ddf5f9e62064c7e4 /test
parent9dd00af7aede2085812a65a888a7539e9a792213 (diff)
downloadpyecsca-bb3ad6b5edafb26309514a0d59e9ba8bc2d5c19f.tar.gz
pyecsca-bb3ad6b5edafb26309514a0d59e9ba8bc2d5c19f.tar.zst
pyecsca-bb3ad6b5edafb26309514a0d59e9ba8bc2d5c19f.zip
Fix Edwards yz/yzsquared to_model.
Fixes #10.
Diffstat (limited to 'test')
-rw-r--r--test/ec/test_regress.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ec/test_regress.py b/test/ec/test_regress.py
index e2c1799..26ef921 100644
--- a/test/ec/test_regress.py
+++ b/test/ec/test_regress.py
@@ -49,3 +49,15 @@ class RegressionTests(TestCase):
formula = coords.formulas["dbl-1987-m-2"]
res = formula(base, **curve.parameters)[0]
self.assertIsNotNone(res)
+
+ def test_issue_10(self):
+ model = EdwardsModel()
+ coords = model.coordinates["yz"]
+ p = 0x1d
+ c = Mod(1, p)
+ d = Mod(0x1c, p)
+ r = d.sqrt()
+ neutral = Point(coords, Y=c * r, Z=Mod(1, p))
+ curve = EllipticCurve(model, coords, p, neutral, {"c": c, "d": d, "r": r})
+ neutral_affine = Point(AffineCoordinateModel(model), x=Mod(0, p), y=c)
+ self.assertEqual(neutral, neutral_affine.to_model(coords, curve))