Remove unnecessary imports from CryptMessage

This commit is contained in:
shortcutme 2019-11-27 03:08:01 +01:00
parent f7c767c1c8
commit 59e0ffd8e0
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -1,12 +1,13 @@
import hashlib import hashlib
import base64 import base64
import binascii
import lib.pybitcointools as btctools import lib.pybitcointools as btctools
from util import ThreadPool
from Crypt import Crypt from Crypt import Crypt
ecc_cache = {} ecc_cache = {}
def eciesEncrypt(data, pubkey, ephemcurve=None, ciphername='aes-256-cbc'): def eciesEncrypt(data, pubkey, ephemcurve=None, ciphername='aes-256-cbc'):
from lib import pyelliptic from lib import pyelliptic
pubkey_openssl = toOpensslPublickey(base64.b64decode(pubkey)) pubkey_openssl = toOpensslPublickey(base64.b64decode(pubkey))
@ -40,7 +41,6 @@ def eciesDecrypt(encrypted_data, privatekey):
ecc_key = getEcc(privatekey) ecc_key = getEcc(privatekey)
return ecc_key.decrypt(base64.b64decode(encrypted_data)) return ecc_key.decrypt(base64.b64decode(encrypted_data))
def split(encrypted): def split(encrypted):
iv = encrypted[0:16] iv = encrypted[0:16]
ciphertext = encrypted[16 + 70:-32] ciphertext = encrypted[16 + 70:-32]