diff options
author | Uri Blumenthal <[email protected]> | 2015-10-23 09:28:24 -0400 |
---|---|---|
committer | Uri Blumenthal <[email protected]> | 2015-10-23 09:28:24 -0400 |
commit | c8d5dc2f8feba7eb9e7a8fd41896eb26974f4417 (patch) | |
tree | f265c9d3eb10074fd113ab33a0be484ff8e170b3 /src | |
parent | b28e81e0889ff91cd3eb6c216f9d8cb11dd57c10 (diff) |
Added comments explaining when .decode() is needed on mce_decrypt
Diffstat (limited to 'src')
-rwxr-xr-x | src/python/botan.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/python/botan.py b/src/python/botan.py index ae58ef349..da59c2a05 100755 --- a/src/python/botan.py +++ b/src/python/botan.py @@ -747,8 +747,13 @@ def test(): mce_decrypt = mceies_decrypt(mce_priv, 'ChaCha20Poly1305', mce_ciphertext, mce_ad) print(" mceies plaintext \'%s\' (%d)" % (mce_plaintext, len(mce_plaintext))) - # Since mceies_decrypt() returns bytes in Python3, need .decode('utf-8') to - # convert it to a text string (Unicode) + + # Since mceies_decrypt() returns bytes in Python3, the following line + # needs .decode('utf-8') to convert mce_decrypt from bytes to a + # text string (Unicode). + # You don't need to add .decode() if + # (a) your expected output is bytes rather than a text string, or + # (b) you are using Python2 rather than Python3. print(" mceies decrypted \'%s\' (%d)" % (mce_decrypt.decode('utf-8'), len(mce_decrypt))) print("mce_pub %s/SHA-1 fingerprint: %s\nEstimated strength %s bits (len %d)\n" % |