aboutsummaryrefslogtreecommitdiff
path: root/test/ec/test_curve.py
diff options
context:
space:
mode:
authorJ08nY2020-07-01 23:08:43 +0200
committerJ08nY2020-07-01 23:09:30 +0200
commit2aa191c63c556857ee22e801c19ee9822016f7cc (patch)
tree8824b678714c71979c4f8579c9cf782a6fadcc5e /test/ec/test_curve.py
parent3eaaed8ff2dfa36ad31884bc4cb0f45e0bf8f427 (diff)
downloadpyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.gz
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.zst
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.zip
Diffstat (limited to 'test/ec/test_curve.py')
-rw-r--r--test/ec/test_curve.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ec/test_curve.py b/test/ec/test_curve.py
index f9e3387..a480bb0 100644
--- a/test/ec/test_curve.py
+++ b/test/ec/test_curve.py
@@ -70,6 +70,13 @@ class CurveTests(TestCase):
self.assertIsNone(self.curve25519.curve.affine_neutral)
self.assertIsNotNone(self.ed25519.curve.affine_neutral)
+ def test_affine_random(self):
+ for params in [self.secp128r1, self.curve25519, self.ed25519]:
+ for _ in range(20):
+ pt = params.curve.affine_random()
+ self.assertIsNotNone(pt)
+ self.assertTrue(params.curve.is_on_curve(pt))
+
def test_neutral_is_affine(self):
self.assertFalse(self.secp128r1.curve.neutral_is_affine)
self.assertFalse(self.curve25519.curve.neutral_is_affine)