Prime Numbers

Prime Numbers Prime Numbers

thales.doa.fmph.uniba.sk
from thales.doa.fmph.uniba.sk More from this publisher
10.12.2012 Views

268 Chapter 6 SUBEXPONENTIAL FACTORING ALGORITHMS from K to K + 1. Thus the disadvantage of using negatives is that our vectors are 1 bit longer, and we need one more vector to be assured of a linear dependency. This disadvantage is minor; it is small compared to the advantage of smaller numbers in the sieve. We therefore go ahead and allow negative polynomial values. (5) We have been ignoring the problem that there is no guarantee that the number d produced in Step [Factorization] is a nontrivial divisor of n. Assuming some kind of randomness (which is certainly not the case, but may be a reasonable heuristic assumption), the “probability” that d is a nontrivial divisor is 1/2 or larger; see Exercise 6.2. If we find a few more dependencies among our exponent vectors, and again assuming statistical independence, we can raise the odds for success. For example, say we sieve in Step [Sieving] until K + 11 polynomial values are found that are Bsmooth. Assuming that the dimension of our space is now K + 1 (because we allow negative values of the polynomial; see above), there will be at least 10 independent linear dependencies. The odds that none will work to give a nontrivial factorization of n is smaller than 1 in 1000. And if these odds for failure are still too high for your liking, you can collect a few more B-smooth numbers for good measure. (6) In Step [Factorizaton] we have to take the square root of perhaps a very large square, namely Y 2 =(x2 1 − n)(x2 2 − n) ···(x2 k − n). However, we are interested only in y = Y mod n. We can exploit the fact that we actually know the prime factorization of Y 2 ,andsoweknowtheprime factorization of Y . We can thus compute y by using Algorithm 2.1.5 to find the residue of each prime power in Y modulo n, and then multiply these together, again reducing modulo n. We shall find that in the number field sieve, the square root problem cannot be solved so easily. In the next few sections we shall discuss some of the principal enhancements to the basic quadratic sieve algorithm. 6.1.3 Fast matrix methods √ With B =exp ln n ln ln n , we have seen that the time to complete the 1 2 sieving stage of QS is (heuristically) B 2+o(1) . After this stage, one has about B vectors of length about B, with entries in the finite field F2 of two elements, and one wishes to find a nonempty subset with sum being the zero vector. To achieve the overall complexity of B 2+o(1) for QS, we shall need a linear algebra subroutine that can find the nonempty subset within this time bound. We first note that forming a matrix with our vectors and using Gaussian elimination to find subsets with sum being the zero vector has a time bound of O B 3 (assuming that the matrix is B × B). Nevertheless, in practice, Gaussian elimination is a fine method to use for smaller factorizations. There are several reasons why the high-complexity estimate is not a problem in practice.

6.1 The quadratic sieve factorization method 269 (1) Since the matrix arithmetic is over F2, it naturally lends itself to computer implementation. With w being the machine word length (typically 8 or 16 bits on older machines, 32 or 64 or even more bits on newer ones), we can deal with blocks of w coordinates in a row at a time, where one step is just a logical operation requiring very few clock cycles. (2) The initial matrix is quite sparse, so at the start, before “fill in” occurs, there are few operations to perform, thus somewhat reducing the worst case time bound. (3) If the number we are factoring is not too large, we can load the algorithm toward the sieving stage and away from the matrix stage. That is, we can choose a bound B that is somewhat too small, thus causing the sieving stage to run longer, but easing difficulties in the matrix stage. Space difficulties with higher values of B form another practical reason to choose B smaller than an otherwise optimal choice. Concerning point (2), ways have been found to use Gaussian elimination in an “intelligent” way so as to preserve sparseness as long as possible, see [Odlyzko 1985] and [Pomerance and Smith 1992]. These methods are sometimes referred to as “structured-Gauss” methods. As the numbers we try to factor get larger, the matrix stage of QS (and especially of the number field sieve; see Section 6.2) looms larger. The unfavorable complexity bound of Gaussian elimination ruins our overall complexity estimates, which assume that the matrix stage is not a bottleneck. In addition, the awkwardness of dealing with huge matrices seems to require large and expensive computers, computers for which it is not easy to get large blocks of time. There have been suggested at least three alternative sparse-matrix methods intended to replace Gaussian elimination, two of which having already been well-studied in numerical analysis. These two, the conjugate gradient method and the Lanczos method, have been adapted to matrices with entries in a finite field. A third option is the coordinate recurrence method in [Wiedemann 1986]. This method is based on the Berlekamp–Massey algorithm for discovering the smallest linear recurrence relation in a sequence of finite field elements. Each of these methods can be accomplished with a sparse encoding of the matrix, namely an encoding that lists merely the locations of the nonzero entries. Thus, if the matrix has N nonzero entries, the space required is O(N ln B). Since our factorization matrices have at most O(ln n) nonzero entries per row, the space requirement for the matrix stage of the algorithm, using a sparse encoding, is O B ln 2 n . Both the Wiedemann and Lanczos methods can be made rigorous. The running time for these methods is O(BN), where N is the number of nonzero entries in the matrix. Thus, the time bound for the matrix stage of factorization algorithms such as QS is B 2+o(1) , equaling the time bound for sieving.

