Skip to content

Commit 07c54de

Browse files
committed
Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0
2022917 Add secp256k1_selftest call (Pieter Wuille) 3bfca78 Remove explicit enabling of default modules (Pieter Wuille) 4462cb0 Adapt to libsecp256k1 API changes (Pieter Wuille) 9d47e7b Squashed 'src/secp256k1/' changes from 44c2452fd3..21ffe4b22a (Pieter Wuille) Pull request description: Now that libsecp256k1 has a release (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-December/021271.html), update the subtree to match it. The changes themselves are not very impactful for Bitcoin Core, but include: * It's no longer needed to specify whether contexts are for signing or verification or both (all contexts support everything), so make use of that in this PR. * Verification operations can use the static context now, removing the need for some infrastructure in pubkey.cpp to make sure a context exists. * Most modules are now enabled by default, so we can drop explicit enabling for them. * CI improvements (in particular, MSVC and more recent MacOS) * Introduction of an internal int128 type, which has no effect for GCC/Clang builds, but enables 128-bit multiplication in MSVC, giving a ~20% speedup there (but still slower than GCC/Clang). * Release process changes (process documentation, changelog, ...). ACKs for top commit: Sjors: ACK 2022917, but 4462cb0 could use more eyes on it. achow101: ACK 2022917 jonasnick: utACK 2022917 Tree-SHA512: 8a9fe28852abe74abd6f96fef16a94d5a427b1d99bff4caab1699014d24698aab9b966a5364a46ed1001c07a7c1d825154ed4e6557c7decce952b77330a8616b
2 parents dcae3c1 + 2022917 commit 07c54de

File tree

91 files changed

+2087
-1200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2087
-1200
lines changed

build_msvc/libsecp256k1/libsecp256k1.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515
<ItemDefinitionGroup>
1616
<ClCompile>
17-
<PreprocessorDefinitions>ENABLE_MODULE_ECDH;ENABLE_MODULE_RECOVERY;ENABLE_MODULE_EXTRAKEYS;ENABLE_MODULE_SCHNORRSIG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
17+
<PreprocessorDefinitions>ENABLE_MODULE_RECOVERY;ENABLE_MODULE_EXTRAKEYS;ENABLE_MODULE_SCHNORRSIG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1818
<AdditionalIncludeDirectories>..\..\src\secp256k1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1919
<DisableSpecificWarnings>4146;4244;4267;4334</DisableSpecificWarnings>
2020
</ClCompile>

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ LIBS_TEMP="$LIBS"
20122012
unset LIBS
20132013
LIBS="$LIBS_TEMP"
20142014

2015-
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig"
2015+
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
20162016
AC_CONFIG_SUBDIRS([src/secp256k1])
20172017

20182018
AC_OUTPUT

src/bench/ccoins_caching.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// (https://github.com/bitcoin/bitcoin/issues/7883#issuecomment-224807484)
1919
static void CCoinsCaching(benchmark::Bench& bench)
2020
{
21-
const ECCVerifyHandle verify_handle;
2221
ECC_Start();
2322

2423
FillableSigningProvider keystore;

src/bench/checkqueue.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
2525
// We shouldn't ever be running with the checkqueue on a single core machine.
2626
if (GetNumCores() <= 1) return;
2727

28-
const ECCVerifyHandle verify_handle;
2928
ECC_Start();
3029

3130
struct PrevectorJob {

src/bench/descriptors.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
static void ExpandDescriptor(benchmark::Bench& bench)
1515
{
16-
const ECCVerifyHandle verify_handle;
1716
ECC_Start();
1817

1918
const auto desc_str = "sh(wsh(multi(16,03669b8afcec803a0d323e9a17f3ea8e68e8abe5a278020a929adbec52421adbd0,0260b2003c386519fc9eadf2b5cf124dd8eea4c4e68d5e154050a9346ea98ce600,0362a74e399c39ed5593852a30147f2959b56bb827dfa3e60e464b02ccf87dc5e8,0261345b53de74a4d721ef877c255429961b7e43714171ac06168d7e08c542a8b8,02da72e8b46901a65d4374fe6315538d8f368557dda3a1dcf9ea903f3afe7314c8,0318c82dd0b53fd3a932d16e0ba9e278fcc937c582d5781be626ff16e201f72286,0297ccef1ef99f9d73dec9ad37476ddb232f1238aff877af19e72ba04493361009,02e502cfd5c3f972fe9a3e2a18827820638f96b6f347e54d63deb839011fd5765d,03e687710f0e3ebe81c1037074da939d409c0025f17eb86adb9427d28f0f7ae0e9,02c04d3a5274952acdbc76987f3184b346a483d43be40874624b29e3692c1df5af,02ed06e0f418b5b43a7ec01d1d7d27290fa15f75771cb69b642a51471c29c84acd,036d46073cbb9ffee90473f3da429abc8de7f8751199da44485682a989a4bebb24,02f5d1ff7c9029a80a4e36b9a5497027ef7f3e73384a4a94fbfe7c4e9164eec8bc,02e41deffd1b7cce11cde209a781adcffdabd1b91c0ba0375857a2bfd9302419f3,02d76625f7956a7fc505ab02556c23ee72d832f1bac391bcd2d3abce5710a13d06,0399eb0a5487515802dc14544cf10b3666623762fbed2ec38a3975716e2c29c232)))";

src/bench/verify_script.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// modified to measure performance of other types of scripts.
1919
static void VerifyScriptBench(benchmark::Bench& bench)
2020
{
21-
const ECCVerifyHandle verify_handle;
2221
ECC_Start();
2322

2423
const uint32_t flags{SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH};

src/bitcoin-tx.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
681681

682682
class Secp256k1Init
683683
{
684-
ECCVerifyHandle globalVerifyHandle;
685-
686684
public:
687685
Secp256k1Init() {
688686
ECC_Start();

src/bitcoin-wallet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ MAIN_FUNCTION
130130
return EXIT_FAILURE;
131131
}
132132

133-
ECCVerifyHandle globalVerifyHandle;
134133
ECC_Start();
135134
if (!wallet::WalletTool::ExecuteWalletToolFunc(args, command->command)) {
136135
return EXIT_FAILURE;

src/kernel/context.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ Context::Context()
2121
LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
2222
RandomInit();
2323
ECC_Start();
24-
ecc_verify_handle.reset(new ECCVerifyHandle());
2524
}
2625

2726
Context::~Context()
2827
{
29-
ecc_verify_handle.reset();
3028
ECC_Stop();
3129
}
3230

src/kernel/context.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include <memory>
99

10-
class ECCVerifyHandle;
11-
1210
namespace kernel {
1311
//! Context struct holding the kernel library's logically global state, and
1412
//! passed to external libbitcoin_kernel functions which need access to this
@@ -18,8 +16,6 @@ namespace kernel {
1816
//! State stored directly in this struct should be simple. More complex state
1917
//! should be stored to std::unique_ptr members pointing to opaque types.
2018
struct Context {
21-
std::unique_ptr<ECCVerifyHandle> ecc_verify_handle;
22-
2319
//! Declare default constructor and destructor that are not inline, so code
2420
//! instantiating the kernel::Context struct doesn't need to #include class
2521
//! definitions for all the unique_ptr members.

0 commit comments

Comments
 (0)