# Fastest Primality test using $N-1$ Factorization?

If $N-1$ could be factored easily with several small prime factors, then what is the fastest way to check $N$ for primality?

Updated

I'm aware of Pocklington primility test which is not good for small factors. I'm looking for a reduction in modular exponentitation when $N-1$ has several small factors.

-
Are you familiar with the Pocklington test, en.wikipedia.org/wiki/Pocklington_primality_test ? –  Gerry Myerson Dec 3 '12 at 9:59
It is not fast, since finally it requires modular exponentiation with $N-1$ in exponent, which requires the same time of Fermat Little Theorem PRP test. –  Mohsen Afshin Dec 3 '12 at 10:15
The pocklington test relies on the fact that $N-1$ is divisible by some relatively large prime, which doesn't seem to be the case. –  Arthur Dec 3 '12 at 11:05
@Arthur: See the section "Generalized Pocklington method" in the Pocklington Test Wikipedia article. This removes youe restriction. –  TonyK Dec 3 '12 at 11:11
@Arthur: You should do these exponentiation in parallel, to save even more time. I don't mean using multiple processors, I mean exponentiating them all at once by incorporating the successive square only in those results that have the appropriate bit set. (If you are familiar with square-and-multiply exponentiation, this might make some sense!) –  TonyK Dec 3 '12 at 11:15