5d8f53e312Remove redudent checks. (Russell O'Connor)d232112fa7Update Changelog (Tim Ruffing)b081f7e4cbAdd secp256k1_fe_add_int function (Pieter Wuille)2ef1c9b387Update overflow check (Russell O'Connor)5660c13755prevent optimization in algorithms (Harshil Jani)ce3cfc78a6doc: Describe Jacobi calculation in safegcd_implementation.md (Elliott Jin)6be01036c8Add secp256k1_fe_is_square_var function (Pieter Wuille)1de2a01c2bNative jacobi symbol algorithm (Pieter Wuille)04c6c1b181Make secp256k1_modinv64_det_check_pow2 support abs val (Pieter Wuille)5fffb2c7afMake secp256k1_i128_check_pow2 support -(2^n) (Pieter Wuille)e4330341bdci: Shutdown wineserver whenever CI script exits (Tim Ruffing)9a5a611a21build: Suppress stupid MSVC linker warning (Tim Ruffing)739c53b19aexamples: Extend sig examples by call that uses static context (Tim Ruffing)914276e4d2build: Add SECP256K1_API_VAR to fix importing variables from DLLs (Tim Ruffing)e089eecc1egroup: Further simply gej_add_ge (Tim Ruffing)ac71020ebegroup: Save a normalize_to_zero in gej_add_ge (Tim Ruffing)8c7e0fc1debuild: Add -Wreserved-identifier supported by clang (Tim Ruffing)9b60e3148dci: Do not set git's `user.{email,name}` config options (Hennadii Stepanov)ef39721cccDo not link `bench` and `ctime_tests` to `COMMON_LIB` (Hennadii Stepanov)c2415866c7ci: Don't fetch git history (Tim Ruffing)0ecf318851ci: Use remote pull/merge ref instead of local git merge (Tim Ruffing)9b7d18669dDrop no longer used Autoheader macros (Hennadii Stepanov)eb6bebaee3scalar: restrict split_lambda args, improve doc and VERIFY_CHECKs (Jonas Nick)7f49aa7f2dci: add test job with -DVERIFY (Jonas Nick)620ba3d74bbenchmarks: fix bench_scalar_split (Jonas Nick)e39d954f11tests: Add CHECK_ILLEGAL(_VOID) macros and use in static ctx tests (Tim Ruffing)61841fc9eecontexts: Forbid randomizing secp256k1_context_static (Tim Ruffing)4b6df5e33econtexts: Forbid cloning/destroying secp256k1_context_static (Tim Ruffing)8f51229e03ctime_tests: improve output when CHECKMEM_RUNNING is not defined (Jonas Nick)2cd4e3c0a9Drop no longer used `SECP_{LIBS,INCLUDE}` variables (Hennadii Stepanov)613626f94cDrop no longer used `SECP_TEST_{LIBS,INCLUDE}` variables (Hennadii Stepanov)d6ff738d5bEnsure safety of ctz_debruijn implementation. (Russell O'Connor)ce60785b26Introduce SECP256K1_B macro for curve b coefficient (Pieter Wuille)4934aa7995Switch to exhaustive groups with small B coefficient (Pieter Wuille)e03ef86559Make all non-API functions (except main) static (Pieter Wuille)0f088ec112Rename CTIMETEST -> CTIMETESTS (Pieter Wuille)74b026f05dAdd runtime checking for DECLASSIFY flag (Pieter Wuille)5e2e6fcfc0Run ctime test in Linux MSan CI job (Pieter Wuille)18974061a3Make ctime tests building configurable (Pieter Wuille)5048be17e9Rename valgrind_ctime_test -> ctime_tests (Pieter Wuille)6eed6c18deUpdate error messages to suggest msan as well (Pieter Wuille)8e11f89a68Add support for msan integration to checkmem.h (Pieter Wuille)8dc64079ebAdd compile-time error to valgrind_ctime_test (Pieter Wuille)0db05a770eAbstract interactions with valgrind behind new checkmem.h (Pieter Wuille)4f1a54e41dMove valgrind CPPFLAGS into SECP_CONFIG_DEFINES (Pieter Wuille)d4a6b58df7Add `noverify_tests` to `.gitignore` (Hennadii Stepanov)e862c4af0cMakefile: add -I$(top_srcdir)/src to CPPFLAGS for precomputed (Matt Whitlock) Pull request description: ACKs for top commit: real-or-random: tACK0d540ec942Tree-SHA512: bc54ccf752163ab6e1a12bb8c4e1f9339f4421d2e4f7716c408549514b3c902f2e9f727655799f1eecb085b0026761b04735b17be3c95c6cf54e07fbf7e86477
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
ff8edf89 f29a3270 a7a7bfaf a01a7d86 b1579cf5 ad7433b1 233822d8 5fbff5d3 2b77240b 1bff2005 e1817a6f 5596ec5c 8ebe5c52 1cca7c17 1b21aa51 cbd25559 09b1d466 57573187 8962fc95 9d1b458d eb8749fc 6048e6c0 ' into temp-merge-1222
libsecp256k1-zkp
A fork of libsecp256k1 with support for advanced and experimental features such as Confidential Assets and MuSig2
Added features:
- Experimental module for ECDSA adaptor signatures.
- Experimental module for ECDSA sign-to-contract.
- Experimental module for MuSig2.
- Experimental module for Confidential Assets (Pedersen commitments, range proofs, and surjection proofs).
- Experimental module for Bulletproofs++ range proofs.
- Experimental module for address whitelisting.
Experimental features are made available for testing and review by the community. The APIs of these features should not be considered stable.
Build steps
libsecp256k1-zkp is built using autotools:
$ ./autogen.sh
$ ./configure
$ make
$ make check # run the test suite
$ sudo make install # optional
To compile optional modules (such as Schnorr signatures), you need to run ./configure with additional flags (such as --enable-module-schnorrsig). Run ./configure --help to see the full list of available flags. For experimental modules, you will also need --enable-experimental as well as a flag for each individual module, e.g. --enable-module-musig.
Usage examples
Usage examples can be found in the examples directory. To compile them you need to configure with --enable-examples.
To compile the Schnorr signature, ECDH and MuSig examples, you need to enable the corresponding module by providing a flag to the configure script, for example --enable-module-schnorrsig.
Test coverage
This library aims to have full coverage of the reachable lines and branches.
To create a test coverage report, configure with --enable-coverage (use of GCC is necessary):
$ ./configure --enable-coverage
Run the tests:
$ make check
To create a report, gcovr is recommended, as it includes branch coverage reporting:
$ gcovr --exclude 'src/bench*' --print-summary
To create a HTML report with coloured and annotated source code:
$ mkdir -p coverage
$ gcovr --exclude 'src/bench*' --html --html-details -o coverage/coverage.html
Benchmark
If configured with --enable-benchmark (which is the default), binaries for benchmarking the libsecp256k1-zkp functions will be present in the root directory after the build.
To print the benchmark result to the command line:
$ ./bench_name
To create a CSV file for the benchmark result :
$ ./bench_name | sed '2d;s/ \{1,\}//g' > bench_name.csv
Reporting a vulnerability
See SECURITY.md