Skip to content

Commit ea9a84a

Browse files
committed
Squashed 'src/secp256k1/' changes from 14e56970cb..15ea24cb8c
15ea24cb8c batch: make add functions void & introduce reset bfcc479a35 batch: remove `batch_usable` api 15e388e096 batch: make tests functions internal & static aac054a373 fix typos & index the right inputs for benchmarks c07e710003 batch: remove experimental status 49fb753393 test: fix ci failures e96dabb4af batch: Generate speedup graphs b0b3425cd4 batch, extrakeys: Add benchmarks 9d5115156b batch: Add tests for batch_add_* APIs 668199c917 batch,ecmult: Add tests for core batch APIs and strauss_batch refactor 53a158203f batch: Add example b40b4186b8 batch: Add batch_add_* APIs 2bed1cb6ee batch, ecmult: Add batch_verify and refactor strauss_batch 8f13eeae31 batch: Add create and destroy APIs 0b6b0c87ad batch: Initialize an experimental batch module REVERT: 14e56970cb Merge bitcoin-core/secp256k1#1794: ecmult: Use size_t for array indices REVERT: c7a52400d6 Merge bitcoin-core/secp256k1#1809: release cleanup: bump version after 0.7.1 REVERT: ae7eb729c0 release cleanup: bump version after 0.7.1 REVERT: 1a53f4961f Merge bitcoin-core/secp256k1#1808: Prepare for 0.7.1 REVERT: 20a209f11c release: prepare for 0.7.1 REVERT: c4b6a81a60 changelog: update in preparation for the v0.7.1 release REVERT: ebb35882da Merge bitcoin-core/secp256k1#1796: bench: fail early if user inputs invalid value for SECP256K1_BENCH_ITERS REVERT: c09215f7af bench: fail early if user inputs invalid value for SECP256K1_BENCH_ITERS REVERT: 471e3a130d Merge bitcoin-core/secp256k1#1800: sage: verify Eisenstein integer connection for GLV constants REVERT: 29ac4d8491 sage: verify Eisenstein integer connection for GLV constants REVERT: 4721e077b4 Merge bitcoin-core/secp256k1#1793: doc/bench: added help text for SECP256K1_BENCH_ITERS env var for bench_ecmult REVERT: bd5ced1fe1 doc/bench: added help text for SECP256K1_BENCH_ITERS env var for bench_ecmult REVERT: 47eb70959a ecmult: Use size_t for array indices in _odd_multiplies_table REVERT: bb1d199de5 ecmult: Use size_t for array indices into tables REVERT: 2d9137ce9d Merge bitcoin-core/secp256k1#1764: group: Avoid using infinity field directly in other modules REVERT: f9a944ff2d Merge bitcoin-core/secp256k1#1790: doc: include arg -DSECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS=ON for cmake REVERT: 0406cfc4d1 doc: include arg -DUSE_EXTERNAL_DEFAULT_CALLBACKS=1 for cmake REVERT: 8d445730ec Merge bitcoin-core/secp256k1#1783: Add VERIFY_CHECKs and documentation that flags must be 0 or 1 REVERT: aa2a39c1a7 Merge bitcoin-core/secp256k1#1778: doc/bench: Added cmake build options to bench error messages REVERT: 540fec8ae9 Merge bitcoin-core/secp256k1#1788: test: split monolithic ellswift test into independent cases REVERT: d822b29021 test: split monolithic ellswift test into independent cases REVERT: ae00c552df Add VERIFY_CHECKs that flags are 0 or 1 REVERT: 5c75183344 Merge bitcoin-core/secp256k1#1784: refactor: remove ret from secp256k1_ec_pubkey_serialize REVERT: be5e4f02fd Merge bitcoin-core/secp256k1#1779: Add ARG_CHECKs to ensure "array of pointers" elements are non-NULL REVERT: 3daab83a60 refactor: remove ret from secp256k1_ec_pubkey_serialize REVERT: 8bcda186d2 test: Add non-NULL checks for "pointer of array" API functions REVERT: 5a08c1bcdc Add ARG_CHECKs to ensure "array of pointers" elements are non-NULL REVERT: 3b5b03f301 doc/bench: Added cmake build options to bench error messages REVERT: e7f7083b53 Merge bitcoin-core/secp256k1#1774: refactor: split up internal pubkey serialization function into compressed/uncompressed variants REVERT: b6c2a3cd77 Merge bitcoin-core/secp256k1#1761: ecmult_multi: reduce strauss memory usage by 30% REVERT: f5e815f430 remove secp256k1_eckey_pubkey_serialize function REVERT: 0d3659c547 use new `_eckey_pubkey_serialize{33,65}` functions in modules (ellswift,musig) REVERT: adb76f82ea use new `_eckey_pubkey_serialize{33,65}` functions in public API REVERT: fc7458ca3e introduce `secp256k1_eckey_pubkey_serialize{33,65}` functions REVERT: 2f73e5281d group: Avoid using infinity field directly in other modules REVERT: 26166c4f5f ecmult_multi: reduce strauss memory usage by 30% git-subtree-dir: src/secp256k1 git-subtree-split: 15ea24cb8c1bd239a7a39939da1952cf6d3a35b0
1 parent 2fccbea commit ea9a84a

