aboutsummaryrefslogtreecommitdiff
path: root/test/ec/test_params.py
blob: da293f40d0ff1c0ab8c35b069b32f2cf36116395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from unittest import TestCase

from pyecsca.ec.curves import get_params
from pyecsca.ec.point import InfinityPoint


class DomainParameterTests(TestCase):

    def setUp(self):
        self.secp128r1 = get_params("secg", "secp128r1", "projective")
        self.curve25519 = get_params("other", "Curve25519", "xz")

    def test_is_neutral(self):
        assert self.secp128r1.is_neutral(InfinityPoint(self.secp128r1.curve.coordinate_model))

    def test_eq(self):
        self.assertEqual(self.secp128r1, self.secp128r1)
        self.assertNotEqual(self.secp128r1, self.curve25519)
        self.assertNotEqual(self.secp128r1, None)