From ed4c22473f5fb07006e773137ed047950e25a4d8 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 26 May 2020 15:18:19 -0400 Subject: Wow, python-version-independent hexadecimal is painful --- tests/test-ecdsa.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test-ecdsa.py') diff --git a/tests/test-ecdsa.py b/tests/test-ecdsa.py index cf21019..4c14d9f 100644 --- a/tests/test-ecdsa.py +++ b/tests/test-ecdsa.py @@ -126,9 +126,10 @@ for curve in curves: if isinstance(value, int): value = long_to_bytes(value, order) if value is not None: + value = hexlify(value).decode("ascii") print() print("static const uint8_t {}[] = {{ /* {:d} bytes */".format(name, len(value))) - print(wrapper.fill(", ".join("0x" + hexlify(v) for v in value))) + print(wrapper.fill(", ".join("0x" + value[i : i + 2] for i in range(0, len(value), 2)))) print("};") print() -- cgit v1.2.3