Skip to content

Commit 6c54db1

Browse files
committed
Merge commits '2286f809 751c435 477f02c e3f8477 5c789dc 8c949f5 21ffe4b ' into temp-merge-1055
2 parents e996d07 + 21ffe4b commit 6c54db1

Some content is hidden

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

51 files changed

+1023
-1149
lines changed

.cirrus.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ env:
3232
# Compile and run the tests
3333
EXAMPLES: yes
3434

35+
# https://cirrus-ci.org/pricing/#compute-credits
36+
credits_snippet: &CREDITS
37+
# Don't use any credits for now.
38+
use_compute_credits: false
39+
3540
cat_logs_snippet: &CAT_LOGS
3641
always:
3742
cat_tests_log_script:
@@ -148,6 +153,7 @@ task:
148153
test_script:
149154
- ./ci/cirrus.sh
150155
<< : *CAT_LOGS
156+
<< : *CREDITS
151157

152158
task:
153159
name: "s390x (big-endian): Linux (Debian stable, QEMU)"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ schnorr_example
2020
*.csv
2121
*.log
2222
*.trs
23+
*.sage.py
2324

2425
Makefile
2526
configure

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
**This changelog is not the libsecp256k1-zkp's changelog.**
2+
Instead, it is the changelog of the upstream library [libsecp256k1](https://github.com/bitcoin-core/secp256k1).
3+
4+
# Changelog
5+
6+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
7+
8+
## [Unreleased]
9+
10+
## [0.2.0] - 2022-12-12
11+
12+
### Added
13+
- Added `secp256k1_selftest`, to be used in conjunction with `secp256k1_context_static`.
14+
15+
### Changed
16+
- Enabled modules schnorrsig, extrakeys and ECDH by default in `./configure`.
17+
18+
### Deprecated
19+
- Deprecated context flags `SECP256K1_CONTEXT_VERIFY` and `SECP256K1_CONTEXT_SIGN`. Use `SECP256K1_CONTEXT_NONE` instead.
20+
- Renamed `secp256k1_context_no_precomp` to `secp256k1_context_static`.
21+
22+
### ABI Compatibility
23+
24+
Since this is the first release, we do not compare application binary interfaces.
25+
However, there are unreleased versions of libsecp256k1 that are *not* ABI compatible with this version.
26+
27+
## [0.1.0] - 2013-03-05 to 2021-12-25
28+
29+
This version was in fact never released.
30+
The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6).
31+
Therefore, this version number does not uniquely identify a set of source files.

Makefile.am

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,15 @@ maintainer-clean-local: clean-precomp
229229
clean-precomp:
230230
rm -f $(PRECOMP)
231231

232-
EXTRA_DIST = autogen.sh SECURITY.md
232+
EXTRA_DIST = autogen.sh CHANGELOG.md SECURITY.md
233+
EXTRA_DIST += doc/release-process.md doc/safegcd_implementation.md
234+
EXTRA_DIST += examples/EXAMPLES_COPYING
235+
EXTRA_DIST += sage/gen_exhaustive_groups.sage
236+
EXTRA_DIST += sage/gen_split_lambda_constants.sage
237+
EXTRA_DIST += sage/group_prover.sage
238+
EXTRA_DIST += sage/prove_group_implementations.sage
239+
EXTRA_DIST += sage/secp256k1_params.sage
240+
EXTRA_DIST += sage/weierstrass_prover.sage
233241

234242
if ENABLE_MODULE_BPPP
235243
include src/modules/bppp/Makefile.am.include

configure.ac

Lines changed: 8 additions & 8 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, 1)
8-
define(_PKG_VERSION_BUILD, 0)
8+
define(_PKG_VERSION_PATCH, 0)
99
define(_PKG_VERSION_IS_RELEASE, false)
1010

1111
# The library version is based on libtool versioning of the ABI. The set of
@@ -17,7 +17,7 @@ define(_LIB_VERSION_CURRENT, 0)
1717
define(_LIB_VERSION_REVISION, 0)
1818
define(_LIB_VERSION_AGE, 0)
1919

20-
AC_INIT([libsecp256k1],m4_join([.], _PKG_VERSION_MAJOR, _PKG_VERSION_MINOR, _PKG_VERSION_BUILD)m4_if(_PKG_VERSION_IS_RELEASE, [true], [], [-pre]),[https://github.com/bitcoin-core/secp256k1/issues],[libsecp256k1],[https://github.com/bitcoin-core/secp256k1])
20+
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])
2121

