[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py

Gurney, John-Mark john-mark at cryptography.com
Wed May 23 13:48:03 EDT 2012


https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Signature/PKCS1_PSS.py

In the file on lines 41 & 42 it has:
>>> signer = PKCS1_PSS.new(key)
>>> signature = PKCS1_PSS.sign(key)

The second line is incorrect.  It should be:
>>> signature = signer.sign(h)

Oh, there is also a bogus assertion in _slowmath.py:
https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/PublicKey/_slowmath.py

On line 85, it asserts that e is long.  If you have an e of 3, it is reasonable for e to be a normal int, and not a long.  Maybe the asserts should be changed to:
n = long(n)
e = long(e)

So that python will convert the types properly.

Thanks.

-- 
John-Mark Gurney
Cryptography Research a division of Rambus
+1 415 397 0123 x4332




More information about the pycrypto mailing list