1749 Commits

Author SHA1 Message Date
Pieter Wuille
6eed6c18de Update error messages to suggest msan as well 2023-01-11 16:07:37 -05:00
Pieter Wuille
8e11f89a68 Add support for msan integration to checkmem.h 2023-01-11 16:07:37 -05:00
Pieter Wuille
8dc64079eb Add compile-time error to valgrind_ctime_test 2023-01-11 16:07:37 -05:00
Pieter Wuille
0db05a770e Abstract interactions with valgrind behind new checkmem.h 2023-01-11 16:07:35 -05:00
Pieter Wuille
4f1a54e41d Move valgrind CPPFLAGS into SECP_CONFIG_DEFINES 2023-01-11 16:03:15 -05:00
Tim Ruffing
cc3b8a4f40
Merge bitcoin-core/secp256k1#1187: refactor: Rename global variables in tests
9a93f48f502da7aaa893b90a575434892b23fc9e refactor: Rename STTC to STATIC_CTX in tests (Tim Ruffing)
3385a2648d7e9dd03094bb65065f30f385101fef refactor: Rename global variables to uppercase in tests (Tim Ruffing)

Pull request description:

  On top of #1186 .

  I feel that this is an improvement, but it touches a lot of lines and so it deserves a separate discussion.

ACKs for top commit:
  sipa:
    ACK 9a93f48f502da7aaa893b90a575434892b23fc9e

Tree-SHA512: b6dad2ffff2267034bf8cefdd3ef7ea11e9bcb8142d64b460ca61e0d3ab8de22fb3ee994dea0fb32feee3864d07395c070abffab318690d09d104294895300c4
2023-01-11 10:55:14 +01:00
Tim Ruffing
9a93f48f50 refactor: Rename STTC to STATIC_CTX in tests 2023-01-10 18:43:09 +01:00
Tim Ruffing
3385a2648d refactor: Rename global variables to uppercase in tests 2023-01-10 18:43:09 +01:00
Pieter Wuille
cbe41ac138
Merge bitcoin-core/secp256k1#1188: tests: Add noverify_tests which is like tests but without VERIFY
203760023c60d250cb5937e27bcf29e7a829096c tests: Add noverify_tests which is like tests but without VERIFY (Tim Ruffing)

Pull request description:

  mentioned in https://github.com/bitcoin-core/secp256k1/issues/1037#issuecomment-1371870423

  Let's see how this affects CI time

ACKs for top commit:
  sipa:
    ACK 203760023c60d250cb5937e27bcf29e7a829096c
  apoelstra:
    ACK 203760023c60d250cb5937e27bcf29e7a829096c

Tree-SHA512: fab1ce1499d418671d3d0ecfddf15d75b7c2bbfbfb4be958a95730491244185a906c7133aba4d0bec56ee6c721cb525750eef4cafc12f386484af931e34b0e8e
2023-01-09 11:06:24 -05:00
Tim Ruffing
203760023c tests: Add noverify_tests which is like tests but without VERIFY 2023-01-07 23:13:06 +01:00
Tim Ruffing
0eb3000417
Merge bitcoin-core/secp256k1#1186: tests: Tidy context tests
39e8f0e3d7ba7924e9cc5f9e0c56747e942f1eab refactor: Separate run_context_tests into static vs proper contexts (Tim Ruffing)
a4a09379b1a6f65d5a1801cffae0992b49660d82 tests: Clean up and improve run_context_tests() further (Tim Ruffing)
fc90bb569564d552ec0b5706fde6e94bb5313f4e refactor: Tidy up main() (Tim Ruffing)
f32a36f620e979b13040ffd2cd55cfc6fac5bad0 tests: Don't use global context for context tests (Tim Ruffing)
ce4f936c4fa077d0473985479c61bd6544172aae tests: Tidy run_context_tests() by extracting functions (Tim Ruffing)
18e0db30cb4a89989f040a5f212d54b306ffd96e tests: Don't recreate global context in scratch space test (Tim Ruffing)
b19806122e9065c6f434fc6160cd0c57fa3fea8c tests: Use global copy of secp256k1_context_static instead of clone (Tim Ruffing)

