Commit Graph

199 Commits

Author SHA1 Message Date
Jonas Nick
f411841a46 Add module "musig" that implements MuSig2 multi-signatures (BIP 327) 2024-10-07 14:03:42 +00:00
Jonas Nick
c3e40d75db release cleanup: bump version after 0.5.1 2024-08-01 19:23:27 +00:00
Jonas Nick
40d87b8e45 release: prepare for 0.5.1 2024-08-01 16:58:24 +00:00
Hennadii Stepanov
d94a9273f8 build: Adjust the default size of the precomputed table for signing
The new default value of the precomputed table for signing is aligned
with Bitcoin Core's default.
See: a057869aa3
2024-07-03 14:04:13 +01:00
merge-script
4af241b320 Merge bitcoin-core/secp256k1#1535: build: Replace hardcoded "auto" value with default one
4d9645bee0 cmake: Remove "AUTO" value of `SECP256K1_ECMULT_GEN_KB` option (Hennadii Stepanov)
a06805ee74 cmake: Remove "AUTO" value of `SECP256K1_ECMULT_WINDOW_SIZE` option (Hennadii Stepanov)
26b94ee92a autotools: Remove "auto" value of `--with-ecmult-gen-kb` option (Hennadii Stepanov)
122dbaeb37 autotools: Remove "auto" value of `--with-ecmult-window` option (Hennadii Stepanov)

Pull request description:

  "auto" implies that a value is being chosen based on build system introspection or host system capabilities. However, for the `--with-ecmult-window` and `--with-ecmult-gen-kb` options, the values "auto" are hardcoded, which might lead to confusion.

  This PR replaces "auto" with more appropriate default values.

  If Concept ACKed, I'll add equivalent commits for CMake.

ACKs for top commit:
  sipa:
    utACK 4d9645bee0
  real-or-random:
    utACK 4d9645bee0 good from my side, but let's see if we can get more (Concept) ACKs

Tree-SHA512: 9e68f73682c5310c68d2337594f13b99a52bfc365564e39df2e412b576635c90cccd2298406a4281f014916c4a1710e19c7390f05a4b0acbd09869bfb56f36ac
2024-06-25 15:59:41 +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
26b94ee92a autotools: Remove "auto" value of --with-ecmult-gen-kb option
"auto" implies that a value is being chosen based on build system
introspection or host system capabilities. However, for the
`--with-ecmult-gen-kb` option, the value "auto" is hardcoded, which
might lead to confusion.

This change replaces "auto" with a more appropriate default value.
2024-05-27 10:57:30 +01:00
Hennadii Stepanov
122dbaeb37 autotools: Remove "auto" value of --with-ecmult-window option
"auto" implies that a value is being chosen based on build system
introspection or host system capabilities. However, for the
`--with-ecmult-window` option, the value "auto" is hardcoded, which
might lead to confusion.

This change replaces "auto" with a more appropriate default value.
2024-05-27 10:56:37 +01: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
Tim Ruffing
2f05e2da4b release cleanup: bump version after 0.5.0 2024-05-06 19:02:57 +02:00
Tim Ruffing
c0e4ec3fee release: prepare for 0.5.0 2024-05-06 17:59:34 +02:00
Pieter Wuille
ed2a056f3d Provide 3 configurations accessible through ./configure 2024-04-19 11:43:26 -04: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
4b2e06f460 release cleanup: bump version after 0.4.1 2023-12-21 15:56:11 +00:00
Jonas Nick
672053d801 release: prepare for 0.4.1 2023-12-21 15:46:34 +00:00
Tim Ruffing
f07cead0ca build: Don't call assembly an optimization
because we don't know whether it's an optimization.
2023-11-24 08:11:33 +01:00
Jonas Nick
9b118bc7fb release cleanup: bump version after 0.4.0 2023-09-04 16:27:38 +00:00
Tim Ruffing
16339804c9 release: Prepare for 0.4.0 2023-09-04 18:18:24 +02:00
Jonas Nick
78ca880788 build: enable ellswift module via SECP_CONFIG_DEFINES
...like the other modules.
2023-07-26 14:44:20 +00:00
Hennadii Stepanov
ae9db95cea build: Introduce SECP256K1_STATIC macro for Windows users
It is a non-Libtool-specific way to explicitly specify the user's
intention to consume a static `libseck256k1`.

