mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-23 19:34:24 +03:00
Avoid defining Python's AES class if libssl's is available
This commit is contained in:
parent
c296459d0a
commit
274e16ac66
|
@ -2,6 +2,12 @@ import os
|
|||
import pyaes
|
||||
from . import libssl
|
||||
|
||||
|
||||
if libssl.libssl:
|
||||
# Use libssl if available, since it will be faster
|
||||
AES = libssl.AES
|
||||
else:
|
||||
# Fallback to a pure Python implementation
|
||||
class AES:
|
||||
@staticmethod
|
||||
def decrypt_ige(cipher_text, key, iv):
|
||||
|
@ -71,7 +77,3 @@ class AES:
|
|||
cipher_text.extend(cipher_text_block)
|
||||
|
||||
return bytes(cipher_text)
|
||||
|
||||
# use libssl if available
|
||||
if libssl.libssl:
|
||||
AES = libssl.AES
|
||||
|
|
Loading…
Reference in New Issue
Block a user