Commit Graph

2210 Commits

Author SHA1 Message Date
Jonas Nick
d47e4d40ca Merge elementsproject/secp256k1-zkp#252: Upstream PRs 1113, 1225, 1227, 1229, 1223
b40adf2360 release: prepare for 0.3.0 (Jonas Nick)
8be82d4362 cmake: Rename project to "libsecp256k1" (Hennadii Stepanov)
756b61d451 readme: Use correct build type in CMake/Windows build instructions (Tim Ruffing)
92098d84cf changelog: Add entry for CMake (Tim Ruffing)
e1eb33724c ci: Add "x86_64: Windows (VS 2022)" task (Hennadii Stepanov)
10602b0030 cmake: Export config files (Hennadii Stepanov)
5468d70964 build: Add CMake-based build system (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK dc733595b0

Tree-SHA512: ded76837ee78d3a99daf5e9dbdb3912a1f7efb8b9ea329535e5b5452f8bf6d02bc290dd2378b17a20e1d33b4811c1d88482bf46a57d6c414855b64cf55e38e99
2023-07-21 14:57:16 +00:00
Jonas Nick
dc733595b0 Merge commits 'df323b5c 3295aa14 ef4f8bd0 90b513aa bdf39000 ' into temp-merge-1223 2023-07-21 13:34:46 +00:00
Jonas Nick
3937cefce6 Merge elementsproject/secp256k1-zkp#249: Upstream PRs 1160, 1193, 1169, 1190, 1192, 1194, 1196, 1195, 1170, 1172, 1200, 1199, 1203, 1201, 1206, 1078, 1209, 979, 1212, 1218, 1217, 1221, 1222
5d8f53e312 Remove redudent checks. (Russell O'Connor)
d232112fa7 Update Changelog (Tim Ruffing)
b081f7e4cb Add secp256k1_fe_add_int function (Pieter Wuille)
2ef1c9b387 Update overflow check (Russell O'Connor)
5660c13755 prevent optimization in algorithms (Harshil Jani)
ce3cfc78a6 doc: Describe Jacobi calculation in safegcd_implementation.md (Elliott Jin)
6be01036c8 Add secp256k1_fe_is_square_var function (Pieter Wuille)
1de2a01c2b Native jacobi symbol algorithm (Pieter Wuille)
04c6c1b181 Make secp256k1_modinv64_det_check_pow2 support abs val (Pieter Wuille)
5fffb2c7af Make secp256k1_i128_check_pow2 support -(2^n) (Pieter Wuille)
e4330341bd ci: Shutdown wineserver whenever CI script exits (Tim Ruffing)
9a5a611a21 build: Suppress stupid MSVC linker warning (Tim Ruffing)
739c53b19a examples: Extend sig examples by call that uses static context (Tim Ruffing)
914276e4d2 build: Add SECP256K1_API_VAR to fix importing variables from DLLs (Tim Ruffing)
e089eecc1e group: Further simply gej_add_ge (Tim Ruffing)
ac71020ebe group: Save a normalize_to_zero in gej_add_ge (Tim Ruffing)
8c7e0fc1de build: Add -Wreserved-identifier supported by clang (Tim Ruffing)
9b60e3148d ci: Do not set git's `user.{email,name}` config options (Hennadii Stepanov)
ef39721ccc Do not link `bench` and `ctime_tests` to `COMMON_LIB` (Hennadii Stepanov)
c2415866c7 ci: Don't fetch git history (Tim Ruffing)
0ecf318851 ci: Use remote pull/merge ref instead of local git merge (Tim Ruffing)
9b7d18669d Drop no longer used Autoheader macros (Hennadii Stepanov)
eb6bebaee3 scalar: restrict split_lambda args, improve doc and VERIFY_CHECKs (Jonas Nick)
7f49aa7f2d ci: add test job with -DVERIFY (Jonas Nick)
620ba3d74b benchmarks: fix bench_scalar_split (Jonas Nick)
e39d954f11 tests: Add CHECK_ILLEGAL(_VOID) macros and use in static ctx tests (Tim Ruffing)
61841fc9ee contexts: Forbid randomizing secp256k1_context_static (Tim Ruffing)
4b6df5e33e contexts: Forbid cloning/destroying secp256k1_context_static (Tim Ruffing)
8f51229e03 ctime_tests: improve output when CHECKMEM_RUNNING is not defined (Jonas Nick)
2cd4e3c0a9 Drop no longer used `SECP_{LIBS,INCLUDE}` variables (Hennadii Stepanov)
613626f94c Drop no longer used `SECP_TEST_{LIBS,INCLUDE}` variables (Hennadii Stepanov)
d6ff738d5b Ensure safety of ctz_debruijn implementation. (Russell O'Connor)
ce60785b26 Introduce SECP256K1_B macro for curve b coefficient (Pieter Wuille)
4934aa7995 Switch to exhaustive groups with small B coefficient (Pieter Wuille)
e03ef86559 Make all non-API functions (except main) static (Pieter Wuille)
0f088ec112 Rename CTIMETEST -> CTIMETESTS (Pieter Wuille)
74b026f05d Add runtime checking for DECLASSIFY flag (Pieter Wuille)
5e2e6fcfc0 Run ctime test in Linux MSan CI job (Pieter Wuille)
18974061a3 Make ctime tests building configurable (Pieter Wuille)
5048be17e9 Rename valgrind_ctime_test -> ctime_tests (Pieter Wuille)
6eed6c18de Update error messages to suggest msan as well (Pieter Wuille)
8e11f89a68 Add support for msan integration to checkmem.h (Pieter Wuille)
8dc64079eb Add compile-time error to valgrind_ctime_test (Pieter Wuille)
0db05a770e Abstract interactions with valgrind behind new checkmem.h (Pieter Wuille)
4f1a54e41d Move valgrind CPPFLAGS into SECP_CONFIG_DEFINES (Pieter Wuille)
d4a6b58df7 Add `noverify_tests` to `.gitignore` (Hennadii Stepanov)
e862c4af0c Makefile: add -I$(top_srcdir)/src to CPPFLAGS for precomputed (Matt Whitlock)

Pull request description:

ACKs for top commit:
  real-or-random:
    tACK  0d540ec942

Tree-SHA512: bc54ccf752163ab6e1a12bb8c4e1f9339f4421d2e4f7716c408549514b3c902f2e9f727655799f1eecb085b0026761b04735b17be3c95c6cf54e07fbf7e86477
2023-07-21 13:29:02 +00:00
Jonas Nick
897c765a49 Merge elementsproject/secp256k1-zkp#251: Update sync-upstream with master
7e9193666f ci: Always define EXPERIMENTAL variable (Tim Ruffing)
0a99156871 sync-upstream.sh: Add "git show --remerge-diff" tip (Tim Ruffing)
9b6a1c384d sync-upstream.sh: Fix position of "-b" option in reproduce command (Tim Ruffing)
05b207e969 sync-upstream: allows providing the local branch via cli (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK 7e9193666f

Tree-SHA512: 4527cb6a2493d210eb7ba6d8f6e717b2acbc07aebdc1c4011cffe23490876a4e795d656a69df2cd50e4e3fe8742c123d9ea493914c148c8fbc93d7d3799e7447
2023-07-21 13:28:15 +00:00
Tim Ruffing
7e9193666f ci: Always define EXPERIMENTAL variable 2023-07-20 23:02:55 +02:00
Jonas Nick
0d540ec942 Merge commits '88e80722 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 2023-07-20 16:29:40 +00:00
Jonas Nick
7aa9887128 Merge pull request #246 from jonasnick/temp-merge-1187
Upstream PRs 1174, 1154, 1178, 1177, 1171, 1158, 1183, 1185, 1186, 1188, 1187
2023-07-20 15:35:18 +00:00
Jonas Nick
304fc88557 Merge commits '9a8d65f0 75d7b7f5 665ba77e 3f57b9f7 eacad90f 01b819a8 31ed5386 2a39ac16 0eb30004 cbe41ac1 cc3b8a4f ' into temp-merge-1187 2023-07-20 12:19:00 +00:00
Tim Ruffing
58e27bc2d2 Merge ElementsProject/secp256k1-zkp#244: sync-upstream.sh: Add "git show --remerge-diff" tip
0a99156871 sync-upstream.sh: Add "git show --remerge-diff" tip (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    utACK 0a99156871

Tree-SHA512: 6d3a26481f8d8f263db2379aca2670f5610b44fbf6b283550d83af9500b7e156927683d400e720fcb017cade317b176f882159a472ac8d5c99cff886b497dcfb
2023-07-19 11:15:29 +02:00
Tim Ruffing
0a99156871 sync-upstream.sh: Add "git show --remerge-diff" tip 2023-07-18 15:05:27 +02:00
Jonas Nick
6c54db1987 Merge commits '2286f809 751c4354 477f02c4 e3f84777 5c789dcd 8c949f56 21ffe4b2 ' into temp-merge-1055 2023-07-18 12:51:17 +00:00
Tim Ruffing
30fc9d6551 Merge ElementsProject/secp256k1-zkp#242: sync-upstream.sh: Fix position of "-b" option in reproduce command
9b6a1c384d sync-upstream.sh: Fix position of "-b" option in reproduce command (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    utACK 9b6a1c384d

Tree-SHA512: 27e4a41bc9c8f10715623f669c97a511520753b23d24ae91d6d2144e54588da0769f97b1de78c87b7471b39e556b682b1c2910b2bf71f124fb77cbc9e446d5f8
2023-07-18 10:11:23 +02:00
Tim Ruffing
9b6a1c384d sync-upstream.sh: Fix position of "-b" option in reproduce command 2023-07-17 18:44:33 +02:00
Jonas Nick
e996d076da Merge commits '44916ae9 86e3b38a ddf2b291 6138d73b e40fd277 ' into temp-merge-1156 2023-07-17 14:02:13 +00:00
Tim Ruffing
533571d6cf Merge ElementsProject/secp256k1-zkp#239: sync-upstream: allows providing the local branch via cli
05b207e969 sync-upstream: allows providing the local branch via cli (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 05b207e969

Tree-SHA512: b02f3fdf6565943cea2b93a0b2b0a38c30bb3c94873d0c4ed2ad276c75f3dc610911d1c9c076c8b7fd3a5baf83aa1ab66ec86415333cf58fe8f07c64fa74656f
2023-07-17 15:47:16 +02:00
Jonas Nick
05b207e969 sync-upstream: allows providing the local branch via cli 2023-07-17 13:29:59 +00:00
Jonas Nick
64717a7b16 Merge commits '8b013fce 485f608f 44c2452f cd470333 accadc94 43756da8 af65d30c 63a3565e 6a873cc4 3efeb9da 9f8a13dc 694ce8fb a43e982b e13fae48 c2ee9175 ' into temp-merge-1146 2023-07-17 13:02:36 +00:00
Jonas Nick
9a981068ce Merge commits '8b013fce 485f608f 44c2452f cd470333 accadc94 43756da8 ' into temp-merge-1115 2023-07-17 12:01:46 +00:00
Tim Ruffing
ff33018fe7 Merge ElementsProject/secp256k1-zkp#232: Backports from libsecp256k1 v0.3.2
39407c3f59 Mark stack variables as early clobber for technical correctness (Pieter Wuille)
56a5d41429 Bugfix: mark outputs as early clobber in scalar x86_64 asm (Pieter Wuille)
c8c0f55a11 ct: Be cautious and use volatile trick in more "conditional" paths (Tim Ruffing)
3e94289966 ct: Use volatile trick in scalar_cond_negate (Tim Ruffing)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 39407c3f59 I also verified that the ct time tests pass on GCC 13.1.1 and Clang 15.0.7.

Tree-SHA512: b7e695527ea58cc7b94a5f2fff6473b6779a469bc5c38baf92624b655cbdf303fbd204e6c1395fa02b98db3bc47bab32afe64bae4ab4fab18da856b621aab070
2023-05-14 20:21:19 +02:00
Pieter Wuille
39407c3f59 Mark stack variables as early clobber for technical correctness
In the field 5x52 asm for x86_64, stack variables are provided as outputs.
The existing inputs are all forcibly allocated to registers, so cannot
coincide, but mark them as early clobber anyway to make this clearer.
2023-05-14 17:20:10 +00:00
Pieter Wuille
56a5d41429 Bugfix: mark outputs as early clobber in scalar x86_64 asm
In the existing code, the compiler is allowed to allocate the RSI register
for outputs m0, m1, or m2, which are written to before the input in RSI is
read from. Fix this by marking them as early clobber.

Reported by ehoffman2 in https://github.com/bitcoin-core/secp256k1/issues/766
2023-05-14 17:20:01 +00:00
Tim Ruffing
c8c0f55a11 ct: Be cautious and use volatile trick in more "conditional" paths
- secp256k1_scalar_cadd_bit
 - secp256k1_modinvXX_normalize_YY
 - secp256k1_modinvXX_divsteps_ZZ
 - ECMULT_CONST_TABLE_GET_GE

Even though those code loations are not problematic right now
(with current compilers).
2023-05-14 17:19:04 +00:00
Tim Ruffing
3e94289966 ct: Use volatile trick in scalar_cond_negate 2023-05-14 17:16:50 +00:00
Jonas Nick
edcba04c28 Merge elementsproject/secp256k1-zkp#231: musig: add note about missing verification to partial_sign to doc
4ab4ec38a0 musig: add note about missing verification to partial_sign to doc (Jonas Nick)
f50ad76004 musig: update version number of BIP (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 4ab4ec38a0

Tree-SHA512: 1e35d83dd97bac96dfbc02d58841582afe67c38562c728bc3c593a797e1316dfdd550c4988dc78557f25a1633711ec13b35f6c5bae0f7dd29c9f1c994ad5c82c
2023-05-12 09:40:51 +00:00
Jonas Nick
4ab4ec38a0 musig: add note about missing verification to partial_sign to doc 2023-05-11 17:50:18 +00:00
Jonas Nick
f50ad76004 musig: update version number of BIP 2023-05-11 17:50:06 +00:00
Jonas Nick
4eab2c2fd8 Merge elementsproject/secp256k1-zkp#230: norm arg: add prove test vectors
f3126fdfec norm arg: remove prove edge tests which are now covered by vectors (Jonas Nick)
847ed9ecb2 norm arg: add verification to prove vectors (Jonas Nick)
cf797ed2a4 norm arg: add prove test vectors (Jonas Nick)
095c1e749c norm arg: add prove_const to tests (Jonas Nick)
bf7bf8a64f norm arg: split norm_arg_zero into prove_edge and verify_zero_len (Jonas Nick)
a70c4d4a8a norm arg: add test vector for |n| = 0 (Jonas Nick)
f5e4b16f0f norm arg: add test vector for sign bit malleability (Jonas Nick)
c0de361fc5 norm arg: allow X and R to be the point at infinity (Jonas Nick)
f22834f202 norm arg: add verify vector for n = [0], l = [0] (Jonas Nick)
d8e7f3763b musig: move ge_{serialize,parse}_ext to module-independent file (Jonas Nick)

Pull request description:

ACKs for top commit:
  Liam-Eagen:
    ACK f3126fd

Tree-SHA512: 1aad86521fce74435beabe7690c7fcc38ad9ae7a884ddcab69ef825b573433f700723a7672d29df1b4465bc33d5957b6a46f657f988cfd2cc73fa94a3472357d
2023-05-09 10:42:07 +00:00
Jonas Nick
f3126fdfec norm arg: remove prove edge tests which are now covered by vectors 2023-04-25 15:06:57 +00:00
Jonas Nick
847ed9ecb2 norm arg: add verification to prove vectors 2023-04-25 15:06:40 +00:00
Jonas Nick
cf797ed2a4 norm arg: add prove test vectors 2023-04-25 14:56:42 +00:00
Jonas Nick
095c1e749c norm arg: add prove_const to tests 2023-04-25 14:54:30 +00:00
Jonas Nick
ce18267b66 Merge elementsproject/secp256k1-zkp#229: musig: Fix nits left open in #211
a0b51afc01 musig: VERIFY_CHECK preconditions of _musig_keyaggcoef_internal() (Tim Ruffing)
da7702844e extrakeys: Clarify comparison order of compare/sort functions (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK a0b51afc01

Tree-SHA512: ad509d7a55c6f832a25b896b0fe38e259b79864b2a8d1fb337b9d9b4a5e1950a9d579040285465c89d815becc6e49af4129ab2d904d32ac98cef74357a440c89
2023-04-23 08:06:33 +00:00
Jonas Nick
78ed0e09ca Merge elementsproject/secp256k1-zkp#227: Use relative #include paths and tidy header guards (as in upstream)
e444d24bca Fix include guards: No _ prefix/suffix but _H suffix (as in upstream) (Tim Ruffing)
0eea7d97ab Use relative #include paths in tests (as in upstream) (Tim Ruffing)
c690d6df70 Use relative #include paths in benchmarks (as in upstream) (Tim Ruffing)
c565827c1a Use relative #include paths in ctime_test (as in upstream) (Tim Ruffing)
4eca406f4c Use relative #include paths in library (as in upstream) (Tim Ruffing)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK e444d24bca
  jonasnick:
    ACK e444d24bca

Tree-SHA512: 4d125cf75748f4a921b70ca933ee59c3cf5c0845c6960e6915a322e53840cb3a0955fe5952e654d133ad36991f3268aeee44430cbd6f7d83e333a554c436f39b
2023-04-23 07:50:30 +00:00
Jonas Nick
e7fc61ff16 Merge elementsproject/secp256k1-zkp#228: Simple dedicated -zkp README
4d9d8f92d4 Simple dedicated -zkp README (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 4d9d8f92d4

Tree-SHA512: bae7aafed0d524d2fea956261547ca094dbaa4b444b56b6f3fb947764cc5647b5eec82ac392f988df3d3d88d1357ae2aa34550c7a596b386a2d0a774f9764661
2023-04-21 16:22:17 +00:00
Tim Ruffing
a0b51afc01 musig: VERIFY_CHECK preconditions of _musig_keyaggcoef_internal() 2023-04-21 16:18:19 +02:00
Tim Ruffing
da7702844e extrakeys: Clarify comparison order of compare/sort functions
Note that the touched functions don't exist upstream currently.
2023-04-21 16:17:52 +02:00
Tim Ruffing
4d9d8f92d4 Simple dedicated -zkp README 2023-04-21 12:38:34 +02:00
Tim Ruffing
e444d24bca Fix include guards: No _ prefix/suffix but _H suffix (as in upstream) 2023-04-21 12:02:28 +02:00
Tim Ruffing
0eea7d97ab Use relative #include paths in tests (as in upstream) 2023-04-21 11:51:04 +02:00
Tim Ruffing
c690d6df70 Use relative #include paths in benchmarks (as in upstream) 2023-04-21 11:50:46 +02:00
Tim Ruffing
c565827c1a Use relative #include paths in ctime_test (as in upstream) 2023-04-21 11:50:34 +02:00
Tim Ruffing
4eca406f4c Use relative #include paths in library (as in upstream) 2023-04-21 11:50:24 +02:00
Jonas Nick
bf7bf8a64f norm arg: split norm_arg_zero into prove_edge and verify_zero_len
One function tests prover edge cases, the other tests verifier edge cases.
2023-04-20 19:05:22 +00:00
Jonas Nick
a70c4d4a8a norm arg: add test vector for |n| = 0 2023-04-20 19:03:27 +00:00
Jonas Nick
f5e4b16f0f norm arg: add test vector for sign bit malleability
R is point at infinity but sign is != 0
2023-04-20 19:02:51 +00:00
Jonas Nick
c0de361fc5 norm arg: allow X and R to be the point at infinity
Add test vector
2023-04-20 19:02:41 +00:00
Jonas Nick
f22834f202 norm arg: add verify vector for n = [0], l = [0] 2023-04-20 19:00:14 +00:00
Jonas Nick
d8e7f3763b musig: move ge_{serialize,parse}_ext to module-independent file 2023-04-20 18:56:11 +00:00
Jonas Nick
050d9b2912 Merge elementsproject/secp256k1-zkp#226: bppp: align terminology with paper
2c63d17c1e bppp: align terminology with paper (gamma) (Jonas Nick)
dbf2e4d3e1 bppp: align terminology with paper (mu, rho) (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK  2c63d17c1e

Tree-SHA512: 494db14717acf95de74ca14cdbd4908b31a2e81562ca18b8e3ddd795d40f60cd8ea8d7472c348da108db7d314d510f7366dc594809cf29c0c044c701c56119cc
2023-04-20 18:54:16 +00:00
Jonas Nick
2c63d17c1e bppp: align terminology with paper (gamma)
e -> gamma
2023-04-19 12:37:47 +00:00