2009-01-18 20:48:28 +00:00
|
|
|
#ifndef _LIBCRYPTAFINITY_MATHTOOLS_HH
|
|
|
|
#define _LIBCRYPTAFINITY_MATHTOOLS_HH
|
|
|
|
|
|
|
|
#include "cryptafinity_global.hh"
|
|
|
|
#include "cryptafinity_iface.hh"
|
|
|
|
|
|
|
|
namespace LibCryptAfinity {
|
2009-04-30 14:12:47 +00:00
|
|
|
|
2009-01-18 20:48:28 +00:00
|
|
|
class MathTools {
|
|
|
|
private:
|
2009-04-30 14:12:47 +00:00
|
|
|
std::vector<int> pgcd_real(int * reste, int * quotient, int * coef_first, int * coef_second, int pas);
|
2009-01-18 20:48:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
int pgcd(int a, int b);
|
|
|
|
int ppcm(int a, int b);
|
|
|
|
|
2009-04-30 14:12:47 +00:00
|
|
|
std::vector<int> pgcd_mod(int a, int b);
|
2009-01-18 20:48:28 +00:00
|
|
|
|
2009-04-30 14:12:47 +00:00
|
|
|
int inverse(int a, int modulo);
|
2009-01-18 20:48:28 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|