From eb5439916dc231175671f9e85be699b3593a76f9 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 18 Apr 2019 17:34:35 +0900 Subject: [PATCH] increase buffer size of FixedBuffer --- include/mcl/vint.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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