2222
AC_CONFIG_AUX_DIR([build-aux])
2323
AC_CONFIG_MACRO_DIR([build-aux/m4])
@@ -160,8 +160,8 @@ AC_ARG_ENABLE(module_bppp,
160160
[SECP_SET_DEFAULT([enable_module_bppp], [no], [yes])])
161161

162162
AC_ARG_ENABLE(module_ecdh,
163-
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH module [default=no]]), [],
164-
[SECP_SET_DEFAULT([enable_module_ecdh], [no], [yes])])
163+
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH module [default=yes]]), [],
164+
[SECP_SET_DEFAULT([enable_module_ecdh], [yes], [yes])])
165165

166166
AC_ARG_ENABLE(module_musig,
167167
AS_HELP_STRING([--enable-module-musig],[enable MuSig module (experimental)]),
@@ -188,12 +188,12 @@ AC_ARG_ENABLE(module_whitelist,
188188
[SECP_SET_DEFAULT([enable_module_whitelist], [no], [yes])])
189189

190190
AC_ARG_ENABLE(module_extrakeys,
191-
AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module [default=no]]), [],
192-
[SECP_SET_DEFAULT([enable_module_extrakeys], [no], [yes])])
191+
AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module [default=yes]]), [],
192+
[SECP_SET_DEFAULT([enable_module_extrakeys], [yes], [yes])])
193193

194194
AC_ARG_ENABLE(module_schnorrsig,
195-
AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module [default=no]]), [],
196-
[SECP_SET_DEFAULT([enable_module_schnorrsig], [no], [yes])])
195+
AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module [default=yes]]), [],
196+
[SECP_SET_DEFAULT([enable_module_schnorrsig], [yes], [yes])])
197197

