19.07.2014 Views

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.4. FROM Z P TO Z? 153<br />

Figure 5.3: Algorithm24: Split a Distinct Degree Factorization<br />

Algorithm 24 (Split a Distinct Degree Factorization)<br />

Input: A prime p, a degree d and a polynomial f(x) (mod p) known to be the<br />

product <strong>of</strong> irreducibles <strong>of</strong> degree d (and not divisible by x)<br />

Output: The factorization <strong>of</strong> f (modulo p) into irreducibles <strong>of</strong> degree d.<br />

if d = deg(f)<br />

then return f # degree d so is irreducible<br />

W := {f}<br />

ans := ∅<br />

while W ≠ ∅ # factors <strong>of</strong> degree d found<br />

h :=RandomPoly(p,d)<br />

h := h (pi −1)/2<br />

(mod g) (*)<br />

V := ∅ # list <strong>of</strong> polynomials to be processed<br />

<strong>for</strong> g ∈ W do<br />

h 1 := gcd(h − 1, g)<br />

if deg(h 1 ) = 0 ∨ deg(h 1 ) = deg(g)<br />

then V := V ∪ {g} # we made no progress<br />

else process(h 1 )<br />

process(g/h 1 )<br />

W := V<br />

return ans<br />

Here RandomPoly(p,d) returns a random non-constant polynomial modulo p <strong>of</strong><br />

degree less than d, and the sub-function process(g 1 ) takes a polynomial g 1 which<br />

is a result <strong>of</strong> splitting g by h 1 , and adds it to ans if it has degree d, otherwise<br />

adds it to V .

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

Saved successfully!

Ooh no, something went wrong!