diff --git a/include/mcl/vint.hpp b/include/mcl/vint.hpp index 8c1a13f..6fe6054 100644 --- a/include/mcl/vint.hpp +++ b/include/mcl/vint.hpp @@ -40,6 +40,13 @@ typedef uint64_t Unit; typedef uint32_t Unit; #endif +template +struct RoundUp { + static const size_t UnitBitSize = sizeof(Unit) * 8; + static const size_t N = (x + UnitBitSize - 1) / UnitBitSize; + static const size_t bit = N * UnitBitSize; +}; + template void dump(const T *x, size_t n, const char *msg = "") { @@ -1984,7 +1991,7 @@ public: }; #ifdef MCL_VINT_FIXED_BUFFER -typedef VintT > Vint; +typedef VintT::bit * 2> > Vint; #else typedef VintT > Vint; #endif