[Cryptech-Commits] [sw/libhal] 01/02: A couple more Python 3 changes.

git at cryptech.is git at cryptech.is
Tue Jun 29 03:12:31 UTC 2021


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

commit 72c7c1f150548519cd9841144f89008ca207c511
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Mon Jun 28 22:44:59 2021 -0400

    A couple more Python 3 changes.
---
 tests/parallel-signatures.py | 17 +++++++++--------
 1 file 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)]



More information about the Commits mailing list