Index: third_party/tlslite/tlslite/utils/pycrypto_aesgcm.py |
diff --git a/third_party/tlslite/tlslite/utils/pycrypto_aesgcm.py b/third_party/tlslite/tlslite/utils/pycrypto_aesgcm.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ee187eea7be97733da0583508e5289b1698bed73 |
--- /dev/null |
+++ b/third_party/tlslite/tlslite/utils/pycrypto_aesgcm.py |
@@ -0,0 +1,16 @@ |
+# Author: Google |
+# See the LICENSE file for legal information regarding use of this file. |
+ |
+"""PyCrypto AES-GCM implementation.""" |
+ |
+from .cryptomath import * |
+from .aesgcm import AESGCM |
+ |
+if pycryptoLoaded: |
+ import Crypto.Cipher.AES |
+ |
+ def new(key): |
+ cipher = Crypto.Cipher.AES.new(bytes(key)) |
+ def encrypt(plaintext): |
+ return bytearray(cipher.encrypt(bytes(plaintext))) |
+ return AESGCM(key, "pycrypto", encrypt) |