1874 Commits

Author SHA1 Message Date
Jonas Nick
b732701faa
Merge #875: Avoid casting (void**) values.
27306186045955803ca4070783c6a28853003e6a Avoid casting (void**) values. Replaced with an expression that only casts (void*) values. (Russell O'Connor)

Pull request description:

ACKs for top commit:
  sipa:
    utACK 27306186045955803ca4070783c6a28853003e6a
  real-or-random:
    utACK 2730618604
  jonasnick:
    utACK 27306186045955803ca4070783c6a28853003e6a

Tree-SHA512: bdc1e9eefa10f79b744ef6ae83f379faff7bce9fb428c3bcfcc3f6e4e252e5c6543efbe0f84760709850948cbc8a432772c76a6c5f6b8cd18cb2d862b324912d
2021-01-25 13:36:01 +00:00
Pieter Wuille
9570f674cc Avoid passing out-of-bound pointers to 0-size memcpy
Doing so could be considered UB in a strict reading of the standard.
Avoid it.
2021-01-23 21:56:43 -08:00
Pieter Wuille
75d2ae149e Remove unused secp256k1_fe_inv_all_var 2021-01-23 20:16:51 -08:00
Russell O'Connor
482e4a9cfc Add missing secp256k1_ge_set_gej_var decl. 2021-01-23 19:12:19 -05:00
Russell O'Connor
2730618604 Avoid casting (void**) values.
Replaced with an expression that only casts (void*) values.
2021-01-23 15:22:54 -05:00
Russell O'Connor
fb390c5299 Remove underscores from header defs.
This makes them consistent with other files and avoids reserved identifiers.
2021-01-23 14:48:35 -05:00
Jonas Nick
ed69ea79b4
Merge #98: Add contrib/sync-upstream.sh script to automate syncing PRs
7eeacd7725fa8c895c2f58850b151e66199137cf Add contrib/sync-upstream.sh script to automate merging upstream PRs (Jonas Nick)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK 7eeacd7725fa8c895c2f58850b151e66199137cf  The code looks fine. I haven't tested this script but it's not the end of the world if the script has a bug.

Tree-SHA512: d2e0128980538f4e1f20ce3709d1464e82e2d0d89e6faafa157f627cea2919cc3d2a578daf73b93624fa61ecb74891b547d303471afb4f865130b7cd094cd0d0
2021-01-14 19:44:40 +00:00
Jonas Nick
7eeacd7725 Add contrib/sync-upstream.sh script to automate merging upstream PRs 2021-01-14 15:17:18 +00:00
Tim Ruffing
f2d9aeae6d
Merge #862: Autoconf improvements
3c15130709da26a6d2f25a483aa45e14bf1e4feb Improve CC_FOR_BUILD detection (Tim Ruffing)
47802a476246b67360bc24df78fe5fad6b93c296 Restructure and tidy configure.ac (Tim Ruffing)
252c19dfc654dbb10a35579fa36edb3466904758 Ask brew for valgrind include path (Tim Ruffing)

Pull request description:

  See individual commit messages. These are improvements in preparation of the switch to Cirrus CI. (Maybe I'll just open a PR on top of this one.)

  The first commit made the difference between successful build https://cirrus-ci.com/task/6740575057608704 and unsuccessful build https://cirrus-ci.com/task/4909571074424832.

  I've tested the second commit without cross-compilation and with cross-compilation for android (https://github.com/bitcoin-core/secp256k1/issues/621#issuecomment-495703399)

  When working on the autoconf stuff, I noticed two things that I just want to write down here:
   - At some point we should update [build-aux/m4/ax_prog_cc_for_build.m4](https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html). This is outdated, and [there have been a lot of fixes](https://github.com/autoconf-archive/autoconf-archive/pull/207) But the latest version is [broken](https://lists.gnu.org/archive/html/autoconf-archive-maintainers/2020-06/msg00002.html), so now is probably not the time.
   - The latest autoconf 2.70 deprecates `AC_PROG_CC_C89`. It's not needed anymore because `AC_PROG_CC` cares about testing for version support. This makes autoconf 2.70 output a warning that we should probably just ignore. We don't want to force users onto 2.70...

ACKs for top commit:
  sipa:
    utACK 3c15130709da26a6d2f25a483aa45e14bf1e4feb
  jonasnick:
    utACK 3c15130 makes sense (with my very basic understanding of autoconf)

Tree-SHA512: 595b9de316374c2213f1340cddaa22eb3190b01fa99aa6ae26e77804df41e7ecf96a09e03c28e8f8b9fd04e211e4ee2f78f1e5a7995143c84f99d2e16d4f0260
2021-01-12 15:38:52 +01:00
Tim Ruffing
328aaef22a
Merge #845: Extract the secret key from a keypair
33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06 Add secret key extraction from keypair to constant time tests (Elichai Turkel)
36d9dc1e8e6e3b15d805f04c973a8784a78880f6 Add seckey extraction from keypair to the extrakeys tests (Elichai Turkel)
fc96aa73f5c7f62452847a31821890ff1f72a5a4 Add a function to extract the secretkey from a keypair (Elichai Turkel)

Pull request description:

  With schnorrsig if you need to tweak the secret key (for BIP32) you must use the keypair API to get compatible secret/public keys which you do by calling `secp256k1_keypair_xonly_tweak_add()`, but after that there's no currently a way to extract the secret key back for storage.
  so I added a `secp256k1_keypair_seckey` function to extract the key

ACKs for top commit:
  jonasnick:
    ACK 33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06
  real-or-random:
    ACK 33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06 code inspection, tests pass

Tree-SHA512: 11212db38c8b87a87e2dc35c4d6993716867b45215b94b20522b1b3164ca63d4c6bf5192a6bff0e9267b333779cc8164844c56669a94e9be72df9ef025ffcfd4
2021-01-12 10:56:14 +01:00
Tim Ruffing
3c15130709 Improve CC_FOR_BUILD detection
This commits simply uses CC as CC_FOR_BUILD and the same for
corresponding flags if we're not cross-compiling. This has a number of
benefits in this common case:
 - It avoids strange cases where very old compilers are used (#768).
 - Flags are consistently set for CC and CC_FOR_BUILD.
 - ./configure is faster.
 - You get compiler x consistently if you set CC=x; we got this wrong
   in CI in the past.

./configure warns if a _FOR_BUILD variable is set but ignored because
we're not cross-compiling.

The change exposed that //-style comments are used in gen_context.c,
which is also fixed by this commit.

This commit also reorganizes code in configure.ac to have a cleaner
separation of sections.
2021-01-08 16:09:04 +01:00
Tim Ruffing
47802a4762 Restructure and tidy configure.ac
No behavioral changes.
2021-01-08 15:29:40 +01:00
Tim Ruffing
252c19dfc6 Ask brew for valgrind include path
Valgrind is typically installed using brew on macOS. This commit
makes ./configure detect this case set the appropriate include
directory (in the same way as we already do for openssl and gmp).
2021-01-08 14:24:34 +01:00
Tim Ruffing
8c727b9087
Merge #860: fixed trivial typo
b7bc3a4aaa5d89c9a9cf2d914362e69ca91a8678 fixed typo (Ferdinando M. Ametrano)

Pull request description:

ACKs for top commit:
  real-or-random:
    ACK b7bc3a4aaa5d89c9a9cf2d914362e69ca91a8678
  elichai:
    ACK b7bc3a4aaa5d89c9a9cf2d914362e69ca91a8678

Tree-SHA512: 6c1889f095607a2f293ffe00359c03e63cfca572b0a17388b83ece54f24ec61ac12d6eb967a47d2dccd54de991383923a07c5cced320c0a96a36a28674cf739c
2021-01-08 14:16:38 +01:00
Tim Ruffing
cfac088e1b
Merge #119: Remove repeated schnorr flag from travis config
96c83a83dcf742bc175c079188b06dfd0622406c Remove repeated schnorr flag from travis config (Jesse Posner)

Pull request description:

  The `SCHNORRSIG=no` flag is set twice for `global` in `travis.yml`. This PR removes the duplicated flag.

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

Tree-SHA512: 15b893e6ad22009e92ebd78389dc0939cec5ada7e84b7236d58f1426b9517333c544a6bea108a4b8921f2608a811269a5105a8eb5cb9010c5ee0945456656224
2021-01-06 11:00:34 +01:00
Jesse Posner
96c83a83dc Remove repeated schnorr flag from travis config 2021-01-05 16:09:04 -08:00
Andrew Poelstra
d2b6740688
Merge pull request #118 from jonasnick/clarify-rangeproof-rewind
rangeproof: clarify rewind outlen argument
2021-01-05 19:16:09 +00:00
Jonas Nick
41d6963bc1 rangeproof: clarify rewind outlen argument 2021-01-05 13:42:58 +00:00
Tim Ruffing
673e551f4d
Merge #111: Add ECDSA sign-to-contract module
47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878 ecdsa-s2c: add ctime tests (Andrew Poelstra)
396b558273ce88969d4b0abc86e003f7557224f7 ecdsa-s2c: add anti-klepto protocol (Andrew Poelstra)
290dee566e14efa852d4e5437546f6a8ff8bfa1a ecdsa-s2c: add actual sign-to-contract functionality (Andrew Poelstra)
8e46cac5b31c3a3127d33d46466c29e97545cf16 ecdsa-s2c: block in module (Andrew Poelstra)
826bd04b43f823813c633449223595031d5c31f7 add eccommit functionality (Andrew Poelstra)

Pull request description:

  This is a backport and rebase of https://github.com/bitcoin-core/secp256k1/pull/669

ACKs for top commit:
  jonasnick:
    ACK 47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878
  real-or-random:
    ACK 47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878

Tree-SHA512: e1f3ee3985bc77197eb57c03884b5d4a5f8733523bba50e11309f86388471c6265b7241e9856e1b80a88f4c268f2826c0394e26161292aa438b2246a1ad86aa1
2021-01-04 14:56:47 +01:00
Ferdinando M. Ametrano
b7bc3a4aaa
fixed typo 2020-12-22 22:31:29 +01:00
Andrew Poelstra
47efb5e39a ecdsa-s2c: add ctime tests 2020-12-21 20:50:19 +00:00
Andrew Poelstra
396b558273 ecdsa-s2c: add anti-klepto protocol
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:50:19 +00:00
Andrew Poelstra
290dee566e ecdsa-s2c: add actual sign-to-contract functionality
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:50:17 +00:00
Andrew Poelstra
8e46cac5b3 ecdsa-s2c: block in module
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:49:41 +00:00
Andrew Poelstra
826bd04b43 add eccommit functionality
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:49:41 +00:00
Elichai Turkel
33cb3c2b1f
Add secret key extraction from keypair to constant time tests 2020-12-19 11:01:36 +02:00
Elichai Turkel
36d9dc1e8e
Add seckey extraction from keypair to the extrakeys tests 2020-12-19 11:00:25 +02:00
Elichai Turkel
fc96aa73f5
Add a function to extract the secretkey from a keypair 2020-12-19 11:00:25 +02:00
Jonas Nick
98dac87839
Merge #858: Fix insecure links
07aa4c70ffb96d21e496854f823c3ea3353b9086 Fix insecure links (Dimitris Apostolou)

Pull request description:

ACKs for top commit:
  sipa:
    ACK 07aa4c70ffb96d21e496854f823c3ea3353b9086. Verified all the modified links.
  jonasnick:
    ACK 07aa4c70ffb96d21e496854f823c3ea3353b9086

Tree-SHA512: d1240aab5e40a204c75fca1049b99af9890684df7dbce4167b1904f73424c8a4f84ed85a8cc315501f1b7cf1674d744232b9f2126dff31e3d47e4f3fc65764d4
2020-12-18 18:33:03 +00:00
Dimitris Apostolou
07aa4c70ff
Fix insecure links 2020-12-18 00:24:22 +02:00
Tim Ruffing
b61f9da54e
Merge #857: docs: fix simple typo, dependecy -> dependency
18aadf9d288a54533376cb94f655d059eb1f098e docs: fix simple typo, dependecy -> dependency (Tim Gates)

Pull request description:

  There is a small typo in src/group_impl.h.

  Should read `dependency` rather than `dependecy`.

ACKs for top commit:
  real-or-random:
    ACK 18aadf9d288a54533376cb94f655d059eb1f098e

Tree-SHA512: 3529f43bcc87ea8940ecf5af765951f61d97d1efa86fd8abc29e32b600fd449165a94a2fa525bc6b3d9a7d8aa6e691cc4d42033537b196ba166a867e6db7f397
2020-12-09 18:05:58 +01:00
Tim Gates
18aadf9d28
docs: fix simple typo, dependecy -> dependency
There is a small typo in src/group_impl.h.

Should read `dependency` rather than `dependecy`.
2020-12-08 21:45:13 +11:00
Jonas Nick
2d9e7175c6
Merge #852: Add sage script for generating scalar_split_lambda constants
329a2e0a3f2d9e936179cbf079773538f95bee33 sage: Add script for generating scalar_split_lambda constants (Tim Ruffing)
f554dfc7088c6ca8d4aff927a51bd889b29dc186 sage: Reorganize files (Tim Ruffing)

Pull request description:

ACKs for top commit:
  sipa:
    ACK 329a2e0a3f2d9e936179cbf079773538f95bee33

Tree-SHA512: d41fe5eba332f48af0b800778aa076925c4e8e95ec21c4371a500ddd6088b6d52961bdb93f7ce2b127e18095667dbb966a0d14191177f0d0e78dfaf55271d5e2
2020-12-07 21:49:32 +00:00
Tim Ruffing
dc6e5c3a5c
Merge #854: Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation
6e85d675aaf9dc17842096f9cbf8cfab216c9331 Rename tweak to tweak32 in public API (Jonas Nick)
f587f04e35719883546afd54cb491ead18eb6fc7 Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation (Jonas Nick)

Pull request description:

  This fixes #307 if there's nothing else that's confusing.

ACKs for top commit:
  real-or-random:
    ACK 6e85d675aaf9dc17842096f9cbf8cfab216c9331 I inspected the diff

Tree-SHA512: 1b0dc9dfffd497058dc39c962a512ed6d7f89218020fef9d2c03aaae1aefbf272b918c4fe6503434b62547714855fe1b8b89f2366f3ae6cde16143207c9e6b86
2020-12-07 22:10:47 +01:00
Jonas Nick
6e85d675aa Rename tweak to tweak32 in public API 2020-12-04 14:16:43 +00:00
Jonas Nick
f587f04e35 Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation 2020-12-04 14:12:38 +00:00
Jonas Nick
0129b77767
Merge #113: Upstream PRs #849 #851
f4fa8d226a95e42b252c07edb425c446370e01c0 forbid a test iteration of 0 or less (Andrew Poelstra)
0ce45548813709d828cb3abcc7db4c9ce6e26907 make test count iteration configurable by environment variable (Andrew Poelstra)
13c88efed0005eb6745a222963ee74564054eafb Convert Sage code to Python 3 (as used by Sage >= 9) (Frédéric Chapoton)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: b17847a02843a36630a3c05065e0bda6895e042bbfd045feb2ad64e278a02842a80d66b6416eb3a6768f4b2f6c8f639fb293a537dff90a353624aff737058b8f
2020-12-04 13:49:30 +00:00
Jonas Nick
e1756dfddc Merge commits '3a106966 8f0c6f15 ' into temp-merge-851 2020-12-04 11:50:18 +00:00
Jonas Nick
7093e633b8
Merge pull request #106 from apoelstra/2020-11-reduce-test-rounds
reduce test rounds for rangeproof and surjectionproof
2020-12-03 16:04:38 +00:00
Andrew Poelstra
29f9a7dc62 reduce test rounds for rangeproof and surjectionproof 2020-12-03 15:35:50 +00:00
Tim Ruffing
329a2e0a3f sage: Add script for generating scalar_split_lambda constants 2020-12-03 11:56:09 +01:00
Jonas Nick
8f0c6f1545
Merge #851: make test count iteration configurable by environment variable
f4fa8d226a95e42b252c07edb425c446370e01c0 forbid a test iteration of 0 or less (Andrew Poelstra)
0ce45548813709d828cb3abcc7db4c9ce6e26907 make test count iteration configurable by environment variable (Andrew Poelstra)

Pull request description:

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

Tree-SHA512: 087771402c8e9536c07446baa7d02da5104d2b691f40c1dd04737329534422d895d3b692f485990d5791af8ccc124305b4f8b19be75e27b6b04cfb2337b28beb
2020-12-01 08:31:13 +00:00
Andrew Poelstra
f4fa8d226a forbid a test iteration of 0 or less 2020-11-30 18:12:31 +00:00
Andrew Poelstra
ff4714e641
Merge pull request #105 from jonasnick/update-musig
MuSig state machine simplifictions, API improvements and taproot tweaking
2020-11-30 16:11:34 +00:00
Jonas Nick
3fb4d6db9c travis: run musig test whenever schnorrsig tests are run
Previously the musig module was not tested under valgrind and not with
sanitizers.
2020-11-30 15:40:09 +00:00
Jonas Nick
b9d91b3ecb musig: add pubkey_tweak_add function to allow taproot tweaking 2020-11-30 15:40:09 +00:00
Andrew Poelstra
0d71b6c61f
Merge pull request #112 from jgriffiths/missed_rename
Update renamed decl missed in e0ced690cff035b61763686cb69b7d06571e23e2
2020-11-27 21:41:08 +00:00
Jon Griffiths
4721bec0ef
Update renamed decl missed in e0ced690cff035b61763686cb69b7d06571e23e2 2020-11-27 13:40:50 +13:00
Tim Ruffing
f554dfc708 sage: Reorganize files
* Move curve parameters to separate file
 * Rename main prover script for clarity
2020-11-25 13:50:40 +01:00
Andrew Poelstra
ebf57dc2f5
Merge pull request #107 from thomaseizinger/secp256k1-zkp
Remove unused context initializer functions
2020-11-24 02:17:54 +00:00