https://gitlab.inria.fr/cado-nfs/cado-nfs
Revision af0cc1693a5534be85dcddbdb0855b839f9a29aa authored by Pierrick Gaudry on 23 January 2013, 08:13:09 UTC, committed by Pierrick Gaudry on 23 January 2013, 08:13:09 UTC
Large prime bounds larger than an unsigned long are now working more or
less correctly. This assumes that all the primes found by ECM fit in an
unsigned long: the very large primes just come from a cofactor that
happens to be a prime. On 32-bit machines, this will reach the limit.
1 parent 3f27e6e
Raw File
Tip revision: af0cc1693a5534be85dcddbdb0855b839f9a29aa authored by Pierrick Gaudry on 23 January 2013, 08:13:09 UTC
Fix problem with very large prime bounds.
Tip revision: af0cc16
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 cado-nfs source directory, 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