The Miller–Rabin test with randomized exponents - Böckle Gebhard (Journal of Mathematical Cryptology, 2009)
We analyze a variant of the well-known Miller–Rabin test, that may be useful in preventing side-channel attacks to the random prime generation on smart cards: In the Miller–Rabin primality test for a positive integer n, one computes repeatedly the expression aω (mod n) for random bases a ∈ ℕ and exponents ω such that ω divides n – 1 and (n – 1)/ω is a power of 2. In each round one chooses, at random, a different base a, and uses binary exponentiation to compute aω (mod n). ‘Listening’ to many rounds, it seems at least plausible that an outside spy could retrieve the integer n – 1.