2755 Commits

Author SHA1 Message Date
Jesse Posner
702dd38c6b
frost: initialize project
This commit adds the foundational configuration and building scripts
and an initial structure for the project.
2024-07-16 00:05:59 -07:00
Jonas Nick
168377204d
Merge elementsproject/secp256k1-zkp#294: generator: massively speed up serialization
6361266013ad14428c89334013c74f8dec6f8e9d generator: speed up parsing (Andrew Poelstra)
5e7c2c178dc22779ad0f23d39aea39fba0746687 generator: massively speed up serialization (Andrew Poelstra)

Pull request description:

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

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
d661a93cc9
Merge BlockstreamResearch/secp256k1-zkp#292: doc: fix sage code for deriving alternative generator H
7040a2024795a7e3758c7ab604ab440652c9772f doc: fix sage code for deriving alternative generator H (Sebastian Falbesoner)

Pull request description:

  The line calculating H (in particular, the expression `G.decode('hex')`) fails with the following error message on Sage 9.5:

  ```
  AttributeError: 'str' object has no attribute 'decode'
  ```

  Fix that by converting the hex-string to bytes using `bytes.fromhex`.

  (Noticed while reviewing https://github.com/bitcoin/bitcoin/pull/30048 which picks this code snippet comment up.)

ACKs for top commit:
  josibake:
    ACK 7040a20247
  real-or-random:
    utACK 7040a2024795a7e3758c7ab604ab440652c9772f

Tree-SHA512: 0a44f399b103c2f5840056d163c1483a1d4f032bc0f8d3822507ac6da9d567f46e36caa79c7f5016aebcc8827b79e9aec7ebdb4f21c3c0242dc6875be140f289
2024-05-08 12:20:56 +02:00
Sebastian Falbesoner
7040a20247 doc: fix sage code for deriving alternative generator H
The expression `G.decode('hex')` fails with the following error message
on Sage 9.5:

AttributeError: 'str' object has no attribute 'decode'

Fix that by converting the hex-string to bytes using `bytes.fromhex`.
2024-05-07 19:38:51 +02:00
Tim Ruffing
a7907b1af2
Merge BlockstreamResearch/secp256k1-zkp#261: Schnorr (Incremental) Half Aggregation
3a9b1d46a31e8ca93a94752e08b514c06ebc2c0c New Experimental Module: Incremental Half-Aggregation for Schnorr Signatures (Benedikt)

Pull request description:

  Revisited PR #130 by jonasnick.
  I am happy to hear your thoughts.

  **Summary of changes compared to #130:**

  - Address comments from rustyrussell
  - Use tagged hash
  - Compute hashes with common prefix by copying midstate
  - Allow Incremental Aggregation and make code consistent with the [draft spec](https://github.com/BlockstreamResearch/cross-input-aggregation/blob/master/half-aggregation.mediawiki)

ACKs for top commit:
  real-or-random:
    ACK 3a9b1d46a31e8ca93a94752e08b514c06ebc2c0c

Tree-SHA512: 27239033f8b28ecf87ea310b3dd5a19dbbe6fd07495db71ef7017f8f444ec25a12897087d1bea0a2e9c3df77d7f17c38b183d7fe768858da2180f26624add4aa
2024-03-05 12:17:22 +01:00
Benedikt
3a9b1d46a3 New Experimental Module: Incremental Half-Aggregation for Schnorr Signatures 2024-02-27 14:04:40 +01:00
Jonas Nick
900a4371d3
Merge elementsproject/secp256k1-zkp#290: configure: Clean ups
860e3bb29461c05b495c6f027b6c5a62532738b5 configure: Fix reduced surjection proof size (Tim Ruffing)
0873358f774d913c4e370d0d0218b61f92c9d171 configure: Reorder modules also for AC_ARG_ENABLE (Tim Ruffing)
9de973f61376754e4125d8d2a5f1711ce421bd4b configure: Document canonical order of modules (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 860e3bb29461c05b495c6f027b6c5a62532738b5

Tree-SHA512: cfbaf9cb8a686aeab43ef6727b38d94467b862746062c1c06876bd98614ada7a00bc617481b0e0059dc294250a94a53581f3ffd685aa05c47a665950b280da51
2024-02-16 14:04:16 +00:00
Tim Ruffing
860e3bb294 configure: Fix reduced surjection proof size
The variable set automatically by AC_ARG_ENABLE is called enable_...
2024-02-16 10:59:25 +01:00
Tim Ruffing
0873358f77 configure: Reorder modules also for AC_ARG_ENABLE 2024-02-16 10:59:25 +01:00
Tim Ruffing
9de973f613 configure: Document canonical order of modules 2024-02-16 10:59:25 +01:00
Jonas Nick
1e04d32447
Merge elementsproject/secp256k1-zkp#288: cmake: Add support for -zkp modules
4228fd1124281af57c9872f1de3f4eaac73973f4 cmake: Add support for -zkp modules (Tim Ruffing)

Pull request description:

ACKs for top commit:
  jonasnick:
    utACK 4228fd1124281af57c9872f1de3f4eaac73973f4

Tree-SHA512: 72606bb3421a4d6479c5cbc94e2468d6a9a53581f571fd5340edc41595eac18fbb04dcaacce8f39020e32a69b733ba6743aac4b901e1600f5245a4a04cb0e27a
2024-02-02 19:47:59 +00:00
Tim Ruffing
4228fd1124 cmake: Add support for -zkp modules
Co-authored-by: lightyear15 <g.minist8@gmail.com>
2024-01-25 15:58:52 +01:00
Jonas Nick
03aecafe4c
Merge elementsproject/secp256k1-zkp#286: shallue_van_de_woestijne rewrite
6b9d335ef641b77884fdb0e65f95c5ac4dd2209f generator: add shallue_van_de_woestijne test for t = 0 (Jonas Nick)
26522241b407a04825442dea839af82d97372daf generators: shallue_van_de_woestijne improve comments (Jonas Nick)
5d87e80c6928694bc9d2fe3bf8fd89343ba16f83 shallue_van_de_woestijne rewrite (Russell O'Connor)

Pull request description:

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

Tree-SHA512: 4a5ca291ec760ea54a43ff0b811ca1fac024002172d4639919fb97f63cfa0e75a580674c86a5a0ac9866e00520be4dd8d1d37b6d2fd8d2057e42a804dbf9127c
2024-01-25 09:07:16 +00:00
Jonas Nick
6b9d335ef6 generator: add shallue_van_de_woestijne test for t = 0 2024-01-24 17:55:38 -05:00
Jonas Nick
26522241b4 generators: shallue_van_de_woestijne improve comments 2024-01-24 17:55:36 -05:00
Russell O'Connor
5d87e80c69 shallue_van_de_woestijne rewrite
The previous implementation returns an off-curve point for the input t=0.

This rewrite addresses that issue by implicity returning the on-curve point
(d, sqrt(1 + b)), which is the point that the paper Indifferentiable Hashing
to Barreto–Naehrig Curves suggests returning in this case.

Note: At the moment it is cryptographically impossible for the input t to be 0.
2024-01-24 17:50:48 -05:00
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
Jonas Nick
b673a43090 musig: new upstream def of VERIFY_CHECK (empty in non-VERIFY)
Remove explicity VERIFY_CHECKs in keyaggcoef_internal since normalization should
be checked in the fe_* functions.
2024-01-23 16:04:45 +01:00
Jonas Nick
cd173688fb musig: replace point_{save,load} with ge_{to,from}_bytes 2024-01-23 16:04:45 +01:00
Jonas Nick
33db8edb27 group: add ge_to_bytes and ge_from_bytes 2024-01-23 16:04:45 +01:00
Jonas Nick
de54a1eff7 musig2: clean up ctx doc in include file 2024-01-23 16:04:45 +01:00
Tim Ruffing
4f65698865 extrakeys: Remove redundant secp256k1_pubkey_cmp
It was a verbatim copy of secp256k1_ec_pubkey_cmp.
2024-01-23 16:04:45 +01:00
Tim Ruffing
c29f28e638 include: make docs more consistent
Like upstream https://github.com/bitcoin-core/secp256k1/pull/1476 .
2024-01-23 16:04:45 +01:00
Tim Ruffing
e626f00d1e Merge commits 'b314cf28 1f1bb78b 40f50d0f c891c5c2 ea47c82e e7210393 c1b49664 5814d848 07687e81 10e6d29b d3e29db8 e2c9888e 4197d667 5e9a4d7a 77af1da9 1a81df82 1ad5185c efe85c70 79e09451 d373bf6d 74b7c3b5 a9db9f2d 44378867 3bf4d68f e4af41c6 ' into temp-merge-1249 2024-01-23 16:04:45 +01:00
Tim Ruffing
e4af41c61b
Merge bitcoin-core/secp256k1#1249: cmake: Add SECP256K1_LATE_CFLAGS configure option
42f8c5140227dbdd8ae7eaaecd914e705e1b12d0 cmake: Add `SECP256K1_LATE_CFLAGS` configure option (Hennadii Stepanov)

Pull request description:

  This PR enables users to override compiler flags that have been set by the CMake-based build system, such as warning flags.

  The Autotools-based build system has the same feature out-of-the-box.

  See more details [here](https://github.com/bitcoin-core/secp256k1/issues/1235#issuecomment-1465330925).

  Here are some examples of the new option usage:
  ```
  cmake -S . -B build -DSECP256K1_LATE_CFLAGS="-Wno-extra -Wlong-long"
  ```

  ```
  cmake -S . -B build -DSECP256K1_BUILD_EXAMPLES=ON -DSECP256K1_LATE_CFLAGS=-O1
  cmake --build build
  ...
  In function ‘secp256k1_ecmult_strauss_wnaf’,
      inlined from ‘secp256k1_ecmult’ at /home/hebasto/git/secp256k1/src/ecmult_impl.h:353:5:
  /home/hebasto/git/secp256k1/src/ecmult_impl.h:291:5: warning: ‘aux’ may be used uninitialized [-Wmaybe-uninitialized]
    291 |     secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /home/hebasto/git/secp256k1/src/secp256k1.c:29:
  /home/hebasto/git/secp256k1/src/ecmult_impl.h: In function ‘secp256k1_ecmult’:
  /home/hebasto/git/secp256k1/src/group_impl.h:174:13: note: by argument 3 of type ‘const secp256k1_fe *’ to ‘secp256k1_ge_table_set_globalz’ declared here
    174 | static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /home/hebasto/git/secp256k1/src/secp256k1.c:30:
  /home/hebasto/git/secp256k1/src/ecmult_impl.h:345:18: note: ‘aux’ declared here
    345 |     secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
        |                  ^~~
  ...
  ```

  Please note that in the last case providing `env CFLAGS=-O1` or `-DCMAKE_C_FLAGS=-O1` won't work.

ACKs for top commit:
  real-or-random:
    ACK 42f8c5140227dbdd8ae7eaaecd914e705e1b12d0

Tree-SHA512: 2b152e420a4a8ffd5f67857de03ae5ba9f2223e535ac01a867c1025e0619180d8255fdd1e5fb8279b290f0a1c96bcc874043ef968fcd99b1ff4e13041a91b1e1
2024-01-17 13:20:50 +01:00
Tim Ruffing
3bf4d68fc0
Merge bitcoin-core/secp256k1#1482: build: Clean up handling of module dependencies
e6822678ea05c431b4f43be9dfbde54e0f7f645b build: Error if required module explicitly off (Tim Ruffing)
89ec583ccf01d9201fdab6a6c1682e6c27224b16 build: Clean up handling of module dependencies (Tim Ruffing)

Pull request description:

  This is a cleanup which makes it easier to add further modules with dependencies, e.g., in #1452. The diff looks larger than it is because I also reordered the modules and made the order consistent between CMake and autotools.

  (We noticed that the current logic could be improved in https://github.com/BlockstreamResearch/secp256k1-zkp/pull/275.)

ACKs for top commit:
  jonasnick:
    ACK e6822678ea05c431b4f43be9dfbde54e0f7f645b
  hebasto:
    ACK e6822678ea05c431b4f43be9dfbde54e0f7f645b.

Tree-SHA512: 040e791e5b5b9b8845a39632633a45ca759391455910bdefba2b7b77c6340e65df6eda18199ae2ad65c30ee2fc6630471437aec143c26fe09ae4c11409a37622
2024-01-17 13:20:19 +01:00
Tim Ruffing
e6822678ea build: Error if required module explicitly off 2024-01-16 22:58:15 +01:00
Tim Ruffing
89ec583ccf build: Clean up handling of module dependencies
This also makes the order in which module options are processed
consistent between CMake and autotools (the reverse order of the listing
printed to stdout).
2024-01-16 22:36:50 +01:00
Jonas Nick
44378867a0
Merge bitcoin-core/secp256k1#1468: v0.4.1 release aftermath
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)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK b37fdb28ce373e359e4d3a9727693b724db31676.
  jonasnick:
    ACK b37fdb28ce373e359e4d3a9727693b724db31676

Tree-SHA512: 6e18a5b897d29a3dd3a73ba81623dd91c04fa6730fb56374b924dc84baaec8c55d0c689ee1a41dab9a03ccd566082fc59ffb5d68cafd536a136fc7aaac2d8ef5
2024-01-16 20:01:44 +00:00
Tim Ruffing
a9db9f2d75
Merge bitcoin-core/secp256k1#1480: Get rid of untested sizeof(secp256k1_ge_storage) == 64 code path
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)

Pull request description:

  This gets rid of an untested code path. Resolves https://github.com/bitcoin-core/secp256k1/issues/1352.

  This is a bit opinionated in the sense that it adds a static assertion where it's needed in `secp256k1_pubkey_save` and `secp256k1_pubkey_load`. I think this is justified in this case. It helps the reviewer verify that these functions are correct.

  See individual commit messages.

ACKs for top commit:
  sipa:
    utACK ba5d72d62659f9305d2be30b2ac89ce9480a0e78
  jonasnick:
    ACK ba5d72d62659f9305d2be30b2ac89ce9480a0e78

Tree-SHA512: 2553c0610b62bcda6d4ef26eb26b5b2e07acf723bcd299691a2d02da57af22b8763f63c2d4adb17d30de8825b6157be6e4f0398147854fbabdf8b865fb0b5c88
2024-01-09 18:59:27 +01:00
Jonas Nick
74b7c3b53e
Merge bitcoin-core/secp256k1#1476: include: make docs more consistent
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)

Pull request description:

ACKs for top commit:
  sipa:
    ACK da7bc1b803b14274bc1687514e5da6a3e1cd9765
  real-or-random:
    ACK da7bc1b803b14274bc1687514e5da6a3e1cd9765

Tree-SHA512: 809f312fa0cd1e9502ac79b8a1c502b87e6dfc2db8ad6bbd96d7ddbdaadad0c3b6110fa704b770c353cd34d5bf5547541cbb5f2779425d7419b584e721c854c2
2024-01-09 16:52:00 +00:00
Tim Ruffing
b37fdb28ce check-abi: Minor UI improvements 2024-01-09 01:05:09 +01:00
Tim Ruffing
ad5f589a94 check-abi: Default to HEAD for new version 2024-01-09 01:00:02 +01:00
Tim Ruffing
9fb7e2f156 release process: Style and formatting nits 2024-01-09 00:59:24 +01:00
Tim Ruffing
ba5d72d626 assumptions: Use new STATIC_ASSERT macro
This also splits the big "&&" expression into separate expressions. If
we ever see an assertion fail, the error message will tell it precisely
which one failed.
2024-01-08 16:10:55 +01:00
Tim Ruffing
e53c2d9ffc Require that sizeof(secp256k1_ge_storage) == 64
This gets rid of an untested code path. Resolves #1352.

secp256k1_ge_storage is a struct with two secp256k1_fe_storage fields.
The C standard allows the compiler to add padding between the fields and
at the end of the struct, but no sane compiler in the end would do this:
The only reason to add padding is to ensure alignment, but such padding
is never necessary between two fields of the same type.

Similarly, secp256k1_fe_storage is a struct with a single array of
uintXX_t. No padding is allowed between array elements. Again, C allows
the compiler to insert padding at the end of the struct, but there's no
absolute reason to do so in this case.

For the uintXX_t itself, this guaranteed to have no padding bits, i.e.,
it's guaranteed to have exactly XX bits.

So I claim that for any existing compiler in the real world,
sizeof(secp256k1_ge_storage) == 64.
2024-01-08 16:08:42 +01:00
Tim Ruffing
d0ba2abbff util: Add STATIC_ASSERT macro 2024-01-08 16:08:42 +01:00
Jonas Nick
0ffca6f794
Merge elementsproject/secp256k1-zkp#281: Make *key_cache const in musig_pubkey_get
e2eb3fae407f0a081a19baeb2ea22eb965fa9674 Make *key_cache const in musig_pubkey_get (Sanket Kanjalkar)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK e2eb3fae407f0a081a19baeb2ea22eb965fa9674

Tree-SHA512: 24d1375bd48440e805e82d8a7d371eebfa98f7ef2c7a60d86c720e8512b5fa5bb70499ea821f9cef81c73145a3569c243fa0ecb1c29d7c31c4515dafeba80e23
2024-01-08 08:03:41 +00:00
Sanket Kanjalkar
e2eb3fae40 Make *key_cache const in musig_pubkey_get 2024-01-07 07:44:11 -08:00
Jonas Nick
da7bc1b803
include: in doc, remove article in front of "pointer" 2024-01-05 13:06:50 +00:00
Jonas Nick
aa3dd5280b
include: make doc about ctx more consistent
Replaces "ctx: a secp256k1 context object" with "ctx: pointer to a context
object". Also removes the word "existing".
2024-01-04 17:15:03 +00:00
Jonas Nick
e3f690015a
include: remove obvious "cannot be NULL" doc 2024-01-04 17:15:01 +00:00
Tim Ruffing
d373bf6d08
Merge bitcoin-core/secp256k1#1474: tests: restore scalar_mul test
3dbfb48946b9d2a98acef23674617510cf1b3386 tests: restore scalar_mul test (Jonas Nick)

Pull request description:

  Without this commit, the res[i][1] test vectors are unused. They were introduced to test the correctness of scalar_sqr(x) and scalar_mul(x, x). These tests were deleted as part of removing scalar_sqr in commit
  [5437e7bdfbffddf69fdf7b4af7e997c78f5dafbf](5437e7bdfb (diff-c2d5f1f7616875ab71cd41b053cfb428696988ff89642b931a0963d50f34f7e8L2195)).

  Discovered in https://github.com/bitcoin-core/secp256k1/discussions/1463 by Coding-Enthusiast (thanks!).

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

Tree-SHA512: 914e08db3efaa1cef546a9730096e740478c422d41fedb2b71ec3a7ea962f81740a05dc7e7c1fb191088f6d38b5690479c7d0864ca8abf2b2e9c4334f03ca605
2024-01-04 17:48:36 +01:00
Tim Ruffing
79e094517c
Merge bitcoin-core/secp256k1#1473: Fix typos
d77170a88d0d6f27d0b90057fa7cd25ec74e3850 Fix typos (shuoer86)

Pull request description:

  Fix some typos caught by spell checker

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

Tree-SHA512: 18722459b0b8d906ad93dd0f159b0a70a338d08c121ce6523bb6be70be33febdffa5241efc000acf18c70a845795b0582599a71d6dd25b663fee1358c8d38c85
2024-01-04 17:39:19 +01:00
Jonas Nick
3dbfb48946
tests: restore scalar_mul test
Without this commit, the res[i][1] test vectors are unused. They were introduced
to test the correctness of scalar_sqr(x) and scalar_mul(x, x). These tests were
deleted as part of removing scalar_sqr in commit
5437e7bdfbffddf69fdf7b4af7e997c78f5dafbf.
2024-01-04 15:45:11 +00:00
shuoer86
d77170a88d
Fix typos 2024-01-03 20:03:07 +08:00
Tim Ruffing
e7053d065b release process: Add email step 2023-12-21 17:34:22 +01:00
Tim Ruffing
429d21dc79 release process: Run sanity checks on release PR 2023-12-21 17:34:18 +01:00