diff --git a/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/cpp_int_modular/misc.hpp b/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/cpp_int_modular/misc.hpp index 938814bca6..05323460f1 100644 --- a/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/cpp_int_modular/misc.hpp +++ b/crypto3/libs/multiprecision/include/nil/crypto3/multiprecision/cpp_int_modular/misc.hpp @@ -148,6 +148,8 @@ namespace boost { return i * cpp_int_modular_backend::limb_bits + boost::multiprecision::detail::find_msb(a.limbs()[i]); } + if (a.limbs()[0] == 0) + return 0; return boost::multiprecision::detail::find_msb(a.limbs()[0]); }