| Index: third_party/tlslite/tlslite/utils/pycrypto_rc4.py
|
| diff --git a/third_party/tlslite/tlslite/utils/pycrypto_rc4.py b/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
|
| index a9f11406115fab365513153407aea729bf3c79dd..fc98d7c78b1cad53cbe71c7ce6ff8c63e7895ad1 100644
|
| --- a/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
|
| +++ b/third_party/tlslite/tlslite/utils/pycrypto_rc4.py
|
| @@ -1,7 +1,10 @@
|
| +# Author: Trevor Perrin
|
| +# See the LICENSE file for legal information regarding use of this file.
|
| +
|
| """PyCrypto RC4 implementation."""
|
|
|
| -from cryptomath import *
|
| -from rc4 import *
|
| +from .cryptomath import *
|
| +from .rc4 import *
|
|
|
| if pycryptoLoaded:
|
| import Crypto.Cipher.ARC4
|
| @@ -13,10 +16,13 @@ if pycryptoLoaded:
|
|
|
| def __init__(self, key):
|
| RC4.__init__(self, key, "pycrypto")
|
| + key = bytes(key)
|
| self.context = Crypto.Cipher.ARC4.new(key)
|
|
|
| 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))
|
|
|