Prime Numbers
Prime Numbers Prime Numbers
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.
- Page 228 and 229: 216 Chapter 4 PRIMALITY PROVING so
- Page 230 and 231: 218 Chapter 4 PRIMALITY PROVING (2)
- Page 232 and 233: 220 Chapter 4 PRIMALITY PROVING hav
- Page 234 and 235: 222 Chapter 4 PRIMALITY PROVING sho
- Page 236 and 237: Chapter 5 EXPONENTIAL FACTORING ALG
- Page 238 and 239: 5.1 Squares 227 5.1.2 Lehman method
- Page 240 and 241: 5.2 Monte Carlo methods 229 That is
- Page 242 and 243: 5.2 Monte Carlo methods 231 It is c
- Page 244 and 245: 5.2 Monte Carlo methods 233 computi
- Page 246 and 247: 5.3 Baby-steps, giant-steps 235 cal
- Page 248 and 249: 5.4 Pollard p − 1 method 237 can
- Page 250 and 251: 5.6 Binary quadratic forms 239 f(jB
- Page 252 and 253: 5.6 Binary quadratic forms 241 so o
- Page 254 and 255: 5.6 Binary quadratic forms 243 equi
- Page 256 and 257: 5.6 Binary quadratic forms 245 is a
- Page 258 and 259: 5.6 Binary quadratic forms 247 In t
- Page 260 and 261: 5.6 Binary quadratic forms 249 of D
- Page 262 and 263: 5.7 Exercises 251 is completely rig
- Page 264 and 265: 5.7 Exercises 253 of each of these
- Page 266 and 267: 5.8 Research problems 255 5.17. Sho
- Page 268 and 269: 5.8 Research problems 257 modulo th
- Page 270 and 271: 5.8 Research problems 259 In judgin
- Page 272 and 273: 262 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 274 and 275: 264 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 276 and 277: 266 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 280 and 281: 270 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 282 and 283: 272 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 284 and 285: 274 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 286 and 287: 276 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 288 and 289: 278 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 290 and 291: 280 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 292 and 293: 282 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 294 and 295: 284 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 296 and 297: 286 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 298 and 299: 288 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 300 and 301: 290 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 302 and 303: 292 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 304 and 305: 294 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 306 and 307: 296 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 308 and 309: 298 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 310 and 311: 300 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 312 and 313: 302 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 314 and 315: 304 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 316 and 317: 306 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 318 and 319: 308 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 320 and 321: 310 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 322 and 323: 312 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 324 and 325: 314 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 326 and 327: 316 Chapter 6 SUBEXPONENTIAL FACTOR
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.