diff options
author | merge-script <fanquake@gmail.com> | 2024-08-24 18:53:41 +0100 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-08-24 18:53:41 +0100 |
commit | 6441c77e97731f7085267c5ff5e04b2d4d700cbc (patch) | |
tree | 5bec203921be57d230771f15a421f65306139df5 /src/test | |
parent | d54fbc85c4a4cb63307f39deecb745185103f8bd (diff) | |
parent | 60055f1abc4b4ad5f66a2fcf2e61c65efc777036 (diff) |
Merge bitcoin/bitcoin#30687: test: replace deprecated secp256k1 context flags usage
60055f1abc4b4ad5f66a2fcf2e61c65efc777036 test: replace deprecated secp256k1 context flags usage (Sebastian Falbesoner)
Pull request description:
The flags `SECP256K1_CONTEXT_{SIGN,VERIFY}` have been marked as deprecated since libsecp256k1 version 0.2 (released in December 2022), with the recommendation to use SECP256K1_CONTEXT_NONE instead, see https://github.com/bitcoin-core/secp256k1/pull/1126 and https://github.com/bitcoin-core/secp256k1/blob/1988855079fa8161521b86515e77965120fdc734/CHANGELOG.md?plain=1#L132. Note that in contrast to other deprecated functions/variables, these defines don't have a deprecated attribute and hence don't lead to a compiler warning (see https://github.com/bitcoin-core/secp256k1/pull/1126#discussion_r922105271), so they are not easily detected.
ACKs for top commit:
TheCharlatan:
ACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036
ismaelsadeeq:
utACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036
tdb3:
light CR and test ACK 60055f1abc4b4ad5f66a2fcf2e61c65efc777036
Tree-SHA512: d93cf49e018a58469620c0d2f50242141f22dabc70afb2a7cd64e416f4f55588714510ae5a877376dd1e6b6f7494261969489af4b18a1c9dff0d0dfdf93f1fa8
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp | 2 | ||||
-rw-r--r-- | src/test/key_tests.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp b/src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp index 0435626356..9f84ac9713 100644 --- a/src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp +++ b/src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp @@ -17,7 +17,7 @@ int ec_seckey_export_der(const secp256k1_context* ctx, unsigned char* seckey, si FUZZ_TARGET(secp256k1_ec_seckey_import_export_der) { FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()}; - secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); + secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_NONE); { std::vector<uint8_t> out32(32); (void)ec_seckey_import_der(secp256k1_context_sign, out32.data(), ConsumeFixedLengthByteVector(fuzzed_data_provider, CKey::SIZE).data(), CKey::SIZE); diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index 112d6db193..d0f9ef8161 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -362,7 +362,7 @@ BOOST_AUTO_TEST_CASE(bip341_test_h) BOOST_AUTO_TEST_CASE(key_schnorr_tweak_smoke_test) { // Sanity check to ensure we get the same tweak using CPubKey vs secp256k1 functions - secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); + secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_NONE); CKey key; key.MakeNewKey(true); |