Skip to content

Commit 073d98a

Browse files
committed
Merge #1292: refactor: Make 64-bit shift explicit
d1e48e5 refactor: Make 64-bit shift explicit (Hennadii Stepanov) b2e29e4 ci: Treat all compiler warnings as errors in "Windows (VS 2022)" task (Hennadii Stepanov) Pull request description: ACKs for top commit: real-or-random: utACK d1e48e5 jonasnick: ACK d1e48e5 Tree-SHA512: fd07c8c136b1c947900d45b5a4ad4963e2c29884aca62a26be07713dfd1b0c5e7655f07a0b99217fc055bf3266e71cb5edabbd4d5c145a172b4be5d10f7ad51c
2 parents 54d34b6 + d1e48e5 commit 073d98a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ task:
397397
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
398398
configure_script:
399399
- '%x64_NATIVE_TOOLS%'
400-
- cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
400+
- cmake -E env CFLAGS="/WX" cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
401401
build_script:
402402
- '%x64_NATIVE_TOOLS%'
403403
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5

src/ecmult_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static int secp256k1_ecmult_pippenger_batch(const secp256k1_callback* error_call
680680
}
681681
state_space->ps = (struct secp256k1_pippenger_point_state *) secp256k1_scratch_alloc(error_callback, scratch, entries * sizeof(*state_space->ps));
682682
state_space->wnaf_na = (int *) secp256k1_scratch_alloc(error_callback, scratch, entries*(WNAF_SIZE(bucket_window+1)) * sizeof(int));
683-
buckets = (secp256k1_gej *) secp256k1_scratch_alloc(error_callback, scratch, (1<<bucket_window) * sizeof(*buckets));
683+
buckets = (secp256k1_gej *) secp256k1_scratch_alloc(error_callback, scratch, ((size_t)1 << bucket_window) * sizeof(*buckets));
684684
if (state_space->ps == NULL || state_space->wnaf_na == NULL || buckets == NULL) {
685685
secp256k1_scratch_apply_checkpoint(error_callback, scratch, scratch_checkpoint);
686686
return 0;

src/tests.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,7 @@ static void scalar_test(void) {
22212221
for (i = 0; i < 100; ++i) {
22222222
int low;
22232223
int shift = 1 + secp256k1_testrand_int(15);
2224-
int expected = r.d[0] % (1 << shift);
2224+
int expected = r.d[0] % (1ULL << shift);
22252225
low = secp256k1_scalar_shr_int(&r, shift);
22262226
CHECK(expected == low);
22272227
}

0 commit comments

Comments
 (0)