rename isYodd to isOdd

dev
MITSUNARI Shigeo 10 years ago
parent b3619c63b0
commit d45ef0da94
  1. 6
      include/mcl/ec.hpp
  2. 2
      include/mcl/fp.hpp
  3. 4
      test/ec_test.cpp

@ -406,7 +406,7 @@ public:
self.normalize();
os << self.x.toStr(16) << '_';
if (compressedExpression_) {
return os << Fp::isYodd(self.y);
return os << Fp::isOdd(self.y);
} else {
return os << self.y.toStr(16);
}
@ -468,7 +468,7 @@ public:
}
x.appendToBitVec(bv);
if (compressedExpression_) {
bv.append(Fp::isYodd(y), 1);
bv.append(Fp::isOdd(y), 1);
} else {
y.appendToBitVec(bv);
}
@ -519,7 +519,7 @@ public:
t *= x;
t += b_;
Fp::squareRoot(y, t);
if (Fp::isYodd(y) ^ isYodd) {
if (Fp::isOdd(y) ^ isYodd) {
Fp::neg(y, y);
}
}

@ -130,7 +130,7 @@ public:
{
Gmp::toStr(pstr, op_.mp);
}
static inline bool isYodd(const FpT& x)
static inline bool isOdd(const FpT& x)
{
fp::Block b;
x.getBlock(b);

@ -134,12 +134,12 @@ struct Test {
{
Fp x(para.gx);
Fp y(para.gy);
bool odd = Fp::isYodd(y);
bool odd = Fp::isOdd(y);
Fp yy;
Ec::getYfromX(yy, x, odd);
CYBOZU_TEST_EQUAL(yy, y);
Fp::neg(y, y);
odd = Fp::isYodd(y);
odd = Fp::isOdd(y);
yy.clear();
Ec::getYfromX(yy, x, odd);
CYBOZU_TEST_EQUAL(yy, y);

Loading…
Cancel
Save