diff --git a/src/int128_struct_impl.h b/src/int128_struct_impl.h index 2eb337cb5483c..cc17bad167519 100644 --- a/src/int128_struct_impl.h +++ b/src/int128_struct_impl.h @@ -193,7 +193,7 @@ static SECP256K1_INLINE int secp256k1_i128_check_pow2(const secp256k1_int128 *r, VERIFY_CHECK(n < 127); VERIFY_CHECK(sign == 1 || sign == -1); return n >= 64 ? r->hi == (uint64_t)sign << (n - 64) && r->lo == 0 - : r->hi == (uint64_t)((sign - 1) >> 1) && r->lo == (uint64_t)sign << n; + : r->hi == (uint64_t)(sign >> 1) && r->lo == (uint64_t)sign << n; } #endif