Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream PRs 1228, 1236, 1243, 1238, 1246, 1247, 1242, 1250, 1244, 1241, 1257, 1226, 1252, 1118, 1245, 1266, 1269 #254

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
28e63f7
release cleanup: bump version after 0.3.0
jonasnick Mar 8, 2023
5658209
Merge bitcoin-core/secp256k1#1228: release cleanup: bump version afte…
real-or-random Mar 8, 2023
647f0a5
Update comment for secp256k1_modinv32_inv256
roconnor-blockstream Mar 10, 2023
427bc3c
Merge bitcoin-core/secp256k1#1236: Update comment for secp256k1_modin…
sipa Mar 11, 2023
96dd062
build: bump CMake minimum requirement to 3.13
theuni Mar 9, 2023
8e79c7e
build: Ensure no optimization when building for coverage analysis
hebasto Mar 14, 2023
4429a8c
Suppress `-Wunused-parameter` when building for coverage analysis
hebasto Mar 14, 2023
fd2a408
Set ARM ASM symbol visibility to `hidden`
hebasto Mar 15, 2023
0cf2fb9
Merge bitcoin-core/secp256k1#1243: build: Ensure no optimization when…
real-or-random Mar 21, 2023
9c8c4f4
Merge bitcoin-core/secp256k1#1238: build: bump CMake minimum requirem…
real-or-random Mar 21, 2023
5bb03c2
Replace `SECP256K1_ECMULT_TABLE_VERIFY` macro by a function
hebasto Mar 21, 2023
d1e7ca1
Typo
roconnor-blockstream Mar 23, 2023
4ebd828
Apply Checks only in VERIFY mode.
roconnor-blockstream Mar 23, 2023
70be3ca
Merge bitcoin-core/secp256k1#1246: Typo
jonasnick Mar 23, 2023
f16a709
Merge bitcoin-core/secp256k1#1247: Apply Checks only in VERIFY mode.
sipa Mar 24, 2023
464a911
Merge bitcoin-core/secp256k1#1242: Set ARM ASM symbol visibility to `…
real-or-random Mar 26, 2023
0c07c82
Add CMake instructions to release process
real-or-random Mar 8, 2023
3addb4c
build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro
hebasto Mar 26, 2023
3e43041
No need to subtract 1 before doing a right shift
roconnor-blockstream Mar 27, 2023
1d8f367
Merge bitcoin-core/secp256k1#1250: No need to subtract 1 before doing…
jonasnick Mar 28, 2023
afd8b23
Merge bitcoin-core/secp256k1#1244: Suppress `-Wunused-parameter` when…
jonasnick Mar 28, 2023
2bca0a5
Merge bitcoin-core/secp256k1#1241: build: Improve `SECP_TRY_APPEND_DE…
jonasnick Mar 28, 2023
3d1f430
Make position of * in pointer declarations in include/ consistent
jonasnick Mar 28, 2023
4a496a3
ct: Use volatile "trick" in all fe/scalar cmov implementations
real-or-random Apr 1, 2023
2d51a45
Merge bitcoin-core/secp256k1#1257: ct: Use volatile "trick" in all fe…
real-or-random Apr 6, 2023
4e68262
Merge bitcoin-core/secp256k1#1226: Add CMake instructions to release …
jonasnick Apr 7, 2023
a0f4644
Merge bitcoin-core/secp256k1#1252: Make position of * in pointer decl…
real-or-random Apr 8, 2023
4485926
Add x-only ecmult_const version for x=n/d
sipa Jul 3, 2022
0f86420
Add exhaustive tests for ecmult_const_xonly
sipa Jan 11, 2023
e5de454
tests: Add Wycheproof ECDSA vectors
RandomLattice Mar 22, 2023
145078c
Merge bitcoin-core/secp256k1#1118: Add x-only ecmult_const version wi…
real-or-random Apr 10, 2023
7b7503d
Merge bitcoin-core/secp256k1#1245: tests: Add Wycheproof ECDSA vectors
sipa Apr 10, 2023
0e09166
changelog: Catch up in preparation of 0.3.1
real-or-random Apr 10, 2023
1d9a13f
changelog: Remove inconsistent newlines
real-or-random Apr 10, 2023
898e1c6
release: Prepare for 0.3.1
real-or-random Apr 10, 2023
ec98fce
Merge bitcoin-core/secp256k1#1266: release: Prepare for 0.3.1
jonasnick Apr 10, 2023
6a37b2a
changelog: Fix link
real-or-random Apr 10, 2023
346a053
Merge bitcoin-core/secp256k1#1269: changelog: Fix link
jonasnick Apr 10, 2023
a9a5c24
Merge commits '56582094 427bc3cd 0cf2fb91 9c8c4f44 70be3cad f16a709f …
jonasnick Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.3.1] - 2023-04-10
We strongly recommend updating to 0.3.1 if you use or plan to use Clang >=14 to compile libsecp256k1, e.g., Xcode >=14 on macOS has Clang >=14. When in doubt, check the Clang version using `clang -v`.

