From bb3ad6b5edafb26309514a0d59e9ba8bc2d5c19f Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 6 Jan 2021 17:32:27 +0100 Subject: Fix Edwards yz/yzsquared to_model. Fixes #10. --- test/ec/test_regress.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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)) -- cgit v1.3.1