This change allows to get rid of MSVC linker warnings LNK4217 and
LNK4286. Also, it makes possible to merge the `SECP256K1_API` and
`SECP256K1_API_VAR` into one.
2023-07-03 13:57:11 +01:00
Pieter Wuille
c47917bbd6 Add ellswift module implementing ElligatorSwift
The scheme implemented is described below, and largely follows the paper
"SwiftEC: Shallue–van de Woestijne Indifferentiable Function To Elliptic Curves",
by Chavez-Saab, Rodriguez-Henriquez, and Tibouchi
(https://eprint.iacr.org/2022/759).

A new 64-byte public key format is introduced, with the property that *every*
64-byte array is an encoding for a non-infinite curve point. Each curve point
has roughly 2^256 distinct encodings. This permits disguising public keys as
uniformly random bytes.

The new API functions:
* secp256k1_ellswift_encode: convert a normal public key to an ellswift 64-byte
  public key, using additional entropy to pick among the many possible
  encodings.
* secp256k1_ellswift_decode: convert an ellswift 64-byte public key to a normal
  public key.
* secp256k1_ellswift_create: a faster and safer equivalent to calling
  secp256k1_ec_pubkey_create + secp256k1_ellswift_encode.
* secp256k1_ellswift_xdh: x-only ECDH directly on ellswift 64-byte public keys,
  where the key encodings are fed to the hash function.

The scheme itself is documented in secp256k1_ellswift.h.
2023-06-20 11:31:58 -04:00
Hennadii Stepanov
1549db0ca5 build: Level up MSVC warnings 2023-05-25 09:43:55 +01:00
Pieter Wuille
95448ef2f8 release cleanup: bump version after 0.3.2 2023-05-13 13:54:32 -04:00
Tim Ruffing
d490ca2046 release: Prepare for 0.3.2 2023-05-12 22:52:30 +02:00
Hennadii Stepanov
c6bb29b303 build: Rename 64bit to x86_64 2023-05-12 10:50:18 +01:00
Hennadii Stepanov
03246457a8 autotools: Add SECP_ARM32_ASM_CHECK macro 2023-05-12 10:38:51 +01:00
Hennadii Stepanov
e5cf4bf3ff build: Rename arm to arm32 2023-05-11 10:03:23 +01:00
Hennadii Stepanov
dc0657c762 build: Fix C4005 "macro redefinition" MSVC warnings in examples 2023-04-13 12:23:30 +01:00
Jonas Nick
656c6ea8d8 release cleanup: bump version after 0.3.1 2023-04-10 19:50:27 +00:00
Tim Ruffing
898e1c676e release: Prepare for 0.3.1 2023-04-10 17:12:12 +02:00
Jonas Nick
2bca0a5cbf Merge bitcoin-core/secp256k1#1241: build: Improve SECP_TRY_APPEND_DEFAULT_CFLAGS macro
3addb4c1e8 build: Improve `SECP_TRY_APPEND_DEFAULT_CFLAGS` macro (Hennadii Stepanov)

Pull request description:

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

Tree-SHA512: 918d906570d82be9354fba72bb55d50b8f661cf7cd4404dc244deb489c2bca95b3942ae8af830873ba825dc8ddc68b99c973fc984ff13fdd1f6668f412ca56a3
2023-03-28 19:02:20 +00:00
Hennadii Stepanov
3addb4c1e8 build: Improve SECP_TRY_APPEND_DEFAULT_CFLAGS macro
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2023-03-26 10:38:43 +01:00
Hennadii Stepanov
8e79c7ed11 build: Ensure no optimization when building for coverage analysis 2023-03-14 18:56:24 +00:00
Jonas Nick
28e63f7ea7 release cleanup: bump version after 0.3.0 2023-03-08 22:07:11 +00:00
Jonas Nick
b40adf2360 release: prepare for 0.3.0 2023-03-08 22:00:43 +00:00
Tim Ruffing
9a5a611a21 build: Suppress stupid MSVC linker warning
... and use correct format to pass linker flags
2023-02-06 21:44:56 +01:00
Tim Ruffing
8c7e0fc1de build: Add -Wreserved-identifier supported by clang
This warns on certain identifiers reserved by the C standard, namely
 * identifiers that begin with an underscore followed by an uppercase
   letter, and
 * identifiers in the global namespace that begin with an underscore.

We had used such identifiers in the past for macros in include guards,
and we should make sure that we don't reintroduce such identifiers
going forward.

Note that C reserves more identifiers for "future library directions",
e.g., identifiers that begin with "str" followed by a lowercase letter.
But even the C standards committee has decided that this is somewhat
silly and adopted a proposal [1] for C23 that removes the restriction
that programs using these identifiers have UB. Instead, these
identifiers are now "potentially reserved", which is not a normative
restriction but simply an informative warning that the identifiers
may become fully reserved in the future.

[1] https://www.open-std.org/jtc1/sc22/WG14/www/docs/n2625.pdf
2023-02-02 14:56:58 +01:00
Hennadii Stepanov
9b7d18669d Drop no longer used Autoheader macros 2023-01-28 07:26:10 +00:00
Hennadii Stepanov
2cd4e3c0a9 Drop no longer used SECP_{LIBS,INCLUDE} variables
The last usage of the `SECP_INCLUDE` variable was removed
in https://github.com/bitcoin-core/secp256k1/pull/1169.
2023-01-19 09:43:28 +00:00
Hennadii Stepanov
613626f94c Drop no longer used SECP_TEST_{LIBS,INCLUDE} variables
The last usage of the `SECP_TEST_{LIBS,INCLUDE}` variables was removed
in https://github.com/bitcoin-core/secp256k1/pull/983.
2023-01-19 09:27:33 +00:00
Pieter Wuille
18974061a3 Make ctime tests building configurable 2023-01-11 16:07:37 -05:00
Pieter Wuille
4f1a54e41d Move valgrind CPPFLAGS into SECP_CONFIG_DEFINES 2023-01-11 16:03:15 -05: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
Jonas Nick
02ebc290f7 release cleanup: bump version after 0.2.0 2022-12-12 22:08:22 +00: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 423b6d19d3).
This is somewhat arbitrary but at least points readers to relevant changes.
2022-12-12 21:26:36 +00:00
Jonas Nick
ad39e2dc41 build: change package version to 0.1.0-dev
The suffix -dev is slightly clearer.

Also, since the package version follows semantic versioning, rename
VERSION_BUILD to VERSION_PATCH for clarity.
2022-12-07 22:07:05 +00:00
Tim Ruffing
2286f80902 Merge bitcoin-core/secp256k1#993: Enable non-experimental modules by default
41e8704b48 build: Enable some modules by default (Tim Ruffing)

Pull request description:

  This has been discussed in https://github.com/bitcoin-core/secp256k1/issues/817#issuecomment-693198323 and I agree with the arguments brought up there.

  Alternatively, we could not enable them and add a discussion to the readme why we discourage people from using the modules. I believe enabling ECDH is not very controversial. But what about recovery? Do we want to leave it off and instead give a reason?

ACKs for top commit:
  sipa:
    ACK 41e8704b48
  jonasnick:
    ACK 41e8704b48

Tree-SHA512: 1dd21037043f2b2c94a92cd2f31e69b505ba5b43119897bc0934966d9ccd84fc4fc20e7509af634f1c3a096710db1a2253090f5f1f107b9d258945a5546e9ba4
2022-11-22 12:53:48 +01:00
Russell O'Connor
2914bccbc0 Simulated int128 type. 2022-11-07 16:37:24 -05:00