| Index: third_party/tlslite/tlslite/utils/pycrypto_aes.py
|
| diff --git a/third_party/tlslite/tlslite/utils/pycrypto_aes.py b/third_party/tlslite/tlslite/utils/pycrypto_aes.py
|
| index a44094185e21d04cad46529385a8679dcef84568..b3425c047d7b3b78d7fb396baeeae47ceafea46a 100644
|
| --- a/third_party/tlslite/tlslite/utils/pycrypto_aes.py
|
| +++ b/third_party/tlslite/tlslite/utils/pycrypto_aes.py
|
| @@ -1,7 +1,10 @@
|
| +# Author: Trevor Perrin
|
| +# See the LICENSE file for legal information regarding use of this file.
|
| +
|
| """PyCrypto AES implementation."""
|
|
|
| -from cryptomath import *
|
| -from aes import *
|
| +from .cryptomath import *
|
| +from .aes import *
|
|
|
| if pycryptoLoaded:
|
| import Crypto.Cipher.AES
|
| @@ -13,10 +16,14 @@ if pycryptoLoaded:
|
|
|
| def __init__(self, key, mode, IV):
|
| AES.__init__(self, key, mode, IV, "pycrypto")
|
| + key = bytes(key)
|
| + IV = bytes(IV)
|
| self.context = Crypto.Cipher.AES.new(key, mode, IV)
|
|
|
| def encrypt(self, plaintext):
|
| - return self.context.encrypt(plaintext)
|
| + plaintext = bytes(plaintext)
|
| + return bytearray(self.context.encrypt(plaintext))
|
|
|
| def decrypt(self, ciphertext):
|
| - return self.context.decrypt(ciphertext)
|
| + ciphertext = bytes(ciphertext)
|
| + return bytearray(self.context.decrypt(ciphertext))
|
|
|