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 well-known MillerRabin primality test for a positive integer n, one computes repeatedly the expression a (mod n) for random bases a ∈ N and exponents ω such that ω divides n − 1 and (n − 1)/ω is a power of 2. In each round one choo...