By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,548 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,548 IT Pros & Developers. It's quick & easy.

pycrypto rsa inverse of p modulo q

P: n/a
jt
Looking up into Crypto.PublicKey.RSA, I see there is a computed value
named "u" for which I can't see the use. The value of "u" is the
inverse of p modulo q, in the code:
obj.u = pubkey.inverse(obj.p, obj.q)
Can someone tell me where this value could be used in the RSA scheme?
(it is not used in the code anyway)

Thx,
--
jt

Nov 4 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

jt wrote:
Looking up into Crypto.PublicKey.RSA, I see there is a computed value
named "u" for which I can't see the use. The value of "u" is the
inverse of p modulo q, in the code:
obj.u = pubkey.inverse(obj.p, obj.q)
Can someone tell me where this value could be used in the RSA scheme?
(it is not used in the code anyway)
Yes, it is. Look in _fastmath.c. It's used in rsaDecrypt:

/* fast path */
/* m1 = c ^ (d mod (p-1)) mod p */
/* m2 = c ^ (d mod (q-1)) mod q */
/* h = u * ( m2 - m1 ) mod q */ <-- right here
/* m = m2 + h * p */


Thx,
--
jt


Nov 4 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.