File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,8 @@ static int secp256k1_scalar_is_high(const secp256k1_scalar *a) {
189189static int secp256k1_scalar_cond_negate (secp256k1_scalar * r , int flag ) {
190190 /* If we are flag = 0, mask = 00...00 and this is a no-op;
191191 * if we are flag = 1, mask = 11...11 and this is identical to secp256k1_scalar_negate */
192- uint64_t mask = !flag - 1 ;
192+ volatile int vflag = flag ;
193+ uint64_t mask = - vflag ;
193194 uint64_t nonzero = (secp256k1_scalar_is_zero (r ) != 0 ) - 1 ;
194195 secp256k1_uint128 t ;
195196 secp256k1_u128_from_u64 (& t , r -> d [0 ] ^ mask );
Original file line number Diff line number Diff line change @@ -242,7 +242,8 @@ static int secp256k1_scalar_is_high(const secp256k1_scalar *a) {
242242static int secp256k1_scalar_cond_negate (secp256k1_scalar * r , int flag ) {
243243 /* If we are flag = 0, mask = 00...00 and this is a no-op;
244244 * if we are flag = 1, mask = 11...11 and this is identical to secp256k1_scalar_negate */
245- uint32_t mask = !flag - 1 ;
245+ volatile int vflag = flag ;
246+ uint32_t mask = - vflag ;
246247 uint32_t nonzero = 0xFFFFFFFFUL * (secp256k1_scalar_is_zero (r ) == 0 );
247248 uint64_t t = (uint64_t )(r -> d [0 ] ^ mask ) + ((SECP256K1_N_0 + 1 ) & mask );
248249 r -> d [0 ] = t & nonzero ; t >>= 32 ;
You can’t perform that action at this time.
0 commit comments