Skip to content

Commit c17d7e7

Browse files
committed
test verification with plain Point
PointJacobi has a mul_add() method, but Point doesn't, verify that verifies() works with both point encodings
1 parent c2a1c16 commit c17d7e7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ecdsa/test_ecdsa.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
generator_112r2,
2828
int_to_string,
2929
)
30+
from .ellipticcurve import Point
3031

3132

3233
HYP_SETTINGS = {}
@@ -76,6 +77,19 @@ def test_verification(self):
7677
def test_rejection(self):
7778
assert not self.pubk.verifies(self.msg - 1, self.sig)
7879

80+
def test_verification_with_regular_point(self):
81+
pubk = Public_key(
82+
Point(
83+
generator_192.curve(),
84+
generator_192.x(),
85+
generator_192.y(),
86+
generator_192.order(),
87+
),
88+
self.pubk.point,
89+
)
90+
91+
assert pubk.verifies(self.msg, self.sig)
92+
7993

8094
class TestPublicKey(unittest.TestCase):
8195
def test_equality_public_keys(self):

0 commit comments

Comments
 (0)