mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
ff061fde18
c545fdc374 Merge bitcoin-core/secp256k1#1298: Remove randomness tests b40e2d30b7 Merge bitcoin-core/secp256k1#1378: ellswift: fix probabilistic test failure when swapping sides c424e2fb43 ellswift: fix probabilistic test failure when swapping sides 907a67212e Merge bitcoin-core/secp256k1#1313: ci: Test on development snapshots of GCC and Clang 0f7657d59c Merge bitcoin-core/secp256k1#1366: field: Use `restrict` consistently in fe_sqrt cc55757552 Merge bitcoin-core/secp256k1#1340: clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 600c5adcd5 clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3) 981e5be38c ci: Fix typo in comment e9e9648219 ci: Reduce number of macOS tasks from 28 to 8 609093b387 ci: Add x86_64 Linux tasks for gcc and clang snapshots 1deecaaf3b ci: Install development snapshots of gcc and clang b79ba8aa4c field: Use `restrict` consistently in fe_sqrt c9ebca95f9 Merge bitcoin-core/secp256k1#1363: doc: minor ellswift.md updates afd7eb4a55 Merge bitcoin-core/secp256k1#1371: Add exhaustive tests for ellswift (with create+decode roundtrip) 2792119278 Add exhaustive test for ellswift (create+decode roundtrip) c7d900ffd1 doc: minor ellswift.md updates 332af315fc Merge bitcoin-core/secp256k1#1344: group: save normalize_weak calls in `secp256k1_ge_is_valid_var`/`secp256k1_gej_eq_x_var` 9e6d1b0e9b Merge bitcoin-core/secp256k1#1367: build: Improvements to symbol visibility logic on Windows (attempt 3) 0aacf64352 Merge bitcoin-core/secp256k1#1370: Corrected some typos b6b9834e8d small fixes 07c0e8b82e group: remove unneeded normalize_weak in `secp256k1_gej_eq_x_var` 3fc1de5c55 Merge bitcoin-core/secp256k1#1364: Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` fb758fe8d6 Merge bitcoin-core/secp256k1#1323: tweak_add: fix API doc for tweak=0 c6cd2b15a0 ci: Add task for static library on Windows + CMake 020bf69a44 build: Add extensive docs on visibility issues 0196e8ade1 build: Introduce `SECP256k1_DLL_EXPORT` macro 9f1b1904a3 refactor: Replace `SECP256K1_API_VAR` with `SECP256K1_API` ae9db95cea build: Introduce `SECP256K1_STATIC` macro for Windows users 7966aee31d Merge bitcoin-core/secp256k1#1369: ci: Print commit in Windows container a7bec34231 ci: Print commit in Windows container 249c81eaa3 Merge bitcoin-core/secp256k1#1368: ci: Drop manual checkout of merge commit 98579e297b ci: Drop manual checkout of merge commit 5b9f37f136 ci: Add `CFLAGS: -O1` to task matrix a6ca76cdf2 Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1` 0fa84f869d Merge bitcoin-core/secp256k1#1358: tests: introduce helper for non-zero `random_fe_test()` results 5a95a268b9 tests: introduce helper for non-zero `random_fe_test` results 304421d57b tests: refactor: remove duplicate function `random_field_element_test` 3aef6ab8e1 Merge bitcoin-core/secp256k1#1345: field: Static-assert that int args affecting magnitude are constant 4494a369b6 Merge bitcoin-core/secp256k1#1357: tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 799f4eec27 Merge bitcoin-core/secp256k1#1356: ci: Adjust Docker image to Debian 12 "bookworm" c862a9fb49 ci: Adjust Docker image to Debian 12 "bookworm" a1782098a9 ci: Force DWARF v4 for Clang when Valgrind tests are expected 7d8d5c86df tests: refactor: take use of `secp256k1_ge_x_on_curve_var` 8a7273465b Help the compiler prove that a loop is entered fd491ea1bb Merge bitcoin-core/secp256k1#1355: Fix a typo in the error message ac43613d25 Merge bitcoin-core/secp256k1#1354: Add ellswift to CHANGELOG 67887ae65c Fix a typo in the error message 926dd3e962 Merge bitcoin-core/secp256k1#1295: abi: Use dllexport for mingw builds 10836832e7 Merge bitcoin-core/secp256k1#1336: Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 7c7467ab7f Refer to ellswift.md in API docs c32ffd8d8c Add ellswift to CHANGELOG 3c1a0fd37f Merge bitcoin-core/secp256k1#1347: field: Document return value of fe_sqrt() 5779137457 field: Document return value of fe_sqrt() be8ff3a02a field: Static-assert that int args affecting magnitude are constant efa76c4bf7 group: remove unneeded normalize_weak in `secp256k1_ge_is_valid_var` 5b7bf2e9d4 Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC 05873bb6b1 tweak_add: fix API doc for tweak=0 6ec3731e8c Simplify test PRNG implementation fb5bfa4eed Add static test vector for Xoshiro256++ 723e8ca8f7 Remove randomness tests bc7c8db179 abi: Use dllexport for mingw builds git-subtree-dir: src/secp256k1 git-subtree-split: c545fdc374964424683d9dac31a828adedabe860
413 lines
11 KiB
YAML
413 lines
11 KiB
YAML
env:
|
|
### cirrus config
|
|
CIRRUS_CLONE_DEPTH: 1
|
|
### compiler options
|
|
HOST:
|
|
WRAPPER_CMD:
|
|
# Specific warnings can be disabled with -Wno-error=foo.
|
|
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
|
|
WERROR_CFLAGS: -Werror -pedantic-errors
|
|
MAKEFLAGS: -j4
|
|
BUILD: check
|
|
### secp256k1 config
|
|
ECMULTWINDOW: auto
|
|
ECMULTGENPRECISION: auto
|
|
ASM: no
|
|
WIDEMUL: auto
|
|
WITH_VALGRIND: yes
|
|
EXTRAFLAGS:
|
|
### secp256k1 modules
|
|
EXPERIMENTAL: no
|
|
ECDH: no
|
|
RECOVERY: no
|
|
SCHNORRSIG: no
|
|
ELLSWIFT: no
|
|
### test options
|
|
SECP256K1_TEST_ITERS:
|
|
BENCH: yes
|
|
SECP256K1_BENCH_ITERS: 2
|
|
CTIMETESTS: yes
|
|
# Compile and run the tests
|
|
EXAMPLES: yes
|
|
|
|
# https://cirrus-ci.org/pricing/#compute-credits
|
|
credits_snippet: &CREDITS
|
|
# Don't use any credits for now.
|
|
use_compute_credits: false
|
|
|
|
cat_logs_snippet: &CAT_LOGS
|
|
always:
|
|
cat_tests_log_script:
|
|
- cat tests.log || true
|
|
cat_noverify_tests_log_script:
|
|
- cat noverify_tests.log || true
|
|
cat_exhaustive_tests_log_script:
|
|
- cat exhaustive_tests.log || true
|
|
cat_ctime_tests_log_script:
|
|
- cat ctime_tests.log || true
|
|
cat_bench_log_script:
|
|
- cat bench.log || true
|
|
cat_config_log_script:
|
|
- cat config.log || true
|
|
cat_test_env_script:
|
|
- cat test_env.log || true
|
|
cat_ci_env_script:
|
|
- env
|
|
|
|
linux_container_snippet: &LINUX_CONTAINER
|
|
container:
|
|
dockerfile: ci/linux-debian.Dockerfile
|
|
# Reduce number of CPUs to be able to do more builds in parallel.
|
|
cpu: 1
|
|
# Gives us more CPUs for free if they're available.
|
|
greedy: true
|
|
# More than enough for our scripts.
|
|
memory: 2G
|
|
|
|
task:
|
|
name: "x86_64: Linux (Debian stable)"
|
|
<< : *LINUX_CONTAINER
|
|
matrix:
|
|
- env: {WIDEMUL: int64, RECOVERY: yes}
|
|
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
|
|
- env: {WIDEMUL: int128}
|
|
- env: {WIDEMUL: int128_struct, ELLSWIFT: yes}
|
|
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
|
|
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes}
|
|
- env: {WIDEMUL: int128, ASM: x86_64 , ELLSWIFT: yes}
|
|
- env: { RECOVERY: yes, SCHNORRSIG: yes}
|
|
- env: {CTIMETESTS: no, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, CPPFLAGS: -DVERIFY}
|
|
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
|
|
- env: {CPPFLAGS: -DDETERMINISTIC}
|
|
- env: {CFLAGS: -O0, CTIMETESTS: no}
|
|
- env: {CFLAGS: -O1, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
|
|
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
|
|
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
|
|
matrix:
|
|
- env:
|
|
CC: gcc
|
|
- env:
|
|
CC: clang
|
|
- env:
|
|
CC: gcc-snapshot
|
|
- env:
|
|
CC: clang-snapshot
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "i686: Linux (Debian stable)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
HOST: i686-linux-gnu
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
matrix:
|
|
- env:
|
|
CC: i686-linux-gnu-gcc
|
|
- env:
|
|
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "arm64: macOS Ventura"
|
|
macos_instance:
|
|
image: ghcr.io/cirruslabs/macos-ventura-base:latest
|
|
env:
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
|
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
|
|
MAKEFLAGS: -j5
|
|
env:
|
|
ASM: no
|
|
WITH_VALGRIND: no
|
|
CTIMETESTS: no
|
|
CC: clang
|
|
matrix:
|
|
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
|
|
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
|
|
- env: {WIDEMUL: int128_struct, ECMULTGENPRECISION: 2, ECMULTWINDOW: 4}
|
|
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
|
|
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
|
|
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
|
|
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CPPFLAGS: -DVERIFY}
|
|
- env: {BUILD: distcheck}
|
|
brew_script:
|
|
- brew install automake libtool gcc
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
<< : *CREDITS
|
|
|
|
task:
|
|
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: qemu-s390x
|
|
SECP256K1_TEST_ITERS: 16
|
|
HOST: s390x-linux-gnu
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
test_script:
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
|
|
- rm /etc/ld.so.cache
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "ARM32: Linux (Debian stable, QEMU)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: qemu-arm
|
|
SECP256K1_TEST_ITERS: 16
|
|
HOST: arm-linux-gnueabihf
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
matrix:
|
|
- env: {}
|
|
- env: {EXPERIMENTAL: yes, ASM: arm32}
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "ARM64: Linux (Debian stable, QEMU)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: qemu-aarch64
|
|
SECP256K1_TEST_ITERS: 16
|
|
HOST: aarch64-linux-gnu
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "ppc64le: Linux (Debian stable, QEMU)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: qemu-ppc64le
|
|
SECP256K1_TEST_ITERS: 16
|
|
HOST: powerpc64le-linux-gnu
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: wine
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
CTIMETESTS: no
|
|
matrix:
|
|
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
|
|
env:
|
|
HOST: x86_64-w64-mingw32
|
|
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
|
|
env:
|
|
HOST: i686-w64-mingw32
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
WRAPPER_CMD: wine
|
|
WERROR_CFLAGS: -WX
|
|
WITH_VALGRIND: no
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
EXPERIMENTAL: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
|
|
# This will detect some MinGW-w64 tools but then make will need only
|
|
# the MSVC tools CC, AR and NM as specified below.
|
|
HOST: x86_64-w64-mingw32
|
|
CC: /opt/msvc/bin/x64/cl
|
|
AR: /opt/msvc/bin/x64/lib
|
|
NM: /opt/msvc/bin/x64/dumpbin -symbols -headers
|
|
# Set non-essential options that affect the CLI messages here.
|
|
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
|
|
CFLAGS: -nologo -diagnostics:caret
|
|
LDFLAGS: -Xlinker -Xlinker -Xlinker -nologo
|
|
matrix:
|
|
- name: "x86_64 (MSVC): Windows (Debian stable, Wine)"
|
|
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"
|
|
env:
|
|
WIDEMUL: int128_struct
|
|
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct with __(u)mulh)"
|
|
env:
|
|
WIDEMUL: int128_struct
|
|
CPPFLAGS: -DSECP256K1_MSVC_MULH_TEST_OVERRIDE
|
|
- name: "i686 (MSVC): Windows (Debian stable, Wine)"
|
|
env:
|
|
HOST: i686-w64-mingw32
|
|
CC: /opt/msvc/bin/x86/cl
|
|
AR: /opt/msvc/bin/x86/lib
|
|
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
# Sanitizers
|
|
task:
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
CTIMETESTS: no
|
|
matrix:
|
|
- name: "Valgrind (memcheck)"
|
|
container:
|
|
cpu: 2
|
|
env:
|
|
# The `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (https://www.valgrind.org/docs/manual/manual-core.html)
|
|
WRAPPER_CMD: "valgrind --error-exitcode=42"
|
|
SECP256K1_TEST_ITERS: 2
|
|
- name: "UBSan, ASan, LSan"
|
|
container:
|
|
memory: 2G
|
|
env:
|
|
CFLAGS: "-fsanitize=undefined,address -g"
|
|
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
|
|
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
|
|
LSAN_OPTIONS: "use_unaligned=1"
|
|
SECP256K1_TEST_ITERS: 32
|
|
# Try to cover many configurations with just a tiny matrix.
|
|
matrix:
|
|
- env:
|
|
ASM: auto
|
|
- env:
|
|
ASM: no
|
|
ECMULTGENPRECISION: 2
|
|
ECMULTWINDOW: 2
|
|
matrix:
|
|
- env:
|
|
CC: clang
|
|
- env:
|
|
HOST: i686-linux-gnu
|
|
CC: i686-linux-gnu-gcc
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
# Memory sanitizers
|
|
task:
|
|
<< : *LINUX_CONTAINER
|
|
name: "MSan"
|
|
env:
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
CTIMETESTS: yes
|
|
CC: clang
|
|
SECP256K1_TEST_ITERS: 32
|
|
ASM: no
|
|
WITH_VALGRIND: no
|
|
container:
|
|
memory: 2G
|
|
matrix:
|
|
- env:
|
|
CFLAGS: "-fsanitize=memory -g"
|
|
- env:
|
|
ECMULTGENPRECISION: 2
|
|
ECMULTWINDOW: 2
|
|
CFLAGS: "-fsanitize=memory -g -O3"
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "C++ -fpermissive (entire project)"
|
|
<< : *LINUX_CONTAINER
|
|
env:
|
|
CC: g++
|
|
CFLAGS: -fpermissive -g
|
|
CPPFLAGS: -DSECP256K1_CPLUSPLUS_TEST_OVERRIDE
|
|
WERROR_CFLAGS:
|
|
ECDH: yes
|
|
RECOVERY: yes
|
|
SCHNORRSIG: yes
|
|
ELLSWIFT: yes
|
|
test_script:
|
|
- ./ci/cirrus.sh
|
|
<< : *CAT_LOGS
|
|
|
|
task:
|
|
name: "C++ (public headers)"
|
|
<< : *LINUX_CONTAINER
|
|
test_script:
|
|
- g++ -Werror include/*.h
|
|
- clang -Werror -x c++-header include/*.h
|
|
- /opt/msvc/bin/x64/cl.exe -c -WX -TP include/*.h
|
|
|
|
task:
|
|
name: "sage prover"
|
|
<< : *LINUX_CONTAINER
|
|
test_script:
|
|
- cd sage
|
|
- sage prove_group_implementations.sage
|
|
|
|
task:
|
|
name: "x86_64: Windows (VS 2022)"
|
|
windows_container:
|
|
image: cirrusci/windowsservercore:visualstudio2022
|
|
cpu: 4
|
|
memory: 3840MB
|
|
env:
|
|
PATH: '%CIRRUS_WORKING_DIR%\build\src\RelWithDebInfo;%PATH%'
|
|
x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
|
|
# Ignore MSBuild warning MSB8029.
|
|
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
|
|
IgnoreWarnIntDirInTempDetected: 'true'
|
|
matrix:
|
|
- env:
|
|
BUILD_SHARED_LIBS: ON
|
|
- env:
|
|
BUILD_SHARED_LIBS: OFF
|
|
git_show_script:
|
|
# Print commit to allow reproducing the job outside of CI.
|
|
- git show --no-patch
|
|
configure_script:
|
|
- '%x64_NATIVE_TOOLS%'
|
|
- 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%
|
|
build_script:
|
|
- '%x64_NATIVE_TOOLS%'
|
|
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5
|
|
check_script:
|
|
- '%x64_NATIVE_TOOLS%'
|
|
- ctest -C RelWithDebInfo --test-dir build -j 5
|
|
- build\src\RelWithDebInfo\bench_ecmult.exe
|
|
- build\src\RelWithDebInfo\bench_internal.exe
|
|
- build\src\RelWithDebInfo\bench.exe
|