Skip to content

Commit 3e43041

Browse files
No need to subtract 1 before doing a right shift
1 parent 464a911 commit 3e43041

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/int128_struct_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static SECP256K1_INLINE int secp256k1_i128_check_pow2(const secp256k1_int128 *r,
193193
VERIFY_CHECK(n < 127);
194194
VERIFY_CHECK(sign == 1 || sign == -1);
195195
return n >= 64 ? r->hi == (uint64_t)sign << (n - 64) && r->lo == 0
196-
: r->hi == (uint64_t)((sign - 1) >> 1) && r->lo == (uint64_t)sign << n;
196+
: r->hi == (uint64_t)(sign >> 1) && r->lo == (uint64_t)sign << n;
197197
}
198198

199199
#endif

0 commit comments

Comments
 (0)