From c2f7a63f97bac65f13c8b5e602b956dc66fdddc3 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 10 Dec 2022 16:39:01 +0800 Subject: [PATCH] remove some whitespace to allow for easier debugging --- tools/encrypt-bitstream.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/encrypt-bitstream.py b/tools/encrypt-bitstream.py index 00e2dd723..244b5ebe6 100755 --- a/tools/encrypt-bitstream.py +++ b/tools/encrypt-bitstream.py @@ -188,17 +188,14 @@ Reverse the order of bits in a word that is bitwidth bits wide def bitflip(data_block, bitwidth=32): if bitwidth == 0: return data_block - bytewidth = bitwidth // 8 bitswapped = bytearray() - i = 0 while i < len(data_block): data = int.from_bytes(data_block[i:i+bytewidth], byteorder='big', signed=False) b = '{:0{width}b}'.format(data, width=bitwidth) bitswapped.extend(int(b[::-1], 2).to_bytes(bytewidth, byteorder='big')) i = i + bytewidth - return bytes(bitswapped) # assumes a, b are the same length eh? @@ -282,7 +279,6 @@ def try_key_to_bytes(input): key_bytes = Bip39MnemonicDecoder().Decode(input) else: key_bytes = int(input, 16).to_bytes(32, byteorder='big') - return key_bytes