From 5ecb8574cc8d0a0adae10daacb269c3ab1bf5b12 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Mon, 24 Oct 2016 22:35:30 +0300 Subject: [PATCH] tests: fix curve25519 unittests (#78) --- test_curves.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_curves.py b/test_curves.py index fb89ec8115..669a425dd1 100755 --- a/test_curves.py +++ b/test_curves.py @@ -409,9 +409,9 @@ def test_curve25519(r): pub2 = curve25519.Private(sec2).get_public() session1 = r.randbytes(32) - lib.curve25519_scalarmult(session1, sec2, pub1.public) + lib.curve25519_donna(session1, sec2, pub1.public) session2 = r.randbytes(32) - lib.curve25519_scalarmult(session2, sec1, pub2.public) + lib.curve25519_donna(session2, sec1, pub2.public) assert bytearray(session1) == bytearray(session2) shared1 = curve25519.Private(sec2).get_shared_key(pub1, hashfunc=lambda x: x) @@ -425,7 +425,7 @@ def test_curve25519_pubkey(r): sec = bytes(bytearray(r.randbytes(32))) pub = curve25519.Private(sec).get_public() res = r.randbytes(32) - lib.curve25519_publickey(res, sec) + lib.curve25519_donna_basepoint(res, sec) assert bytearray(res) == pub.public @@ -433,6 +433,6 @@ def test_curve25519_scalarmult_from_gpg(r): sec = binascii.unhexlify('4a1e76f133afb29dbc7860bcbc16d0e829009cc15c2f81ed26de1179b1d9c938') pub = binascii.unhexlify('5d6fc75c016e85b17f54e0128a216d5f9229f25bac1ec85cecab8daf48621b31') res = r.randbytes(32) - lib.curve25519_scalarmult(res, sec[::-1], pub[::-1]) + lib.curve25519_donna(res, sec[::-1], pub[::-1]) expected = 'a93dbdb23e5c99da743e203bd391af79f2b83fb8d0fd6ec813371c71f08f2d4d' assert binascii.hexlify(bytearray(res)) == expected