rename Gmp to Mpz

dev
MITSUNARI Shigeo 10 years ago
parent 2b7dc0ba1a
commit 2b8b45cc60
  1. 2
      include/mcl/elgamal.hpp
  2. 12
      include/mcl/fp.hpp
  3. 2
      test/fp_generator_test.cpp
  4. 2
      test/mont_fp_test.cpp

@ -156,7 +156,7 @@ struct ElgamalT {
, enableWindowMethod_(false)
{
}
void enablePowerWindow(size_t winSize = 10)
void enableWindowMethod(size_t winSize = 10)
{
wm_f.init(f, bitSize, winSize);
wm_g.init(g, bitSize, winSize);

@ -81,10 +81,10 @@ public:
static inline bool squareRoot(FpT& y, const FpT& x)
{
mpz_class mx, my;
x.getGmp(mx);
x.getMpz(mx);
bool b = op_.sq.get(my, mx);
if (!b) return false;
y.setGmp(my);
y.setMpz(my);
return true;
}
FpT() {}
@ -203,19 +203,19 @@ public:
getStr(str, base, withPrefix);
return str;
}
void getGmp(mpz_class& x) const
void getMpz(mpz_class& x) const
{
fp::Block b;
getBlock(b);
Gmp::setArray(x, b.p, b.n);
}
mpz_class getGmp() const
mpz_class getMpz() const
{
mpz_class x;
getGmp(x);
getMpz(x);
return x;
}
void setGmp(const mpz_class& x)
void setMpz(const mpz_class& x)
{
setArray(Gmp::getUnit(x), Gmp::getUnitSize(x));
}

@ -65,7 +65,7 @@ struct Int {
void set(const char *str) { setStr(str); }
void set(const Fp& rhs)
{
convertToArray(v, rhs.getGmp());
convertToArray(v, rhs.getMpz());
}
void set(const uint64_t* x)
{

@ -69,7 +69,7 @@ struct Montgomery {
};
template<class T>
mpz_class getGmp(const T& x)
mpz_class getMpz(const T& x)
{
std::string str = x.getStr();
mpz_class t;

Loading…
Cancel
Save