From a982efd8c5b00aadf39adf07da07f68263022c9d Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 2 Feb 2022 16:36:27 +0100 Subject: [PATCH] ePass: Python 3 compatibility --- virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py b/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py index 5017c9c..e9d4d26 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py @@ -215,10 +215,7 @@ def hash(hashmethod, data): def operation_on_string(string1, string2, op): if len(string1) != len(string2): raise ValueError("string1 and string2 must be of equal length") - result = [] - for i in range(len(string1)): - result.append(chr(op(ord(string1[i]), ord(string2[i])))) - return "".join(result) + return bytes([op(_a, _b) for _a, _b in zip(string1, string2)]) # *******************************************************************