Commit c7459f92 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

zerobin: Fix imports to work with the mainstream Cryptodome library

https://pycryptodome.readthedocs.io/ uses the Crypto namespace
https://pypi.org/project/pycryptodomex/ is a fork of Cryptodome that
uses the Cryptodome namespace.

Some distributions went with pycryptodomex, others with pycryptodome.
parent 0ce05a1b
......@@ -22,10 +22,16 @@ from collections import OrderedDict
import math
from os import urandom
from Cryptodome.Cipher import AES
from Cryptodome.Protocol.KDF import PBKDF2
from Cryptodome.Hash import SHA256
from Cryptodome.Hash import HMAC
try:
from Cryptodome.Cipher import AES
from Cryptodome.Protocol.KDF import PBKDF2
from Cryptodome.Hash import SHA256
from Cryptodome.Hash import HMAC
except ImportError:
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
from Crypto.Hash import SHA256
from Crypto.Hash import HMAC
def log2(n):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment