dlitz/pycrypto — pull request #70 by Legrandin (2013-12-27 23:03:09+00:00)
Title: Add side-channel countermeasures to DSA

This patch strenghten the DSA signing code against side-channel attacks.

The DSA signing formulae:

r = (g^{k} mod p) mod q
s = k^{-1} * (H(m) + r*x) mod q

becomes:

b = random in [1..q)
r = (g^{k} mod p) mod q
s = (b * k)^{-1} * (b*H(m) + r*(b*x)) mod q