1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

python3 migration (#149)

This commit is contained in:
onvej-sl 2018-04-05 16:02:07 +02:00 committed by Pavol Rusnak
parent 7ea31aecf7
commit 8b61a7e365

View File

@ -86,7 +86,7 @@ def r(request):
@pytest.fixture(params=list(sorted(curves)))
def curve(request):
name = request.param
curve_ptr = lib.get_curve_by_name(name).contents.params
curve_ptr = lib.get_curve_by_name(bytes(name, "ascii")).contents.params
assert curve_ptr, 'curve {} not found'.format(name)
curve_obj = curves[name]
curve_obj.ptr = c.c_void_p(curve_ptr)
@ -96,7 +96,7 @@ def curve(request):
@pytest.fixture(params=points)
def point(request):
name = request.param.curve
curve_ptr = lib.get_curve_by_name(name).contents.params
curve_ptr = lib.get_curve_by_name(bytes(name, "ascii")).contents.params
assert curve_ptr, 'curve {} not found'.format(name)
curve_obj = curves[name]
curve_obj.ptr = c.c_void_p(curve_ptr)
@ -435,4 +435,4 @@ def test_curve25519_scalarmult_from_gpg(r):
res = r.randbytes(32)
lib.curve25519_scalarmult(res, sec[::-1], pub[::-1])
expected = 'a93dbdb23e5c99da743e203bd391af79f2b83fb8d0fd6ec813371c71f08f2d4d'
assert binascii.hexlify(bytearray(res)) == expected
assert binascii.hexlify(bytearray(res)) == bytes(expected, "ascii")