Home Online Manual
Top
Back: HilbertClassPoly
Forward: wUnit
FastBack: aksaka_lib
FastForward: crypto_lib
Up: atkins_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.12.2.12 rootsModp

Procedure from library atkins.lib (see atkins_lib).

Usage:
rootsModp(p,P);

Return:
list of roots of the polynomial P modulo p with p prime

Assume:
p>=3

Note:
this algorithm will be called recursively, and it is understood that all the operations are done in Z/pZ (excepting squareRoot(d,p))

Example:
 
LIB "atkins.lib";
ring r = 0,x,dp;
poly f=x4+2x3-5x2+x;
rootsModp(7,f);
==> [1]:
==>    0
==> [2]:
==>    -1
==> [3]:
==>    2
==> [4]:
==>    -3
poly g=x5+112x4+655x3+551x2+1129x+831;
rootsModp(1223,g);
==> [1]:
==>    -33
==> [2]:
==>    -225
==> [3]:
==>    206
==> [4]:
==>    295
==> [5]:
==>    -355