RSA u parameter not available when _slowmath in use

Bug #622879 reported by Jean-Paul Calderone on 2010-08-23
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python-Crypto
Undecided
Unassigned

Bug Description

Consider this behavior when _fastmath is built and available:

>>> import Crypto.PublicKey._fastmath
>>> 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.PublicKey._fastmath
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/exarkun/.local/lib/python2.6/site-packages/Crypto/PublicKey/RSA.py", line 55, in __getattr__
    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.

Dwayne Litzenberger (dlitz) wrote :

This bug has been fixed in PyCrypto 2.3. Thanks!

Changed in pycrypto:
status: Fix Committed → Fix Released
Glyph Lefkowitz (glyph) wrote :

Wow, thanks a ton for the prompt turnaround, Dwayne!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers