Skip to content

Commit b6e3453

Browse files
authored
Update secp256k1 library to 0.6.0 (#5254)
1 parent ed4870c commit b6e3453

File tree

109 files changed

+12679
-13503
lines changed

Some content is hidden

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

109 files changed

+12679
-13503
lines changed

external/secp256k1/.cirrus.yml

+37-345
Large diffs are not rendered by default.

external/secp256k1/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ctime_tests
1010
ecdh_example
1111
ecdsa_example
1212
schnorr_example
13+
ellswift_example
14+
musig_example
1315
*.exe
1416
*.so
1517
*.a

external/secp256k1/CHANGELOG.md

+82-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,83 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.6.0] - 2024-11-04
9+
10+
#### Added
11+
- New module `musig` implements the MuSig2 multisignature scheme according to the [BIP 327 specification](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki). See:
12+
- Header file `include/secp256k1_musig.h` which defines the new API.
13+
- Document `doc/musig.md` for further notes on API usage.
14+
- Usage example `examples/musig.c`.
15+
- New CMake variable `SECP256K1_APPEND_LDFLAGS` for appending linker flags to the build command.
16+
17+
#### Changed
18+
- API functions now use a significantly more robust method to clear secrets from the stack before returning. However, secret clearing remains a best-effort security measure and cannot guarantee complete removal.
19+
- Any type `secp256k1_foo` can now be forward-declared using `typedef struct secp256k1_foo secp256k1_foo;` (or also `struct secp256k1_foo;` in C++).
20+
- Organized CMake build artifacts into dedicated directories (`bin/` for executables, `lib/` for libraries) to improve build output structure and Windows shared library compatibility.
21+
22+
#### Removed
23+
- Removed the `secp256k1_scratch_space` struct and its associated functions `secp256k1_scratch_space_create` and `secp256k1_scratch_space_destroy` because the scratch space was unused in the API.
24+
25+
#### ABI Compatibility
26+
The symbols `secp256k1_scratch_space_create` and `secp256k1_scratch_space_destroy` were removed.
27+
Otherwise, the library maintains backward compatibility with versions 0.3.x through 0.5.x.
28+
29+
## [0.5.1] - 2024-08-01
30+
31+
#### Added
32+
- Added usage example for an ElligatorSwift key exchange.
33+
34+
#### Changed
35+
- The default size of the precomputed table for signing was changed from 22 KiB to 86 KiB. The size can be changed with the configure option `--ecmult-gen-kb` (`SECP256K1_ECMULT_GEN_KB` for CMake).
36+
- "auto" is no longer an accepted value for the `--with-ecmult-window` and `--with-ecmult-gen-kb` configure options (this also applies to `SECP256K1_ECMULT_WINDOW_SIZE` and `SECP256K1_ECMULT_GEN_KB` in CMake). To achieve the same configuration as previously provided by the "auto" value, omit setting the configure option explicitly.
37+
38+
#### Fixed
39+
- Fixed compilation when the extrakeys module is disabled.
40+
41+
#### ABI Compatibility
42+
The ABI is backward compatible with versions 0.5.0, 0.4.x and 0.3.x.
43+
44+
## [0.5.0] - 2024-05-06
45+
46+
#### Added
47+
- New function `secp256k1_ec_pubkey_sort` that sorts public keys using lexicographic (of compressed serialization) order.
48+
49+
#### Changed
50+
- The implementation of the point multiplication algorithm used for signing and public key generation was changed, resulting in improved performance for those operations.
51+
- The related configure option `--ecmult-gen-precision` was replaced with `--ecmult-gen-kb` (`SECP256K1_ECMULT_GEN_KB` for CMake).
52+
- This changes the supported precomputed table sizes for these operations. The new supported sizes are 2 KiB, 22 KiB, or 86 KiB (while the old supported sizes were 32 KiB, 64 KiB, or 512 KiB).
53+
54+
#### ABI Compatibility
55+
The ABI is backward compatible with versions 0.4.x and 0.3.x.
56+
57+
## [0.4.1] - 2023-12-21
58+
59+
#### Changed
60+
- The point multiplication algorithm used for ECDH operations (module `ecdh`) was replaced with a slightly faster one.
61+
- Optional handwritten x86_64 assembly for field operations was removed because modern C compilers are able to output more efficient assembly. This change results in a significant speedup of some library functions when handwritten x86_64 assembly is enabled (`--with-asm=x86_64` in GNU Autotools, `-DSECP256K1_ASM=x86_64` in CMake), which is the default on x86_64. Benchmarks with GCC 10.5.0 show a 10% speedup for `secp256k1_ecdsa_verify` and `secp256k1_schnorrsig_verify`.
62+
63+
#### ABI Compatibility
64+
The ABI is backward compatible with versions 0.4.0 and 0.3.x.
65+
66+
## [0.4.0] - 2023-09-04
67+
68+
#### Added
69+
- New module `ellswift` implements ElligatorSwift encoding for public keys and x-only Diffie-Hellman key exchange for them.
70+
ElligatorSwift permits representing secp256k1 public keys as 64-byte arrays which cannot be distinguished from uniformly random. See:
71+
- Header file `include/secp256k1_ellswift.h` which defines the new API.
72+
- Document `doc/ellswift.md` which explains the mathematical background of the scheme.
73+
- The [paper](https://eprint.iacr.org/2022/759) on which the scheme is based.
74+
- We now test the library with unreleased development snapshots of GCC and Clang. This gives us an early chance to catch miscompilations and constant-time issues introduced by the compiler (such as those that led to the previous two releases).
75+
76+
#### Fixed
77+
- Fixed symbol visibility in Windows DLL builds, where three internal library symbols were wrongly exported.
78+
79+
#### Changed
80+
- When consuming libsecp256k1 as a static library on Windows, the user must now define the `SECP256K1_STATIC` macro before including `secp256k1.h`.
81+
82+
#### ABI Compatibility
83+
This release is backward compatible with the ABI of 0.3.0, 0.3.1, and 0.3.2. Symbol visibility is now believed to be handled properly on supported platforms and is now considered to be part of the ABI. Please report any improperly exported symbols as a bug.
84+
885
## [0.3.2] - 2023-05-13
986
We strongly recommend updating to 0.3.2 if you use or plan to use GCC >=13 to compile libsecp256k1. When in doubt, check the GCC version using `gcc -v`.
1087

@@ -85,7 +162,11 @@ This version was in fact never released.
85162
The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6).
86163
Therefore, this version number does not uniquely identify a set of source files.
87164

88-
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.2...HEAD
165+
[0.6.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.1...v0.6.0
166+
[0.5.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.0...v0.5.1
167+
[0.5.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.1...v0.5.0
168+
[0.4.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.0...v0.4.1
169+
[0.4.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.2...v0.4.0
89170
[0.3.2]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.1...v0.3.2
90171
[0.3.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.0...v0.3.1
91172
[0.3.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.2.0...v0.3.0

0 commit comments

Comments
 (0)