#### Security
- Fix "constant-timeness" issue with Clang >=14 that could leave applications using libsecp256k1 vulnerable to a timing side-channel attack. The fix avoids secret-dependent control flow and secret-dependent memory accesses in conditional moves of memory objects when libsecp256k1 is compiled with Clang >=14.

#### Added
- Added tests against [Project Wycheproof's](https://github.com/google/wycheproof/) set of ECDSA test vectors (Bitcoin "low-S" variant), a fixed set of test cases designed to trigger various edge cases.

#### Changed
- Increased minimum required CMake version to 3.13. CMake builds remain experimental.

#### ABI Compatibility
The ABI is compatible with version 0.3.0.

## [0.3.0] - 2023-03-08

Expand All @@ -28,7 +41,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed the configuration header `src/libsecp256k1-config.h`. We recommend passing flags to `./configure` or `cmake` to set configuration options (see `./configure --help` or `cmake -LH`). If you cannot or do not want to use one of the supported build systems, pass configuration flags such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG` manually to the compiler (see the file `configure.ac` for supported flags).

#### ABI Compatibility

Due to changes in the API regarding `secp256k1_context_static` described above, the ABI is *not* compatible with previous versions.

## [0.2.0] - 2022-12-12
Expand All @@ -48,7 +60,6 @@ Due to changes in the API regarding `secp256k1_context_static` described above,
- Module `schnorrsig`: renamed `secp256k1_schnorrsig_sign` to `secp256k1_schnorrsig_sign32`.

#### ABI Compatibility

Since this is the first release, we do not compare application binary interfaces.
However, there are earlier unreleased versions of libsecp256k1 that are *not* ABI compatible with this version.

Expand All @@ -59,6 +70,7 @@ The number was given by the build system since the introduction of autotools in
Therefore, this version number does not uniquely identify a set of source files.

[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.0...HEAD
[0.3.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/bitcoin-core/secp256k1/compare/423b6d19d373f1224fd671a982584d7e7900bc93..v0.2.0
[0.1.0]: https://github.com/bitcoin-core/secp256k1/commit/423b6d19d373f1224fd671a982584d7e7900bc93
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.13)

if(CMAKE_VERSION VERSION_GREATER 3.14)
# MSVC runtime library flags are selected by the CMAKE_MSVC_RUNTIME_LIBRARY abstraction.
Expand All @@ -10,15 +10,15 @@ endif()
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
# the API. All changes in experimental modules are treated as
# backwards-compatible and therefore at most increase the minor version.
project(libsecp256k1 VERSION 0.3.0 LANGUAGES C)
project(libsecp256k1 VERSION 0.3.1 LANGUAGES C)

# The library version is based on libtool versioning of the ABI. The set of
# rules for updating the version can be found here:
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# All changes in experimental modules are treated as if they don't affect the
# interface and therefore only increase the revision.
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 2)
set(${PROJECT_NAME}_LIB_VERSION_REVISION 0)
set(${PROJECT_NAME}_LIB_VERSION_REVISION 1)
set(${PROJECT_NAME}_LIB_VERSION_AGE 0)

set(CMAKE_C_STANDARD 90)
Expand Down Expand Up @@ -147,7 +147,7 @@ else()
endif()

# Define custom "Coverage" build type.
set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0 -DCOVERAGE=1 --coverage -Wno-unused-parameter" CACHE STRING
set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0 -DCOVERAGE=1 --coverage" CACHE STRING
"Flags used by the C compiler during \"Coverage\" builds."
FORCE
)
Expand Down Expand Up @@ -203,11 +203,6 @@ else()
try_add_compile_option(-Wundef)
endif()

if(CMAKE_VERSION VERSION_GREATER 3.2)
# Honor visibility properties for all target types.
# See: https://cmake.org/cmake/help/latest/policy/CMP0063.html
cmake_policy(SET CMP0063 NEW)
endif()
set(CMAKE_C_VISIBILITY_PRESET hidden)

# Ask CTest to create a "check" target (e.g., make check) as alias for the "test" target.
Expand Down
17 changes: 17 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,20 @@ endif
if ENABLE_MODULE_ECDSA_ADAPTOR
include src/modules/ecdsa_adaptor/Makefile.am.include
endif

EXTRA_DIST += src/wycheproof/WYCHEPROOF_COPYING
EXTRA_DIST += src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h
EXTRA_DIST += src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json
EXTRA_DIST += tools/tests_wycheproof_generate.py

TESTVECTORS = src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h

src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h: src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json
python3 tools/tests_wycheproof_generate.py $< > $@

testvectors: $(TESTVECTORS)

maintainer-clean-testvectors: clean-testvectors

clean-testvectors:
rm -f $(TESTVECTORS)
4 changes: 2 additions & 2 deletions ci/cirrus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ fi
# Rebuild precomputed files (if not cross-compiling).
if [ -z "$HOST" ]
then
make clean-precomp
make precomp
make clean-precomp clean-testvectors
make precomp testvectors
fi

# Check that no repo files have been modified by the build.
Expand Down
22 changes: 18 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ AM_INIT_AUTOMAKE([1.11.2 foreign subdir-objects])
# Make the compilation flags quiet unless V=1 is used.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

if test "${CFLAGS+set}" = "set"; then
CFLAGS_overridden=yes
else
CFLAGS_overridden=no
fi
AC_PROG_CC
AM_PROG_AS
AM_PROG_AR
Expand Down Expand Up @@ -88,11 +93,14 @@ esac
AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
# GCC and compatible (incl. clang)
if test "x$GCC" = "xyes"; then
# Try to append -Werror=unknown-warning-option to CFLAGS temporarily. Otherwise clang will
# not error out if it gets unknown warning flags and the checks here will always succeed
# no matter if clang knows the flag or not.
# Try to append -Werror to CFLAGS temporarily. Otherwise checks for some unsupported
# flags will succeed.
# Note that failure to append -Werror does not necessarily mean that -Werror is not
# supported. The compiler may already be warning about something unrelated, for example
# about some path issue. If that is the case, -Werror cannot be used because all
# of those warnings would be turned into errors.
SECP_TRY_APPEND_DEFAULT_CFLAGS_saved_CFLAGS="$CFLAGS"
SECP_TRY_APPEND_CFLAGS([-Werror=unknown-warning-option], CFLAGS)
SECP_TRY_APPEND_CFLAGS([-Werror], CFLAGS)

SECP_TRY_APPEND_CFLAGS([-std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef], $1) # GCC >= 3.0, -Wlong-long is implied by -pedantic.
SECP_TRY_APPEND_CFLAGS([-Wno-overlength-strings], $1) # GCC >= 4.2, -Woverlength-strings is implied by -pedantic.
Expand Down Expand Up @@ -286,6 +294,12 @@ fi
if test x"$enable_coverage" = x"yes"; then
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOVERAGE=1"
SECP_CFLAGS="-O0 --coverage $SECP_CFLAGS"
# If coverage is enabled, and the user has not overridden CFLAGS,
# override Autoconf's value "-g -O2" with "-g". Otherwise we'd end up
# with "-O0 --coverage -g -O2".
if test "$CFLAGS_overridden" = "no"; then
CFLAGS="-g"
fi
LDFLAGS="--coverage $LDFLAGS"
else
# Most likely the CFLAGS already contain -O2 because that is autoconf's default.
Expand Down
15 changes: 11 additions & 4 deletions doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ This process also assumes that there will be no minor releases for old major rel
## Regular release

1. Open a PR to the master branch with a commit (using message `"release: prepare for $MAJOR.$MINOR.$PATCH"`, for example) that
* finalizes the release notes in [CHANGELOG.md](../CHANGELOG.md) (make sure to include an entry for `### ABI Compatibility`) and
* updates `_PKG_VERSION_*`, `_LIB_VERSION_*`, and sets `_PKG_VERSION_IS_RELEASE` to `true` in `configure.ac`.
* finalizes the release notes in [CHANGELOG.md](../CHANGELOG.md) (make sure to include an entry for `### ABI Compatibility`),
* updates `_PKG_VERSION_*` and `_LIB_VERSION_*` and sets `_PKG_VERSION_IS_RELEASE` to `true` in `configure.ac`, and
* updates `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_*` in `CMakeLists.txt`.
2. After the PR is merged, tag the commit and push it:
```
RELEASE_COMMIT=<merge commit of step 1>
git tag -s v$MAJOR.$MINOR.$PATCH -m "libsecp256k1 $MAJOR.$MINOR.$PATCH" $RELEASE_COMMIT
git push [email protected]:bitcoin-core/secp256k1.git v$MAJOR.$MINOR.$PATCH
```
3. Open a PR to the master branch with a commit (using message `"release cleanup: 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.
3. Open a PR to the master branch with a commit (using message `"release cleanup: bump version after $MAJOR.$MINOR.$PATCH"`, for example) that
* sets `_PKG_VERSION_IS_RELEASE` to `false` and increments `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac`, and
* increments the `$PATCH` component of `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_REVISION` in `CMakeLists.txt`.

If other maintainers are not present to approve the PR, it can be merged without ACKs.
4. Create a new GitHub release with a link to the corresponding entry in [CHANGELOG.md](../CHANGELOG.md).

## Maintenance release
Expand All @@ -38,7 +43,9 @@ Note that bugfixes only need to be backported to releases for which no compatibl
2. Open a pull request to the `$MAJOR.$MINOR` branch that
* includes the bugfixes,
* finalizes the release notes,
* 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).
* increments `_PKG_VERSION_PATCH` and `_LIB_VERSION_REVISION` in `configure.ac`
and the `$PATCH` component of `project(libsecp256k1 VERSION ...)` and `${PROJECT_NAME}_LIB_VERSION_REVISION` in `CMakeLists.txt`
(with commit message `"release: bump versions for $MAJOR.$MINOR.$PATCH"`, for example).
3. After the PRs are merged, update the release branch and tag the commit:
```
git checkout $MAJOR.$MINOR && git pull
Expand Down
Loading