198198
AC_ARG_ENABLE(module_ecdsa_s2c,
199199
AS_HELP_STRING([--enable-module-ecdsa-s2c],[enable ECDSA sign-to-contract module [default=no]]),

contrib/lax_der_privatekey_parsing.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ extern "C" {
4343
/** Export a private key in DER format.
4444
*
4545
* Returns: 1 if the private key was valid.
46-
* Args: ctx: pointer to a context object, initialized for signing (cannot
47-
* be NULL)
46+
* Args: ctx: pointer to a context object (not secp256k1_context_static).
4847
* Out: privkey: pointer to an array for storing the private key in BER.
4948
* Should have space for 279 bytes, and cannot be NULL.
5049
* privkeylen: Pointer to an int where the length of the private key in

doc/CHANGELOG.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/release-process.md

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,52 @@
11
# Release Process
22

3-
1. Open PR to master that
4-
1. adds release notes to `doc/CHANGELOG.md` and
5-
2. if this is **not** a patch release, updates `_PKG_VERSION_{MAJOR,MINOR}` and `_LIB_VERSIONS_*` in `configure.ac`
6-
2. After the PR is merged,
7-
* if this is **not** a patch release, create a release branch with name `MAJOR.MINOR`.
8-
Make sure that the branch contains the right commits.
9-
Create commit on the release branch that sets `_PKG_VERSION_IS_RELEASE` in `configure.ac` to `true`.
10-
* if this **is** a patch release, open a pull request with the bugfixes to the `MAJOR.MINOR` branch.
11-
Also include the release note commit bump `_PKG_VERSION_BUILD` and `_LIB_VERSIONS_*` in `configure.ac`.
12-
4. Tag the commit with `git tag -s vMAJOR.MINOR.PATCH`.
13-
5. Push branch and tag with `git push origin --tags`.
14-
6. Create a new GitHub release with a link to the corresponding entry in `doc/CHANGELOG.md`.
3+
This document outlines the process for releasing versions of the form `$MAJOR.$MINOR.$PATCH`.
4+
5+
We distinguish between two types of releases: *regular* and *maintenance* releases.
6+
Regular releases are releases of a new major or minor version as well as patches of the most recent release.
7+
Maintenance releases, on the other hand, are required for patches of older releases.
8+
9+
You should coordinate with the other maintainers on the release date, if possible.
10+
This date will be part of the release entry in [CHANGELOG.md](../CHANGELOG.md) and it should match the dates of the remaining steps in the release process (including the date of the tag and the GitHub release).
11+
It is best if the maintainers are present during the release, so they can help ensure that the process is followed correctly and, in the case of a regular release, they are aware that they should not modify the master branch between merging the PR in step 1 and the PR in step 3.
12+
13+
This process also assumes that there will be no minor releases for old major releases.
14+
15+
## Regular release
16+
17+
1. Open a PR to the master branch with a commit (using message `"release: prepare for $MAJOR.$MINOR.$PATCH"`, for example) that
18+
* finalizes the release notes in [CHANGELOG.md](../CHANGELOG.md) (make sure to include an entry for `### ABI Compatibility`) and
19+
* updates `_PKG_VERSION_*`, `_LIB_VERSION_*`, and sets `_PKG_VERSION_IS_RELEASE` to `true` in `configure.ac`.
20+
2. After the PR is merged, tag the commit and push it:
21+
```
22+
RELEASE_COMMIT=<merge commit of step 1>
23+
git tag -s v$MAJOR.$MINOR.$PATCH -m "libsecp256k1 $MAJOR.$MINOR.$PATCH" $RELEASE_COMMIT
24+
git push [email protected]:bitcoin-core/secp256k1.git v$MAJOR.$MINOR.$PATCH
25+
```
26+
3. Open a PR to the master branch with a commit (using message `"release: bump version after $MAJOR.$MINOR.$PATCH"`, for example) that sets `_PKG_VERSION_IS_RELEASE` to `false` and `_PKG_VERSION_PATCH` to `$PATCH + 1` and increases `_LIB_VERSION_REVISION`. If other maintainers are not present to approve the PR, it can be merged without ACKs.
27+
4. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
28+
29+
## Maintenance release
30+
31+
Note that bugfixes only need to be backported to releases for which no compatible release without the bug exists.
32+
33+
1. If `$PATCH = 1`, create maintenance branch `$MAJOR.$MINOR`:
34+
```
35+
git checkout -b $MAJOR.$MINOR v$MAJOR.$MINOR.0
36+
git push [email protected]:bitcoin-core/secp256k1.git $MAJOR.$MINOR
37+
```
38+
2. Open a pull request to the `$MAJOR.$MINOR` branch that
39+
* includes the bugfixes,
40+
* finalizes the release notes,
41+
* bumps `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac` (with commit message `"release: update PKG_ and LIB_VERSION for $MAJOR.$MINOR.$PATCH"`, for example).
42+
3. After the PRs are merged, update the release branch and tag the commit:
43+
```
44+
git checkout $MAJOR.$MINOR && git pull
45+
git tag -s v$MAJOR.$MINOR.$PATCH -m "libsecp256k1 $MAJOR.$MINOR.$PATCH"
46+
```
47+
4. Push tag:
48+
```
49+
git push [email protected]:bitcoin-core/secp256k1.git v$MAJOR.$MINOR.$PATCH
50+
```
51+
5. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).
52+
6. Open PR to the master branch that includes a commit (with commit message `"release notes: add $MAJOR.$MINOR.$PATCH"`, for example) that adds release notes to [CHANGELOG.md](../CHANGELOG.md).

examples/ecdh.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ int main(void) {
3030
secp256k1_pubkey pubkey1;
3131
secp256k1_pubkey pubkey2;
3232

33-
/* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create`
34-
* needs a context object initialized for signing, which is why we create
35-
* a context with the SECP256K1_CONTEXT_SIGN flag.
36-
* (The docs for `secp256k1_ecdh` don't require any special context, just
37-
* some initialized context) */
38-
secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
33+
/* Before we can call actual API functions, we need to create a "context". */
34+
secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
3935
if (!fill_random(randomize, sizeof(randomize))) {
4036
printf("Failed to generate randomness\n");
4137
return 1;

examples/ecdsa.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ int main(void) {
3838
int return_val;
3939
secp256k1_pubkey pubkey;
4040
secp256k1_ecdsa_signature sig;
41-
/* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create` needs
42-
* a context object initialized for signing and `secp256k1_ecdsa_verify` needs
43-
* a context initialized for verification, which is why we create a context
44-
* for both signing and verification with the SECP256K1_CONTEXT_SIGN and
45-
* SECP256K1_CONTEXT_VERIFY flags. */
46-
secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
41+
/* Before we can call actual API functions, we need to create a "context". */
42+
secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
4743
if (!fill_random(randomize, sizeof(randomize))) {
4844
printf("Failed to generate randomness\n");
4945
return 1;

0 commit comments

Comments
 (0)