Revision 371fb45476f4f481c803a62229edec1095f7bf30 authored by Emmanuel Thomé on 17 January 2013, 18:25:58 UTC, committed by Emmanuel Thomé on 17 January 2013, 18:26:51 UTC
1 parent 2b6f189
Raw File
README
1) convert a polynomial from CADO format to Franke-Kleinjung format:

% $CADO/misc/convert_poly -if cado -of fk < rsa100.poly > rsa100

2) convert relations from CADO format to Franke-Kleinjung format
(warning you have to specify the degree of the algebraic polynomial):

% $CADO/misc/convert_rels -if cado -of fk -deg 5 rsa100.rels > part1

3) use msieve linear algebra with relations in CADO format:

   a) create a file msieve.fb, which contains:

      N <number to be factored>
      R0  <coeff of x^0, rational side>
      R1  <coeff of x^1, rational side>
      A0  <coeff of x^0, algebraic side>
      A1  <etc>
      A2  <etc>
      A3  <etc>
      A4  <etc>
      A5  <etc>

      This can be done with:

      $ ./convert_poly -of msieve < cxxx.poly > msieve.fb

   b) create a file msieve.dat, which contains:

      N <number to be factored>
      <all the relations in GGNFS/CADO format>

      (Do not include free relations, since the CADO-NFS format is not
       recognized by msieve, and msieve includes them in the filtering.)

   c) then run "msieve -nc -v <number to be factored>"
      The msieve output goes into msieve.log.
      You can add the "-t 4" option to use 4 threads.   

4) do filtering with CADO-NFS with relations in GGNFS format:
    a) get the valid lines with get_valid_lines script in misc (this will remove
    the free relations, if necessary, of the form a,0:):
 
        zcat rels.gz | $CADO/misc/get_valid_lines | gzip -c --fast > rels_ok.gz

       and check all relations are correct (this is ***very important*** since
       CADO-NFS does not check relations, thus any corrupted relation might
       make the factorization fail):

       $CADO/utils/complete_rels -poly rsa100.poly rels_ok.gz > /dev/null

    b) generate the factor base and the free relations:

        $CADO/sieve/makefb -poly rsa100.poly > rsa100.fb
        $CADO/sieve/freerel -poly rsa100.poly -fb rsa100.fb > rsa100.freerels
        gzip --fast rsa100.freerels

    c) If necessary use dup to remove duplicates:

        $CADO/filter/dup1 -n 1 -out nodup -filelist rsa100.filelist -basepath /base/path
        $CADO/filter/dup2 -K K -out nodup/0 -filelist rsa100.filelist -basepath
        /base/path/nodup/0
        $CADO/filter/dup2 -K K -out nodup/1 -filelist rsa100.filelist -basepath
        /base/path/nodup/1

        K is the size of the hash table (should be larger than the number of
           relations in each chunk nodup/0 and nodup/1)
        rsa100.filelist contains the list of all relation files (one per line),
        including rsa100.freerels.gz
        /base/path is the directory where all files are

    d) Filtering is done by 3 command: purge, merge and replay:

        $CADO/filter/purge -poly rsa100.poly -keep 160 -nrels nrels -out         rsa100.purged -basepath /base/path -subdirlist rsa100.subdirlist -filelist rsa100.filelist 

            subdirlist contains the list of subdirectories that contains the
            relations. In this example it should be nodup/0 and nodup/1 (one on
            each line)

        $CADO/filter/merge -out rsa100.merge.his -mat rsa100.purged -forbw 3 -coverNmax MAX -keep 160 -maxlevel LEVEL

        $CADO/filter/replay --noindex --binary -purged rsa100.purged -his rsa100.merge.his -out matrix/rsa100 

        MAX is the maximum density wanted for the matrix (100 is a good value)
        LEVEL is the maximum merge level (use 15 for small numbers, 20 or 25
           for larger ones)

back to top