File tree 1 file changed +2
-8
lines changed 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -348,20 +348,14 @@ def process_xor_many(data, key):
348
348
else :
349
349
return bytes (a ^ b for a , b in zip (data , itertools .cycle (key )))
350
350
351
- precomputed_rotations = {amount :[(i << amount ) & 0xff | (i >> (- amount & 7 )) for i in range (256 )] for amount in range (9 )}
351
+ precomputed_rotations = {( amount , 1 ) :[(i << amount ) & 0xff | (i >> (- amount & 7 )) for i in range (256 )] for amount in range (9 )}
352
352
353
353
@staticmethod
354
354
def process_rotate_left (data , amount , group_size ):
355
- if group_size != 1 :
356
- raise Exception (
357
- "unable to rotate group of %d bytes yet" %
358
- (group_size ,)
359
- )
360
-
361
355
if amount == 0 :
362
356
return data
363
357
364
- translate = KaitaiStream .precomputed_rotations [amount ]
358
+ translate = KaitaiStream .precomputed_rotations [amount , group_size ]
365
359
if PY2 :
366
360
return bytes (bytearray (translate [a ] for a in bytearray (data )))
367
361
else :
You can’t perform that action at this time.
0 commit comments