Skip to content

Commit 270d2b3

Browse files
committed
Squashed 'src/secp256k1/' changes from acf5c55..c545fdc
c545fdc Merge bitcoin-core/secp256k1#1298: Remove randomness tests b40e2d3 Merge bitcoin-core/secp256k1#1378: ellswift: fix probabilistic test failure when swapping sides c424e2f ellswift: fix probabilistic test failure when swapping sides 907a672 Merge bitcoin-core/secp256k1#1313: ci: Test on development snapshots of GCC and Clang 0f7657d Merge bitcoin-core/secp256k1#1366: field: Use `restrict` consistently in fe_sqrt cc55757 Merge bitcoin-core/secp256k1#1340: clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 600c5ad clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 981e5be ci: Fix typo in comment e9e9648 ci: Reduce number of macOS tasks from 28 to 8 609093b ci: Add x86_64 Linux tasks for gcc and clang snapshots 1deecaa ci: Install development snapshots of gcc and clang b79ba8a field: Use `restrict` consistently in fe_sqrt c9ebca9 Merge bitcoin-core/secp256k1#1363: doc: minor ellswift.md updates afd7eb4 Merge bitcoin-core/secp256k1#1371: Add exhaustive tests for ellswift (with create+decode roundtrip) 2792119 Add exhaustive test for ellswift (create+decode roundtrip) c7d900f doc: minor ellswift.md updates 332af31 Merge bitcoin-core/secp256k1#1344: group: save normalize_weak calls in `secp256k1_ge_is_valid_var`/`secp256k1_gej_eq_x_var` 9e6d1b0 Merge bitcoin-core/secp256k1#1367: build: Improvements to symbol visibility logic on Windows (attempt 3) 0aacf64 Merge bitcoin-core/secp256k1#1370: Corrected some typos b6b9834 small fixes 07c0e8b group: remove unneeded normalize_weak in `secp256k1_gej_eq_x_var` 3fc1de5 Merge bitcoin-core/secp256k1#1364: Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` fb758fe Merge bitcoin-core/secp256k1#1323: tweak_add: fix API doc for tweak=0 c6cd2b1 ci: Add task for static library on Windows + CMake 020bf69 build: Add extensive docs on visibility issues 0196e8a build: Introduce `SECP256k1_DLL_EXPORT` macro 9f1b190 refactor: Replace `SECP256K1_API_VAR` with `SECP256K1_API` ae9db95 build: Introduce `SECP256K1_STATIC` macro for Windows users 7966aee Merge bitcoin-core/secp256k1#1369: ci: Print commit in Windows container a7bec34 ci: Print commit in Windows container 249c81e Merge bitcoin-core/secp256k1#1368: ci: Drop manual checkout of merge commit 98579e2 ci: Drop manual checkout of merge commit 5b9f37f ci: Add `CFLAGS: -O1` to task matrix a6ca76c Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` 0fa84f8 Merge bitcoin-core/secp256k1#1358: tests: introduce helper for non-zero `random_fe_test()` results 5a95a26 tests: introduce helper for non-zero `random_fe_test` results 304421d tests: refactor: remove duplicate function `random_field_element_test` 3aef6ab Merge bitcoin-core/secp256k1#1345: field: Static-assert that int args affecting magnitude are constant 4494a36 Merge bitcoin-core/secp256k1#1357: tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 799f4ee Merge bitcoin-core/secp256k1#1356: ci: Adjust Docker image to Debian 12 "bookworm" c862a9f ci: Adjust Docker image to Debian 12 "bookworm" a178209 ci: Force DWARF v4 for Clang when Valgrind tests are expected 7d8d5c8 tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 8a72734 Help the compiler prove that a loop is entered fd491ea Merge bitcoin-core/secp256k1#1355: Fix a typo in the error message ac43613 Merge bitcoin-core/secp256k1#1354: Add ellswift to CHANGELOG 67887ae Fix a typo in the error message 926dd3e Merge bitcoin-core/secp256k1#1295: abi: Use dllexport for mingw builds 1083683 Merge bitcoin-core/secp256k1#1336: Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 7c7467a Refer to ellswift.md in API docs c32ffd8 Add ellswift to CHANGELOG 3c1a0fd Merge bitcoin-core/secp256k1#1347: field: Document return value of fe_sqrt() 705ce7e Merge bitcoin-core/secp256k1#1129: ElligatorSwift + integrated x-only DH 0702ecb Merge bitcoin-core/secp256k1#1338: Drop no longer needed `#include "../include/secp256k1.h"` 5779137 field: Document return value of fe_sqrt() 90e360a Add doc/ellswift.md with ElligatorSwift explanation 4f09184 Add ellswift testing to CI 1bcea8c Add benchmarks for ellswift module 2d1d41a Add ctime tests for ellswift module df633cd Add _prefix and _bip324 ellswift_xdh hash functions 9695deb Add tests for ellswift module c47917b Add ellswift module implementing ElligatorSwift 79e5b2a Add functions to test if X coordinate is valid a597a5a Add benchmark for key generation 30574f2 Merge bitcoin-core/secp256k1#1349: Normalize ge produced from secp256k1_pubkey_load 45c5ca7 Merge bitcoin-core/secp256k1#1350: scalar: introduce and use `secp256k1_{read,write}_be64` helpers f165252 Normalize ge produced from secp256k1_pubkey_load 7067ee5 tests: add tests for `secp256k1_{read,write}_be64` 740528c scalar: use newly introduced `secp256k1_{read,write}_be64` helpers (4x64 impl.) be8ff3a field: Static-assert that int args affecting magnitude are constant efa76c4 group: remove unneeded normalize_weak in `secp256k1_ge_is_valid_var` 67214f5 Merge bitcoin-core/secp256k1#1339: scalar: refactor: use `secp256k1_{read,write}_be32` helpers cb1a592 Merge bitcoin-core/secp256k1#1341: docs: correct `pubkey` param descriptions for `secp256k1_keypair_{xonly_,}pub` f364428 docs: correct `pubkey` param descriptions for `secp256k1_keypair_{xonly_,}pub` 887183e scalar: use `secp256k1_{read,write}_be32` helpers (4x64 impl.) 52b8423 scalar: use `secp256k1_{read,write}_be32` helpers (8x32 impl.) e449af6 Drop no longer needed `#include "../include/secp256k1.h"` 5b7bf2e Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 60556c9 Merge bitcoin-core/secp256k1#1337: ci: Fix error D8037 in `cl.exe` (attempt 2) db29bf2 ci: Remove quirk that runs dummy command after wineserver c7db494 ci: Fix error D8037 in `cl.exe` 7dae115 Revert "ci: Move wine prefix to /tmp to avoid error D8037 in cl.exe" bf29f8d Merge bitcoin-core/secp256k1#1334: fix input range comment for `secp256k1_fe_add_int` 605e07e fix input range comment for `secp256k1_fe_add_int` debf3e5 Merge bitcoin-core/secp256k1#1330: refactor: take use of `secp256k1_scalar_{zero,one}` constants d75dc59 Merge bitcoin-core/secp256k1#1333: test: Warn if both `VERIFY` and `COVERAGE` are defined ade5b36 tests: add checks for scalar constants `secp256k1_scalar_{zero,one}` e83801f test: Warn if both `VERIFY` and `COVERAGE` are defined 654246c refactor: take use of `secp256k1_scalar_{zero,one}` constants 908e02d Merge bitcoin-core/secp256k1#1328: build: Bump MSVC warning level up to W3 1549db0 build: Level up MSVC warnings 20a5da5 Merge bitcoin-core/secp256k1#1310: Refine release process 05873bb tweak_add: fix API doc for tweak=0 ad84603 release process: clarify change log updates 6348bc7 release process: fix process for maintenance release 79fa50b release process: mention targeted release schedule 1652067 release process: add sanity checks 09df0bf Merge bitcoin-core/secp256k1#1327: ci: Move wine prefix to /tmp to avoid error D8037 in cl.exe 27504d5 ci: Move wine prefix to /tmp to avoid error D8037 in cl.exe d373a72 Merge bitcoin-core/secp256k1#1316: Do not invoke fe_is_zero on failed set_b32_limit 6433175 Do not invoke fe_is_zero on failed set_b32_limit 5f7903c Merge bitcoin-core/secp256k1#1318: build: Enable -DVERIFY for precomputation binaries e9e4526 Merge bitcoin-core/secp256k1#1317: Make fe_cmov take max of magnitudes 5768b50 build: Enable -DVERIFY for precomputation binaries 31b4bbe Make fe_cmov take max of magnitudes 83186db Merge bitcoin-core/secp256k1#1314: release cleanup: bump version after 0.3.2 95448ef release cleanup: bump version after 0.3.2 6ec3731 Simplify test PRNG implementation fb5bfa4 Add static test vector for Xoshiro256++ 723e8ca Remove randomness tests bc7c8db abi: Use dllexport for mingw builds git-subtree-dir: src/secp256k1 git-subtree-split: c545fdc374964424683d9dac31a828adedabe860
1 parent 8a43918 commit 270d2b3

