aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ecdsa.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2020-05-26 15:18:19 -0400
committerRob Austein <sra@hactrn.net>2020-05-26 15:18:19 -0400
commited4c22473f5fb07006e773137ed047950e25a4d8 (patch)
tree26f7b93d5447b2e0cf5bd9c92dcda70161a46545 /tests/test-ecdsa.py
parent1cd42f6d3332e1edf78b06bd7dcf51f5a1a7bb23 (diff)
Wow, python-version-independent hexadecimal is painful
Diffstat (limited to 'tests/test-ecdsa.py')
-rw-r--r--tests/test-ecdsa.py3
1 files changed, 2 insertions, 1 deletions
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()