Skip to content

Commit 3c26af6

Browse files
authored
Merge branch 'bitcoin-core:master' into musig-partial-clear-nonce
2 parents d872a08 + 4985ac0 commit 3c26af6

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,16 @@ jobs:
631631
cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'
632632
- job_name: 'x86 (MSVC): Windows (VS 2022)'
633633
cmake_options: '-A Win32'
634-
- job_name: 'x64 (MSVC): Windows (clang-cl)'
635-
cmake_options: '-T ClangCL'
634+
- job_name: 'x64 (clang-cl): Windows (VS 2022, shared)'
635+
cmake_options: '-T ClangCL -DBUILD_SHARED_LIBS=ON'
636+
symbol_check: 'true'
637+
- job_name: 'x64 (clang-cl): Windows (VS 2022, static)'
638+
cmake_options: '-T ClangCL -DBUILD_SHARED_LIBS=OFF'
639+
- job_name: 'x64 (clang-cl): Windows (VS 2022, int128_struct)'
640+
cmake_options: '-T ClangCL -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
641+
- job_name: 'x64 (clang-cl): Windows (VS 2022, int128_struct with __(u)mulh)'
642+
cmake_options: '-T ClangCL -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
643+
cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'
636644

637645
steps:
638646
- name: Checkout

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,11 @@ To cross compile for Android with [NDK](https://developer.android.com/ndk/guides
135135
136136
### Building on Windows
137137
138-
To build on Windows with Visual Studio, a proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) must be specified for a new build tree.
139-
140-
The following example assumes using of Visual Studio 2022 and CMake v3.21+.
138+
The following example assumes Visual Studio 2022. Using clang-cl is recommended.
141139
142140
In "Developer Command Prompt for VS 2022":
143141
144-
>cmake -G "Visual Studio 17 2022" -A x64 -B build
142+
>cmake -B build -T ClangCL
145143
>cmake --build build --config RelWithDebInfo
146144
147145
Usage examples

include/secp256k1_ellswift.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ SECP256K1_API int secp256k1_ellswift_decode(
130130
*
131131
* Returns: 1: secret was valid, public key was stored.
132132
* 0: secret was invalid, try again.
133-
* Args: ctx: pointer to a context object
133+
* Args: ctx: pointer to a context object (not secp256k1_context_static)
134134
* Out: ell64: pointer to a 64-byte array to receive the ElligatorSwift
135135
* public key
136136
* In: seckey32: pointer to a 32-byte secret key

src/hash_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256
265265

266266
while (outlen > 0) {
267267
secp256k1_hmac_sha256 hmac;
268-
int now = outlen;
268+
size_t now = outlen;
269269
secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
270270
secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
271271
secp256k1_hmac_sha256_finalize(&hmac, rng->v);

src/modules/schnorrsig/main_impl.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int secp256k1_schnorrsig_sign_internal(const secp256k1_context* ctx, unsi
139139
secp256k1_gej rj;
140140
secp256k1_ge pk;
141141
secp256k1_ge r;
142-
unsigned char buf[32] = { 0 };
142+
unsigned char nonce32[32] = { 0 };
143143
unsigned char pk_buf[32];
144144
unsigned char seckey[32];
145145
int ret = 1;
@@ -164,8 +164,8 @@ static int secp256k1_schnorrsig_sign_internal(const secp256k1_context* ctx, unsi
164164

165165
secp256k1_scalar_get_b32(seckey, &sk);
166166
secp256k1_fe_get_b32(pk_buf, &pk.x);
167-
ret &= !!noncefp(buf, msg, msglen, seckey, pk_buf, bip340_algo, sizeof(bip340_algo), ndata);
168-
secp256k1_scalar_set_b32(&k, buf, NULL);
167+
ret &= !!noncefp(nonce32, msg, msglen, seckey, pk_buf, bip340_algo, sizeof(bip340_algo), ndata);
168+
secp256k1_scalar_set_b32(&k, nonce32, NULL);
169169
ret &= !secp256k1_scalar_is_zero(&k);
170170
secp256k1_scalar_cmov(&k, &secp256k1_scalar_one, !ret);
171171

@@ -191,6 +191,7 @@ static int secp256k1_schnorrsig_sign_internal(const secp256k1_context* ctx, unsi
191191
secp256k1_scalar_clear(&k);
192192
secp256k1_scalar_clear(&sk);
193193
secp256k1_memclear(seckey, sizeof(seckey));
194+
secp256k1_memclear(nonce32, sizeof(nonce32));
194195
secp256k1_gej_clear(&rj);
195196

196197
return ret;

0 commit comments

Comments
 (0)