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

Side by Side Diff: third_party/tlslite/tlslite/utils/python_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 """Pure-Python RSA implementation.""" 1 """Pure-Python RSA implementation."""
2 2
3 from cryptomath import * 3 from cryptomath import *
4 import xmltools 4 import xmltools
5 from ASN1Parser import ASN1Parser 5 from asn1parser import ASN1Parser
6 from RSAKey import * 6 from rsakey import *
7 7
8 class Python_RSAKey(RSAKey): 8 class Python_RSAKey(RSAKey):
9 def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): 9 def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
10 if (n and not e) or (e and not n): 10 if (n and not e) or (e and not n):
11 raise AssertionError() 11 raise AssertionError()
12 self.n = n 12 self.n = n
13 self.e = e 13 self.e = e
14 self.d = d 14 self.d = d
15 self.p = p 15 self.p = p
16 self.q = q 16 self.q = q
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #Parse private values, if present 200 #Parse private values, if present
201 if element.childNodes.length>=3: 201 if element.childNodes.length>=3:
202 d = base64ToNumber(xmltools.getText(xmltools.getChild(element, 2, "d "), xmltools.base64RegEx)) 202 d = base64ToNumber(xmltools.getText(xmltools.getChild(element, 2, "d "), xmltools.base64RegEx))
203 p = base64ToNumber(xmltools.getText(xmltools.getChild(element, 3, "p "), xmltools.base64RegEx)) 203 p = base64ToNumber(xmltools.getText(xmltools.getChild(element, 3, "p "), xmltools.base64RegEx))
204 q = base64ToNumber(xmltools.getText(xmltools.getChild(element, 4, "q "), xmltools.base64RegEx)) 204 q = base64ToNumber(xmltools.getText(xmltools.getChild(element, 4, "q "), xmltools.base64RegEx))
205 dP = base64ToNumber(xmltools.getText(xmltools.getChild(element, 5, " dP"), xmltools.base64RegEx)) 205 dP = base64ToNumber(xmltools.getText(xmltools.getChild(element, 5, " dP"), xmltools.base64RegEx))
206 dQ = base64ToNumber(xmltools.getText(xmltools.getChild(element, 6, " dQ"), xmltools.base64RegEx)) 206 dQ = base64ToNumber(xmltools.getText(xmltools.getChild(element, 6, " dQ"), xmltools.base64RegEx))
207 qInv = base64ToNumber(xmltools.getText(xmltools.getLastChild(element , 7, "qInv"), xmltools.base64RegEx)) 207 qInv = base64ToNumber(xmltools.getText(xmltools.getLastChild(element , 7, "qInv"), xmltools.base64RegEx))
208 return Python_RSAKey(n, e, d, p, q, dP, dQ, qInv) 208 return Python_RSAKey(n, e, d, p, q, dP, dQ, qInv)
209 _parseXML = staticmethod(_parseXML) 209 _parseXML = staticmethod(_parseXML)
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/utils/python_rc4.py ('k') | third_party/tlslite/tlslite/utils/rc4.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698