Skip to content

Commit

Permalink
Merge bitcoin#30687: test: replace deprecated secp256k1 context flags…
Browse files Browse the repository at this point in the history
… usage

60055f1 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 bitcoin-core/secp256k1#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 bitcoin-core/secp256k1#1126 (comment)), so they are not easily detected.

ACKs for top commit:
  TheCharlatan:
    ACK 60055f1
  ismaelsadeeq:
    utACK 60055f1
  tdb3:
    light CR and test ACK 60055f1

Tree-SHA512: d93cf49e018a58469620c0d2f50242141f22dabc70afb2a7cd64e416f4f55588714510ae5a877376dd1e6b6f7494261969489af4b18a1c9dff0d0dfdf93f1fa8
  • Loading branch information
fanquake committed Aug 24, 2024
2 parents d54fbc8 + 60055f1 commit 6441c77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/test/key_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6441c77

Please sign in to comment.