10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

312 Chapter 6 SUBEXPONENTIAL FACTORING ALGORITHMS<br />

testing your QS implementation in earnest, it will demonstrate how 12digit<br />

factors can be extracted with QS in a matter of seconds or minutes<br />

(depending on the efficiency of the sieve and the matrix package). This is<br />

still somewhat slower than sheer sieving or say Pollard-rho methods, but<br />

of course, QS can be pressed much further, with its favorable asymptotic<br />

behavior.<br />

(4) Try factoring the repunit<br />

n = 1029 − 1<br />

9<br />

= 11111111111111111111111111111<br />

using a forced parameter B = 40000, for which matrices will be about<br />

2000 × 2000 in size.<br />

(5) If you have not already for the above, implement Algorithm 6.1.1 in fast,<br />

compiled fashion to attempt factorization of, say, 100-digit composites.<br />

6.15. In the spirit of Exercise 6.14, we here work through the following<br />

explicit examples of the NFS Algorithm 6.2.5. Again the point is to give the<br />

reader some guidance and means for algorithm debugging. We shall find that<br />

a particular obstruction—the square-rooting in the number field—begs to be<br />

handled in different ways, depending on the scale of the problem.<br />

(1) Start with the simple choice n = 10403 and discover that the polynomial<br />

f is reducible, hence the very Step [Setup] yields a factorization, with no<br />

sieving required.<br />

(2) Use Algorithm 6.2.5 with initialization parameters as is in the pseudocode<br />

listing, to factor n = F5 = 232 + 1. (Of course, the SNFS likes this<br />

composite, but the exercise here is to get the general NFS working!) From<br />

the initialization we thus have d =2,B = 265, m = 65536, k = 96,<br />

and thus matrix dimension V = 204. The matrix manipulations then<br />

accrue exactly as in Exercise 6.14, and you will obtain a suitable set<br />

S of (a, b) pairs. Now, for the small composite n in question (and the<br />

correspondingly small parameters) you can, in Step [Square roots], just<br />

multiply out the product <br />

(a,b)∈S<br />

(a − bα) to generate a Gaussian integer,<br />

because the assignment α = i is acceptable. Note how one is lucky for<br />

such (d = 2) examples, in that square-rooting in the number field is a<br />

numerical triviality. In fact, the square root of a Gaussian integer c + di<br />

can be obtained by solving simple simultaneous relations. So for such small<br />

degree as d = 2, the penultimate Step [Square roots] of Algorithm 6.2.5 is<br />

about as simple as can be.<br />

(3) As a kind of “second gear” with respect mainly to the square-root obstacle,<br />

try next the same composite n = F5 but force parameters d =4,B = 600,<br />

which choices will result in successful NFS. Now, at the Step [Square<br />

roots], you can again just multiply out the product of terms (a − bα)<br />

where now α = √ i, and you can then take the square root of the resulting<br />

element<br />

s0 + s1α + s2α 2 + s3α 3

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

Saved successfully!

Ooh no, something went wrong!