diff --git a/core/src/trezor/wire/thp/channel.py b/core/src/trezor/wire/thp/channel.py index 70679b1753..42e6ba82ad 100644 --- a/core/src/trezor/wire/thp/channel.py +++ b/core/src/trezor/wire/thp/channel.py @@ -29,7 +29,7 @@ from .writer import ( ) if __debug__: - from ubinascii import hexlify + from trezor.utils import get_bytes_as_str from . import state_to_str @@ -194,19 +194,19 @@ class Channel: assert nonce_receive is not None if __debug__ and utils.ALLOW_DEBUG_MESSAGES: - self._log("Buffer before decryption: ", hexlify(noise_buffer)) + self._log("Buffer before decryption: ", get_bytes_as_str(noise_buffer)) is_tag_valid = crypto.dec( noise_buffer, tag, key_receive, nonce_receive, b"" ) if __debug__ and utils.ALLOW_DEBUG_MESSAGES: - self._log("Buffer after decryption: ", hexlify(noise_buffer)) + self._log("Buffer after decryption: ", get_bytes_as_str(noise_buffer)) self.channel_cache.set_int(CHANNEL_NONCE_RECEIVE, nonce_receive + 1) if __debug__ and utils.ALLOW_DEBUG_MESSAGES: self._log("Is decrypted tag valid? ", str(is_tag_valid)) - self._log("Received tag: ", hexlify(tag).decode()) + self._log("Received tag: ", get_bytes_as_str(tag)) self._log("New nonce_receive: ", str((nonce_receive + 1))) if not is_tag_valid: