aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)]