Commit Graph

2855 Commits

Author SHA1 Message Date
mllwchrry
91b2deab7b ci: Add zkp modules to arm64-macos-native job 2026-02-06 14:37:11 +02:00
mllwchrry
f5e9804e34 Merge remote-tracking branch 'zkp/master' into temp-merge-1488 2026-02-06 13:02:03 +02:00
merge-script
e34dc81278 Merge BlockstreamResearch/secp256k1-zkp#315: ci: Backport LLVM apt signature fix
040673bd44 ci, docker: Fix LLVM repository signature failure (Hennadii Stepanov)

Pull request description:

  Cherry-pick of bitcoin-core/secp256k1@0ffb1749a5

  Fixes Docker build CI failure caused by Debian's Sequoia PGP policy rejecting SHA-1 signatures from the LLVM apt repository.

ACKs for top commit:
  real-or-random:
    utACK 040673bd44

Tree-SHA512: d524472a3e74abd787007d453e62e2ae28458e37fa2eaf28ee3f1379634e9f34419a5e06fe52d627ea010f634dcbeb6264ff73b60005cb4622b81c69ffd22e28
2026-02-06 11:56:24 +01:00
Hennadii Stepanov
040673bd44 ci, docker: Fix LLVM repository signature failure
The LLVM apt repository uses legacy SHA1 signatures which are now
rejected by the stricter Sequoia PGP policy.

This change extends the 'sha1.second_preimage_resistance' cutoff date to
9999-01-01 in the default Sequoia config. This effectively whitelists
the legacy signature algorithm, preventing "OpenPGP signature
verification failed" errors during `apt-get update`.