66 files changed

Lines changed: 2292 additions & 393 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ env:
3535
SCHNORRSIG: 'no'
3636
MUSIG: 'no'
3737
ELLSWIFT: 'no'
38+
BATCH: 'no'
3839
### test options
3940
SECP256K1_TEST_ITERS: 64
4041
BENCH: 'yes'
@@ -83,18 +84,18 @@ jobs:
8384
matrix:
8485
configuration:
8586
- env_vars: { WIDEMUL: 'int64', RECOVERY: 'yes' }
86-
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
87+
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
8788
- env_vars: { WIDEMUL: 'int128' }
8889
- env_vars: { WIDEMUL: 'int128_struct', ELLSWIFT: 'yes' }
89-
- env_vars: { WIDEMUL: 'int128', RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
90-
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes' }
90+
- env_vars: { WIDEMUL: 'int128', RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
91+
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', BATCH: 'yes' }
9192
- env_vars: { WIDEMUL: 'int128', ASM: 'x86_64', ELLSWIFT: 'yes' }
92-
- env_vars: { RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes' }
93-
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', CPPFLAGS: '-DVERIFY' }
93+
- env_vars: { RECOVERY: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', BATCH: 'yes' }
94+
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', BATCH: 'yes', CPPFLAGS: '-DVERIFY' }
9495
- env_vars: { BUILD: 'distcheck', WITH_VALGRIND: 'no', CTIMETESTS: 'no', BENCH: 'no' }
9596
- env_vars: { CPPFLAGS: '-DDETERMINISTIC' }
9697
- env_vars: { CFLAGS: '-O0', CTIMETESTS: 'no' }
97-
- env_vars: { CFLAGS: '-O1', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
98+
- env_vars: { CFLAGS: '-O1', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
9899
- env_vars: { ECMULTGENKB: 2, ECMULTWINDOW: 2 }
99100
- env_vars: { ECMULTGENKB: 86, ECMULTWINDOW: 4 }
100101
cc:
@@ -146,6 +147,7 @@ jobs:
146147
SCHNORRSIG: 'yes'
147148
MUSIG: 'yes'
148149
ELLSWIFT: 'yes'
150+
BATCH: 'yes'
149151
CC: ${{ matrix.cc }}
150152

151153
steps:
@@ -174,6 +176,7 @@ jobs:
174176
SCHNORRSIG: 'yes'
175177
MUSIG: 'yes'
176178
ELLSWIFT: 'yes'
179+
BATCH: 'yes'
177180
CTIMETESTS: 'no'
178181

179182
steps:
@@ -204,6 +207,7 @@ jobs:
204207
SCHNORRSIG: 'yes'
205208
MUSIG: 'yes'
206209
ELLSWIFT: 'yes'
210+
BATCH: 'yes'
207211
CTIMETESTS: 'no'
208212

209213
steps:
@@ -225,6 +229,7 @@ jobs:
225229
SCHNORRSIG: 'yes'
226230
MUSIG: 'yes'
227231
ELLSWIFT: 'yes'
232+
BATCH: 'yes'
228233
CTIMETESTS: 'no'
229234
CC: ${{ matrix.cc }}
230235

@@ -265,6 +270,7 @@ jobs:
265270
SCHNORRSIG: 'yes'
266271
MUSIG: 'yes'
267272
ELLSWIFT: 'yes'
273+
BATCH: 'yes'
268274
CTIMETESTS: 'no'
269275

270276
steps:
@@ -310,6 +316,7 @@ jobs:
310316
SCHNORRSIG: 'yes'
311317
MUSIG: 'yes'
312318
ELLSWIFT: 'yes'
319+
BATCH: 'yes'
313320
CTIMETESTS: 'no'
314321
SECP256K1_TEST_ITERS: 2
315322

@@ -339,6 +346,7 @@ jobs:
339346
SCHNORRSIG: 'yes'
340347
MUSIG: 'yes'
341348
ELLSWIFT: 'yes'
349+
BATCH: 'yes'
342350
CTIMETESTS: 'no'
343351
CFLAGS: '-fsanitize=undefined,address -g'
344352
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
@@ -385,6 +393,8 @@ jobs:
385393
SCHNORRSIG: 'yes'
386394
MUSIG: 'yes'
387395
ELLSWIFT: 'yes'
396+
BATCH: 'yes'
397+
EXPERIMENTAL: 'yes'
388398
CC: ${{ matrix.cc }}
389399
SECP256K1_TEST_ITERS: 32
390400
ASM: 'no'
@@ -410,6 +420,7 @@ jobs:
410420
SCHNORRSIG: 'yes'
411421
MUSIG: 'yes'
412422
ELLSWIFT: 'yes'
423+
BATCH: 'yes'
413424
CTIMETESTS: 'no'
414425

415426
strategy:
@@ -442,15 +453,15 @@ jobs:
442453
fail-fast: false
443454
matrix:
444455
env_vars:
445-
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
456+
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
446457
- { WIDEMUL: 'int128_struct', ECMULTGENKB: 2, ECMULTWINDOW: 4 }
447-
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
458+
- { WIDEMUL: 'int128', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
448459
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
449-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes' }
450-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
451-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
452-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
453-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
460+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes' }
461+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes', CC: 'gcc' }
462+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
463+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
464+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', EXTRAKEYS: 'yes', SCHNORRSIG: 'yes', MUSIG: 'yes', ELLSWIFT: 'yes', BATCH: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
454465
- BUILD: 'distcheck'
455466

456467
steps:
@@ -618,6 +629,7 @@ jobs:
618629
SCHNORRSIG: 'yes'
619630
MUSIG: 'yes'
620631
ELLSWIFT: 'yes'
632+
BATCH: 'yes'
621633

622634
steps:
623635
- *CHECKOUT

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ecdsa_example
1212
schnorr_example
1313
ellswift_example
1414
musig_example
15+
batch_example
1516
*.exe
1617
*.so
1718
*.a

CHANGELOG.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.7.1] - 2026-01-26
11-
12-
#### Changed
13-
- Tests: Introduced a unit test framework with support for parallel test execution, selective test running, and named command-line arguments. Run `./tests -help` for usage information.
14-
15-
#### Fixed
16-
- Increased the number of cases where the library attempts to clear secrets from the stack.
17-
- build: Fixed x86_64 assembly feature check that could fail when user-provided `CFLAGS` included `-Werror`. This would cause the build to fall back to the slower C implementation instead of using the optimized x86_64 assembly.
18-
19-
#### ABI Compatibility
20-
The ABI is backward compatible with version 0.7.0.
21-
2210
## [0.7.0] - 2025-07-21
2311

2412
#### Added
@@ -199,8 +187,7 @@ This version was in fact never released.
199187
The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6).
200188
Therefore, this version number does not uniquely identify a set of source files.
201189

202-
[Unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.7.1...HEAD
203-
[0.7.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.7.0...v0.7.1
190+
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.7.0...HEAD
204191
[0.7.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.6.0...v0.7.0
205192
[0.6.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.1...v0.6.0
206193
[0.5.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.0...v0.5.1

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(libsecp256k1
77
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
88
# the API. All changes in experimental modules are treated as
99
# backwards-compatible and therefore at most increase the minor version.
10-
VERSION 0.7.2
10+
VERSION 0.7.1
1111
DESCRIPTION "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1."
1212
HOMEPAGE_URL "https://github.com/bitcoin-core/secp256k1"
1313
LANGUAGES C
@@ -22,7 +22,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
2222
# All changes in experimental modules are treated as if they don't affect the
2323
# interface and therefore only increase the revision.
2424
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 6)
25-
set(${PROJECT_NAME}_LIB_VERSION_REVISION 2)
25+
set(${PROJECT_NAME}_LIB_VERSION_REVISION 1)
2626
set(${PROJECT_NAME}_LIB_VERSION_AGE 0)
2727

2828
#=============================
@@ -52,6 +52,7 @@ option(SECP256K1_ENABLE_MODULE_EXTRAKEYS "Enable extrakeys module." ON)
5252
option(SECP256K1_ENABLE_MODULE_SCHNORRSIG "Enable schnorrsig module." ON)
5353
option(SECP256K1_ENABLE_MODULE_MUSIG "Enable musig module." ON)
5454
option(SECP256K1_ENABLE_MODULE_ELLSWIFT "Enable ElligatorSwift module." ON)
55+
option(SECP256K1_ENABLE_MODULE_BATCH "Enable batch module." ON)
5556

5657
option(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS "Enable external default callback functions." OFF)
5758
if(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS)
@@ -285,6 +286,7 @@ message(" extrakeys ........................... ${SECP256K1_ENABLE_MODULE_EXTRA
285286
message(" schnorrsig .......................... ${SECP256K1_ENABLE_MODULE_SCHNORRSIG}")
286287
message(" musig ............................... ${SECP256K1_ENABLE_MODULE_MUSIG}")
287288
message(" ElligatorSwift ...................... ${SECP256K1_ENABLE_MODULE_ELLSWIFT}")
289+
message(" batch ............................... ${SECP256K1_ENABLE_MODULE_BATCH}")
288290
message("Parameters:")
289291
message(" ecmult window size .................. ${SECP256K1_ECMULT_WINDOW_SIZE}")
290292
message(" ecmult gen table size ............... ${SECP256K1_ECMULT_GEN_KB} KiB")

Makefile.am

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ if BUILD_WINDOWS
209209
musig_example_LDFLAGS += -lbcrypt
210210
endif
211211
TESTS += musig_example
212+
if ENABLE_MODULE_BATCH
213+
noinst_PROGRAMS += batch_example
214+
batch_example_SOURCES = examples/batch.c
215+
batch_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
216+
batch_example_LDADD = libsecp256k1.la
217+
batch_example_LDFLAGS = -static
218+
if BUILD_WINDOWS
219+
batch_example_LDFLAGS += -lbcrypt
220+
endif
221+
TESTS += batch_example
222+
endif
212223
endif
213224
endif
214225

@@ -314,3 +325,7 @@ endif
314325
if ENABLE_MODULE_ELLSWIFT
315326
include src/modules/ellswift/Makefile.am.include
316327
endif
328+
329+
if ENABLE_MODULE_BATCH
330+
include src/modules/batch/Makefile.am.include
331+
endif

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Features:
2222
* Optional module for Schnorr signatures according to [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki).
2323
* Optional module for ElligatorSwift key exchange according to [BIP-324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki).
2424
* Optional module for MuSig2 Schnorr multi-signatures according to [BIP-327](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki).
25+
* Optional module for Batch Verification compatible with [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki).
2526

2627
Implementation details
2728
----------------------

ci/ci.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ print_environment() {
1313
# does not rely on bash.
1414
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
1515
ECMULTWINDOW ECMULTGENKB ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
16-
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT \
16+
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT BATCH \
1717
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS SYMBOL_CHECK \
1818
EXAMPLES \
1919
HOST WRAPPER_CMD \
@@ -64,6 +64,7 @@ fi
6464
--enable-module-extrakeys="$EXTRAKEYS" \
6565
--enable-module-schnorrsig="$SCHNORRSIG" \
6666
--enable-module-musig="$MUSIG" \
67+
--enable-module-batch="$BATCH" \
6768
--enable-examples="$EXAMPLES" \
6869
--enable-ctime-tests="$CTIMETESTS" \
6970
--with-valgrind="$WITH_VALGRIND" \

configure.ac

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AC_PREREQ([2.60])
55
# backwards-compatible and therefore at most increase the minor version.
66
define(_PKG_VERSION_MAJOR, 0)
77
define(_PKG_VERSION_MINOR, 7)
8-
define(_PKG_VERSION_PATCH, 2)
8+
define(_PKG_VERSION_PATCH, 1)
99
define(_PKG_VERSION_IS_RELEASE, false)
1010

1111
# The library version is based on libtool versioning of the ABI. The set of
@@ -14,7 +14,7 @@ define(_PKG_VERSION_IS_RELEASE, false)
1414
# All changes in experimental modules are treated as if they don't affect the
1515
# interface and therefore only increase the revision.
1616
define(_LIB_VERSION_CURRENT, 6)
17-
define(_LIB_VERSION_REVISION, 2)
17+
define(_LIB_VERSION_REVISION, 1)
1818
define(_LIB_VERSION_AGE, 0)
1919

2020
AC_INIT([libsecp256k1],m4_join([.], _PKG_VERSION_MAJOR, _PKG_VERSION_MINOR, _PKG_VERSION_PATCH)m4_if(_PKG_VERSION_IS_RELEASE, [true], [], [-dev]),[https://github.com/bitcoin-core/secp256k1/issues],[libsecp256k1],[https://github.com/bitcoin-core/secp256k1])
@@ -191,6 +191,10 @@ AC_ARG_ENABLE(module_ellswift,
191191
AS_HELP_STRING([--enable-module-ellswift],[enable ElligatorSwift module [default=yes]]), [],
192192
[SECP_SET_DEFAULT([enable_module_ellswift], [yes], [yes])])
193193

194+
AC_ARG_ENABLE(module_batch,
195+
AS_HELP_STRING([--enable-module-batch],[enable batch verification module [default=yes]]), [],
196+
[SECP_SET_DEFAULT([enable_module_batch], [yes], [yes])])
197+
194198
AC_ARG_ENABLE(external_default_callbacks,
195199
AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]), [],
196200
[SECP_SET_DEFAULT([enable_external_default_callbacks], [no], [no])])
@@ -397,6 +401,10 @@ SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"
397401

398402
# Processing must be done in a reverse topological sorting of the dependency graph
399403
# (dependent module first).
404+
if test x"$enable_module_batch" = x"yes"; then
405+
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_BATCH=1"
406+
fi
407+
400408
if test x"$enable_module_ellswift" = x"yes"; then
401409
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_ELLSWIFT=1"
402410
fi
@@ -470,6 +478,7 @@ AM_CONDITIONAL([ENABLE_MODULE_EXTRAKEYS], [test x"$enable_module_extrakeys" = x"
470478
AM_CONDITIONAL([ENABLE_MODULE_SCHNORRSIG], [test x"$enable_module_schnorrsig" = x"yes"])
471479
AM_CONDITIONAL([ENABLE_MODULE_MUSIG], [test x"$enable_module_musig" = x"yes"])
472480
AM_CONDITIONAL([ENABLE_MODULE_ELLSWIFT], [test x"$enable_module_ellswift" = x"yes"])
481+
AM_CONDITIONAL([ENABLE_MODULE_BATCH], [test x"$enable_module_batch" = x"yes"])
473482
AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$enable_external_asm" = x"yes"])
474483
AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm32"])
475484
AM_CONDITIONAL([BUILD_WINDOWS], [test "$build_windows" = "yes"])
@@ -494,6 +503,7 @@ echo " module extrakeys = $enable_module_extrakeys"
494503
echo " module schnorrsig = $enable_module_schnorrsig"
495504
echo " module musig = $enable_module_musig"
496505
echo " module ellswift = $enable_module_ellswift"
506+
echo " module batch = $enable_module_batch"
497507
echo
498508
echo " asm = $set_asm"
499509
echo " ecmult window size = $set_ecmult_window"

doc/speedup-batch.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Schnorrsig Batch Verification Speedup
2+
3+
![Speedup over single verification](speedup-batch/schnorrsig-speedup-batch.png)
4+
5+
# Tweak Pubkey Check Batch Verification Speedup
6+
7+
![Speedup over single verification](speedup-batch/tweakcheck-speedup-batch.png)
8+
9+
Build steps
10+
-----------
11+
To generate the above graphs on your local machine:
12+
13+
$ cd doc/speedup-batch
14+
$ make
15+
$ make speedup-batch.png
16+
17+
<!-- TODO: add additional notes on the API -->

doc/speedup-batch/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.dat

0 commit comments

Comments
 (0)