56 Commits

Author SHA1 Message Date
Tim Ruffing
ad3e65d9fe
ci: Remove GCC build files and sage to reduce size of Docker image 2023-08-18 13:52:28 +01:00
Hennadii Stepanov
87d35f30c0
ci: Rename cirrus.sh to more general ci.sh
This makes sense in the process of moving stuff to GitHub Actions.
2023-08-18 10:57:58 +01:00
Hennadii Stepanov
d78bec7001
ci: Remove Windows MSVC tasks from Cirrus CI
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2023-08-17 10:13:38 +01:00
Hennadii Stepanov
d62db57427
ci: Use Homebrew's gcc in native macOS task
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2023-08-16 14:39:58 +01:00
Hennadii Stepanov
8408dfdc4c
Revert "ci: Run sage prover on CI"
This reverts commit d8d54859ed138a8ed9a8486d847155211c9f4a7d.
2023-08-14 14:28:54 +01:00
Jonas Nick
4692478853
ci: print $ELLSWIFT in cirrus.sh 2023-07-27 10:20:50 +00:00
Tim Ruffing
981e5be38c ci: Fix typo in comment 2023-07-06 20:19:07 +02:00
Tim Ruffing
1deecaaf3b ci: Install development snapshots of gcc and clang
TODO: Make sure the Docker image is actually rebuild
2023-07-06 20:19:04 +02:00
Tim Ruffing
98579e297b ci: Drop manual checkout of merge commit
This is no longer necessary as of
https://github.com/cirruslabs/cirrus-ci-docs/issues/791#issuecomment-1615691585 .
2023-07-01 13:01:57 +02:00
Hennadii Stepanov
c862a9fb49
ci: Adjust Docker image to Debian 12 "bookworm" 2023-06-26 10:24:15 +01:00
Hennadii Stepanov
a1782098a9
ci: Force DWARF v4 for Clang when Valgrind tests are expected 2023-06-26 10:03:19 +01:00
Pieter Wuille
4f091847c2 Add ellswift testing to CI 2023-06-20 11:31:58 -04:00
Tim Ruffing
db29bf220c
ci: Remove quirk that runs dummy command after wineserver
The underlying issue is now worked around in upstream, see
https://github.com/mstorsjo/msvc-wine/issues/47 for details.
2023-06-03 09:08:38 +01:00
Hennadii Stepanov
c7db4942b3
ci: Fix error D8037 in cl.exe 2023-06-03 09:08:31 +01:00
Hennadii Stepanov
7dae115861
Revert "ci: Move wine prefix to /tmp to avoid error D8037 in cl.exe"
This reverts commit 27504d5c941df89bc828067248270179c9dcb04b.
2023-06-02 16:13:29 +01:00
Tim Ruffing
27504d5c94 ci: Move wine prefix to /tmp to avoid error D8037 in cl.exe
Don't ask me why this makes a difference. It may be some permission
problem even though everything in Cirrus CI runs as root anyway. In
any case, I'll probably get mad if I investigate this further.

Fixes #1326.
2023-05-24 14:28:05 +02:00
RandomLattice
e5de454609 tests: Add Wycheproof ECDSA vectors
Adds a test using the Wycheproof vectors as outlined in #1106. The
vectors are taken from the Wycheproof repo. We use a python script
to convert the JSON-formatted vectors into C code.

Co-authored-by: Sean Andersen <6730974+andozw@users.noreply.github.com>
2023-04-09 06:17:16 +02:00
Tim Ruffing
e4330341bd ci: Shutdown wineserver whenever CI script exits
Before: CI times out when a wine task fails.
After:  Wine tasks exit properly when they fail.
2023-02-06 21:44:56 +01:00
Pieter Wuille
0f088ec112 Rename CTIMETEST -> CTIMETESTS 2023-01-11 16:07:37 -05:00
Pieter Wuille
5e2e6fcfc0 Run ctime test in Linux MSan CI job 2023-01-11 16:07:37 -05:00
Pieter Wuille
5048be17e9 Rename valgrind_ctime_test -> ctime_tests 2023-01-11 16:07:37 -05:00
Jonas Nick
7a74688201
ci: add missing CFLAGS & CPPFLAGS variable to print_environment 2022-12-19 13:22:28 +00:00
Jonas Nick
c2e0fdadeb
ci: set -u in cirrus.sh to treat unset variables as an error 2022-12-19 13:22:18 +00:00
Tim Ruffing
44916ae915
Merge bitcoin-core/secp256k1#1147: ci: print env to allow reproducing the job outside of CI
4e54c03153a307af5cc80c7671ac7eef28138326 ci: print env to allow reproducing the job outside of CI (Jonas Nick)

