From d45ef0da94892b7811d5e67bf82b06a653b42478 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 29 May 2015 10:44:57 +0900 Subject: [PATCH] rename isYodd to isOdd --- include/mcl/ec.hpp | 6 +++--- include/mcl/fp.hpp | 2 +- test/ec_test.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index 8b70b70..8011efe 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -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); } } diff --git a/include/mcl/fp.hpp b/include/mcl/fp.hpp index 0581d5c..c4cf3c2 100644 --- a/include/mcl/fp.hpp +++ b/include/mcl/fp.hpp @@ -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); diff --git a/test/ec_test.cpp b/test/ec_test.cpp index 1255a1d..dc72e41 100644 --- a/test/ec_test.cpp +++ b/test/ec_test.cpp @@ -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);