aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2021-06-28 22:44:59 -0400
committerPaul Selkirk <paul@psgd.org>2021-06-28 22:44:59 -0400
commit72c7c1f150548519cd9841144f89008ca207c511 (patch)
tree0aff817e2969c1fab52f0c94243ac38e3161c865 /tests
parent8ef2a4e5f54c8623c98c396e378ec093629b849b (diff)
A couple more Python 3 changes.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/parallel-signatures.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/parallel-signatures.py b/tests/parallel-signatures.py
index abecbfc..b9da4dd 100755
--- a/tests/parallel-signatures.py
+++ b/tests/parallel-signatures.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
#
-# Copyright (c) 2016-2018, NORDUnet A/S
-# All rights reserved.
+# Copyright (c) 2016-2018, NORDUnet A/S All rights reserved.
+# Copyright: 2020-2021, The Commons Conservancy Cryptech Project
+# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -13,9 +14,9 @@
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
-# - Neither the name of the NORDUnet nor the names of its contributors may
-# be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# - Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -155,7 +156,7 @@ class HSM(cryptech.libhal.HSM):
unpacker = cryptech.libhal.slip_decode(unpacker)
if not unpacker:
continue
- unpacker = ContextManagedUnpacker(b"".join(unpacker))
+ unpacker = ContextManagedUnpacker(unpacker)
if unpacker.unpack_uint() == code:
break
client = unpacker.unpack_uint()
@@ -242,10 +243,10 @@ def main():
k = key_table[args.key]
d = k.exportKey(format = "DER", pkcs = 8)
- h = SHA256(args.text)
+ h = SHA256(args.text.encode())
v = PKCS115_SigScheme(k)
q = list(range(args.iterations))
- m = pkcs1_hash_and_pad(args.text)
+ m = pkcs1_hash_and_pad(args.text.encode())
r = Result(args, args.key)
hsms = [HSM() for i in range(args.clients)]