Jonas Nick b5a6812bd6
Merge elementsproject/secp256k1-zkp#285: Upstream PRs 1426, 1430, 1184, 1437, 1442, 1441, 1445, 1438, 1393, 1446, 1450, 1451, 1431, 990, 1455, 1380, 1465, 1466, 1473, 1474, 1476, 1480, 1468, 1482, 1249
b673a43090df39190084860cee385f9099b77e76 musig: new upstream def of VERIFY_CHECK (empty in non-VERIFY) (Jonas Nick)
cd173688fb94d4a4acdde2304321064a162254e2 musig: replace point_{save,load} with ge_{to,from}_bytes (Jonas Nick)
33db8edb2760ac86c693db48c85f78930b3c239f group: add ge_to_bytes and ge_from_bytes (Jonas Nick)
de54a1eff741917b734ad64e1bc914025a97325d musig2: clean up ctx doc in include file (Jonas Nick)
4f656988650006a779c898bdf6303e469b4a8b01 extrakeys: Remove redundant secp256k1_pubkey_cmp (Tim Ruffing)
c29f28e638599a48741a1c59599cff282f88d633 include: make docs more consistent (Tim Ruffing)
42f8c5140227dbdd8ae7eaaecd914e705e1b12d0 cmake: Add `SECP256K1_LATE_CFLAGS` configure option (Hennadii Stepanov)
e6822678ea05c431b4f43be9dfbde54e0f7f645b build: Error if required module explicitly off (Tim Ruffing)
89ec583ccf01d9201fdab6a6c1682e6c27224b16 build: Clean up handling of module dependencies (Tim Ruffing)
b37fdb28ce373e359e4d3a9727693b724db31676 check-abi: Minor UI improvements (Tim Ruffing)
ad5f589a94cfa23f09ef9424d779a5c9054f6572 check-abi: Default to HEAD for new version (Tim Ruffing)
9fb7e2f1568c302eb9f69d6e585e6ce129ea0093 release process: Style and formatting nits (Tim Ruffing)
e7053d065b9b2c7a67dd7908598e51b739cc2f77 release process: Add email step (Tim Ruffing)
429d21dc79ef4a9f0b3837c530a06d581baf067f release process: Run sanity checks on release PR (Tim Ruffing)
ba5d72d62659f9305d2be30b2ac89ce9480a0e78 assumptions: Use new STATIC_ASSERT macro (Tim Ruffing)
e53c2d9ffc0b0096881e30e388c3fb040f35e05d Require that sizeof(secp256k1_ge_storage) == 64 (Tim Ruffing)
d0ba2abbff2dcd4ca355f648d61fc6520f929949 util: Add STATIC_ASSERT macro (Tim Ruffing)
da7bc1b803b14274bc1687514e5da6a3e1cd9765 include: in doc, remove article in front of "pointer" (Jonas Nick)
aa3dd5280b4a046c03bd344bfd7f1499199a1f3c include: make doc about ctx more consistent (Jonas Nick)
e3f690015a21d6404cdec30666f721001b493172 include: remove obvious "cannot be NULL" doc (Jonas Nick)
3dbfb48946b9d2a98acef23674617510cf1b3386 tests: restore scalar_mul test (Jonas Nick)
d77170a88d0d6f27d0b90057fa7cd25ec74e3850 Fix typos (shuoer86)
4b2e06f460a513bff630fa60c537d290589049a8 release cleanup: bump version after 0.4.1 (Jonas Nick)
672053d8015fe8ac8d411ef79fbcd97abc045b56 release: prepare for 0.4.1 (Jonas Nick)
74a4d974d5c81fbc437287dffc453028509682ab doc: Add ABI checking with `check-abi.sh` to the Release Process (Hennadii Stepanov)
e7f830e32c61ac4cf6c562b477063ccf35940ba9 Add `tools/check-abi.sh` (Hennadii Stepanov)
3928b7c38367947756b7d506f431bfb7bbbac5d0 doc: improve secp256k1_fe_set_b32_mod doc (Coding Enthusiast)
e02f313b1f251ccb363ae1ac24016d87c1be9009 Add comment on length checks when parsing ECDSA sigs (Tim Ruffing)
0e5ea6220707d9c96e06efc43bce3d5a3b3a06f2 CONTRIBUTING: add some coding and style conventions (Jonas Nick)
1a432cb98220f29ac47639d30a6dbb3aa679a441 README: update first sentence (Jonas Nick)
0922a047fb2a225fd89802bbd6f2d0919cd50bca docs: move coverage report instructions to CONTRIBUTING (Jonas Nick)
76880e40151ddb18d0cd0549502d5ade95f501d6 Add CONTRIBUTING.md including scope and guidelines for new code (Jonas Nick)
d2e36a2b81c0ba9d28425ea14c1ff6523156ee52 changelog: add entry for "field: Remove x86_64 asm" (Jonas Nick)
04af0ba162b152073455a5ccbb2c5833ae6d1d57 Replace ge_equals_ge[,j] calls with group.h equality calls (Pieter Wuille)
60525f6c14ad37719c6ea2deee19ec7b3654f061 Add unit tests for group.h equality functions (Pieter Wuille)
a47cd97d51e37c38ecf036d04e48518f6b0063f7 Add group.h ge/gej equality functions (Pieter Wuille)
f07cead0ca96e26356466b635ce6e7fe3834c949 build: Don't call assembly an optimization (Tim Ruffing)
2f0762fa8fd30b457bc5dcf53403123212091df5 field: Remove x86_64 asm (Tim Ruffing)
bb4672342efce7fae1cfd30e007c6835a25286a7 remove VERIFY_SETUP define (Sebastian Falbesoner)
a3a3e11acdb473f96a8972ed40cd3310057aec23 remove unneeded VERIFY_SETUP uses in ECMULT_CONST_TABLE_GET_GE macro (Sebastian Falbesoner)
a0fb68a2e7db14c6b27f92217bf2307681b6b6ea introduce and use SECP256K1_SCALAR_VERIFY macro (Sebastian Falbesoner)
cf25c86d05bbaacd37f42a190e39eab4863cdaf7 introduce and use SECP256K1_{FE,GE,GEJ}_VERIFY macros (Sebastian Falbesoner)
5d89bc031b25dc0aaba8c7d2eeba88ae92facb09 remove superfluous `#ifdef VERIFY`/`#endif` preprocessor conditions (Sebastian Falbesoner)
c2688f8de9fb9a44dc953d2f8a0e9226d8e19349 redefine VERIFY_CHECK to empty in production (non-VERIFY) mode (Sebastian Falbesoner)
dcdda31f2cda13839a4285d8601118c041b18c13 Tighten secp256k1_fe_mul_inner's VERIFY_BITS checks (Russell O'Connor)
8e2a5fe908faa2ad0b847b3e5c42662614c8fa88 correct assertion for secp256k1_fe_mul_inner (roconnor-blockstream)
1ddd76af0a735b7fcbec7f37c0d99a7db9893ac1 bench: add --help option to bench_internal (Sebastian Falbesoner)
33dc7e4d3e1947af4c84c09ecc75ea2eeed3f7e0 asm: add .note.GNU-stack section for non-exec stack (fanquake)
10271356c8fc34395850ac70df5902571945fbea Return temporaries to being unsigned in secp256k1_fe_sqr_inner (roconnor-blockstream)
8185e72d299bc77de9c06cc92fd1988676df3bc1 ci: Ignore internal errors in snapshot compilers (Hennadii Stepanov)
355bbdf38a2f932daadd02325a0d90d902cb2af4 Add changelog entry for signed-digit ecmult_const algorithm (Pieter Wuille)
21f49d9bec518a769029f809817444a984e735ab Remove unused secp256k1_scalar_shr_int (Pieter Wuille)
115fdc7232a80872c99f88589a5a3608ba757f1d Remove unused secp256k1_wnaf_const (Pieter Wuille)
aa9f3a3c004469033709dc8138892e66adf0b030 ecmult_const: add/improve tests (Jonas Nick)
4d16e90111c050de3b7e25ac451d87cd4e3f874e Signed-digit based ecmult_const algorithm (Pieter Wuille)
ba523be067d6e45957d154838cb9da942704f01a make SECP256K1_SCALAR_CONST reduce modulo exhaustive group order (Pieter Wuille)
2140da9cd5d490d8462d5c7cc909755edc10c1e6 Add secp256k1_scalar_half for halving scalars (+ tests/benchmarks). (Pieter Wuille)
5dab0baa80d763b1de599e64307c090d1a3fb04d README: remove CI badge (Jonas Nick)
fa4d6c76b6dc249d02c926ad75725556614fdddd ci/cirrus: Add native ARM64 persistent workers (MarcoFalke)
2262d0eaab2aa1181f900acd2d8cd568047599b6 ci/cirrus: Bring back skeleton .cirrus.yml without jobs (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK b673a43090df39190084860cee385f9099b77e76

Tree-SHA512: fe4f4d1db71518cad80724c21915a6235ffc21aadc06226f6dc29237e786f546189165ffdbe64b90b094ada4c36a031caa712c1f21bf280d33ba221fda2e0019
2024-01-23 19:07:05 +00:00
2024-01-09 01:05:09 +01:00
2024-01-03 20:03:07 +08:00
2013-05-09 15:24:32 +02:00

libsecp256k1-zkp

Dependencies: None

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

Building with 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.

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

Contributing to libsecp256k1

See CONTRIBUTING.md

Description
Experimental fork of libsecp256k1 with support for pedersen commitments and range proofs.
Readme 12 MiB
Languages
C 93.2%
Sage 1.6%
CMake 1.2%
M4 1.2%
Assembly 1.1%
Other 1.7%