Pull request description:

  This is an improved version of some of the tidying/refactoring in #1170.

  I think it's enough to deserve a separate PR. Once this is merged, I'll get back to the actual goal of #1170 (namely, forbidding cloning and randomizing static contexts.)

  This PR is a general clean up of the context tests. A notable change is that this avoids a code smell where `run_context_tests()` would use the global `ctx` variable like a local one (i.e., create a context in it and destroy it afterwards).  After this PR, the global `ctx` is properly initialized for all the other tests, and they can decide whether they want to use it or not. Same for a global `sttc`, which is a memcpy of the static context (we need a writable copy in order to be able to set callbacks).

  Note that this touches code which is also affected by #1167 but I refrained from trying to solve this issue. The goal of this PR is simply not to worsen the situation w.r.t. #1167. We should really introduce a macro to solve #1167 but that's another PR.

ACKs for top commit:
  sipa:
    utACK 39e8f0e3d7ba7924e9cc5f9e0c56747e942f1eab
  apoelstra:
    ACK 39e8f0e3d7ba7924e9cc5f9e0c56747e942f1eab

Tree-SHA512: a22471758111061a062b126a52a0de24a1a311d1a0332a4ef006882379a4f3f2b00e53089e3c374bf47c4051bb10bbc6a9fdbcf6d0cd4eca15b5703590395fba
2023-01-06 11:52:59 +01:00
Tim Ruffing
39e8f0e3d7 refactor: Separate run_context_tests into static vs proper contexts 2023-01-05 10:28:10 +01:00
Tim Ruffing
a4a09379b1 tests: Clean up and improve run_context_tests() further 2023-01-05 10:28:10 +01:00
Tim Ruffing
fc90bb5695 refactor: Tidy up main() 2023-01-05 10:28:10 +01:00
Tim Ruffing
f32a36f620 tests: Don't use global context for context tests 2023-01-05 10:28:10 +01:00
Tim Ruffing
ce4f936c4f tests: Tidy run_context_tests() by extracting functions 2023-01-05 10:28:04 +01:00
Tim Ruffing
18e0db30cb tests: Don't recreate global context in scratch space test 2023-01-04 16:52:36 +01:00
Tim Ruffing
b19806122e tests: Use global copy of secp256k1_context_static instead of clone 2023-01-04 16:39:50 +01:00
Tim Ruffing
2a39ac162e
Merge bitcoin-core/secp256k1#1185: Drop SECP_CONFIG_DEFINES from examples
2f9ca284e2af0c738e701b3dc3e348b87f26a7a2 Drop `SECP_CONFIG_DEFINES` from examples (Hennadii Stepanov)

Pull request description:

  User applications shouldn't need or rely on `SECP_CONFIG_DEFINES`.

  See https://github.com/bitcoin-core/secp256k1/pull/1178#discussion_r1059457252.

ACKs for top commit:
  sipa:
    utACK 2f9ca284e2af0c738e701b3dc3e348b87f26a7a2
  real-or-random:
    utACK 2f9ca284e2af0c738e701b3dc3e348b87f26a7a2

