13.12 PRIME NUMBER TESTING AND FACTORIZATION PROBLEMS
Problem 13.1 requires a program to implement the Miller–Rabin Primality Test.6 Your implementation should use at least T = 10 random a-values. Your solution should include a trace of your Miller–Rabin primality test as in Section 13.7; my trace for the composite number 42,091 is given in Table 13.16.
Problems 13.2 to 13.12 are examples of factorization of the integer N = pq using the quadratic residue sieve to find the two prime factors p, q. Factorization using the quadratic residue sieve involves four phases:
TABLE 13.16 Trace for Composite Number 42,091

| QS1. |
Select a factor base
|
||||
| QS2. |
For x = 0, 1, − 1, 2, −2, …, r, −r with r ≈ 400, compute
with m = √N. Make a table whose ith row (i = 1, 2, …) contains i, xi and ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access