See https://github.com/llvm/llvm-project/issues/153385.
2026-02-06 12:01:29 +02:00
mllwchrry
c946b0978a Merge commits 'e3a885d4 d7f6613d 7d0bc087 7712a530 4155e62f 06bff6de 1791f6fc 4b8d5eea bedffd53 ' into temp-merge-1488 2026-02-06 10:42:44 +02:00
Jonas Nick
1cdc3e0fe3 Merge elementsproject/secp256k1-zkp#311: sync-upstream: Extend git usage tips
41cead8a0b sync-upstream: Extend git usage tips (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 41cead8a0b

Tree-SHA512: ce484d8235a6079be34257bfe859786d2fa666c2f373db7742030210118b8186f8b975517a24be60ee566682d2cdc217f6f10a36ae9c96c9f592dc3c2f5b4331
2026-02-06 08:36:23 +00:00
merge-script
d176205dd7 Merge BlockstreamResearch/secp256k1-zkp#313: Upstream PR 1518
2cb2e312e9 extrakeys: Migrate to bitcoin-core/secp256k1#1518 secp256k1_ec_pubkey_sort (DarkWindman)
7d2591ce12 Add secp256k1_pubkey_sort (Jonas Nick)

Pull request description:

  Merge bitcoin-core/secp256k1#1518: Add secp256k1_pubkey_sort

  This PR can be recreated with `./contrib/sync-upstream.sh -b master range bb528cf`.
  Tip: Use `git show --remerge-diff` to show the changes manually added to the merge commit.

ACKs for top commit:
  real-or-random:
    ACK 2cb2e312e9

Tree-SHA512: dbdb6c5df2195d2ece9574367e0f684a651ea199806a80232c85b0ffd0ba6b930b108bd97385d9fab656754a85fa6de223a93b945046b043aab20ad7bb3d1bff
2026-02-05 22:59:07 +01:00
merge-script
ca68d08872 Merge BlockstreamResearch/secp256k1-zkp#312: scalar: Add SECP256K1_SCALAR_VERIFY to zkp-specific function
96a415b1c0 scalar: Port bitcoin-core/secp256k1#1393 to zkp-specific code (mllwchrry)

Pull request description:

  Add the `SECP256K1_SCALAR_VERIFY` macro to the zkp-specific `secp256k1_scalar_set_u64` function.

  This was missed when upstream PRs bitcoin-core/secp256k1#1373 and bitcoin-core/secp256k1#1393 were merged.

ACKs for top commit:
  real-or-random:
    ACK 96a415b1c0

Tree-SHA512: 4c3c6209e4c27bec7afc07398c9fc50aef7d44850fbbf5969ff4b57991279960c9645c8daeee5d78bee54dac7fe85bc3d9a01ba4b9deb761d574ae6221ef41c1
2026-02-05 21:44:16 +01:00
DarkWindman
2cb2e312e9 extrakeys: Migrate to bitcoin-core/secp256k1#1518 secp256k1_ec_pubkey_sort 2026-02-05 19:02:49 +02:00
DarkWindman
3291b021bf Merge commits 'bb528cf ' into temp-merge-1518 2026-02-05 18:50:53 +02:00
mllwchrry
96a415b1c0 scalar: Port bitcoin-core/secp256k1#1393 to zkp-specific code 2026-02-05 17:29:53 +02:00
Tim Ruffing
41cead8a0b sync-upstream: Extend git usage tips 2026-02-05 16:01:30 +01:00
merge-script
36a7b87449 Merge BlockstreamResearch/secp256k1-zkp#310: Upstream PRs 1058
4c341f89ab Add changelog entry for SDMC (Pieter Wuille)
a043940253 Permit COMB_BITS < 256 for exhaustive tests (Pieter Wuille)
39b2f2a321 Add test case for ecmult_gen recoded = {-1,0,1} (Pieter Wuille)
644e86de9a Reintroduce projective blinding (Pieter Wuille)
07810d9abb Reduce side channels from single-bit reads (Peter Dettman)
a0d32b597d Optimization: use Nx32 representation for recoded bits (Peter Dettman)
e03dcc44b5 Make secp256k1_scalar_get_bits support 32-bit reads (Pieter Wuille)
5005abee60 Rename scalar_get_bits -> scalar_get_bits_limb32; return uint32_t (Pieter Wuille)
6247f485b6 Optimization: avoid unnecessary doublings in precomputation (Peter Dettman)
15d0cca2a6 Optimization: first table lookup needs no point addition (Pieter Wuille)
7a33db35cd Optimization: move (2^COMB_BITS-1)/2 term into ctx->scalar_offset (Pieter Wuille)
ed2a056f3d Provide 3 configurations accessible through ./configure (Pieter Wuille)
5f7be9f6a5 Always generate tables for current (blocks,teeth) config (Pieter Wuille)
fde1dfcd8d Signed-digit multi-comb ecmult_gen algorithm (Peter Dettman)
486518b350 Make exhaustive tests's scalar_inverse(&x,&x) work (Pieter Wuille)
ab45c3e089 Initial gej blinding -> final ge blinding (Pieter Wuille)
aa00a6b892 Introduce CEIL_DIV macro and use it (Tim Ruffing)

Pull request description:

  [bitcoin-core/secp256k1#1058]: Signed-digit multi-comb ecmult_gen algorithm

  This PR can be recreated with `./contrib/sync-upstream.sh -b master range da51507`.
  Tip: Use `git show --remerge-diff` to show the changes manually added to the merge commit.

ACKs for top commit:
  mllwchrry:
    ACK 9a57e3c
  real-or-random:
    ACK 9a57e3c650

Tree-SHA512: 6de5961697ed1f23ce60a6437b622cdf1289273cf9e22f7abfeced08c1f279e30b1a807148f3405c723ad5d3c712eecf0499f994dfce8a1c687b4521b0ef60dd
2026-02-05 15:47:28 +01:00
Jonas Nick
9a57e3c650 Merge commits 'da515074 ' into temp-merge-1058 2026-01-30 21:18:06 +00:00
merge-script
7e460db4ca Merge BlockstreamResearch/secp256k1-zkp#307: Upstream PRs 1484, 1483, 1486, 1496, 1489, 1490, 1507, 1512, 1515
f9cf003d9b scalar: Port bitcoin-core/secp256k1#1512 to zkp-specific code (mllwchrry)
a85e2233e7 ci: Note affected clangs in comment on ASLR quirk (Tim Ruffing)
f7f0184ba1 msan: notate more variable assignments from assembly code (Cory Fields)
a61339149f change inconsistent array param to pointer (Cory Fields)
a5e8ab2484 ci: Add sanitizer env variables to debug output (Tim Ruffing)
84a93de4d2 ci: Add workaround for ASLR bug in sanitizers (Tim Ruffing)
2028069df2 doc: clarify input requirements for secp256k1_fe_mul (Sebastian Falbesoner)
11420a7a28 tests: improve fe_sqr test (Sebastian Falbesoner)
e7bdddd9c9 refactor: rename `check_fe_equal` -> `fe_equal` (Sebastian Falbesoner)
00111c9c56 tests: add missing fe comparison checks for inverse field test cases (Sebastian Falbesoner)
31ba404944 msan: notate variable assignments from assembly code (Cory Fields)
e7ea32e30a msan: Add SECP256K1_CHECKMEM_MSAN_DEFINE which applies to memory sanitizer and not valgrind (Cory Fields)
94a14d5290 ci: Update cache action (Hennadii Stepanov)
3777e3f36a cmake: Recommend native CMake commands in README (Tim Ruffing)
51df2d9ab3 tests: Drop redundant _scalar_check_overflow calls (Tim Ruffing)

Pull request description:

  Merge bitcoin-core/secp256k1#1484: tests: Drop redundant _scalar_check_overflow calls
  Merge bitcoin-core/secp256k1#1483: cmake: Recommend native CMake commands in README
  Merge bitcoin-core/secp256k1#1486: ci: Update cache action
  Merge bitcoin-core/secp256k1#1496: msan: notate variable assignments from assembly code
  Merge bitcoin-core/secp256k1#1489: tests: add missing fe comparison checks for inverse field test cases
  Merge bitcoin-core/secp256k1#1490: tests: improve fe_sqr test (issue #1472)
  Merge bitcoin-core/secp256k1#1507: ci: Add workaround for ASLR bug in sanitizers
  Merge bitcoin-core/secp256k1#1512: msan: notate more variable assignments from assembly code
  Merge bitcoin-core/secp256k1#1515: ci: Note affected clangs in comment on ASLR quirk

  This PR can be recreated with `./contrib/sync-upstream.sh -b master range d831168`.
  Tip: Use `git show --remerge-diff` to show the changes manually added to the merge commit.

ACKs for top commit:
  real-or-random:
    ACK f9cf003d9b

Tree-SHA512: c1720b50abb452ebea28f48239411863ac5ab2a7dcc2f34b8ebf05eb11b2657d35ea63a261624d33a82b89eb93db41eea166d5565b3e5d080a0181370d3d9b72
2026-01-29 16:26:31 +01:00
mllwchrry
f9cf003d9b scalar: Port bitcoin-core/secp256k1#1512 to zkp-specific code 2026-01-29 12:51:33 +02:00
mllwchrry
8c72644a0e Merge commits '5ad3aa3 2483627 0653a25 d926510 cdc9a62 427e86b 05bfab6 4b77fec d831168 ' into temp-merge-1515 2026-01-23 19:51:09 +02:00
Jonas Nick
797e2ed61a Merge elementsproject/secp256k1-zkp#306: sync-upstream: improve help text
db8750de46 sync-upstream: improve help text (Jonas Nick)

Pull request description:

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

Tree-SHA512: 06f28c5ebd74437c3c2ef5ae460bec66ff9f15c4bae3b76c74b1323e2ef24d8ec456b72d58df9d68a3d41fcd44d6dfbefe8115900ccb10b8f028a7b0952b6df1
2026-01-22 11:07:36 +00:00
Jonas Nick
db8750de46 sync-upstream: improve help text 2026-01-22 09:09:27 +00:00
merge-script
42e75b613b Merge BlockstreamResearch/secp256k1-zkp#304: ci: Backport MSan fixes for ctime_tests
b9a82b481f ci: Update macOS image (Hennadii Stepanov)
a1be8ed1b1 ci: Silent Homebrew's noisy reinstall warnings (Hennadii Stepanov)
fd259fe9ad ci: Add job with -fsanitize-memory-param-retval (Tim Ruffing)
76b3396516 configure: Move "experimental" warning to bottom (Tim Ruffing)
e639e6caa9 autotools: Disable eager MSan in ctime_tests (Tim Ruffing)

Pull request description:

  Cherry-picked the upstream fixes from bitcoin-core/secp256k1#1517 to align behaviour here and silence the false 'use-of-uninitialized-value' reports in ctime_tests under Clang ≥16.

  #### Result:
  - `ctime_tests` is clean under MSan.
  - Other tests are unchanged.
  - No API or behaviour changes.

  #### Commits cherry-picked:
  - [55e5d975db](55e5d975db),
  - [e1bef0961c](e1bef0961c),
  - [ebfb82ee2f](ebfb82ee2f)

  #### References:
  Upstream: https://github.com/bitcoin-core/secp256k1/pull/1517

ACKs for top commit:
  apoelstra:
    ACK b9a82b481fc35c5db3a127185ffada77fe107d46; successfully ran local tests
  jonasnick:
    ACK b9a82b481f

Tree-SHA512: b6c9ae38b142c7fadf1157a1b25cdc8e85e6cd271222b950b1246f14daf85b072979d4f2ee8791c8b81b2f6a94ad1094fc8110bbd4ff19153de6a6efad2e3cc0
2025-09-19 17:58:29 +02:00
Hennadii Stepanov
b9a82b481f ci: Update macOS image
The macOS 12 GHA image has been deprecated since 2024-10-07.
See: https://github.com/actions/runner-images/issues/10721
2025-09-18 13:12:29 +05:30
Hennadii Stepanov
a1be8ed1b1 ci: Silent Homebrew's noisy reinstall warnings 2025-09-18 13:12:18 +05:30
Tim Ruffing
fd259fe9ad ci: Add job with -fsanitize-memory-param-retval 2025-09-16 15:27:23 +05:30
Tim Ruffing
76b3396516 configure: Move "experimental" warning to bottom
to make it more promiment
2025-09-16 15:24:23 +05:30
Tim Ruffing
e639e6caa9 autotools: Disable eager MSan in ctime_tests
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2025-09-16 15:17:35 +05:30
Jonas Nick
f92fd5cc91 Merge elementsproject/secp256k1-zkp#303: ci: backport upstream string-initializer fixes and clean up related tests
7d779c6d9d examples/musig: use brace-enclosed initializer for 32-byte msg (BEULAHEVANJALIN)
53fd89b635 musig/tests: initialize keypair (Jonas Nick)
40bd8549dd musig/test: Remove dead code (Tim Ruffing)
c4570307ec test/fix: refactor unterminated string initializers to brace arrays - Mirror upstream fix (bitcoin-core/secp256k1 fa67b675) - Convert tags, test vectors, and constants in -zkp-only modules (ecdsa_adaptor, ecdsa_s2c, musig, bppp, rangeproof, schnorrsig_halfagg) - Avoid -Wunterminated-string-initialization without changing behavior (BEULAHEVANJALIN)
654a8c327c refactor: Use array initialization for unterminated strings (MarcoFalke)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK 7d779c6d9d thanks!
  jonasnick:
    ACK 7d779c6d9d

Tree-SHA512: edb9885a36eab499dee05e0c87a184f139ba6f68c01128ae692ab1195546ba8ff77d0c0b06faa22164fd89fd27935fd68b1e9c04a1fc9bcd0b7d6472515095dd
2025-09-16 06:00:35 +00:00
BEULAHEVANJALIN
7d779c6d9d examples/musig: use brace-enclosed initializer for 32-byte msg
Switch msg initialization from a string literal to a brace-enclosed
array to avoid -Wunterminated-string-initialization. Upstream removed
the trailing '!' from the message; this change retains it.
2025-09-09 21:56:53 +05:30
Jonas Nick
53fd89b635 musig/tests: initialize keypair
The keypair is unused in musig_partial_sign, but clang-snapshot gives a compiler
warning anyway.
2025-09-09 21:56:00 +05:30
Tim Ruffing
40bd8549dd musig/test: Remove dead code
This avoids a compiler warning on clang-snapshot about &keypair being uninitialized.

(cherry picked from commit 8d967a602b)
2025-09-09 21:55:51 +05:30
BEULAHEVANJALIN
c4570307ec test/fix: refactor unterminated string initializers to brace arrays
- Mirror upstream fix (bitcoin-core/secp256k1 fa67b675)
- Convert tags, test vectors, and constants in -zkp-only modules (ecdsa_adaptor, ecdsa_s2c, musig, bppp, rangeproof, schnorrsig_halfagg)
- Avoid -Wunterminated-string-initialization without changing behavior
2025-09-09 21:55:17 +05:30
MarcoFalke
654a8c327c refactor: Use array initialization for unterminated strings
The previous code is correct and harmless to initialize an array with a
non-terminated character sequence using a string literal.

However, it requires exactly specifying the array size, which can be
cumbersome.

Also, GCC-15 may issue the -Wunterminated-string-initialization warning.
[1]

Fix both issues by using array initialization. This refactoring commit
does not change behavior.

[1] Example warning:

src/modules/schnorrsig/main_impl.h:48:46: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
   48 | static const unsigned char bip340_algo[13] = "BIP0340/nonce";
      |                                              ^~~~~~~~~~~~~~~

(cherry picked from commit fa67b6752d)

Conflicts:
	src/testrand_impl.h (kept local name `secp256k1_testrand_seed`)
2025-09-09 21:47:12 +05:30
Andrew Poelstra
f9a04ae405 Merge BlockstreamResearch/secp256k1-zkp#302: extrakeys: fix pubkey_sort_cmp test
83d0fa25a8 extrakeys: fix pubkey_sort_cmp test (Jonas Nick)

Pull request description:

  Instead of providing CTX directly, pass a cmp_data object containing CTX. Otherwise, memory sanitizer fails with "use-of-uninitialized-value".


ACKs for top commit:
  real-or-random:
    utACK 83d0fa25a8
  apoelstra:
    ACK 83d0fa25a826d716f809e00ef0a67385b776aec9; successfully ran local tests


Tree-SHA512: eb36c9f90632a3fb472653686ffb5c7a9c29849e05ab1084106a49c23e60ca1c90022ee1accd99ab5bfaa4fd5b3f4670cea8d5a2c415f00c05d645c793b6bedd
2025-09-09 15:27:50 +00:00
Jonas Nick
83d0fa25a8 extrakeys: fix pubkey_sort_cmp test
Instead of providing CTX directly, pass a cmp_data object containing CTX.
Otherwise, memory sanitizer fails with "use-of-uninitialized-value".
2025-09-08 19:18:39 +00:00
Andrew Poelstra
6152622613 Merge ElementsProject/secp256k1-zkp#295: rangeproof: add unit test for malleating single-value proofs
3a1c39625e rangeproof: add unit test for malleating single-value proofs (Andrew Poelstra)

Pull request description:

  I was a bit confused reading `secp256k1_rangeproof_getheader_impl` because in the case of single-value proofs (`has_nz_range == 0`) some bits of the header are unconstrained. At first I thought this was a malleability vector. And I think I've had this same confusion in the past.

  But in fact it is not a malleability vector because the whole header gets hashed into the proof.

  Add a unit test to confirm this to reduce future confusion.

ACKs for top commit:
  real-or-random:
    utACK 3a1c39625e

Tree-SHA512: 9670cd04fcc0bb322d89c2c86ef863e13c29e4477dc6fecdda16b9a745e42a84f237a7ec387b3291f334e2a5c5806a8cc7cc00e40246ad5b36366be841195b4b
2024-06-20 13:18:07 +00:00
Andrew Poelstra
3a1c39625e rangeproof: add unit test for malleating single-value proofs
I was a bit confused reading `secp256k1_rangeproof_getheader_impl`
because in the case of single-value proofs (`has_nz_range == 0`) some
bits of the header are unconstrained. At first I thought this was a
malleability vector. And I think I've had this same confusion in the
past.

But in fact it is not a malleability vector because the whole header
gets hashed into the proof.

Add a unit test to confirm this to reduce future confusion.
2024-06-19 15:27:06 +00:00
merge-script
bedffd53d8 Merge bitcoin-core/secp256k1#1488: ci: Add native macOS arm64 job
218f0cc93b ci: Add native macOS arm64 job (Hennadii Stepanov)

Pull request description:

  This PR starts using the [new](https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/) M1 macOS runner.

  The alternative approach might be using a matrix, but it is not trivial to implement.

ACKs for top commit:
  real-or-random:
    ACK 218f0cc93b

Tree-SHA512: 709e836909fa2a90248f689f4c57192d1daecc53abd3d2d1b8b892a7deb6fdd008bf8f7270ab39da5b0f994d0ea4cf0767dab3a07c6dfc2109a9735af1072f3f
2024-06-10 18:11:12 +02:00
merge-script
4b8d5eeacf Merge bitcoin-core/secp256k1#1532: cmake: Disable eager MSan in ctime_tests
f55703ba49 autotools: Delete unneeded compiler test (Hennadii Stepanov)
396e885886 autotools: Align MSan checking code with CMake's implementation (Hennadii Stepanov)
abde59f52d cmake: Report more compiler details in summary (Hennadii Stepanov)
7abf979a43 cmake: Disable `ctime_tests` if build with `-fsanitize=memory` (Hennadii Stepanov)

Pull request description:

  Same as https://github.com/bitcoin-core/secp256k1/pull/1517, but for the CMakle build system.

  The second commit improves the configure summary (similar to https://github.com/hebasto/bitcoin/pull/189.

ACKs for top commit:
  real-or-random:
    ACK f55703ba49

Tree-SHA512: 18190c062ae6e27d0ecbe7460cc22c960b25c0d35aa4b94f151d4b1c48f16e99fd5ecdfcb359784f95995292633d30d3d23b75a12be3aca5afffcc1e7e7daf31
2024-06-10 18:07:13 +02:00
Hennadii Stepanov
f55703ba49 autotools: Delete unneeded compiler test
This change makes both Autotools and CMake build systems consistent.
2024-05-28 09:47:00 +01:00
Hennadii Stepanov
396e885886 autotools: Align MSan checking code with CMake's implementation 2024-05-28 09:44:47 +01:00
Hennadii Stepanov
abde59f52d cmake: Report more compiler details in summary 2024-05-28 09:37:01 +01:00
Hennadii Stepanov
7abf979a43 cmake: Disable ctime_tests if build with -fsanitize=memory
Clang >= 16 has `-fsanitize-memory-param-retval` turned on by default,
which is incompatible with
2024-05-28 09:37:00 +01:00
merge-script
1791f6fce4 Merge bitcoin-core/secp256k1#1517: autotools: Disable eager MSan in ctime_tests
ebfb82ee2f ci: Add job with -fsanitize-memory-param-retval (Tim Ruffing)
e1bef0961c configure: Move "experimental" warning to bottom (Tim Ruffing)
55e5d975db autotools: Disable eager MSan in ctime_tests (Tim Ruffing)

Pull request description:

  This is the autotools solution for #1516.

  Alternatively, we could have a full-blown `--enable-msan` option, but it's more work, and I'm not convinced that it's necessary or at least much better.

  hebasto If you're Concept ACK, are you willing to work on an equivalent PR for CMake?

ACKs for top commit:
  hebasto:
    ACK ebfb82ee2f, tested on Ubuntu 24.04 with different clang versions (from 15 to 18) and different build configurations. CI changes look OK as well.

Tree-SHA512: c083d778fd50bd35c2e29b7fe0d92b98d912ee5ac7809ae73067d050a0d3c42b3483260f1286d0023cdb802a3c3006bf932ecf60ce81b942de1c9824374c0132
2024-05-27 14:14:04 +02:00
Tim Ruffing
ebfb82ee2f ci: Add job with -fsanitize-memory-param-retval 2024-05-26 14:01:14 +02:00
Tim Ruffing
e1bef0961c configure: Move "experimental" warning to bottom
to make it more promiment
2024-05-26 14:01:14 +02:00
Tim Ruffing
55e5d975db autotools: Disable eager MSan in ctime_tests
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2024-05-26 14:01:14 +02:00
Jonas Nick
168377204d Merge elementsproject/secp256k1-zkp#294: generator: massively speed up serialization
6361266013 generator: speed up parsing (Andrew Poelstra)
5e7c2c178d generator: massively speed up serialization (Andrew Poelstra)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK 6361266013
  jonasnick:
    ACK 6361266013

Tree-SHA512: 9f35467ac9d39d23b68a3f830c920f61ae39d99974d6a864df4a3c19860dc8fc447609d0480e45234c66250878d34da03bfcf0056eaa83d3c78babb254962bf4
2024-05-22 11:55:07 +00:00
Andrew Poelstra
6361266013 generator: speed up parsing
Similar to speeding up serialization; in our parsing logic we did a
bunch of expensive stuff then expensively inverted it. Drop everything
except the essential checks and then memcpy.
2024-05-21 13:32:12 +00:00
Andrew Poelstra
5e7c2c178d generator: massively speed up serialization
`secp256k1_pedersen_commit_serialize` would call `_load` (which does a
sqrt to fully decompress the key, then a conditional negation based on
the flag), then check the Jacobian symbol of the resulting y-coordinate,
then re-serialize based on this.

Instead, don't do any of this stuff. Copy the flag directly out of the
internal representation and copy the x-coordinate directly out of the
internal representation.

Checked that none of the other _serialize methods in the modules do
this.

Fixes #293
2024-05-20 12:40:02 +00:00
Tim Ruffing
06bff6dec8 Merge bitcoin-core/secp256k1#1528: tests: call secp256k1_ecmult_multi_var with a non-NULL error callback
9554362b15 tests: call secp256k1_ecmult_multi_var with a non-NULL error callback (Nicolas Iooss)

Pull request description:

  Hello,
  This Pull Request fixes the issue reported in https://github.com/bitcoin-core/secp256k1/issues/1527. Function `secp256k1_ecmult_multi_var` expects to be called with a non-`NULL` `error_callback` parameter. Fix the invocation in `test_ecmult_accumulate` to do this. While at it, wrap the call in a `CHECK` macro to ensure it succeeds.

ACKs for top commit:
  real-or-random:
    utACK 9554362b15
  siv2r:
    ACK 9554362, I have also verified that other invocations of `ecmult_multi_var` (in tests) don’t use `NULL` for the error callback function argument.

Tree-SHA512: 6a9f6c10c575794da75f2254d6fbbc195de889c81a371ce35ab38e2e5483aa1e25ec0bcd5aa8d6a32a1493586f73430208a4bd0613e373571d2f04d63dbc4a1c
2024-05-13 16:06:55 +02:00
Tim Ruffing
4155e62fcc Merge bitcoin-core/secp256k1#1526: cmake: Fix check_arm32_assembly when using as subproject
9f4c8cd730 cmake: Fix `check_arm32_assembly` when using as subproject (Hennadii Stepanov)

Pull request description:

  When integrating libsecpk1 in a downstream project like this:
  ```cmake
  set(SECP256K1_ASM arm32 CACHE STRING "" FORCE)
  add_subdirectory(src/secp256k1)
  ```
  it fails to configure:
  ```
  CMake Error at /home/hebasto/git/bitcoin/build/check_arm32_assembly/CMakeFiles/CMakeTmp/CMakeLists.txt:21 (target_sources):
    Cannot find source file:

      /home/hebasto/git/bitcoin/cmake/source_arm32.s

  CMake Error at /home/hebasto/git/bitcoin/build/check_arm32_assembly/CMakeFiles/CMakeTmp/CMakeLists.txt:20 (add_executable):
    No SOURCES given to target: cmTC_d0f0b

  CMake Error at src/secp256k1/cmake/CheckArm32Assembly.cmake:2 (try_compile):
    Failed to generate test project build system.
  Call Stack (most recent call first):
    src/secp256k1/CMakeLists.txt:127 (check_arm32_assembly)

  ```

  This PR fixes this issue, which was overlooked in https://github.com/bitcoin-core/secp256k1/pull/1304.

ACKs for top commit:
  real-or-random:
    utACK 9f4c8cd730
  theuni:
    utACK 9f4c8cd730

Tree-SHA512: 47d97ad0fb2e3779523c2111ea75906671a0fb3f50646e29dee195f53106ace69af5e4abc92c765f0eee6973528ce9195b94377d0157209230c958894d4049fb
2024-05-09 09:51:58 +02:00