Skip to content

Commit

Permalink
Merge #1250: No need to subtract 1 before doing a right shift
Browse files Browse the repository at this point in the history
3e43041 No need to subtract 1 before doing a right shift (roconnor-blockstream)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK 3e43041
  jonasnick:
    ACK 3e43041

Tree-SHA512: bcecda11eae3fb845bef7af88c6171bedcd933872d08a9849c0a250cb6c9e982a88bd45e8a8364a4a348f8be413fc91ee04cf8fa78adae44e584e3ad7ec544cf
  • Loading branch information
jonasnick committed Mar 28, 2023
2 parents 464a911 + 3e43041 commit 1d8f367
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/int128_struct_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1d8f367

Please sign in to comment.