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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Author: Google
2 # See the LICENSE file for legal information regarding use of this file.
3
4 """PyCrypto AES-GCM implementation."""
5
6 from .cryptomath import *
7 from .aesgcm import AESGCM
8
9 if pycryptoLoaded:
10 import Crypto.Cipher.AES
11
12 def new(key):
13 cipher = Crypto.Cipher.AES.new(bytes(key))
14 def encrypt(plaintext):
15 return bytearray(cipher.encrypt(bytes(plaintext)))
16 return AESGCM(key, "pycrypto", encrypt)
OLDNEW
« 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