Pull request description:

  Example output:

  ```
  WERROR_CFLAGS="-Werror -pedantic-errors"  MAKEFLAGS="-j4"  BUILD="check"  ECMULTWINDOW="auto"  ECMULTGENPRECISION="auto"  ASM="no"  WIDEMUL="int64"  WITH_VALGRIND="no"  EXTRAFLAGS=""  EXPERIMENTAL="no"  ECDH="no"  RECOVERY="yes"  SCHNORRSIG="no"  SECP256K1_TEST_ITERS=""  BENCH="yes"  SECP256K1_BENCH_ITERS="2"  CTIMETEST="yes"  EXAMPLES="yes"  WRAPPER_CMD=""  CC="gcc"  AR=""  NM=""  HOST=""  ./ci/cirrus.sh
  ```

ACKs for top commit:
  sipa:
    ACK 4e54c03153a307af5cc80c7671ac7eef28138326
  real-or-random:
    ACK 4e54c03153

Tree-SHA512: b74a8724e72b3de7884e4d93fe933dc5043aec37020672b7997a8faebda3b0cbbba1bca69c344109729261ab4a94e76f4eca0d8773dc101a443fdf9e0d7d54f5
2022-11-14 18:01:49 -05:00
Jonas Nick
49ae843592
ci: mostly prevent "-v/--version: not found" irrelevant error
$CC, $WRAPPER_CMD and valgrind are not necessarily defined
2022-11-02 17:13:21 +00:00
Jonas Nick
4e54c03153
ci: print env to allow reproducing the job outside of CI 2022-11-02 15:57:14 +00:00
Tim Ruffing
51f296a46c ci: Run persistent wineserver to speed up wine 2022-06-29 11:05:40 +02:00
Tim Ruffing
9efc2e5221 ci: Add MSVC builds
This adds MSVC builds built on Linux using wine. This requires some
settings of tools and flags because the autotools support for MSVC is
naturally somewhat limited.

The advantage of this approach is that it is compatible with our
existing CI scripts, so there's no need to write a Windows CI script
(in PowerShell or similar). If we want to test building and running on
Windows native (e.g., as supported by Cirrus CI) we could still do this
in the future.

Another advantage of this approach is that contributors can simply use
the docker image if they need a MSVC installation in a non-Windows
environment.

This commit also improves the Dockerfile by grouping RUN commands
according to Docker docs:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
2022-06-29 11:05:40 +02:00
Jonas Nick
64b34979ed
Merge bitcoin-core/secp256k1#748: Add usage examples
7c9502cece9c9e8d811333f7ab5bb22f4eb01c04 Add a copy of the CC0 license to the examples (Elichai Turkel)
42e03432e6be7f0bf18c7f86130d3930bdf4038d Add usage examples to the readme (Elichai Turkel)
517644eab14ef397e1f0bc2b45f2dff8b1a473ec Optionally compile the examples in autotools, compile+run in travis (Elichai Turkel)
422a7cc86ae86496794c5014028ee249bbe0e072 Add a ecdh shared secret example (Elichai Turkel)
b0cfbcc14347ff6b04ff62a0d935638840a37971 Add a Schnorr signing and verifying example (Elichai Turkel)
fee7d4bf9e4ea316ea4ff3151bbe52bec1f0745c Add an ECDSA signing and verifying example (Elichai Turkel)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 7c9502cece9c9e8d811333f7ab5bb22f4eb01c04
  jonasnick:
    ACK 7c9502cece9c9e8d811333f7ab5bb22f4eb01c04

