From 2b5628f24391c78682d16db8ed0362da42f78388 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 31 Jul 2017 14:23:05 +0900 Subject: [PATCH] add MCL_VINT_FIXED_BUFFER --- include/mcl/vint.hpp | 5 ++++- src/fp.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/mcl/vint.hpp b/include/mcl/vint.hpp index 5e3d240..e8e5fde 100644 --- a/include/mcl/vint.hpp +++ b/include/mcl/vint.hpp @@ -1794,8 +1794,11 @@ public: }; //typedef VintT > Vint; -//typedef VintT > Vint; +#ifdef MCL_VINT_FIXED_BUFFER +typedef VintT > Vint; +#else typedef VintT > Vint; +#endif } // mcl diff --git a/src/fp.cpp b/src/fp.cpp index a6d43d2..88979a2 100644 --- a/src/fp.cpp +++ b/src/fp.cpp @@ -390,7 +390,7 @@ static void initForMont(Op& op, const Unit *p, Mode mode) R = (t << (N * UnitBitSize)) % op.mp; t = (R * R) % op.mp; gmp::getArray(op.R2, N, t); - t = (R * R * R) % op.mp; + t = (t * R) % op.mp; gmp::getArray(op.R3, N, t); } op.rp = getMontgomeryCoeff(p[0]);