Merge bitcoin-core/secp256k1#1250: No need to subtract 1 before doing a right shift
3e43041be6No need to subtract 1 before doing a right shift (roconnor-blockstream) Pull request description: ACKs for top commit: real-or-random: utACK3e43041be6jonasnick: ACK3e43041be6Tree-SHA512: bcecda11eae3fb845bef7af88c6171bedcd933872d08a9849c0a250cb6c9e982a88bd45e8a8364a4a348f8be413fc91ee04cf8fa78adae44e584e3ad7ec544cf
This commit is contained in:
@@ -193,7 +193,7 @@ static SECP256K1_INLINE int secp256k1_i128_check_pow2(const secp256k1_int128 *r,
|
|||||||
VERIFY_CHECK(n < 127);
|
VERIFY_CHECK(n < 127);
|
||||||
VERIFY_CHECK(sign == 1 || sign == -1);
|
VERIFY_CHECK(sign == 1 || sign == -1);
|
||||||
return n >= 64 ? r->hi == (uint64_t)sign << (n - 64) && r->lo == 0
|
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
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user