Tree-SHA512: c475cfd5b324b1e2d7126aa5bb1e7da25183b50adb7357d464c140de83d9097cb1bdc027d09aeadf167dbf9c8afd123235b0a1a742c5795089862418fafa1964
2022-02-23 17:37:58 +00:00
Elichai Turkel
517644eab1
Optionally compile the examples in autotools, compile+run in travis 2022-02-23 16:14:58 +02:00
Tim Ruffing
d8d54859ed ci: Run sage prover on CI 2022-02-04 15:37:32 +01:00
Tim Ruffing
22382f0ea0 ci: Test different ecmult window sizes 2021-12-22 14:56:27 +01:00
Tim Ruffing
26a022a3a0 ci: Remove STATICPRECOMPUTATION
This has been overlooked in #988.
2021-12-20 14:18:02 +01:00
Tim Ruffing
0559fc6e41
Merge bitcoin-core/secp256k1#988: Make signing table fully static
7dfceceea692c4118829c06128c41623b2373ac2 build: Remove #undef hack for ASM in the precomputation programs (Tim Ruffing)
bb36fe9be0998c81ebc9f18e122bb7617d919877 ci: Test `make precomp` (Tim Ruffing)
d94a37a20c3b5b44f1bcf60d309ffc50727e18e4 build: Remove CC_FOR_BUILD stuff (Tim Ruffing)
ad63bb4c296e6007dab22cda05fd599b20139362 build: Prebuild and distribute ecmult_gen table (Tim Ruffing)
ac49361ed0a342e01eafb1410c5b43e1214efaac prealloc: Get rid of manual memory management for prealloc contexts (Tim Ruffing)
6573c08f656f8ec305a2db801d57bfe6441e83e0 ecmult_gen: Tidy precomputed file and save space (Tim Ruffing)
5eba83f17c5aa1cf3698bb057a4b3ee35f3b6c30 ecmult_gen: Precompute tables for all values of ECMULT_GEN_PREC_BITS (Tim Ruffing)
fdb33dd1227f935ca95c7f8bd9429f42e18a870e refactor: Make PREC_BITS a parameter of ecmult_gen_build_prec_table (Tim Ruffing)
a4875e30a631d67b77b41f37fc3bf06ffb8ff11f refactor: Move default callbacks to util.h (Tim Ruffing)
4c94c55bce9e1fae8fd2e8993726c8ec74cc0f7d doc: Remove obsolete hint for valgrind stack size (Tim Ruffing)
5106226991117da78f85ca88b7ea66c2ac8fe0b3 exhaustive_tests: Fix with ecmult_gen table with custom generator (Tim Ruffing)
e1a76530db40b8aa8953717d9f984b6bdf845308 refactor: Make generator a parameter of ecmult_gen_create_prec_table (Tim Ruffing)
9ad09f6911906a1fa9af2c5540a8004e44f3ccc6 refactor: Rename program that generates static ecmult_gen table (Tim Ruffing)
8ae18f1ab3dce4c487bab75c2f0cdf4fe311b318 refactor: Rename file that contains static ecmult_gen table (Tim Ruffing)
00d2fa116ed7a8c2d049723aca8d8b6d1c49f6a8 ecmult_gen: Make code consistent with comment (Tim Ruffing)
3b0c2185eab0fe5cb910fffee4c88e134f6d3cad ecmult_gen: Simplify ecmult_gen context after making table static (Tim Ruffing)
e43ba02cfc836dba48c8c9a483e79b7589ce9ae1 refactor: Decouple table generation and ecmult_gen context (Tim Ruffing)
22dc2c0a0dc3b321e72253f492cfa8bcbf00169b ecmult_gen: Move table creation to new file and force static prec (Tim Ruffing)

