From 093e916151f8728071d97fb91c4e87c99a6b6c5e Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 7 May 2021 17:39:20 +0900 Subject: [PATCH] fix for (bitlen(p) + 1) % 64 = 0 --- include/mcl/gmp_util.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mcl/gmp_util.hpp b/include/mcl/gmp_util.hpp index e444993..4111c37 100644 --- a/include/mcl/gmp_util.hpp +++ b/include/mcl/gmp_util.hpp @@ -960,6 +960,7 @@ struct SmallModp { } uint32_t getTop(const Unit *x) const { + if (shiftR_ == 0) return x[N_ - 1]; return (x[N_ - 1] >> shiftR_) | (x[N_] << shiftL_); } uint32_t cvtInt(const mpz_class& x) const