diff --git a/crypto3/libs/math/include/nil/crypto3/math/algorithms/make_evaluation_domain.hpp b/crypto3/libs/math/include/nil/crypto3/math/algorithms/make_evaluation_domain.hpp index e18ff409c7..9ad6011735 100644 --- a/crypto3/libs/math/include/nil/crypto3/math/algorithms/make_evaluation_domain.hpp +++ b/crypto3/libs/math/include/nil/crypto3/math/algorithms/make_evaluation_domain.hpp @@ -107,6 +107,12 @@ namespace nil { typedef std::shared_ptr> result_type; + // If m is 1, the value of (std::size_t(std::ceil(std::log2(m))) - 1) is -1, and stored in size_t it becomes a + // very large value. + if (m == 1) { + return result_type(); + } + const std::size_t big = 1ul << (std::size_t(std::ceil(std::log2(m))) - 1); const std::size_t rounded_small = (1ul << std::size_t(std::ceil(std::log2(m - big))));