1. | determine m in n-1 = 2lm (m odd) | |||
2. | randomly chose a x with 1 <= x < n | |||
3. | x0 = xm mod n | |||
4. | if x0 = 1 or x0 = n-1 | |||
5. | then write("n is prime"); goto END | |||
6. | end | |||
7. | for i = 1 to l-1 do | |||
8. | xi = xi-12 mod n | |||
9. | if xi = n-1 | |||
10. | then write("n is prime"); goto END | |||
11. | else if xi = 1 | |||
12. | then write("n is composite"); goto END | |||
13. | end | |||
14. | end | |||
15. | end | |||
16. | write("n is composite") | |||
17. | END |
2.3.2 Generating large Primes |