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

Side by Side Diff: third_party/tlslite/tlslite/utils/pycrypto_rsakey.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 """PyCrypto RSA implementation.""" 1 """PyCrypto RSA implementation."""
2 2
3 from cryptomath import * 3 from cryptomath import *
4 4
5 from RSAKey import * 5 from rsakey import *
6 from Python_RSAKey import Python_RSAKey 6 from python_rsakey import Python_RSAKey
7 7
8 if pycryptoLoaded: 8 if pycryptoLoaded:
9 9
10 from Crypto.PublicKey import RSA 10 from Crypto.PublicKey import RSA
11 11
12 class PyCrypto_RSAKey(RSAKey): 12 class PyCrypto_RSAKey(RSAKey):
13 def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): 13 def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
14 if not d: 14 if not d:
15 self.rsa = RSA.construct( (n, e) ) 15 self.rsa = RSA.construct( (n, e) )
16 else: 16 else:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 def writeXMLPublicKey(self, indent=''): 52 def writeXMLPublicKey(self, indent=''):
53 return Python_RSAKey(self.n, self.e).write(indent) 53 return Python_RSAKey(self.n, self.e).write(indent)
54 54
55 def generate(bits): 55 def generate(bits):
56 key = PyCrypto_RSAKey() 56 key = PyCrypto_RSAKey()
57 def f(numBytes): 57 def f(numBytes):
58 return bytesToString(getRandomBytes(numBytes)) 58 return bytesToString(getRandomBytes(numBytes))
59 key.rsa = RSA.generate(bits, f) 59 key.rsa = RSA.generate(bits, f)
60 return key 60 return key
61 generate = staticmethod(generate) 61 generate = staticmethod(generate)
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/utils/pycrypto_rc4.py ('k') | third_party/tlslite/tlslite/utils/pycrypto_tripledes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698