Some content is hidden

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

53 files changed

+2608
-490
lines changed

.cirrus.yml

+37-33
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
ECDH: no
2222
RECOVERY: no
2323
SCHNORRSIG: no
24+
ELLSWIFT: no
2425
### test options
2526
SECP256K1_TEST_ITERS:
2627
BENCH: yes
@@ -53,12 +54,6 @@ cat_logs_snippet: &CAT_LOGS
5354
cat_ci_env_script:
5455
- env
5556

56-
merge_base_script_snippet: &MERGE_BASE
57-
merge_base_script:
58-
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
59-
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
60-
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
61-
6257
linux_container_snippet: &LINUX_CONTAINER
6358
container:
6459
dockerfile: ci/linux-debian.Dockerfile
@@ -67,32 +62,36 @@ linux_container_snippet: &LINUX_CONTAINER
6762
# Gives us more CPUs for free if they're available.
6863
greedy: true
6964
# More than enough for our scripts.
70-
memory: 1G
65+
memory: 2G
7166

7267
task:
7368
name: "x86_64: Linux (Debian stable)"
7469
<< : *LINUX_CONTAINER
75-
matrix: &ENV_MATRIX
70+
matrix:
7671
- env: {WIDEMUL: int64, RECOVERY: yes}
77-
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes}
72+
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
7873
- env: {WIDEMUL: int128}
79-
- env: {WIDEMUL: int128_struct}
80-
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
74+
- env: {WIDEMUL: int128_struct, ELLSWIFT: yes}
75+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
8176
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes}
82-
- env: {WIDEMUL: int128, ASM: x86_64}
77+
- env: {WIDEMUL: int128, ASM: x86_64 , ELLSWIFT: yes}
8378
- env: { RECOVERY: yes, SCHNORRSIG: yes}
8479
- env: {CTIMETESTS: no, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, CPPFLAGS: -DVERIFY}
8580
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
8681
- env: {CPPFLAGS: -DDETERMINISTIC}
8782
- env: {CFLAGS: -O0, CTIMETESTS: no}
83+
- env: {CFLAGS: -O1, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
8884
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
8985
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
9086
matrix:
9187
- env:
9288
CC: gcc
9389
- env:
9490
CC: clang
95-
<< : *MERGE_BASE
91+
- env:
92+
CC: gcc-snapshot
93+
- env:
94+
CC: clang-snapshot
9695
test_script:
9796
- ./ci/cirrus.sh
9897
<< : *CAT_LOGS
@@ -110,7 +109,6 @@ task:
110109
CC: i686-linux-gnu-gcc
111110
- env:
112111
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
113-
<< : *MERGE_BASE
114112
test_script:
115113
- ./ci/cirrus.sh
116114
<< : *CAT_LOGS
@@ -124,20 +122,22 @@ task:
124122
HOMEBREW_NO_INSTALL_CLEANUP: 1
125123
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
126124
MAKEFLAGS: -j5
127-
matrix:
128-
<< : *ENV_MATRIX
129125
env:
130126
ASM: no
131127
WITH_VALGRIND: no
132128
CTIMETESTS: no
129+
CC: clang
133130
matrix:
134-
- env:
135-
CC: gcc
136-
- env:
137-
CC: clang
131+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
132+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
133+
- env: {WIDEMUL: int128_struct, ECMULTGENPRECISION: 2, ECMULTWINDOW: 4}
134+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
135+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
136+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
137+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CPPFLAGS: -DVERIFY}
138+
- env: {BUILD: distcheck}
138139
brew_script:
139140
- brew install automake libtool gcc
140-
<< : *MERGE_BASE
141141
test_script:
142142
- ./ci/cirrus.sh
143143
<< : *CAT_LOGS
@@ -154,8 +154,8 @@ task:
154154
ECDH: yes
155155
RECOVERY: yes
156156
SCHNORRSIG: yes
157+
ELLSWIFT: yes
157158
CTIMETESTS: no
158-
<< : *MERGE_BASE
159159
test_script:
160160
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
161161
- rm /etc/ld.so.cache
@@ -173,11 +173,11 @@ task:
173173
ECDH: yes
174174
RECOVERY: yes
175175
SCHNORRSIG: yes
176+
ELLSWIFT: yes
176177
CTIMETESTS: no
177178
matrix:
178179
- env: {}
179180
- env: {EXPERIMENTAL: yes, ASM: arm32}
180-
<< : *MERGE_BASE
181181
test_script:
182182
- ./ci/cirrus.sh
183183
<< : *CAT_LOGS
@@ -193,8 +193,8 @@ task:
193193
ECDH: yes
194194
RECOVERY: yes
195195
SCHNORRSIG: yes
196+
ELLSWIFT: yes
196197
CTIMETESTS: no
197-
<< : *MERGE_BASE
198198
test_script:
199199
- ./ci/cirrus.sh
200200
<< : *CAT_LOGS
@@ -210,8 +210,8 @@ task:
210210
ECDH: yes
211211
RECOVERY: yes
212212
SCHNORRSIG: yes
213+
ELLSWIFT: yes
213214
CTIMETESTS: no
214-
<< : *MERGE_BASE
215215
test_script:
216216
- ./ci/cirrus.sh
217217
<< : *CAT_LOGS
@@ -232,7 +232,6 @@ task:
232232
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
233233
env:
234234
HOST: i686-w64-mingw32
235-
<< : *MERGE_BASE
236235
test_script:
237236
- ./ci/cirrus.sh
238237
<< : *CAT_LOGS
@@ -247,6 +246,7 @@ task:
247246
RECOVERY: yes
248247
EXPERIMENTAL: yes
249248
SCHNORRSIG: yes
249+
ELLSWIFT: yes
250250
CTIMETESTS: no
251251
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
252252
# This will detect some MinGW-w64 tools but then make will need only
@@ -274,7 +274,6 @@ task:
274274
CC: /opt/msvc/bin/x86/cl
275275
AR: /opt/msvc/bin/x86/lib
276276
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
277-
<< : *MERGE_BASE
278277
test_script:
279278
- ./ci/cirrus.sh
280279
<< : *CAT_LOGS
@@ -286,6 +285,7 @@ task:
286285
ECDH: yes
287286
RECOVERY: yes
288287
SCHNORRSIG: yes
288+
ELLSWIFT: yes
289289
CTIMETESTS: no
290290
matrix:
291291
- name: "Valgrind (memcheck)"
@@ -318,7 +318,6 @@ task:
318318
- env:
319319
HOST: i686-linux-gnu
320320
CC: i686-linux-gnu-gcc
321-
<< : *MERGE_BASE
322321
test_script:
323322
- ./ci/cirrus.sh
324323
<< : *CAT_LOGS
@@ -345,7 +344,6 @@ task:
345344
ECMULTGENPRECISION: 2
346345
ECMULTWINDOW: 2
347346
CFLAGS: "-fsanitize=memory -g -O3"
348-
<< : *MERGE_BASE
349347
test_script:
350348
- ./ci/cirrus.sh
351349
<< : *CAT_LOGS
@@ -361,7 +359,7 @@ task:
361359
ECDH: yes
362360
RECOVERY: yes
363361
SCHNORRSIG: yes
364-
<< : *MERGE_BASE
362+
ELLSWIFT: yes
365363
test_script:
366364
- ./ci/cirrus.sh
367365
<< : *CAT_LOGS
@@ -393,11 +391,17 @@ task:
393391
# Ignore MSBuild warning MSB8029.
394392
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
395393
IgnoreWarnIntDirInTempDetected: 'true'
396-
merge_script:
397-
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
394+
matrix:
395+
- env:
396+
BUILD_SHARED_LIBS: ON
397+
- env:
398+
BUILD_SHARED_LIBS: OFF
399+
git_show_script:
400+
# Print commit to allow reproducing the job outside of CI.
401+
- git show --no-patch
398402
configure_script:
399403
- '%x64_NATIVE_TOOLS%'
400-
- cmake -E env CFLAGS="/WX" cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
404+
- cmake -E env CFLAGS="/WX" cmake -A x64 -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
401405
build_script:
402406
- '%x64_NATIVE_TOOLS%'
403407
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ 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+
## [Unreleased]
9+
10+
#### Added
11+
- New module `ellswift` implements ElligatorSwift encoding for public keys and x-only Diffie-Hellman key exchange for them.
12+
ElligatorSwift permits representing secp256k1 public keys as 64-byte arrays which cannot be distinguished from uniformly random. See:
13+
- Header file `include/secp256k1_ellswift.h` which defines the new API.
14+
- Document `doc/ellswift.md` which explains the mathematical background of the scheme.
15+
- The [paper](https://eprint.iacr.org/2022/759) on which the scheme is based.
16+
17+
#### Changed
18+
- When consuming libsecp256k1 as a static library on Windows, the user must now define the `SECP256K1_STATIC` macro before including `secp256k1.h`.
19+
820
## [0.3.2] - 2023-05-13
921
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`.
1022

CMakeLists.txt

+13-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project(libsecp256k1
1111
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
1212
# the API. All changes in experimental modules are treated as
1313
# backwards-compatible and therefore at most increase the minor version.
14-
VERSION 0.3.2
14+
VERSION 0.3.3
1515
DESCRIPTION "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1."
1616
HOMEPAGE_URL "https://github.com/bitcoin-core/secp256k1"
1717
LANGUAGES C
@@ -35,7 +35,7 @@ endif()
3535
# All changes in experimental modules are treated as if they don't affect the
3636
# interface and therefore only increase the revision.
3737
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 2)
38-
set(${PROJECT_NAME}_LIB_VERSION_REVISION 2)
38+
set(${PROJECT_NAME}_LIB_VERSION_REVISION 3)
3939
set(${PROJECT_NAME}_LIB_VERSION_AGE 0)
4040

4141
set(CMAKE_C_STANDARD 90)
@@ -71,6 +71,11 @@ if(SECP256K1_ENABLE_MODULE_EXTRAKEYS)
7171
add_compile_definitions(ENABLE_MODULE_EXTRAKEYS=1)
7272
endif()
7373

74+
option(SECP256K1_ENABLE_MODULE_ELLSWIFT "Enable ElligatorSwift module." ON)
75+
if(SECP256K1_ENABLE_MODULE_ELLSWIFT)
76+
add_compile_definitions(ENABLE_MODULE_ELLSWIFT=1)
77+
endif()
78+
7479
option(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS "Enable external default callback functions." OFF)
7580
if(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS)
7681
add_compile_definitions(USE_EXTERNAL_DEFAULT_CALLBACKS=1)
@@ -212,8 +217,12 @@ endif()
212217
include(TryAppendCFlags)
213218
if(MSVC)
214219
# Keep the following commands ordered lexicographically.
215-
try_append_c_flags(/W2) # Moderate warning level.
220+
try_append_c_flags(/W3) # Production quality warning level.
216221
try_append_c_flags(/wd4146) # Disable warning C4146 "unary minus operator applied to unsigned type, result still unsigned".
222+
try_append_c_flags(/wd4244) # Disable warning C4244 "'conversion' conversion from 'type1' to 'type2', possible loss of data".
223+
try_append_c_flags(/wd4267) # Disable warning C4267 "'var' : conversion from 'size_t' to 'type', possible loss of data".
224+
# Eliminate deprecation warnings for the older, less secure functions.
225+
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
217226
else()
218227
# Keep the following commands ordered lexicographically.
219228
try_append_c_flags(-pedantic)
@@ -266,6 +275,7 @@ message(" ECDH ................................ ${SECP256K1_ENABLE_MODULE_ECDH}
266275
message(" ECDSA pubkey recovery ............... ${SECP256K1_ENABLE_MODULE_RECOVERY}")
267276
message(" extrakeys ........................... ${SECP256K1_ENABLE_MODULE_EXTRAKEYS}")
268277
message(" schnorrsig .......................... ${SECP256K1_ENABLE_MODULE_SCHNORRSIG}")
278+
message(" ElligatorSwift ...................... ${SECP256K1_ENABLE_MODULE_ELLSWIFT}")
269279
message("Parameters:")
270280
message(" ecmult window size .................. ${SECP256K1_ECMULT_WINDOW_SIZE}")
271281
message(" ecmult gen precision bits ........... ${SECP256K1_ECMULT_GEN_PREC_BITS}")

Makefile.am

+9-5
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ endif
153153
if USE_EXAMPLES
154154
noinst_PROGRAMS += ecdsa_example
155155
ecdsa_example_SOURCES = examples/ecdsa.c
156-
ecdsa_example_CPPFLAGS = -I$(top_srcdir)/include
156+
ecdsa_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
157157
ecdsa_example_LDADD = libsecp256k1.la
158158
ecdsa_example_LDFLAGS = -static
159159
if BUILD_WINDOWS
@@ -163,7 +163,7 @@ TESTS += ecdsa_example
163163
if ENABLE_MODULE_ECDH
164164
noinst_PROGRAMS += ecdh_example
165165
ecdh_example_SOURCES = examples/ecdh.c
166-
ecdh_example_CPPFLAGS = -I$(top_srcdir)/include
166+
ecdh_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
167167
ecdh_example_LDADD = libsecp256k1.la
168168
ecdh_example_LDFLAGS = -static
169169
if BUILD_WINDOWS
@@ -174,7 +174,7 @@ endif
174174
if ENABLE_MODULE_SCHNORRSIG
175175
noinst_PROGRAMS += schnorr_example
176176
schnorr_example_SOURCES = examples/schnorr.c
177-
schnorr_example_CPPFLAGS = -I$(top_srcdir)/include
177+
schnorr_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
178178
schnorr_example_LDADD = libsecp256k1.la
179179
schnorr_example_LDFLAGS = -static
180180
if BUILD_WINDOWS
@@ -189,11 +189,11 @@ EXTRA_PROGRAMS = precompute_ecmult precompute_ecmult_gen
189189
CLEANFILES = $(EXTRA_PROGRAMS)
190190

191191
precompute_ecmult_SOURCES = src/precompute_ecmult.c
192-
precompute_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES)
192+
precompute_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES) -DVERIFY
193193
precompute_ecmult_LDADD = $(COMMON_LIB)
194194

195195
precompute_ecmult_gen_SOURCES = src/precompute_ecmult_gen.c
196-
precompute_ecmult_gen_CPPFLAGS = $(SECP_CONFIG_DEFINES)
196+
precompute_ecmult_gen_CPPFLAGS = $(SECP_CONFIG_DEFINES) -DVERIFY
197197
precompute_ecmult_gen_LDADD = $(COMMON_LIB)
198198

199199
# See Automake manual, Section "Errors with distclean".
@@ -267,3 +267,7 @@ endif
267267
if ENABLE_MODULE_SCHNORRSIG
268268
include src/modules/schnorrsig/Makefile.am.include
269269
endif
270+
271+
if ENABLE_MODULE_ELLSWIFT
272+
include src/modules/ellswift/Makefile.am.include
273+
endif

ci/cirrus.sh

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -eux
44

55
export LC_ALL=C
66

7-
# Print relevant CI environment to allow reproducing the job outside of CI.
7+
# Print commit and relevant CI environment to allow reproducing the job outside of CI.
8+
git show --no-patch
89
print_environment() {
910
# Turn off -x because it messes up the output
1011
set +x
@@ -36,8 +37,7 @@ case "$WRAPPER_CMD" in
3637
*wine*)
3738
# Make sure to shutdown wineserver whenever we exit.
3839
trap "wineserver -k || true" EXIT INT HUP
39-
# This is apparently only reliable when we run a dummy command such as "hh.exe" afterwards.
40-
wineserver -p && wine hh.exe
40+
wineserver -p
4141
;;
4242
esac
4343

@@ -54,6 +54,22 @@ if [ -n "$WRAPPER_CMD" ]; then
5454
$WRAPPER_CMD --version
5555
fi
5656

57+
# Workaround for https://bugs.kde.org/show_bug.cgi?id=452758 (fixed in valgrind 3.20.0).
58+
case "${CC:-undefined}" in
59+
clang*)
60+
if [ "$CTIMETESTS" = "yes" ] && [ "$WITH_VALGRIND" = "yes" ]
61+
then
62+
export CFLAGS="${CFLAGS:+$CFLAGS }-gdwarf-4"
63+
else
64+
case "$WRAPPER_CMD" in
65+
valgrind*)
66+
export CFLAGS="${CFLAGS:+$CFLAGS }-gdwarf-4"
67+
;;
68+
esac
69+
fi
70+
;;
71+
esac
72+
5773
./autogen.sh
5874

5975
./configure \
@@ -62,6 +78,7 @@ fi
6278
--with-ecmult-window="$ECMULTWINDOW" \
6379
--with-ecmult-gen-precision="$ECMULTGENPRECISION" \
6480
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
81+
--enable-module-ellswift="$ELLSWIFT" \
6582
--enable-module-schnorrsig="$SCHNORRSIG" \
6683
--enable-examples="$EXAMPLES" \
6784
--enable-ctime-tests="$CTIMETESTS" \

0 commit comments

Comments
 (0)