Revision 24d2dc18e53205337a4bb9bc2dd1f9faa17798e3 authored by Lionel Muller on 07 October 2011, 09:58:47 UTC, committed by Lionel Muller on 07 October 2011, 09:58:47 UTC
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/cado-nfs/trunk@957 3eaf19af-ecc0-40f6-b43f-672aa0c71c71
1 parent 171f670
Raw File
README.nonlinear
This file explains how to factor a number with two non linear polynomials.
This is currently very experimental in CADO-NFS. In particular the CADO siever
does not support two non linear polynomials, thus we have to use the Franke-
Kleinjung siever.

Assume for example we want to factor the following 59-digit number:

n = 71641520761751435455133616475667090434063332228247871795429

with the two quadratics below (found by Thomas Prest using Montgomery's two
quadratics method):

f = 215609964539787*x^2 + 75006949764904*x + 44337721223995
g = -205964131819700*x^2 - 71651332635517*x + 1199051061668898
skew = 1.29196058385
m = 14849204829709953721577291784724593124898329527333780861554
(m is the common root of f and g mod n.)

In the following, we assume $CADO is the directory .../svn/cado-nfs, and
$HOSTNAME is the hostname of your computer.

1) you first have to prepare a polynomial file for the Franke-Kleinjung siever:

$ cat c59
71641520761751435455133616475667090434063332228247871795429
# skew: 1.29196058385
X0 44337721223995
X1 75006949764904
X2 215609964539787
Y0 1199051061668898
Y1 -71651332635517
Y2 -205964131819700
M 14849204829709953721577291784724593124898329527333780861554
0 350000 1.9 24 34
0 350000 1.9 24 34

2) then create the factor base and sieve:

$ gnfs-lasieve4I12e -b c59 -k -c 0
$ gnfs-lasieve4I12e -b c59 -f 350000 -c 20000 -v -z -S 1.29196058385 -a
...
Total yield: 1739519

3) then we convert the polynomial and relations to the CADO format. For that
   we first compile the convert_poly.c and convert_rels.c utilities in
   cado-nfs/misc:

$ gcc convert_poly.c -o convert_poly -lgmp
$ gcc convert_rels.c -o convert_rels ../build/$HOSTNAME/utils/libutils.a -lgmp

$ $CADO/misc/convert_rels -if fk -of cado c59.lasieve-0.350000-370000.gz | gzip --stdout > c59.rels.gz
Convert relations from Franke-Kleinjung to CADO format
Output 1739519 relations from 1 file(s).

$ $CADO/misc/convert_poly -if fk -of cado < c59 > c59.poly
$ cat >> c59.poly << EOF
alim: 350000
rlim: 350000
lbpr: 24
lpba: 24
EOF

4) then we have to run 'dup2' and 'purge' by hand, where the -nrels value is
   the number of relations in dup2/c59.rels.gz (zcat dup2/c59.rels.gz | wc -l):

$ mkdir dup2
$ $CADO/build/$HOSTNAME/filter/dup2 -out dup2 -K 2000000 c59.rels.gz
$ $CADO/build/$HOSTNAME/filter/purge -poly c59.poly -nrels 1734218 -out c59.purged dup2/c59.rels.gz

5) then we prepare a working directory for CADO-NFS and run cadofactor.pl:

$ mkdir /tmp/c59
$ mv c59.rels.gz c59.purged c59.poly /tmp/c59
$ mv dup2/c59.rels.gz /tmp/c59/c59.nodup.gz

$ cat mach_desc
[local]
tmpdir=/tmp
bindir=$CADO/build/$HOSTNAME
localhost cores=2

$ touch /tmp/c59/c59.polysel_done
$ touch /tmp/c59/c59.factbase_done
$ touch /tmp/c59/c59.freerels_done
$ touch /tmp/c59/c59.sieve_done

6) we can finally run cado:

$ ./cadofactor.pl n=71641520761751435455133616475667090434063332228247871795429 params=params/params.c59 machines=mach_desc wdir=/tmp/c59
back to top