diff options
| author | J08nY | 2019-12-21 20:30:28 +0100 |
|---|---|---|
| committer | J08nY | 2019-12-21 20:55:48 +0100 |
| commit | 77c3141139be0c3f851dff92f8da6f463e29d57c (patch) | |
| tree | 2835dc974bba3a6afccae437e745d1bf10843952 /test/ec/test_point.py | |
| parent | 4cde58b8b0826db51814fc930bfaa3ff3144bc4d (diff) | |
| download | pyecsca-77c3141139be0c3f851dff92f8da6f463e29d57c.tar.gz pyecsca-77c3141139be0c3f851dff92f8da6f463e29d57c.tar.zst pyecsca-77c3141139be0c3f851dff92f8da6f463e29d57c.zip | |
Add curve parameters, improve coverage.
Diffstat (limited to 'test/ec/test_point.py')
| -rw-r--r-- | test/ec/test_point.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/test/ec/test_point.py b/test/ec/test_point.py index c80d4cc..0809edc 100644 --- a/test/ec/test_point.py +++ b/test/ec/test_point.py @@ -1,15 +1,15 @@ from unittest import TestCase from pyecsca.ec.coordinates import AffineCoordinateModel +from pyecsca.ec.curves import get_curve from pyecsca.ec.mod import Mod from pyecsca.ec.model import ShortWeierstrassModel, MontgomeryModel from pyecsca.ec.point import Point, InfinityPoint -from .curves import get_secp128r1 class PointTests(TestCase): def setUp(self): - self.secp128r1 = get_secp128r1() + self.secp128r1 = get_curve("secp128r1", "projective") self.base = self.secp128r1.generator self.coords = self.secp128r1.curve.coordinate_model self.affine = AffineCoordinateModel(ShortWeierstrassModel()) @@ -81,12 +81,3 @@ class PointTests(TestCase): Z=Mod(1, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)) assert not pt.equals(different) self.assertNotEqual(pt, different) - - def test_repr(self): - self.assertEqual(str(self.base), - "[X=29408993404948928992877151431649155974, Y=275621562871047521857442314737465260675, Z=1]") - self.assertEqual(repr(self.base), - "Point([[X=29408993404948928992877151431649155974, Y=275621562871047521857442314737465260675, Z=1]] in EFDCoordinateModel(\"projective\" on short Weierstrass curves))") - self.assertEqual(str(InfinityPoint(self.coords)), "Infinity") - self.assertEqual(repr(InfinityPoint(self.coords)), - "InfinityPoint(EFDCoordinateModel(\"projective\" on short Weierstrass curves))") |
