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 00039 #if !defined(_TIFA_FERMAT_H_) 00040 00044 #define _TIFA_FERMAT_H_ 00045 00046 #ifdef __cplusplus 00047 extern "C" { 00048 #endif 00049 00050 #include <stdlib.h> 00051 #include <gmp.h> 00052 00053 #include "array.h" 00054 #include "factoring_machine.h" 00055 #include "exit_codes.h" 00056 00069 struct struct_fermat_params_t { 00073 unsigned int _dummy_variable_; 00074 }; 00075 00080 typedef struct struct_fermat_params_t fermat_params_t; 00081 00095 void set_fermat_params_to_default(fermat_params_t* const params); 00096 00134 ecode_t fermat( 00135 mpz_array_t* const factors, 00136 uint32_array_t* const multis, 00137 const mpz_t n, 00138 const fermat_params_t* const params, 00139 const factoring_mode_t mode 00140 ); 00141 00142 #ifdef __cplusplus 00143 } 00144 #endif 00145 00146 #endif