mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-14 19:25:05 -05:00
Optimize code for cryptutils.py
This commit is contained in:
parent
8e4507ef52
commit
af78467668
1 changed files with 1 additions and 5 deletions
|
@ -289,11 +289,7 @@ class cryptutils:
|
|||
ctr = Counter.new(128, initial_value=counter)
|
||||
# Create the AES cipher object and decrypt the ciphertext, basically this here is just aes ctr 256 :)
|
||||
cipher = AES.new(key, AES.MODE_CTR, counter=ctr)
|
||||
data = b""
|
||||
if decrypt:
|
||||
data = cipher.decrypt(enc_data)
|
||||
else:
|
||||
data = cipher.encrypt(enc_data)
|
||||
data = cipher.decrypt(enc_data) if decrypt else cipher.encrypt(enc_data)
|
||||
return data
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue