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

Side by Side Diff: third_party/tlslite/tlslite/utils/aes.py

Issue 211173006: Perform tlslite 0.3.8 -> 0.4.6 renames ahead of time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop the -B Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 """Abstract class for AES.""" 1 """Abstract class for AES."""
2 2
3 class AES: 3 class AES:
4 def __init__(self, key, mode, IV, implementation): 4 def __init__(self, key, mode, IV, implementation):
5 if len(key) not in (16, 24, 32): 5 if len(key) not in (16, 24, 32):
6 raise AssertionError() 6 raise AssertionError()
7 if mode != 2: 7 if mode != 2:
8 raise AssertionError() 8 raise AssertionError()
9 if len(IV) != 16: 9 if len(IV) != 16:
10 raise AssertionError() 10 raise AssertionError()
(...skipping 11 matching lines...) Expand all
22 22
23 #CBC-Mode encryption, returns ciphertext 23 #CBC-Mode encryption, returns ciphertext
24 #WARNING: *MAY* modify the input as well 24 #WARNING: *MAY* modify the input as well
25 def encrypt(self, plaintext): 25 def encrypt(self, plaintext):
26 assert(len(plaintext) % 16 == 0) 26 assert(len(plaintext) % 16 == 0)
27 27
28 #CBC-Mode decryption, returns plaintext 28 #CBC-Mode decryption, returns plaintext
29 #WARNING: *MAY* modify the input as well 29 #WARNING: *MAY* modify the input as well
30 def decrypt(self, ciphertext): 30 def decrypt(self, ciphertext):
31 assert(len(ciphertext) % 16 == 0) 31 assert(len(ciphertext) % 16 == 0)
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/utils/__init__.py ('k') | third_party/tlslite/tlslite/utils/asn1parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698