Pull request description:

  This resolves #893,  resolves #692 (and also resolves bitcoin/bitcoin#22854).

  - [x] Extract table generation to separate function in separate file (to be used by generation script and exhaustive tests)
  - [x] Tidy up
    - [x] Remove code that deals with non-static tables
    - [x] Make functions that need ecmult_gen not depend on signing context
    - [x] Rename stuff to make it fit the new structure and consistent with how we hande verification tables (#956)
  - [x] Fix exhaustive tests
    - [x] Make table generation function take generator as input
    - [x] Overwrite the static tables with a table with custom generator in exhaustive tests
  - [x] Overhaul script that generates table files
    - [x] Make table generation function take PREC_BITS as input (I have some code already, just not yet in this branch)
    - [x] Change generation script to generate three tables (for all three values of ECMULT_GEN_PREC_BITS)
  - [x] Ship pre-built tables
    - [x] Add pregenerated table file to repo
    - [x] Remove generation of table file from build process (like in #956)
    - [x] Remove left-over stuff (e.g., detecting a compiler running on the build machine) from build system
  - [x] Final cleanups (copyright headers, commit, messages, etc.)
  - [ ] (separate PR:) Make sure link-time optimization remove corresponding static tables (and code) when no signing/verifcation function is called
  - [ ] (separate PR:) Compile precomputation as a separate object file and link it (https://github.com/bitcoin-core/secp256k1/pull/988#issuecomment-977813538)
  - [ ] (separate PR:) Document the backwards-compatible API changes made in this PR and in #956.
    - [ ] Maybe deprecate the static context

ACKs for top commit:
  sipa:
    ACK 7dfceceea692c4118829c06128c41623b2373ac2
  robot-dreams:
    ACK 7dfceceea692c4118829c06128c41623b2373ac2 (based on range-diff between 56284c7d44c0ed46e636588bfbf6c403b7dfa6c1 and 7dfceceea692c4118829c06128c41623b2373ac2)

Tree-SHA512: 6efb3f36f05efe3b79bbd877881fe1409f71fd6488d24c811b2e77d9f053bed78670dd1dcbb42ad780458a51c4ffa36de9cd6567271b22041dc7a122ceb677c5
2021-12-15 11:06:47 +01:00
Tim Ruffing
bb36fe9be0 ci: Test make precomp 2021-12-09 20:52:28 +01:00
siv2r
592661c22f ci: move test environment variable declaration to .cirrus.yml
environment var moved:
    1. SECP256K1_TEST_ITERS (replaces TEST_ITERS)
    2. SECP256K1_BENCH_ITERS (replaces BENCH_ITERS)
2021-12-04 22:47:40 +05:30
Pieter Wuille
9f56bdf5b9 Merge bench_schnorrsig into bench 2021-11-05 17:35:11 -04:00
Pieter Wuille
3208557ae1 Merge bench_recover into bench 2021-11-05 17:34:46 -04:00
Pieter Wuille
855e18d8a8 Merge bench_ecdh into bench 2021-11-05 17:34:25 -04:00
Pieter Wuille
2a7be678a6 Combine bench_sign and bench_verify into single bench 2021-11-05 17:30:56 -04:00
Tim Ruffing
3d2f492ceb ci: Install libasan6 (instead of 5) after Debian upgrade 2021-08-19 12:11:11 +02:00
Tim Ruffing
90e83449b2 ci: Add C++ test 2021-07-05 13:57:40 +02:00
Tim Ruffing
c58c4ea470 ci: Add ppc64le build 2021-06-08 17:03:53 +02:00
Tim Ruffing
02dcea1ad9 ci: Make test iterations configurable and tweak for sanitizer builds 2021-05-21 20:48:07 +02:00
Tim Ruffing
fcfcb97e74 ci: Simplify to use generic wrapper for QEMU, Valgrind, etc 2021-05-21 20:46:48 +02:00
Tim Ruffing
de4157f13a ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs 2021-05-21 12:12:46 +02:00
Pieter Wuille
7d65ed5214 Add ARM32/ARM64 CI 2021-05-03 12:03:52 -07:00
Pieter Wuille
4dc37bf81b Add mingw32-w64/wine CI build 2021-04-30 16:37:44 -07:00
Pieter Wuille
1f233b3fa0 Remove num/gmp support
The whole "num" API and its libgmp-based implementation are now unused. Remove them.
2021-03-15 13:01:52 -07:00
Tim Ruffing
9361f360bb ci: Select number of parallel make jobs depending on CI environment
This should improve compilation times on macOS. Things can certainly
be improved further, e.g., by running the benchmarks in parallel.
2021-03-03 18:16:25 +01:00