RSA u parameter not available when _slowmath in use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Consider this behavior when _fastmath is built and available:
>>> import Crypto.
>>> from Crypto.PublicKey import RSA
>>> RSA.construct((1L, 2L, 3L, 4L, 5L)).u
4L
Compare to this behavior when _slowmath, instead, must be used:
>>> import Crypto.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _fastmath
>>> from Crypto.PublicKey import RSA
>>> RSA.construct((1L, 2L, 3L, 4L, 5L)).u
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
return getattr(self.key, attrname)
AttributeError: '_RSAKey' object has no attribute 'u'
>>>
It seems that the _fastmath rsaKey calculates u if it is not provided, but _slowmath _RSAKey does not. This breaks Twisted Conch when _slowmath is in use.
Fix committed:
http:// gitweb. pycrypto. org/?p= crypto/ pycrypto- 2.x.git; a=commitdiff; h=1d68d2b9fdf6e dc4cc672fa8f260 5e6d7e4f517e