Tree-SHA512: c8e81e6842b31e7f4ebcbb18d5962f7d7308f024025d6225330a7ec099739278bb43ad98243698c5802bcc49bf7e247ab7cae7f40008fbba87f0d0e46cbe1e85
2023-01-03 21:03:40 +01:00
Hennadii Stepanov
2f9ca284e2
Drop SECP_CONFIG_DEFINES from examples
User applications shouldn't need or rely on `SECP_CONFIG_DEFINES`.
2023-01-03 17:33:32 +00:00
Tim Ruffing
31ed5386e8
Merge bitcoin-core/secp256k1#1183: Bugfix: pass SECP_CONFIG_DEFINES to bench compilation
c0a555b2ae35d5cca0481ecdd4cff5a1ae314283 Bugfix: pass SECP_CONFIG_DEFINES to bench compilation (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    utACK c0a555b2ae35d5cca0481ecdd4cff5a1ae314283
  apoelstra:
    ACK c0a555b2ae35d5cca0481ecdd4cff5a1ae314283

Tree-SHA512: 4ec6ca4c012166beb6c5bdd1b2ed939554415e03545c176cf281000145c4000a460e231d5da26f617a81b048cd0fa3f8f16b61a207aed9479fdd854483e35ded
2023-01-02 13:02:40 +01:00
Pieter Wuille
c0a555b2ae Bugfix: pass SECP_CONFIG_DEFINES to bench compilation 2022-12-29 15:31:55 -05:00
Tim Ruffing
01b819a8c7
Merge bitcoin-core/secp256k1#1158: Add a secp256k1_i128_to_u64 function.
d21647520532957a78027be1ab606b814a2ec720 test secp256k1_i128_to_i64 (Russell O'Connor)
4bc429019dc4bff6af0f9824ad6ab6745f09f8ba Add a secp256k1_i128_to_u64 function. (Russell O'Connor)

Pull request description:

  I wanted to experiment with what would be required to split up `secp256k1_i128_to_i64` between those cases when a signed 64 bit value is being demoted, versus an unsigned 64 bit value is being extracted from the lower bits, and this is the result.

  I'm not sure this is a useful PR, so feel free to close it.  However, since it is already written, I figured it is worth at least discussing.

ACKs for top commit:
  sipa:
    utACK d21647520532957a78027be1ab606b814a2ec720
  real-or-random:
    ACK d21647520532957a78027be1ab606b814a2ec720

Tree-SHA512: 41dbb1d33b3078bee8e71a838cfad6f1859c0bba602ae061259add8e9e8ea5aa482daa41de79dbd7433ddbef4a0bc52757f3c45d63acc9c0eb05aa3ca891b922
2022-12-21 17:25:07 +01:00
Jonas Nick
eacad90f69
Merge bitcoin-core/secp256k1#1171: Change ARG_CHECK_NO_RETURN to ARG_CHECK_VOID which returns (void)
a49e0940ad671f96533d5a79f2ca1fa4020abc0a docs: Fix typo (Tim Ruffing)
2551cdac903937c112357d4eb43bc194072a6cc2 tests: Fix code formatting (Tim Ruffing)
c635c1bfd54417487745bbbf518114a962a47bcc Change ARG_CHECK_NO_RETURN to ARG_CHECK_VOID which returns (void) (Tim Ruffing)
cf66f2357c6ad8c5fe219577ad56e6f51301ca5a refactor: Add helper function secp256k1_context_is_proper() (Tim Ruffing)

Pull request description:

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

Tree-SHA512: 0fd4ee88510f2de0de96378ae69ce6e610a446000bb78597026c5924803e1ce5a4f76303fc6446233a6129f9c42dce1b1549f93bef935131101e47b5a69cdf2f
2022-12-21 15:28:10 +00:00
Jonas Nick
3f57b9f774
Merge bitcoin-core/secp256k1#1177: Some improvements to the changelog
c30b889f17e0e75b63cdfa2fe021b0d0b59c4526 Clarify that the ABI-incompatible versions are earlier (Pieter Wuille)
881fc33d0c1fcaac8a2c37a72a1db431329de636 Consistency in naming of modules (Pieter Wuille)
9ecf8149a199e12bb8d6c804878931e8b2e403b9 Reduce font size in changelog (Pieter Wuille)
2dc133a67ff74e088a75993fe2ed3d5c6c369915 Add more changelog entries (Pieter Wuille)
ac233e181a5cd96cb3918d669b035221baa18062 Add links to diffs to changelog (Pieter Wuille)
cee8223ef6d6b2d60b0b81762f1aeb0fd40613e0 Mention semantic versioning in changelog (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK c30b889f17e0e75b63cdfa2fe021b0d0b59c4526
  jonasnick:
    ACK c30b889f17e0e75b63cdfa2fe021b0d0b59c4526

Tree-SHA512: 0f753eae0ea4d65035bfbcd81b90169111ea030cf7196dd072fb1ccc8aac1437768031f3fcef431584028da68b66873204e16e03bcde4a6ae96b08ab7f97a480
2022-12-20 19:43:06 +00:00
Pieter Wuille
c30b889f17 Clarify that the ABI-incompatible versions are earlier 2022-12-20 11:09:37 -05:00
Pieter Wuille
881fc33d0c Consistency in naming of modules 2022-12-20 11:09:13 -05:00
Pieter Wuille
665ba77e79
Merge bitcoin-core/secp256k1#1178: Drop src/libsecp256k1-config.h
9c5a4d21bbe820173e361211f42d5fee4765944c Do not define unused `HAVE_VALGRIND` macro (Hennadii Stepanov)
ad8647f548cba9c367f837fcdb76de280fa93c19 Drop no longer relevant files from `.gitignore` (Hennadii Stepanov)
b627ba7050b608e869515a8ef622d71bf8c13b54 Remove dependency on `src/libsecp256k1-config.h` (Hennadii Stepanov)

Pull request description:

  Cherry-picked the first commit from #1142 and addressed a [comment](https://github.com/bitcoin-core/secp256k1/pull/1142#issuecomment-1295099597).

ACKs for top commit:
  sipa:
    utACK 9c5a4d21bbe820173e361211f42d5fee4765944c
  real-or-random:
    utACK 9c5a4d21bbe820173e361211f42d5fee4765944c

Tree-SHA512: c6f268261fc5edee855a7e69fdf9f6c5f4b859eb1e078e3c44c3ee4c9c445738af3de9fc2fbcca90db9b9e38681da8217faaeb0735201052b16ea397a7817db9
2022-12-19 22:43:47 -05:00
Tim Ruffing
75d7b7f5ba
Merge bitcoin-core/secp256k1#1154: ci: set -u in cirrus.sh to treat unset variables as an error
7a74688201318cbbe30b0d1601aae16dc14ee17a ci: add missing CFLAGS & CPPFLAGS variable to print_environment (Jonas Nick)
c2e0fdadebd2f9bf06fd73b9e89dae03133d71f9 ci: set -u in cirrus.sh to treat unset variables as an error (Jonas Nick)

Pull request description:

  This PR is supposed to prevent accidental misuse of cirrus.sh. Maybe there is a way to check if `CC`, `AR` and `NM` are set within the loop that deals with the other variables, but so far I did not come up with one (that's POSIX shell compliant).

ACKs for top commit:
  real-or-random:
    ACK 7a74688201318cbbe30b0d1601aae16dc14ee17a
  hebasto:
    re-ACK 7a74688201318cbbe30b0d1601aae16dc14ee17a

Tree-SHA512: 91e42b3f1192fbf86e6fb43942713e78b2bee977ddd95256ea7448f84324369399d31ec4eedd47af595bf994bbc9396e26bb5c93bdb7f58c4310b5d3d5d66731
2022-12-19 14:57:55 +01:00
Jonas Nick
7a74688201
ci: add missing CFLAGS & CPPFLAGS variable to print_environment 2022-12-19 13:22:28 +00:00
Jonas Nick
c2e0fdadeb
ci: set -u in cirrus.sh to treat unset variables as an error 2022-12-19 13:22:18 +00:00
Hennadii Stepanov
9c5a4d21bb
Do not define unused HAVE_VALGRIND macro 2022-12-15 20:06:55 +00:00
Hennadii Stepanov
ad8647f548
Drop no longer relevant files from .gitignore 2022-12-15 10:56:29 +00:00
Hennadii Stepanov
b627ba7050
Remove dependency on src/libsecp256k1-config.h
This change eases the use of alternate build systems by moving
the variables in `src/libsecp256k1-config.h` to compiler macros
for each invocation, preventing duplication of these variables
for each build system.

Co-authored-by: Ali Sherief <ali@notatether.com>
2022-12-15 10:56:16 +00:00
Pieter Wuille
9ecf8149a1 Reduce font size in changelog 2022-12-13 12:06:42 -05:00
Pieter Wuille
2dc133a67f Add more changelog entries 2022-12-13 12:05:10 -05:00
Pieter Wuille
ac233e181a Add links to diffs to changelog 2022-12-13 11:53:50 -05:00
Pieter Wuille
cee8223ef6 Mention semantic versioning in changelog 2022-12-13 11:50:32 -05:00
Jonas Nick
9a8d65f07f
Merge bitcoin-core/secp256k1#1174: release cleanup: bump version after 0.2.0
02ebc290f7413164c14792156e522abd4030e2d1 release cleanup: bump version after 0.2.0 (Jonas Nick)
b6b360efafcb3c0ed95d35c5ca7861769a99fa71 doc: improve message of cleanup commit (Jonas Nick)

Pull request description:

ACKs for top commit:
  sipa:
    ACK 02ebc290f7413164c14792156e522abd4030e2d1

Tree-SHA512: b887e31a531f7d21025558ed0a64ff5f68dee6feff8288478f7eb023189ceb20e5ca8baf0434ebd2ee49488d35d7aebc1b837888ff8c6e6420e6b86cc2f99cb1
2022-12-12 22:21:26 +00:00
Jonas Nick
02ebc290f7
release cleanup: bump version after 0.2.0 2022-12-12 22:08:22 +00:00
Jonas Nick
b6b360efaf
doc: improve message of cleanup commit 2022-12-12 22:08:13 +00:00
Pieter Wuille
21ffe4b22a
Merge bitcoin-core/secp256k1#1055: Prepare initial release
e025ccdf7473702a76bb13d763dc096548ffefba release: prepare for initial release 0.2.0 (Jonas Nick)
6d1784a2e2c1c5a8d89ffb08a7f76fa15e84fff5 build: add missing files to EXTRA_DIST (Jonas Nick)
13bf1b6b324f2ed1c1fb4c8d17a4febd3556839e changelog: make order of change types match keepachangelog.com (Jonas Nick)
b1f992a552785395d2e60b10862626fd11f66f84 doc: improve release process (Jonas Nick)
ad39e2dc417f85c1577a6a6a9c519f5c60453def build: change package version to 0.1.0-dev (Jonas Nick)
90618e9263ebc2a0d73d487d6d94fd3af96b973c doc: move CHANGELOG from doc/ to root directory (Jonas Nick)

Pull request description:

  Based on #964

ACKs for top commit:
  sipa:
    ACK e025ccdf7473702a76bb13d763dc096548ffefba

Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49
2022-12-12 17:01:25 -05:00
Jonas Nick
e025ccdf74
release: prepare for initial release 0.2.0
There are plenty of unreleased variants of libsecp256k1 version 0.1.0
(libsecp256k1.so.0.0.0) in the wild. We choose a new version number to allow a
clear distinction.

There are variants of 0.1.0 that are incompatible with the initial release,
hence we increase the minor version to arrive at version number 0.2.0. For the
same reason, we increase the LIB_VERSION_CURRENT and keep AGE at 0.

The changelog for 0.2.0 consists of the relevant changes since 2021-12-25, which
is the date when the initial release process PR was merged (and the library
version was set to a pre-release, see 423b6d19d373f1224fd671a982584d7e7900bc93).
This is somewhat arbitrary but at least points readers to relevant changes.
2022-12-12 21:26:36 +00:00
Jonas Nick
6d1784a2e2
build: add missing files to EXTRA_DIST 2022-12-12 21:26:32 +00:00
Jonas Nick
8c949f56da
Merge bitcoin-core/secp256k1#1173: Don't use compute credits for now
7e5b22684f4f3e53fa94af84286d21a40dd95525 Don't use compute credits for now (Pieter Wuille)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 7e5b22684f4f3e53fa94af84286d21a40dd95525

Tree-SHA512: 5f37521dede4270151f4f1ed59e021f78e39b7e3362f4c16ecf2b7733dd1d49306466cc4e9b7837be10769c86799905fb1305cb35fe5cae0366a7f7861e6e9df
2022-12-12 20:10:04 +00:00
Jonas Nick
13bf1b6b32
changelog: make order of change types match keepachangelog.com 2022-12-12 19:53:36 +00:00
Jonas Nick
b1f992a552
doc: improve release process
- make version on master always equal to latest release with patch+1
- separate regular from maintenance releases
- add more git commands to prevent accidents
- mention that one needs to somehow deal with release dates
- _LIB_VERSIONS_ -> _LIB_VERSION_
- don't push all tags in step 4
- add required message to git tag
- add suggested commit messages
2022-12-12 19:53:27 +00:00
Pieter Wuille
7e5b22684f Don't use compute credits for now 2022-12-12 08:35:36 -05:00
Tim Ruffing
a49e0940ad docs: Fix typo 2022-12-08 16:31:00 +01:00
Tim Ruffing
2551cdac90 tests: Fix code formatting 2022-12-08 16:30:26 +01:00