00001 // Copyright (C) 2011 CNRS - Ecole Polytechnique - INRIA. 00002 // 00003 // This file is part of TIFA. 00004 // 00005 // TIFA is free software; you can redistribute it and/or modify it under the 00006 // terms of the GNU Lesser General Public License as published by the Free 00007 // Software Foundation; either version 2.1 of the License, or (at your option) 00008 // any later version. 00009 // 00010 // TIFA is distributed in the hope that it will be useful, but WITHOUT ANY 00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00013 // more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, 00017 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00043 #if !defined(_TIFA_ECM_H_) 00044 00048 #define _TIFA_ECM_H_ 00049 00050 #ifdef __cplusplus 00051 extern "C" { 00052 #endif 00053 00054 #include <gmp.h> 00055 00056 #include "array.h" 00057 #include "factoring_machine.h" 00058 #include "exit_codes.h" 00059 00067 struct struct_ecm_params_t { 00071 uint32_t b1; 00080 uint32_t b2; 00085 uint32_t ncurves; 00086 00087 00088 uint32_t seed; 00089 }; 00094 typedef struct struct_ecm_params_t ecm_params_t; 00095 00110 void set_ecm_params_to_default(const mpz_t n, ecm_params_t* const params); 00111 00141 ecode_t ecm( 00142 mpz_array_t* const factors, 00143 uint32_array_t* const multis, 00144 const mpz_t n, 00145 const ecm_params_t* const params, 00146 const factoring_mode_t mode 00147 ); 00148 00149 #ifdef __cplusplus 00150 } 00151 #endif 00152 00153 #endif