Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: third_party/tlslite/tlslite/utils/pycrypto_aesgcm.py

Issue 875683002: Implement AES-GCM in tlslite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « third_party/tlslite/tlslite/utils/cipherfactory.py ('k') | third_party/tlslite/tlslite/utils/python_aesgcm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698