6.1 The quadratic sieve factorization method 269<br />

(1) Since the matrix arithmetic is over F2, it naturally lends itself to computer<br />

implementation. With w being the machine word length (typically 8 or<br />

16 bits on older machines, 32 or 64 or even more bits on newer ones), we<br />

can deal with blocks of w coordinates in a row at a time, where one step<br />

is just a logical operation requiring very few clock cycles.<br />

(2) The initial matrix is quite sparse, so at the start, before “fill in” occurs,<br />

there are few operations to perform, thus somewhat reducing the worst<br />

case time bound.<br />

(3) If the number we are factoring is not too large, we can load the algorithm<br />

toward the sieving stage and away from the matrix stage. That is, we<br />

can choose a bound B that is somewhat too small, thus causing the<br />

sieving stage to run longer, but easing difficulties in the matrix stage.<br />

Space difficulties with higher values of B form another practical reason to<br />

choose B smaller than an otherwise optimal choice.<br />

Concerning point (2), ways have been found to use Gaussian elimination<br />

in an “intelligent” way so as to preserve sparseness as long as possible,<br />

see [Odlyzko 1985] and [Pomerance and Smith 1992]. These methods are<br />

sometimes referred to as “structured-Gauss” methods.<br />

As the numbers we try to factor get larger, the matrix stage of QS<br />

(and especially of the number field sieve; see Section 6.2) looms larger.<br />

The unfavorable complexity bound of Gaussian elimination ruins our overall<br />

complexity estimates, which assume that the matrix stage is not a bottleneck.<br />

In addition, the awkwardness of dealing with huge matrices seems to require<br />

large and expensive computers, computers for which it is not easy to get large<br />

blocks of time.<br />

There have been suggested at least three alternative sparse-matrix<br />

methods intended to replace Gaussian elimination, two of which having<br />

already been well-studied in numerical analysis. These two, the conjugate<br />

gradient method and the Lanczos method, have been adapted to matrices with<br />

entries in a finite field. A third option is the coordinate recurrence method in<br />

[Wiedemann 1986]. This method is based on the Berlekamp–Massey algorithm<br />

for discovering the smallest linear recurrence relation in a sequence of finite<br />

field elements.<br />

Each of these methods can be accomplished with a sparse encoding of the<br />

matrix, namely an encoding that lists merely the locations of the nonzero<br />

entries. Thus, if the matrix has N nonzero entries, the space required is<br />

O(N ln B). Since our factorization matrices have at most O(ln n) nonzero<br />

entries per row, the space requirement for the matrix stage of the algorithm,<br />

using a sparse encoding, is O B ln 2 n .<br />

Both the Wiedemann and Lanczos methods can be made rigorous. The<br />

running time for these methods is O(BN), where N is the number of<br />

nonzero entries in the matrix. Thus, the time bound for the matrix stage<br />

of factorization algorithms such as QS is B 2+o(1) , equaling the time bound for<br />

sieving.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!