Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

  1. 28 May, 2021 4 commits
    • Andreas Enge's avatar
      Unify the two Kronecker symbol computations. · 8d15b33e
      Andreas Enge authored
      * lib/cm-impl.h (cm_classgroup_kronecker): Drop function, but reuse its
        prototype for...
        (cm_nt_kronecker): ...this.
      * lib/classgroup.c (cm_classgroup_kronecker): Drop function and move its
        content to replace the content of...
      * lib/nt.c (cm_nt_kronecker): ...this function.
      * lib/class.c (eval),
        lib/param.c (cm_param_init, doubleeta_compute_parameter): Adapt function
    • Andreas Enge's avatar
      Add a function to compute the "signed primes" in a discriminant. · 7e924976
      Andreas Enge authored
      This is useful for ECPP. At the same time, drop the duplicate
      implementation of factoring by trial division.
      * lib/cm-impl.h (cm_classgroup_fundamental_primes): Declare new function.
        (cm_classgroup_factor): Drop function.
      * lib/classgroup.c (cm_classgroup_factor,
        classgroup_fundamental_discriminant_conductor): Drop functions.
        (cm_classgroup_fundamental_primes): New function.
        (cm_classgroup_fundamental_discriminant): Implement with
        cm_classgroup_fundamental_primes instead of
      * lib/class.c (cm_class_init): Print fundamental discriminant.
    • Andreas Enge's avatar
      Let cm_nt_factor operate on uint_cl_t. · f135a900
      Andreas Enge authored
      * lib/cm-impl.h (cm_nt_factor): Change prototype.
      * lib/nt.c (cm_nt_factor): Reformat implementation, drop unused variable i.
      * lib/classgroup.c (cm_classgroup_normalseries): Adapt function call.
    • Andreas Enge's avatar
      Move number theoretic function to internal header. · 1238cf68
      Andreas Enge authored
      * lib/cm.h (cm_nt_gcd, cm_nt_kronecker, cm_nt_is_prime, cm_nt_next_prime,
        cm_nt_factor): Move...
      * lib/cm.h: ...here.
  2. 19 May, 2021 5 commits
    • Andreas Enge's avatar
      Use a simpler, division free formula for getting a curve from j. · 0058bc4b
      Andreas Enge authored
      * lib/curve.c (cm_curve_and_point): Use a simpler formula for the initial
        curve equation in terms of j.
    • Andreas Enge's avatar
      Add quartic and sextic twists. · 25f0c2a7
      Andreas Enge authored
      * lib/curve.c (cm_curve_and_point): Also check for quartic twists when
        d=-4 and sextic twists when d=-3.
      * tests/ttwist.c: New file.
      * tests/Makefile.am: Register new file.
    • Andreas Enge's avatar
      Use 256 bits for crypto curves and correct a typo. · b0de29f0
      Andreas Enge authored
      * src/cm.c (main): Use 256 instead of 100 bits for the curve.
      * lib/file.c (cm_class_print_pari): Drop an unmatched closing parenthesis
        in printing.
    • Andreas Enge's avatar
      Choose a larger PARI stack size. · 3a55b88b
      Andreas Enge authored
      Doubling the stack size makes the tests pass without the PARI warning
      that it needed to adapt the stack.
      * lib/class.c (cm_pari_init): Change PARI stack size from 1MB to 2MB.
    • Andreas Enge's avatar
      Separate class polynomial computation from curve computation. · e6b7a793
      Andreas Enge authored
      At the same time, use more precise mpz pointer types for the elliptic
      curve arithmetic functions.
      * lib/cm.h (cm_curve_crypto_param): New function prototype.
        (cm_curve_compute_curve): Rename to...
        (cm_curve_and_point): ...this and change prototype to take an already
        computed cm_class and to also return point coordinates.
      * lib/curve.c (elliptic_curve_double, elliptic_curve_add,
        elliptic_curve_multiply, elliptic_curve_random, curve_is_crypto):
        Use mpz_ptr and mpz_srcptr instead of mpz_t.
        (curve_compute_param): Rename to...
        (cm_curve_crypto_param): ...this.
        (cm_curve_compute_curve): Rename to...
        (cm_curve_and_point): ...this and change behaviour.
      * src/cm.c (main), tests/tcm.c (test_curve): Adapt the function calls.
  3. 17 May, 2021 9 commits
    • Andreas Enge's avatar
      Move class polynomial computation out of cm_class_get_j_mod_p. · 5810857d
      Andreas Enge authored
      At the same time, rename some "P" to "p" (in function and parameter names)
      and make the pointer types of mpz_t more precise.
      * lib/cm-impl.h (cm_class_get_j_mod_P): Modify prototype to take a cm_param
        and an (already computed) cm_class and rename to...
        (cm_class_get_j_mod_p): ...this.
      * lib/jmodp.c (cm_class_get_j_mod_P): Rename to...
        (cm_class_get_j_mod_p): ...this and adapt code to new prototype.
      * lib/cm.h (cm_modpol_read_specialised_mod): Make prototype more precise.
      * lib/curve.c (cm_curve_compute_curve): Compute class polynomial tower
        before calling cm_class_get_j_mod_P.
      * lib/jmodp.c (get_root_mod_P, get_j_mod_P_from_modular,
        simpleeta_cm_get_j_mod_P): Rename to...
        (get_root_mod_p, get_j_mod_p_from_modular, simpleeta_cm_get_j_mod_p):
        ...these and rename parameters P to p.
      * lib/modpol.c (cm_modpol_read_specialised_mod): Make prototype more
    • Andreas Enge's avatar
      Initialise PARI separately from cm_class_init. · cf608b40
      Andreas Enge authored
      * lib/class.c (cm_pari_init, cm_pari_clear): New functions, containing code
        taken from...
        (cm_class_init, cm_class_clear): ...here.
      * lib/cm.h (cm_pari_init, cm_pari_clear): Declare the new functions.
        (cm_class_init, cm_curve_compute_curve): Drop the pari parameter.
        (__cm_class_struct): Drop the pari field.
      * lib/cm-impl.h (cm_class_get_j_mod_P): Drop the pari parameter.
      * lib/curve.c (cm_curve_compute_curve),
        lib/jmodp.c (cm_class_get_j_mod_P): Drop the pari parameter and adapt
        function calls.
      * src/classpol.c (main), src/cm.c (main),
        tests/tcm.c (main, test_curve): Adapt function calls and add calls to
        cm_pari_init and cm_pari_clear.
    • Andreas Enge's avatar
      Move the polynomial printing choice from the library to the application. · 2c5d7a60
      Andreas Enge authored
      * lib/cm.h (cm_class_compute), lib/class.c (cm_class_compute): Drop the
        parameter for printing class polynomials to screen.
      * lib/jmodp.c (cm_class_get_j_mod_P): Drop the function call.
      * src/classpol.c (main): Drop the function call and add printing.
    • Andreas Enge's avatar
      Move class polynomial printing into a function. · 7b4de98b
      Andreas Enge authored
      * lib/cm.h (cm_class_print_pari), lib/file.c (cm_class_print_pari):
        New function.
      * lib/class.c (cm_class_compute): Call new function.
    • Andreas Enge's avatar
      Add fields to cm_class storing the state of the computation. · f2a982af
      Andreas Enge authored
      * lib/cm.h (__cm_class_struct): Add fields computed_classpol and
      * lib/class.c (cm_class_init): Initialise new fields.
      * lib/class.c (cm_class_compute), lib/file.c (cm_class_read):
        Update new fields.
    • Andreas Enge's avatar
      Rename "minpoly" to "classpol", in field and function names. · 50667dc9
      Andreas Enge authored
      Additionally shorten the _complex fields.
      * lib/cm.h (__cm_class_struct): Rename field minpoly to classpol,
        minpoly_complex to classpol_c and tower_complex to tower_c.
        (cm_class_compute_minpoly): Rename to...
        (cm_class_compute): ...this.
      * lib/class.c (cm_class_compute_minpoly): Rename to...
        (cm_class_compute): ...this.
        (cm_class_init, cm_class_clear, class_get_height,
        lib/file.c (cm_class_write, cm_class_read),
        lib/jmodp.c (get_root_mod_P, cm_class_get_j_mod_P),
        src/classpol.c (main): Adapt field names and function calls.
    • Andreas Enge's avatar
      Add a field to cm_class_t describing the real or complex field. · ca72c70e
      Andreas Enge authored
      This is a duplicate with cm_param_t, but it makes some functions
      self-contained and makes it possible to drop cm_param parameters in them.
      * lib/cm.h (__cm_class_struct): Add a field field.
        (cm_class_clear): Drop cm_param_srcptr parameter.
      * lib/class.c (cm_class_init): Copy field.
        (cm_class_clear, class_get_height): Drop parameter.
        (cm_class_compute_minpoly): Adapt function call.
      * lib/jmodp.c (cm_class_get_j_mod_P),
        src/classpol.c (main): Adapt function call.
    • Andreas Enge's avatar
      Drop reading and writing class polynomials. · 3d68bcb3
      Andreas Enge authored
      The corresponding functions are still present in file.c, but not called
      any more from other functions.
      * lib/cm.h (cm_class_compute_minpoly, cm_curve_compute_curve),
        lib/cm-impl.h (cm_class_get_j_mod_P): Drop parameters related to file
        reading and writing.
      * lib/class.c (cm_class_compute_minpoly),
        lib/curve.c (cm_curve_compute_curve),
        lib/jmodp.c (cm_class_get_j_mod_P): Drop parameters and code for reading
        and writing class polynomials.
      * src/classpol.c (main), src/cm.c (main), tests/tcm.c (test_curve):
        Adapt function calls.
    • Andreas Enge's avatar
      Drop fields from cm_class that are already in cm_param. · 1ddf0acf
      Andreas Enge authored
      * lib/cm.h (__cm_class_struct): Drop fields already present in cm_param.
      * lib/cm.h (cm_class_clear, cm_class_compute_minpoly),
        lib/cm-impl.h (cm_class_write, cm_class_read): Add a cm_param parameter.
      * lib/class.c (cm_class_clear, cm_class_compute_minpoly, compute_nsystem,
        compute_precision, class_get_height, compute_conjugates, get_root_mod_P):
        Add a cm_param parameter and use it instead of the same fields from the
        cm_class parameter.
        (class_get_valuation, eval): Use a cm_param instead of a cm_class
        (cm_class_compute_minpoly): Adapt function calls.
      * lib/file.c (cm_class_write, cm_class_read): Add a cm_param parameter and
        use it instead of the same fields from the cm_class parameter.
      * lib/jmodp.c (simpleeta_cm_get_j_mod_P): Use a cm_param instead of a
        cm_class parameter.
        (cm_class_get_j_mod_P), src/classpol.c (main): Adapt
        function calls.
  4. 13 May, 2021 10 commits
    • Andreas Enge's avatar
      Introduce pointer types corresponding to cm_class. · 1e15c923
      Andreas Enge authored
      * lib/cm.h (cm_class_t): Change type from struct to array of length 1.
        (__cm_class_struct, cm_class_ptr, cm_class_srcptr): New types.
        (cm_class_init, cm_class_clear, cm_class_compute_minpoly): Adapt
      * lib/cm-impl.h (cm_class_write, cm_class_read): Adapt prototypes.
        (cm_modclass_multieta_eval_quad): Change prototype to placate warning
        about const.
      * lib/class.c, lib/file.c, lib/jmodp.c, src/classpol.c, src/modclass.c:
        Adapt functions and function calls.
    • Andreas Enge's avatar
      Create a new type for CM parameters. · 155e174a
      Andreas Enge authored
      This is a first commit in a series that aims at making the code more
      modular and "less intelligent". In particular, cm_class is to be split
      into cm_param, holding the CM parameters, and a smaller cm_class holding
      the results of class polynomial computations. In this commit, the fields
      of cm_param are simply copied into cm_class during cm_class_init.
      * lib/param.c: New file.
      * lib/Makefile.am: Register new file.
      * lib/class.c (doubleeta_compute_parameter): Move content to...
      * lib/param.c (doubleeta_compute_parameter): This function with an
        adapted prototype.
      * lib/class.c (cm_class_compute_parameter): Move content to...
      * lib/param.c (cm_param_init): This new function.
      * lib/cm.h (__cm_param_struct, cm_param_t, cm_param_ptr, cm_param_srcptr):
        New types.
        (cm_param_init): Declare function prototype.
        (cm_class_init): Adapt function declaration.
      * lib/class.c (cm_class_init): Adapt to new prototype, taking a cm_param
        instead of an invariant and a discriminant.
      * lib/jmodp.c (cm_class_get_j_mod_P), src/classpol.c (main): Call
        cm_param_init before cm_class_init.
    • Andreas Enge's avatar
      Add the classgroup as a field into cm_class_t. · b636a0c6
      Andreas Enge authored
      * lib/cm-impl.h (cm_form_t, cm_classgroup_t): Move...
      * lib/cm-impl.h (cm_form_t, cm_classgroup_t): ...here.
        (cm_class_t): Add field cl, drop fields d and h.
      * lib/class.c (cm_class_init): Initialise class group field. Adapt function
        (cm_class_clear): Clear class group field.
        (compute_nsystem): Drop class group parameter, change class parameter
        from pointer to ordinary variable. Use d from classgroup.
        (compute_conjugates, cm_class_compute_minpoly): Use h from class group.
        (compute_precision): Drop class group parameter.
        (cm_class_compute_minpoly): Drop recomputation of class group.
        (cm_class_compute_parameter, doubleeta_compute_parameter): Add
        parameter d, since this function is called before the class group
        is initialised.
        (eval): Use d from class group.
      * lib/file.c (cm_class_write, cm_class_read): Use d from class group.
      * lib/jmodp.c (cm_class_get_j_mod_P): Use d from parameter.
    • Andreas Enge's avatar
      Print height of class polynomial only when it has been computed. · cd817396
      Andreas Enge authored
      * lib/class.c (cm_class_compute_minpoly): Do not print the height when only
        a class field tower has been computed.
    • Andreas Enge's avatar
      Hide more nt functions from the public interface. · 55a0d34f
      Andreas Enge authored
      * lib/cm.h (cm_nt_mpz_tonelli_z, cm_nt_mpz_tonelli, cm_nt_cget_zz): Move
        function prototypes...
      * lib/cm-impl.h: ...here.
    • Andreas Enge's avatar
      Hide elliptic curve related functions from nt. · eb626d07
      Andreas Enge authored
      * lib/nt.c (nt_elliptic_curve_double, nt_elliptic_curve_add,
        cm_nt_elliptic_curve_multiply, cm_nt_elliptic_curve_random): Move to...
      * lib/curve.c (elliptic_curve_double, elliptic_curve_add,
        elliptic_curve_multiply, elliptic_curve_random): ...these static functions.
      * lib/cm.h (cm_nt_elliptic_curve_multiply, cm_nt_elliptic_curve_random):
        Drop function prototypes.
    • Andreas Enge's avatar
      Disable tower fields for the class polynomial example application. · bd1e3984
      Andreas Enge authored
      * src/classpol.c (main): Disable class field towers.
    • Andreas Enge's avatar
      Add a boolean variable for tower fields during curve construction. · 929df90a
      Andreas Enge authored
      * lib/cm.h (cm_curve_compute_curve), lib/cm-impl.h (cm_class_get_j_mod_P):
        Add a parameter tower to the prototype.
      * lib/curve.c (cm_curve_compute_curve), lib/jmodp.c (cm_class_get_j_mod_P):
        Adapt the functions.
      * src/cm.c (main): Enable class field towers.
      * tests/tcm.c (test_curve): Adapt function call and carry out tests once
        with and once without class field towers.
    • Andreas Enge's avatar
      Use a tower decomposition for getting complex class invariants modulo p. · 25ca3a26
      Andreas Enge authored
      * lib/jmodp.c (quadraticx_eval_mod_p, quadraticxx_eval_mod_p,
        get_quadratic_tower_root_mod_p): New functions.
        (cm_class_get_j_mod_P): Enable tower decomposition and iterative root
        finding modulo p in the complex case.
    • Andreas Enge's avatar
      Use a tower decomposition for getting real class invariants modulo p. · 3bc7cdf5
      Andreas Enge authored
      * lib/jmodp.c (mpzx_eval_mod_p, mpzxx_eval_mod_p, get_tower_root_mod_p):
        New functions.
        (cm_class_get_j_mod_P): Enable tower decomposition and iterative root
        finding modulo p in the real case.
  5. 11 May, 2021 2 commits
    • Andreas Enge's avatar
      Use mpzx type to transform polynomials to PARI and refine prototypes. · 7ba4b347
      Andreas Enge authored
      * lib/pari.c (mpzx_get_FpX): Change prototype to use mpzx instead of
        array of mpz and drop obsolete degree parameter.
        (cm_pari_oneroot, cm_pari_find_roots): Update function calls.
        (mpz_get_Z, Z_get_mpz, cm_pari_oneroot, cm_pari_find_roots): Change
        prototype to finely record pointer types.
      * lib/cm-impl.h (cm_pari_oneroot, cm_pari_find_roots): Modify function
        declaration accordingly.
    • Andreas Enge's avatar
      Use mpzx type for roots of modular polynomials. · 7a860aa4
      Andreas Enge authored
      * lib/cm-impl.h, lib/pari.c (cm_pari_find_roots): Change prototype.
      * lib/jmodp.c (get_j_mod_P_from_modular): Adapt call.
  6. 10 May, 2021 2 commits
  7. 07 May, 2021 3 commits
  8. 05 May, 2021 5 commits
    • Andreas Enge's avatar
      Add a parameter for the full class polynomial. · ce5ba502
      Andreas Enge authored
      * lib/cm.h (cm_class_compute_minpoly): Add parameter classpol indicating
        whether the absolute class polynomial shall be computed, in addition
        to the parameter tower.
      * lib/class.c (cm_class_compute_minpoly): Add and implement the parameter
      * lib/jmodp.c (cm_class_get_j_mod_P), src/classpol.c (main): Adapt the
        function call.
    • Andreas Enge's avatar
      Make the PARI stack initialisation optional through cm_class_init. · 394b248e
      Andreas Enge authored
      This makes it possible to embed CM as a library into an application that
      handles its own PARI stack.
      * lib/cm.h (cm_class_t): Add a field pari.
        (cm_class_init, cm_curve_compute_curve): Add parameter pari.
      * lib/cm-impl.h: Include pari.h.
        (cm_class_get_j_mod_P): Add parameter pari.
      * lib/class.c (cm_class_init, cm_class_clear): Optionally handle
        initialisation and closing of the PARI stack.
      * lib/curve.c (cm_curve_compute_curve),
        lib/jmodp.c (cm_class_get_j_mod_P): Add parameter pari and pass it through
        to cm_class_init.
      * lib/pari.c (cm_pari_oneroot, cm_pari_find_roots, cm_pari_classgroup):
        Drop initialising and closing of the PARI stack and add PARI gc.
      * src/classpol.c (main), src/cm.c (main), tests/tcm.c (test_curve): Add
        the pari parameter equal to true to the main function call.
    • Andreas Enge's avatar
      Split off handling of j-invariants modulo p from class.c. · 3e226fd3
      Andreas Enge authored
      * lib/class.c (cm_class_get_j_mod_P, get_root_mod_P,
        cm_get_j_mod_P_from_modular, simpleeta_cm_get_j_mod_P): Move functions
      * lib/jmodp.c: ...this new file and rename cm_get_j_mod_P_from_modular
        to get_j_mod_P_from_modular.
      * lib/Makefile.am: Register new file.
    • Andreas Enge's avatar
      Drop computation of the heuristic precision bound. · 5b41ea77
      Andreas Enge authored
      * lib/class.c (compute_precision): Only compute the precision used for
    • Andreas Enge's avatar
      Correctly handle the complex case for computing the height. · 7097c390
      Andreas Enge authored
      * lib/class.c (class_get_height): Also compute the height of the complex
        part of the class polynomial to fit the function description; in practice
        this will not make a meaningful difference.