diff --git a/kaitaistruct.py b/kaitaistruct.py index 8edac81..cf47e0c 100644 --- a/kaitaistruct.py +++ b/kaitaistruct.py @@ -348,6 +348,8 @@ def process_xor_one(data, key): def process_xor_many(data, key): if key == b'\x00' * len(key): return data + if len(key) == 1: + return KaitaiStream.process_xor_one(data, ord(key)) if PY2: return bytes(bytearray(a ^ b for a, b in zip(bytearray(data), itertools.cycle(bytearray(key)))))