diff --git a/include/mcl/fp_generator.hpp b/include/mcl/fp_generator.hpp index 961c4ca..59e2b60 100644 --- a/include/mcl/fp_generator.hpp +++ b/include/mcl/fp_generator.hpp @@ -121,6 +121,8 @@ if (rm.isReg()) { \ op(qword [rm.getMem()], r); \ } +namespace fp { + struct FpGenerator : Xbyak::CodeGenerator { typedef Xbyak::RegExp RegExp; typedef Xbyak::Reg64 Reg64; @@ -1641,6 +1643,6 @@ private: } }; -} // mcl +} } // mcl::fp #endif diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp index 6f2aadf..5d4ab12 100644 --- a/include/mcl/op.hpp +++ b/include/mcl/op.hpp @@ -16,10 +16,10 @@ namespace mcl { -struct FpGenerator; - namespace fp { +struct FpGenerator; + const size_t maxOpUnitN = (MCL_MAX_OP_BIT_N + UnitBitN - 1) / UnitBitN; struct Op; diff --git a/test/fp_generator_test.cpp b/test/fp_generator_test.cpp index 9a61ab2..28ad51c 100644 --- a/test/fp_generator_test.cpp +++ b/test/fp_generator_test.cpp @@ -110,7 +110,7 @@ static inline std::ostream& operator<<(std::ostream& os, const Int& x) return os << x.toStr(); } -void testAddSub(const mcl::FpGenerator& fg, int pn) +void testAddSub(const mcl::fp::FpGenerator& fg, int pn) { Fp x, y; Int mx(pn), my(pn); @@ -135,7 +135,7 @@ void testAddSub(const mcl::FpGenerator& fg, int pn) } } -void testNeg(const mcl::FpGenerator& fg, int pn) +void testNeg(const mcl::fp::FpGenerator& fg, int pn) { Fp x; Int mx(pn), my(pn); @@ -154,7 +154,7 @@ void testNeg(const mcl::FpGenerator& fg, int pn) } } -void testMulI(const mcl::FpGenerator& fg, int pn) +void testMulI(const mcl::fp::FpGenerator& fg, int pn) { cybozu::XorShift rg; for (int i = 0; i < 100; i++) { @@ -181,7 +181,7 @@ void testMulI(const mcl::FpGenerator& fg, int pn) } } -void testShr1(const mcl::FpGenerator& fg, int pn) +void testShr1(const mcl::fp::FpGenerator& fg, int pn) { cybozu::XorShift rg; for (int i = 0; i < 100; i++) { @@ -204,7 +204,7 @@ void test(const char *pStr) uint64_t p[MAX_N]; const int pn = convertToArray(p, pStr); printf("pn=%d\n", pn); - mcl::FpGenerator fg; + mcl::fp::FpGenerator fg; fg.init(p, pn); testAddSub(fg, pn); testNeg(fg, pn);