]> Git Repo - secp256k1.git/log
secp256k1.git
5 years agoMerge #685: Fix issue where travis does not show the ./tests seed…
Tim Ruffing [Mon, 25 Nov 2019 14:03:15 +0000 (15:03 +0100)]
Merge #685: Fix issue where travis does not show the ./tests seed…

a0771d1 Explicitly disable buffering for stderr in tests (Jonas Nick)
fb424fb Make travis show the ./tests seed by removing stdout buffering and always cat tests.log after a travis run. (Jonas Nick)

Pull request description:

  …by removing stdout buffering and always cat tests.log after a travis run. Fixes #645.

  I noticed that according to the [doc](https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html) tests.log should contain stdout as well as stderr. But it doesn't because stdout isn't flushed. I removed buffering completely to avoid having to call `fflush` twice.

  Travis is instructed to always show the seed which seems helpful with `after_script` by `cat`ing `./tests.log`. In case the tests fail it looks like https://travis-ci.org/jonasnick/secp256k1/jobs/606446234.

ACKs for commit a0771d:
  real-or-random:
    ACK a0771d15e67d3fe6ac1791f81d9731f73c550e5e I looked at the diff and checked that it does not break the tests

Tree-SHA512: 3ba37c2d9169867112981bba3d56680000651ef22ef684c3703f26ed3f71bf415fb23875d30059c8247ea9520c9cfad2c9207badf1b33da8fa3b7b7235a8bf16

5 years agoExplicitly disable buffering for stderr in tests
Jonas Nick [Mon, 25 Nov 2019 10:17:02 +0000 (10:17 +0000)]
Explicitly disable buffering for stderr in tests

5 years agoMake travis show the ./tests seed by removing stdout buffering and always cat tests...
Jonas Nick [Sat, 2 Nov 2019 14:06:36 +0000 (14:06 +0000)]
Make travis show the ./tests seed by removing stdout buffering and always cat tests.log after a travis run.

5 years agoMerge #690: Add valgrind check to travis
Jonas Nick [Mon, 25 Nov 2019 10:18:44 +0000 (10:18 +0000)]
Merge #690: Add valgrind check to travis

dd98cc988f0fb3a0ab10bf1a4e28d2fbffd6c1e7 travis: Added a valgrind test without endro and enabled recovery+ecdh (Elichai Turkel)
b4c1382a87dde22d0a5075e56fb7f5d2a09f7cc7 Add valgrind check to travis (Elichai Turkel)

Pull request description:

  As discussed in https://github.com/bitcoin-core/secp256k1/pull/687
  This adds valgrind check to the repo.

  It doesn't run on recovery+ecdh because of the time.
  No openssl because of uninitialized mem.
  I debated between with and without ASM, but decided with ASM because it might be more fragile(?).

  I wasn't sure if I should pass `-DVALGRIND` via `CFLAGS` or `CPPFLAGS`, it seems like because this is only C then there shouldn't even be `CPPFLAGS` but looks like we use `CPPFLAGS` in other places for the preprocessor definitions.

  If people are worried about the time it takes we can mark it as `allow_failure` although I don't think it's a problem here because there's only a handful of PRs and they're usually open for weeks.

ACKs for top commit:
  real-or-random:
    ACK dd98cc988f0fb3a0ab10bf1a4e28d2fbffd6c1e7 I looked at the diff
  jonasnick:
    ACK dd98cc988f0fb3a0ab10bf1a4e28d2fbffd6c1e7

Tree-SHA512: 72d7f1f4c8dd4c58501ac1003b28296d6fd140a8f7711e9e3b3c04a3fbce358ff1c89d2e1d1c5489d7668d3019981264c5cadecae3d9b48cd38c9463e287d8ad

5 years agoMerge #678: Preventing compiler optimizations in benchmarks without a memory fence
Jonas Nick [Mon, 18 Nov 2019 20:09:05 +0000 (20:09 +0000)]
Merge #678: Preventing compiler optimizations in benchmarks without a memory fence

362bb25608dbcd724a07dd5170c4ebe081c3dd84 Modified bench_scalar_split so it won't get optimized out (Elichai Turkel)
73a30c6b58f078b42a03a222c55bfe8b4dd86a2b Added accumulators and checks on benchmarks so they won't get optimized out (Elichai Turkel)

Pull request description:

  As asked https://github.com/bitcoin-core/secp256k1/pull/667#issuecomment-546885951 this is the parts of #667 that don't require an assembly memory fence.

  I splitted them to 2 commits, one with obvious easy ones. and another that changes the logic a bit to achieve this (See https://github.com/bitcoin-core/secp256k1/pull/667#discussion_r337248398 )

ACKs for top commit:
  jonasnick:
    ACK 362bb256
  real-or-random:
    ACK 362bb25608dbcd724a07dd5170c4ebe081c3dd84 I read the diff and I ran the benchmarks

Tree-SHA512: d5e47f5d64c3b035155276f057671ceb7f5852f24c7102fee4d0141aabebf882039f3eae0d152bae89d0603bc09fa6ad9f7bc6b8c0f74a668ee252c727517804

5 years agotravis: Added a valgrind test without endro and enabled recovery+ecdh
Elichai Turkel [Sat, 9 Nov 2019 11:40:45 +0000 (13:40 +0200)]
travis: Added a valgrind test without endro and enabled recovery+ecdh

5 years agoAdd valgrind check to travis
Elichai Turkel [Thu, 7 Nov 2019 19:31:59 +0000 (21:31 +0200)]
Add valgrind check to travis

5 years agoMerge #688: Fix ASM setting in travis
Tim Ruffing [Tue, 5 Nov 2019 11:27:36 +0000 (12:27 +0100)]
Merge #688: Fix ASM setting in travis

5c5f71e Fix ASM setting in travis (Jonas Nick)

Pull request description:

  Without this PR the `ASM` setting isn't taken into account in travis.

ACKs for commit 5c5f71:
  real-or-random:
    ACK 5c5f71eea5167b0dd9dbef246fc70132c50c9af3 I read the diff

Tree-SHA512: 741650e4b9163e0e7341fa59b9859da85d0e34fa59980e68eacf59388879281b640836532acb3d8121da18d8e75a7c2993defada6329df830a99472b71cc17fe

5 years agoFix ASM setting in travis
Jonas Nick [Tue, 5 Nov 2019 10:56:02 +0000 (10:56 +0000)]
Fix ASM setting in travis

5 years agoMerge #684: Make no-float policy explicit
Jonas Nick [Fri, 1 Nov 2019 10:21:09 +0000 (10:21 +0000)]
Merge #684: Make no-float policy explicit

bae1bea3c4b46a2fb5ca76ff6bf1e98d43cff52f Make no-float policy explicit (Tim Ruffing)

Pull request description:

  We don't want floating types for various reasons, e.g.,
   - Their representation and often their behavior is implementation-defined.
   - Many targets don't support them.

  Closes #683.

ACKs for top commit:
  jonasnick:
    ACK bae1bea3c4b46a2fb5ca76ff6bf1e98d43cff52f

Tree-SHA512: e0027d6dda1a3e4b7d146fd3bea04e05473e08e25c0d0730018768be00351dfcf51b87b47b9e27953a21d42e0621433f13cbe55e4c20a7f7086e0191dff607a6

5 years agoMake no-float policy explicit
Tim Ruffing [Fri, 1 Nov 2019 09:39:41 +0000 (10:39 +0100)]
Make no-float policy explicit

We don't want floating types for various reasons, e.g.,
 - Their representation and often their behavior is implementation-defined.
 - Many targets don't support them.

5 years agoAdd SECURITY.md
Jonas Nick [Mon, 28 Oct 2019 14:59:05 +0000 (14:59 +0000)]
Add SECURITY.md

5 years agoModified bench_scalar_split so it won't get optimized out
Elichai Turkel [Mon, 28 Oct 2019 14:27:44 +0000 (16:27 +0200)]
Modified bench_scalar_split so it won't get optimized out

5 years agoAdded accumulators and checks on benchmarks so they won't get optimized out
Elichai Turkel [Mon, 28 Oct 2019 14:27:16 +0000 (16:27 +0200)]
Added accumulators and checks on benchmarks so they won't get optimized out

5 years agoMerge #677: Remove note about heap allocation in secp256k1_ecmult_odd_multiples_table...
Tim Ruffing [Mon, 28 Oct 2019 12:23:35 +0000 (13:23 +0100)]
Merge #677: Remove note about heap allocation in secp256k1_ecmult_odd_multiples_table_storage_var

b76142f Remove note about heap allocation in secp256k1_ecmult_odd_multiples_table_storage_var which was removed in 47045270fa90f81205d989f7107769bce1e71c4d (Jonas Nick)

Pull request description:

  ...which was removed in 47045270fa90f81205d989f7107769bce1e71c4d. h/t @roconnor-blockstream

ACKs for commit b76142:

Tree-SHA512: 05fcd7aa5d765f1f5d31b93d40c2621e1dd9674a0db136a1e1cb216d6c01f5be1580275700cbdc08feda8f165b3b349640472d0bdec770bebb23f952225e3f52

5 years agoRemove note about heap allocation in secp256k1_ecmult_odd_multiples_table_storage_var...
Jonas Nick [Mon, 28 Oct 2019 12:21:36 +0000 (12:21 +0000)]
Remove note about heap allocation in secp256k1_ecmult_odd_multiples_table_storage_var which was removed in 47045270fa90f81205d989f7107769bce1e71c4d

5 years agoMerge #647: Increase robustness against UB in secp256k1_scalar_cadd_bit
Tim Ruffing [Mon, 28 Oct 2019 10:53:46 +0000 (11:53 +0100)]
Merge #647: Increase robustness against UB in secp256k1_scalar_cadd_bit

0d82732 Improve VERIFY_CHECK of overflow in secp256k1_scalar_cadd_bit. This added check ensures that any curve order overflow doesn't go undetected due a uint32_t overflow. (Russell O'Connor)
8fe63e5 Increase robustness against UB. Thanks to elichai2 who noted that the literal '1' is a signed integer, and that shifting a signed 32-bit integer by 31 bits causes an overflow and yields undefined behaviour. While 'scalar_low_impl''s 'secp256k1_scalar_cadd_bit' is only used for testing purposes and currently the 'bit' parameter is only 0 or 1, it is better to avoid undefined behaviour in case the used domain of 'secp256k1_scalar_cadd_bit' expands. (roconnor-blockstream)

Pull request description:

  Avoid possible, but unlikely undefined behaviour in `scalar_low_impl`'s `secp256k1_scalar_cadd_bit`.
  Thanks to elichai2 who noted that the literal `1` is a signed integer, and that shifting a signed 32-bit integer by 31 bits causes an overflow and yields undefined behaviour.

  Using the unsigned literal `1u` addresses the issue.

ACKs for commit 0d8273:
  real-or-random:
    ACK 0d82732a9a16cecc445e61c718ce9bdc2d228e76
  jonasnick:
    ACK 0d82732a9a16cecc445e61c718ce9bdc2d228e76

Tree-SHA512: 905be3b8b00aa5cc9bd6dabb543745119da8f34181d37765071f28abbc1d6ff3659e3f195b72c2f2d003006678823919668bc0d169ac8b8d4bcc5da671813c99

5 years agoMerge #664: Remove mention of ec_privkey_export because it doesn't exist
Jonas Nick [Fri, 11 Oct 2019 17:31:26 +0000 (17:31 +0000)]
Merge #664: Remove mention of ec_privkey_export because it doesn't exist

59782c68b41e4262f003135717705990b3fdc3ae Remove mention of ec_privkey_export because it doesn't exist (Jonas Nick)

Pull request description:

  Fixes #663
  There is `ec_privkey_export_der` but it takes `0` for uncompressed and not `SECP256K1_EC_UNCOMPRESSED` (which is `2`).

ACKs for top commit:
  real-or-random:
    ACK https://github.com/bitcoin-core/secp256k1/pull/664/commits/59782c68b41e4262f003135717705990b3fdc3ae
  apoelstra:
    utACK https://github.com/bitcoin-core/secp256k1/commit/59782c68b41e4262f003135717705990b3fdc3ae

Tree-SHA512: 6167581df74264be576f921d04bb8e23e16fa3b823bac4b45299079ceee38d6c74dd14a55b7b976a2cee9bdbd74dd6e3b39c0482808c1b8e65c8c80743f113a2

5 years agoRemove mention of ec_privkey_export because it doesn't exist
Jonas Nick [Sun, 15 Sep 2019 11:27:17 +0000 (11:27 +0000)]
Remove mention of ec_privkey_export because it doesn't exist

5 years agoMerge #337: variable sized precomputed table for signing
Tim Ruffing [Thu, 5 Sep 2019 13:25:47 +0000 (15:25 +0200)]
Merge #337: variable sized precomputed table for signing

dcb2e3b3fff0b287d576842aabe5c79f2fe4df30 variable signing precompute table (djb)

Pull request description:

  This pull request gives an option to reduce the precomputed table size for the signing context (`ctx`) by setting `#define ECMULT_GEN_PREC_BITS [N_BITS]`.

  Motivation: Per #251 and #254, the static table can be reduced to 64kB. However, this is still too big for some of my embedded applications. Setting `#define ECMULT_GEN_PREC_BITS 2` produces a 32kB table at a tradeoff of about 75% of the signing speed. Not defining this value will default to the existing implementation of 4 bits. Statistics:

  ```
  ECMULT_GEN_PREC_BITS = 1
  Precomputed table size: 32kB
  ./bench_sign
  ecdsa_sign: min 195us / avg 200us / max 212us

  ECMULT_GEN_PREC_BITS = 2
  Precomputed table size: 32kB
  ./bench_sign
  ecdsa_sign: min 119us / avg 126us / max 134us

  ECMULT_GEN_PREC_BITS = 4 (default)
  Precomputed table size: 64kB
  ./bench_sign
  ecdsa_sign: min 83.5us / avg 89.6us / max 95.3us

  ECMULT_GEN_PREC_BITS = 8
  Precomputed table size: 512kB
  ./bench_sign
  ecdsa_sign: min 96.4us / avg 99.4us / max 104us
  ```

  Only values of 2 and 4 make sense. 8 bits causes a larger table size with no increase in speed. 1 bit runs, actually, but does not reduce table size and is slower than 2 bits.

ACKs for top commit:
  real-or-random:
    ACK dcb2e3b3fff0b287d576842aabe5c79f2fe4df30 verified that all changes to the previous ACKed 1d26b27ac90092306bfbc9cdd5123e8a5035202a were due to the rebase
  jonasnick:
    ACK dcb2e3b3fff0b287d576842aabe5c79f2fe4df30 read the code and tested various configurations with valgrind

Tree-SHA512: ed6f68ca23ffdc4b59d51525336b34b25521233537edbc74d32dfb3eafd8196419be17f01cbf10bd8d87ce745ce143085abc6034727f742163f7e5f13f26f56e

5 years agovariable signing precompute table
djb [Sun, 18 Oct 2015 08:35:16 +0000 (10:35 +0200)]
variable signing precompute table

make ECMULT_GEN_PREC_BITS configurable

ecmult_static_context.h: add compile time config assertion (#3) - Prevents accidentally using a file which was generated with a
different configuration.

README: mention valgrind issue

With --with-ecmult-gen-precision=8, valgrind needs a max stack size
adjustment to not run into a stack switching heuristic:

http://valgrind.org/docs/manual/manual-core.html

> -max-stackframe= [default: 2000000]
> The maximum size of a stack frame. If the stack pointer moves by more than this amount then Valgrind will assume that the program is switching to a different stack.
You may need to use this option if your program has large stack-allocated arrays.

basic-config: undef ECMULT_WINDOW_SIZE before (re-)defining it

5 years agoMerge #661: Make ./configure string consistent
Jonas Nick [Wed, 4 Sep 2019 22:22:39 +0000 (22:22 +0000)]
Merge #661: Make ./configure string consistent

a467047e110fb55186df173afa3d5f330f6fa47c Make ./configure string consistent (Tim Ruffing)

Pull request description:

  This was forgotten in some PR rebase.

ACKs for top commit:
  jonasnick:
    ACK a467047e110fb55186df173afa3d5f330f6fa47c

Tree-SHA512: 5aa67e886c165afa97a1e34ccfbd6bb0158ba4d4e5a4aacf6ac8b17ad9ee55132061957fd5ec383a79ad72ec7c92c745d7ad4fddca743b53e4b0e635616b29dc

5 years agoMake ./configure string consistent
Tim Ruffing [Wed, 4 Sep 2019 16:53:08 +0000 (18:53 +0200)]
Make ./configure string consistent

This was forgotten in some PR rebase.

5 years agoMerge #657: Fix a nit in the recovery tests
Jonas Nick [Thu, 22 Aug 2019 08:49:34 +0000 (08:49 +0000)]
Merge #657: Fix a nit in the recovery tests

b64a2e2597b66b57e23f3cb34f9c88809e34d93f Fix a nit in the recovery tests (Elichai Turkel)

Pull request description:

  this signature is only valid under recid 1 not 0.

  Source: https://github.com/bitcoin-core/secp256k1/blob/master/src/modules/recovery/tests_impl.h#L247
  (it passes only when the sig is parsed with recid 1)

ACKs for top commit:
  real-or-random:
    ACK b64a2e2597b66b57e23f3cb34f9c88809e34d93f I only looked at the diff
  jonasnick:
    ACK b64a2e2597b66b57e23f3cb34f9c88809e34d93f read the code

Tree-SHA512: 8e6744fe87c4078181dd1b334641784bf4fee37eb87346ecf8149482a9ea2c321bbe068e6a9199d836430b54b73848d94473a9aa6b59b4a68921a6321f449736

5 years agoFix a nit in the recovery tests
Elichai Turkel [Wed, 21 Aug 2019 14:07:22 +0000 (10:07 -0400)]
Fix a nit in the recovery tests

5 years agoMerge #650: secp256k1/src/tests.c: Properly handle sscanf return value
Jonas Nick [Sun, 18 Aug 2019 22:49:23 +0000 (22:49 +0000)]
Merge #650: secp256k1/src/tests.c:  Properly handle sscanf return value

a11c76c59a431e3492994f71a968a838e398fb58 secp256k1/src/tests.c:  Properly handle sscanf return value (Mustapha Abiola)

Pull request description:

  This pull request fixes a bug which allows the `sh` variable to be used uninitialised
  when sscanf(3) returns EOF.

Signed-off-by: Mustapha Abiola <[email protected]>
ACKs for top commit:
  sipa:
    ACK a11c76c59a431e3492994f71a968a838e398fb58.
  practicalswift:
    utACK a11c76c59a431e3492994f71a968a838e398fb58
  real-or-random:
    ACK a11c76c59a431e3492994f71a968a838e398fb58 I looked at the code

Tree-SHA512: fd9660a18e39ecf9366db94ccbcec2682b020223f4f982a4356ddf56c2fbdafa5edcd830db37be12b661c1ec0b15c57b9f34ba59ef4460187c9c2478376fbc88

5 years agoMerge #654: Fix typo (∞)
Tim Ruffing [Sat, 17 Aug 2019 14:17:50 +0000 (16:17 +0200)]
Merge #654: Fix typo (∞)

271582b3b7aadf6dc00e7a5e88a251dcf15a6c1a Fix typo (practicalswift)

Pull request description:

  Fix ∞ typo :-)

ACKs for top commit:
  real-or-random:
    ACK 271582b3b7aadf6dc00e7a5e88a251dcf15a6c1a

Tree-SHA512: 41b8134e2572707d8a1ea1e5a79fffcc206b6093ec761ee1f93e4529506553c9cc8e3839b046210468f6c4c0d7af9d78a3e7e546bb0026656f1db1c793244296

5 years agoMerge pull request #656 from real-or-random/patch-1
Andrew Poelstra [Sat, 10 Aug 2019 13:08:06 +0000 (13:08 +0000)]
Merge pull request #656 from real-or-random/patch-1

Fix typo in docs for _context_set_illegal_callback

5 years agoFix typo in docs for _context_set_illegal_callback
Tim Ruffing [Fri, 9 Aug 2019 09:25:09 +0000 (11:25 +0200)]
Fix typo in docs for _context_set_illegal_callback

5 years agoImprove VERIFY_CHECK of overflow in secp256k1_scalar_cadd_bit.
Russell O'Connor [Fri, 5 Jul 2019 04:30:36 +0000 (00:30 -0400)]
Improve VERIFY_CHECK of overflow in secp256k1_scalar_cadd_bit.
This added check ensures that any curve order overflow doesn't go undetected due a uint32_t overflow.

5 years agoMerge #583: JNI: fix use sig array
Pieter Wuille [Tue, 6 Aug 2019 22:32:20 +0000 (15:32 -0700)]
Merge #583: JNI: fix use sig array

74e2dbd JNI: fix use sig array (liuyujun)

Pull request description:

ACKs for commit 74e2db:
  sipa:
    ACK 74e2dbd68e07f752ac326a578e3071f9efa55e55. This is clearly an improvement.
  real-or-random:
    ACK 74e2dbd68e07f752ac326a578e3071f9efa55e55 I've read the code but haven't tested it

Tree-SHA512: 850b32e893463be4be28185dcc127d429afe4b6076036a078b7c61d590e0f4ea89127e448760b71c087cf70ffbefc52d87db77a5131bee81f3e4f95cfbd3bd3e

5 years agoMerge #644: Avoid optimizing out a verify_check
Pieter Wuille [Tue, 6 Aug 2019 22:28:48 +0000 (15:28 -0700)]
Merge #644: Avoid optimizing out a verify_check

94ae7cb Moved a dereference so the null check will be before the dereferencing (Elichai Turkel)

Pull request description:

  Before that even on debug the compiler could've assumed `a` isn't null and optimized `VERIFY_CHECK(a != NULL);` out.
  This put the dereference after the check
  Resolves #643

ACKs for commit 94ae7c:
  sipa:
    ACK 94ae7cbf83a34456e5cad721f61ea77fcc023a3f

Tree-SHA512: 8b986f202ede5bde1f14a8ecf25e339d64ee6cd5cb391c5f18b4ff58f946c3845902d1230bc80d110a0a33b37025d281bd4532afbdf03b1c9ca321097374eb8e

5 years agoMerge #652: README.md: update instruction to run tests
Pieter Wuille [Tue, 6 Aug 2019 22:04:26 +0000 (15:04 -0700)]
Merge #652: README.md: update instruction to run tests

ce6d438 README.md: update instruction to run tests (Marko Bencun)

Pull request description:

  Reflecting what Travis does.

ACKs for commit ce6d43:
  real-or-random:
    ACK ce6d438266e075b22a955b3205b2d8279bfa04e7
  sipa:
    ACK ce6d438266e075b22a955b3205b2d8279bfa04e7

Tree-SHA512: c0a36772a5d8571bb503f83111e89181acc1eec080cf7efa64ab922f6136138234555a9d47120e2126ae958a60864b0479c3037bff74895dd488015f25a05c10

5 years agoMerge #651: Fix typo in secp256k1_preallocated.h
Pieter Wuille [Tue, 6 Aug 2019 22:02:51 +0000 (15:02 -0700)]
Merge #651: Fix typo in secp256k1_preallocated.h

b1e68cb Fix typo in secp256k1_preallocated.h (Jan Xie)

Pull request description:

ACKs for commit b1e68c:
  sipa:
    ACK b1e68cb8e68d5d7ef8ba15c8d8a608c42b7803f6
  real-or-random:
    ACK b1e68cb8e68d5d7ef8ba15c8d8a608c42b7803f6

Tree-SHA512: ccd51ac687193cb8be34f7388b20d002773df574a52ba6dd85cf6fd69241c079eed0f624f2e72d5e8922edc07d51923831057377a9c6550e8e072bff43854bda

5 years agoMerge #640: scalar_impl.h: fix includes
Pieter Wuille [Tue, 6 Aug 2019 22:01:16 +0000 (15:01 -0700)]
Merge #640: scalar_impl.h: fix includes

2cb73b1 scalar_impl.h: fix includes (Marko Bencun)

Pull request description:

  group.h functions are not referenced.
  utils.h added as functions like VERIFY_CHECK are used.

ACKs for commit 2cb73b:
  sipa:
    ACK 2cb73b1064c796f5902189e0850066299e87aa93

Tree-SHA512: b9c7367061c2a22d2c9266c61261edd47798551b03b878ecd2e005d858701487145589793406cb4e88e85cd3c769007132efac9c228d5ee288e487e7d308e1c2

5 years agoMerge #655: jni: Use only Guava for hex encoding and decoding
Pieter Wuille [Tue, 6 Aug 2019 19:54:31 +0000 (12:54 -0700)]
Merge #655: jni: Use only Guava for hex encoding and decoding

2abcf95 jni: Use only Guava for hex encoding and decoding (Tim Ruffing)

Pull request description:

  This removes a dependency on javax.xml.bind, which is no longer
  available in JDK >= 11, see
  https://openjdk.java.net/jeps/320#Java-EE-modules .

ACKs for commit 2abcf9:
  sipa:
    ACK 2abcf951af6a9e8aff7398eb9588a50339b720c7, tests pass.

Tree-SHA512: bae4d1285b4a4a0ad62323c25eabcad5f800ddb2d97f2e15085b39982e29248b21e2e8de0d4c07a33a64f071dcdba653f72415558c0f8b619227bc6f6d71eda3

5 years agojni: Use only Guava for hex encoding and decoding
Tim Ruffing [Mon, 5 Aug 2019 15:02:29 +0000 (17:02 +0200)]
jni: Use only Guava for hex encoding and decoding

This removes a dependency on javax.xml.bind, which is no longer
available in JDK >= 11, see
https://openjdk.java.net/jeps/320#Java-EE-modules .

5 years agoFix typo
practicalswift [Mon, 5 Aug 2019 13:47:23 +0000 (13:47 +0000)]
Fix typo

5 years agoREADME.md: update instruction to run tests
Marko Bencun [Fri, 19 Jul 2019 11:50:16 +0000 (13:50 +0200)]
README.md: update instruction to run tests

Reflecting what Travis does.

5 years agoFix typo in secp256k1_preallocated.h
Jan Xie [Thu, 18 Jul 2019 00:35:42 +0000 (08:35 +0800)]
Fix typo in secp256k1_preallocated.h

5 years agosecp256k1/src/tests.c: Properly handle sscanf return value
Mustapha Abiola [Sun, 14 Jul 2019 15:02:58 +0000 (17:02 +0200)]
secp256k1/src/tests.c:  Properly handle sscanf return value

This pull request fixes a bug which allows the `sh` variable to be used uninitialized when sscanf returns EOF.

Signed-off-by: Mustapha Abiola <[email protected]>
5 years agoIncrease robustness against UB.
roconnor-blockstream [Wed, 3 Jul 2019 15:23:20 +0000 (11:23 -0400)]
Increase robustness against UB.
Thanks to elichai2 who noted that the literal '1' is a signed integer, and that shifting a signed 32-bit integer by 31 bits causes an overflow and yields undefined behaviour.
While 'scalar_low_impl''s 'secp256k1_scalar_cadd_bit' is only used for testing purposes and currently the 'bit' parameter is only 0 or 1, it is better to avoid undefined behaviour in case the used domain of 'secp256k1_scalar_cadd_bit' expands.

5 years agoMoved a dereference so the null check will be before the dereferencing
Elichai Turkel [Tue, 2 Jul 2019 23:18:56 +0000 (19:18 -0400)]
Moved a dereference so the null check will be before the dereferencing

5 years agoscalar_impl.h: fix includes
Marko Bencun [Thu, 20 Jun 2019 15:33:47 +0000 (17:33 +0200)]
scalar_impl.h: fix includes

group.h functions are not referenced.
utils.h added as functions like VERIFY_CHECK are used.

5 years agoMerge #634: Add a descriptive comment for secp256k1_ecmult_const.
Gregory Maxwell [Tue, 4 Jun 2019 23:05:07 +0000 (23:05 +0000)]
Merge #634: Add a descriptive comment for secp256k1_ecmult_const.

ee9e68c Add a descriptive comment for secp256k1_ecmult_const. (Gregory Maxwell)

Pull request description:

  Helps issue #633

ACKs for commit ee9e68:

Tree-SHA512: 552bebbd99bf8e8225ef6028e6a3bd188d412977d9c6caa90515041622accd2ea43e320217bf097180343921e967f4627a76c73e4529097bca50be414503e63b

5 years agoAdd a descriptive comment for secp256k1_ecmult_const.
Gregory Maxwell [Tue, 4 Jun 2019 01:52:44 +0000 (01:52 +0000)]
Add a descriptive comment for secp256k1_ecmult_const.

5 years agoMerge #631: typo in comment for secp256k1_ec_pubkey_tweak_mul ()
Gregory Maxwell [Sat, 1 Jun 2019 17:42:50 +0000 (17:42 +0000)]
Merge #631: typo in comment for secp256k1_ec_pubkey_tweak_mul ()

6914c25 typo in comment for secp256k1_ec_pubkey_tweak_mul () (philsmd)

Pull request description:

  Fixes a typo in secp256k1.h documentation

ACKs for commit 6914c2:

Tree-SHA512: 9b95209b7decab4624054b5e3476e99468f84f84eb270bba997abf73a78acbbf2eaa094dfa367ebfe0b1e553329071e9a0ca8a1e2b31ea7fbc4aad3fb0665e88

5 years agotypo in comment for secp256k1_ec_pubkey_tweak_mul ()
philsmd [Sat, 1 Jun 2019 10:21:20 +0000 (12:21 +0200)]
typo in comment for secp256k1_ec_pubkey_tweak_mul ()

Fixes a typo in secp256k1.h documentation

5 years agoMerge #629: Avoid calling _is_zero when _set_b32 fails.
Gregory Maxwell [Wed, 29 May 2019 21:46:31 +0000 (21:46 +0000)]
Merge #629: Avoid calling _is_zero when _set_b32 fails.

cd473e0 Avoid calling secp256k1_*_is_zero when secp256k1_*_set_b32 fails. (Gregory Maxwell)

Pull request description:

  Most of the codebase correctly used short-cutting to avoid calling
   _is_zero on possibly incompletely initialized elements, but a few
   places were missed.

ACKs for commit cd473e:
  sipa:
    utACK cd473e02c372217c3a6608ce5afaa543ed78f891
  jonasnick:
    utACK cd473e02c372217c3a6608ce5afaa543ed78f891

Tree-SHA512: d6af2863f6795d2df26f2bd05a4e33085e88c45f7794601ea57e67238a2073ef1ee3ba0feab62a7fcbc0636c48dfd80eea07d0ca4f194414127f914b0478c732

5 years agoMerge #630: Note intention of timing sidechannel freeness.
Gregory Maxwell [Wed, 29 May 2019 20:30:27 +0000 (20:30 +0000)]
Merge #630: Note intention of timing sidechannel freeness.

8d1563b Note intention of timing sidechannel freeness. (Gregory Maxwell)

Pull request description:

  Resolves #238

ACKs for commit 8d1563:

Tree-SHA512: 2b0ca945d70e5975291ed9a0884eddfd771fd06dfed37c9711f8b57d431c28b974e5a5d86ae6e70e5e37c5f208bcb74e9ab18fcf9d7b78849fcf3cff9ba7623b

5 years agoNote intention of timing sidechannel freeness.
Gregory Maxwell [Wed, 29 May 2019 12:23:20 +0000 (12:23 +0000)]
Note intention of timing sidechannel freeness.

Resolves #238

5 years agoMerge #628: Fix ability to compile tests without -DVERIFY.
Gregory Maxwell [Wed, 29 May 2019 14:24:22 +0000 (14:24 +0000)]
Merge #628: Fix ability to compile tests without -DVERIFY.

dcf3920 Fix ability to compile tests without -DVERIFY. (Gregory Maxwell)

Pull request description:

  Broken by 3f3964e4.

  It's important that the tests are also run without -DVERIFY due to
   the possibility that side-effects of a VERIFY_CHECK fix a bug that
   would otherwise be detected.

  Use of the verify_check macro in tests isn't sufficient.

ACKs for commit dcf392:

Tree-SHA512: ff7ca0e89e33f845656a4d7d18c0195d1378b020d67f89e900b18cf3d702aa81dd91ffd05a98953a481b83e4247eaf0c484bea12eab020efb3c966a456e8129f

5 years agoMerge #627: Guard memcmp in tests against mixed size inputs.
Gregory Maxwell [Wed, 29 May 2019 14:23:45 +0000 (14:23 +0000)]
Merge #627: Guard memcmp in tests against mixed size inputs.

248bffb Guard memcmp in tests against mixed size inputs. (Gregory Maxwell)

Pull request description:

  Reported by real-or-random.

  Fixes #623.

ACKs for commit 248bff:
  practicalswift:
    utACK 248bffb0526ce8d829ce22f4d63d0d4a9ccfe137

Tree-SHA512: 29867c79d2d6852f495334a5a9129c7feac2df639dd7f752067380689b0ce9f9b35e94524834c01e698df5c0b83dc9855204ec09f5dfe488a388b509c9b861d9

5 years agoMerge #578: Avoid implementation-defined and undefined behavior when dealing with...
Gregory Maxwell [Wed, 29 May 2019 10:35:10 +0000 (10:35 +0000)]
Merge #578: Avoid implementation-defined and undefined behavior when dealing with sizes

14c7dbd Simplify control flow in DER parsing (Tim Ruffing)
ec8f20b Avoid out-of-bound pointers and integer overflows in size comparisons (Tim Ruffing)
01ee1b3 Parse DER-enconded length into a size_t instead of an int (Tim Ruffing)
3cb057f Fix possible integer overflow in DER parsing (Tim Ruffing)

Pull request description:

  This is a result of auditing the code for overflow issues at random places. None of this is critical but I think all of it should be fixed.

  I know this touches "red" code. I double-checked and triple-checked this but I can understand if some of the changes are not desirable because they change well-tested code.

  Best reviewed in individual commits.

ACKs for commit 14c7db:

Tree-SHA512: 312dd3f961739752e1a861e75bd755920f634f87ee9668793e102c224434e8d21367452e114de729322c71a89f4fa82126aa5d32742f2bbbc091777c99515e10

5 years agoMerge #595: Allow to use external default callbacks
Gregory Maxwell [Mon, 27 May 2019 07:30:33 +0000 (07:30 +0000)]
Merge #595: Allow to use external default callbacks

e49f799 Add missing #(un)defines to base-config.h (Tim Ruffing)
77defd2 Add secp256k1_ prefix to default callback functions (Tim Ruffing)
908bdce Include stdio.h and stdlib.h explicitly in secp256k1.c (Tim Ruffing)
5db782e Allow usage of external default callbacks (Tim Ruffing)
6095a86 Replace CHECKs for no_precomp ctx by ARG_CHECKs without a return (Tim Ruffing)

Pull request description:

  This is intended for environments without implementations for `abort()`, `fprintf()`, and `stderr`. e.g., embedded systems. Those can provide their own implementations of `default_illegal_callback_fn` and `default_error_callback_fn` at compile time.

  If you want to use your own default callback, things will be somewhat inconsistent unfortunately: We cannot make the callback data `extern` too, because then the initialization lists for `default_illegal_callback` won't contain only constants. (`const` variables are not compile-time constants). So you cannot take callback data in your own default callback function.

  As a more drastic/breaking alternative I suggest to remove the callback data entirely. I don't think it's a big loss and I would be surprised if anyone uses it. Additionally, we could even remove the possibility to set the callback function at runtime after this PR. This will simplify things a lot, and again I don't think it's a big loss.

  Note that `abort()`, `fprintf()`, and `stderr` are also used in `CHECK`, which is still used in production code if we rely on gmp for scalar and field inversions (e.g.,  https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar_impl.h#L240). This is not an issue for embedded system which probably don't want to use gmp anyway, but it is probably an issue for the reasons explained in https://github.com/bitcoin-core/secp256k1/pull/566#issuecomment-469111901.

  (related downstream: https://github.com/rust-bitcoin/rust-secp256k1/pull/100 @elichai)

ACKs for commit e49f79:

Tree-SHA512: 4dec0821eef4156cbe162bd8cdf0531c1fae8c98cd9db8438170ff1aa0e59b199739eeab293695bb582246812bea5309959f02f1fb74bb57872da54ebc52313f

5 years agoAdd missing #(un)defines to base-config.h
Tim Ruffing [Mon, 18 Mar 2019 15:20:07 +0000 (16:20 +0100)]
Add missing #(un)defines to base-config.h

5 years agoAdd secp256k1_ prefix to default callback functions
Tim Ruffing [Sat, 9 Mar 2019 10:41:21 +0000 (11:41 +0100)]
Add secp256k1_ prefix to default callback functions

5 years agoInclude stdio.h and stdlib.h explicitly in secp256k1.c
Tim Ruffing [Mon, 4 Mar 2019 15:11:35 +0000 (16:11 +0100)]
Include stdio.h and stdlib.h explicitly in secp256k1.c

5 years agoAllow usage of external default callbacks
Tim Ruffing [Mon, 4 Mar 2019 14:36:35 +0000 (15:36 +0100)]
Allow usage of external default callbacks

5 years agoReplace CHECKs for no_precomp ctx by ARG_CHECKs without a return
Tim Ruffing [Mon, 4 Mar 2019 12:09:45 +0000 (13:09 +0100)]
Replace CHECKs for no_precomp ctx by ARG_CHECKs without a return

5 years agoAvoid calling secp256k1_*_is_zero when secp256k1_*_set_b32 fails.
Gregory Maxwell [Sun, 26 May 2019 10:22:38 +0000 (10:22 +0000)]
Avoid calling secp256k1_*_is_zero when secp256k1_*_set_b32 fails.

Most of the codebase correctly used short-cutting to avoid calling
 _is_zero on possibly incompletely initialized elements, but a few
 places were missed.

5 years agoMerge #600: scratch space: use single allocation
Gregory Maxwell [Sun, 26 May 2019 07:37:54 +0000 (07:37 +0000)]
Merge #600: scratch space: use single allocation

98836b1 scratch: replace frames with "checkpoint" system (Andrew Poelstra)
7623cf2 scratch: save a couple bytes of unnecessarily-allocated memory (Andrew Poelstra)
a7a164f scratch: rename `max_size` to `size`, document that extra will actually be allocated (Andrew Poelstra)
5a4bc0b scratch: unify allocations (Andrew Poelstra)
c2b028a scratch space: thread `error_callback` into all scratch space functions (Andrew Poelstra)
0be1a4a scratch: add magic bytes to beginning of structure (Andrew Poelstra)
92a48a7 scratch space: use single allocation (Andrew Poelstra)

Pull request description:

ACKs for commit 98836b:

Tree-SHA512: 6e251f704644a5f61b24aa05c6f7a31ad8c58d147195079d52fe45daacd28a9fd2f4aaf71273183b99b3795a01a88f8389170d4280489b2a28a14a56e03153d7

5 years agoscratch: replace frames with "checkpoint" system
Andrew Poelstra [Sat, 25 May 2019 14:15:38 +0000 (14:15 +0000)]
scratch: replace frames with "checkpoint" system

5 years agoscratch: save a couple bytes of unnecessarily-allocated memory
Andrew Poelstra [Fri, 15 Mar 2019 15:41:09 +0000 (15:41 +0000)]
scratch: save a couple bytes of unnecessarily-allocated memory

5 years agoscratch: rename `max_size` to `size`, document that extra will actually be allocated
Andrew Poelstra [Thu, 14 Mar 2019 14:41:03 +0000 (14:41 +0000)]
scratch: rename `max_size` to `size`, document that extra will actually be allocated

5 years agoscratch: unify allocations
Andrew Poelstra [Thu, 14 Mar 2019 14:37:53 +0000 (14:37 +0000)]
scratch: unify allocations

5 years agoscratch space: thread `error_callback` into all scratch space functions
Andrew Poelstra [Wed, 13 Mar 2019 23:30:51 +0000 (23:30 +0000)]
scratch space: thread `error_callback` into all scratch space functions

Use it when checking magic bytes

5 years agoscratch: add magic bytes to beginning of structure
Andrew Poelstra [Wed, 13 Mar 2019 22:35:08 +0000 (22:35 +0000)]
scratch: add magic bytes to beginning of structure

5 years agoscratch space: use single allocation
Andrew Poelstra [Wed, 13 Mar 2019 22:19:41 +0000 (22:19 +0000)]
scratch space: use single allocation

5 years agoMerge #592: Use trivial algorithm in ecmult_multi if scratch space is small
Gregory Maxwell [Sat, 25 May 2019 22:34:47 +0000 (22:34 +0000)]
Merge #592: Use trivial algorithm in ecmult_multi if scratch space is small

9ab96f7 Use trivial algorithm in ecmult_multi if scratch space is small (Jonas Nick)

Pull request description:

  `ecmult_multi` already selects the trivial algorithm if the scratch space is NULL. With this PR the trivial algorithm is also selected if the scratch space is too small to use pippenger or strauss instead of returning 0. That makes it more easier to avoid consensus relevant inconsistencies just because scratch space construction was messed up.

ACKs for commit 9ab96f:
  real-or-random:
    utACK 9ab96f7

Tree-SHA512: aa451adf8880af15cf167a59cb07fc411edc43f26c8eb0873bdae2774382ba182e2a1c54487912f8f2999cb0402d554b9d293e2fb9483234471348a1f43c6653

5 years agoFix ability to compile tests without -DVERIFY.
Gregory Maxwell [Sat, 25 May 2019 21:49:45 +0000 (21:49 +0000)]
Fix ability to compile tests without -DVERIFY.

Broken by 3f3964e4.

It's important that the tests are also run without -DVERIFY due to
 the possibility that side-effects of a VERIFY_CHECK fix a bug that
 would otherwise be detected.

Use of the verify_check macro in tests isn't sufficient.

5 years agoMerge #566: Enable context creation in preallocated memory
Gregory Maxwell [Sat, 25 May 2019 21:16:07 +0000 (21:16 +0000)]
Merge #566: Enable context creation in preallocated memory

0522caa Explain caller's obligations for preallocated memory (Tim Ruffing)
238305f Move _preallocated functions to separate header (Tim Ruffing)
695feb6 Export _preallocated functions (Tim Ruffing)
814cc78 Add tests for contexts in preallocated memory (Tim Ruffing)
ba12dd0 Check arguments of _preallocated functions (Tim Ruffing)
5feadde Support cloning a context into preallocated memory (Tim Ruffing)
c4fd5da Switch to a single malloc call (Tim Ruffing)
ef020de Add size constants for preallocated memory (Tim Ruffing)
1bf7c05 Prepare for manual memory management in preallocated memory (Tim Ruffing)

Pull request description:

  @apoelstra

  This builds on #557.

  Manually managing memory is always a pain in the ass in some way. I tried to keep the pain manageable. I'm open to suggestions to make this less ugly or error-prone.

  to do:
   * tests
   * export functions

ACKs for commit 0522ca:

Tree-SHA512: 8ddb5b70219b6f095e780a9812d2387ab2a7f399803ce4101e27da504b479a61ebe08b6380568c7ba6f1e73d7d0b1f58a3c0a66fa0fdec7a64cd0740e156ce38

5 years agoExplain caller's obligations for preallocated memory
Tim Ruffing [Fri, 29 Mar 2019 21:27:01 +0000 (22:27 +0100)]
Explain caller's obligations for preallocated memory

5 years agoMove _preallocated functions to separate header
Tim Ruffing [Tue, 27 Nov 2018 15:48:57 +0000 (16:48 +0100)]
Move _preallocated functions to separate header

5 years agoExport _preallocated functions
Tim Ruffing [Tue, 27 Nov 2018 15:47:46 +0000 (16:47 +0100)]
Export _preallocated functions

5 years agoAdd tests for contexts in preallocated memory
Tim Ruffing [Thu, 25 Oct 2018 18:32:38 +0000 (20:32 +0200)]
Add tests for contexts in preallocated memory

5 years agoCheck arguments of _preallocated functions
Tim Ruffing [Thu, 25 Oct 2018 16:08:14 +0000 (18:08 +0200)]
Check arguments of _preallocated functions

5 years agoSupport cloning a context into preallocated memory
Tim Ruffing [Thu, 25 Oct 2018 15:14:10 +0000 (17:14 +0200)]
Support cloning a context into preallocated memory

5 years agoSwitch to a single malloc call
Tim Ruffing [Mon, 22 Oct 2018 14:25:26 +0000 (16:25 +0200)]
Switch to a single malloc call

5 years agoAdd size constants for preallocated memory
Tim Ruffing [Mon, 22 Oct 2018 14:23:09 +0000 (16:23 +0200)]
Add size constants for preallocated memory

5 years agoPrepare for manual memory management in preallocated memory
Tim Ruffing [Thu, 18 Oct 2018 17:09:51 +0000 (19:09 +0200)]
Prepare for manual memory management in preallocated memory

 * Determine ALIGNMENT more cleverly and move it to util.h
 * Implement manual_malloc() helper function

5 years agoGuard memcmp in tests against mixed size inputs.
Gregory Maxwell [Sat, 25 May 2019 11:54:08 +0000 (11:54 +0000)]
Guard memcmp in tests against mixed size inputs.

Reported by real-or-random.

Fixes #623.

5 years agoMerge #596: Make WINDOW_G configurable
Gregory Maxwell [Sat, 25 May 2019 10:15:59 +0000 (10:15 +0000)]
Merge #596: Make WINDOW_G configurable

a61a93f Clean up ./configure help strings (Tim Ruffing)
2842dc5 Make WINDOW_G configurable (Tim Ruffing)

Pull request description:

  This makes WINDOW_G a configurable value in the range of [2..24].
  The upper limit of 24 is a defensive choice. The code is probably
  correct for values up to 33 but those larger values yield in huge
  tables (>= 256MiB), which are i) unlikely to be really beneficial
  in practice and ii) increasingly difficult to test.

  The main point of this is not to make the window size configurable (using ./configure) but rather to use an external #define for the window size, which makes it configurable for embedded system that rely on their own build system (like in #595).

ACKs for commit a61a93:

Tree-SHA512: 0d58fdf4763340ddab992e95f6302a33d891476a7ac1748202ee99808e72b20754bb6935cbeaf0bb36077abaaff7d65f4848b1af64f1a0a5258239ba0d27020c

5 years agoClean up ./configure help strings
Tim Ruffing [Wed, 6 Mar 2019 13:10:38 +0000 (14:10 +0100)]
Clean up ./configure help strings

5 years agoMake WINDOW_G configurable
Tim Ruffing [Wed, 6 Mar 2019 12:12:33 +0000 (13:12 +0100)]
Make WINDOW_G configurable

This makes WINDOW_G a configurable value in the range of [2..24].
The upper limit of 24 is a defensive choice. The code is probably
correct for values up to 27 but those larger values yield in huge
tables (>= 256MiB), which are i) unlikely to be really beneficial
in practice and ii) increasingly difficult to test.

5 years agoMerge #626: Revert "Merge #620: Install headers automatically"
Gregory Maxwell [Fri, 24 May 2019 01:00:58 +0000 (01:00 +0000)]
Merge #626: Revert "Merge #620: Install headers automatically"

662918c Revert "Merge #620: Install headers automatically" (ian)

Pull request description:

  This reverts commit 91fae3ace0291b144b27fd8bbda509042f5400f1, reversing
  changes made to 5df77a0eda6e902a1aa9c6249cdeaec197b1e0cd.

  See discussion in https://github.com/bitcoin-core/secp256k1/pull/625

  After the change, if we enable any module, `make install` fails because of the
  duplicated files in the command line arguments.

  Closes https://github.com/bitcoin-core/secp256k1/issues/624

Tree-SHA512: 7769ede527ac307bff094603e5974c56b19e41bc2ef55113173d3dbc8e545d6add7ae044753fa0361595e5e7a746d6c8d641f98caa3381b683aa2b61a1742097

5 years agoRevert "Merge #620: Install headers automatically"
ian [Fri, 24 May 2019 00:34:54 +0000 (08:34 +0800)]
Revert "Merge #620: Install headers automatically"

This reverts commit 91fae3ace0291b144b27fd8bbda509042f5400f1, reversing
changes made to 5df77a0eda6e902a1aa9c6249cdeaec197b1e0cd.

See discussion in https://github.com/bitcoin-core/secp256k1/pull/625

After the change, if we enable any module, `make install` fails because of the
duplicated files in the command line arguments.

5 years agoSimplify control flow in DER parsing
Tim Ruffing [Wed, 7 Nov 2018 15:13:27 +0000 (16:13 +0100)]
Simplify control flow in DER parsing

5 years agoAvoid out-of-bound pointers and integer overflows in size comparisons
Tim Ruffing [Wed, 7 Nov 2018 15:17:57 +0000 (16:17 +0100)]
Avoid out-of-bound pointers and integer overflows in size comparisons

This changes pointer calculations in size comparions to a form that
ensures that no out-of-bound pointers are computed, because even their
computation yields undefined behavior.
Also, this changes size comparions to a form that ensures that neither
the left-hand side nor the right-hand side can overflow.

5 years agoParse DER-enconded length into a size_t instead of an int
Tim Ruffing [Wed, 7 Nov 2018 15:07:33 +0000 (16:07 +0100)]
Parse DER-enconded length into a size_t instead of an int

This avoids a possibly implementation-defined signed (int) to unsigned
(size_t) conversion portably.

5 years agoMerge #561: Respect LDFLAGS and #undef STATIC_PRECOMPUTATION if using basic config
Gregory Maxwell [Thu, 23 May 2019 00:36:27 +0000 (00:36 +0000)]
Merge #561: Respect LDFLAGS and #undef STATIC_PRECOMPUTATION if using basic config

dbed75d Undefine `STATIC_PRECOMPUTATION` if using the basic config (DesWurstes)
310111e Keep LDFLAGS if `--coverage` (DesWurstes)

Pull request description:

  Update: **This is a trimmed pull request with strong rationale.**

  - Adding `--coverage` shouldn't reset `LDFLAGS`, this is definitely a typo
  - The basic configuration should undefine `STATIC_PRECOMPUTATION`, as generating it is not supported and it complicates #549

Tree-SHA512: 29f0dd4c870ec60d535346446b453da459ca843ed1265c2bc966bf0fcbdf3c5c79f9e48a419662e81d790a7003f8877a16e2a5a74aa5c0b79645e15ad56a0f66

5 years agoMerge #620: Install headers automatically
Gregory Maxwell [Thu, 23 May 2019 00:00:49 +0000 (00:00 +0000)]
Merge #620: Install headers automatically

16e8615 Install headers automatically (Víctor Mayoral Vilches)

Pull request description:

  This fix install all the headers under include/ into
  /usr/local/include. The fix solves problems that arise
  when building libraries that depend on secp256k1 such
  as libbitcoin-system which require all the headers

Tree-SHA512: 8a5dc664b278e47340bf7478ad278306c44c4c8ad17a023b198c6a927c67c7a7a50100357388342129078afdf7606d2ed06579ce1fc14195fa974510b933021b

5 years agoMerge #533: Make sure we're not using an uninitialized variable in secp256k1_wnaf_con...
Gregory Maxwell [Wed, 22 May 2019 04:43:53 +0000 (04:43 +0000)]
Merge #533: Make sure we're not using an uninitialized variable in secp256k1_wnaf_const(...)

248f046 Make sure we're not using an uninitialized variable in secp256k1_wnaf_const(...) (practicalswift)

Pull request description:

  Make sure we're not using an uninitialized variable in `secp256k1_wnaf_const(...)`:

  ```
  In file included from src/secp256k1.c:15:0,
                   from src/tests.c:17:
  src/ecmult_const_impl.h: In function ‘secp256k1_wnaf_const’:
  src/ecmult_const_impl.h:117:20: warning: ‘u’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       wnaf[word] = u * global_sign;
                      ^
  ```

  **Note to reviewers:** Perhaps an `assert(…);` is a bit drastic. What would be a more graceful way to handle this? :-)

Tree-SHA512: 536cd7cc5b87a84fbaac578cecbba81b8d82e4672a30a2db9a674b82856132e79b0158a6a88609bc24942ebdbf1fcd2c4399a4c31ab0654b88ace9c0e6f1eaf3

5 years agoMerge #617: Pass scalar by reference in secp256k1_wnaf_const()
Gregory Maxwell [Wed, 22 May 2019 04:38:27 +0000 (04:38 +0000)]
Merge #617: Pass scalar by reference in secp256k1_wnaf_const()

8979ec0 Pass scalar by reference in secp256k1_wnaf_const() (Tim Ruffing)

Pull request description:

  After this change, no struct or union is passed by value in the
  entire codebase. This makes it easier to compile the library with
  CompCert.

Tree-SHA512: 6b23e2b39701c3eeb6ae8c8d660cabe8872ac8f13141504c1ec55c47f2009e206129b34b31796e618114b60350598187df6df4c2be0e5c1b138a6126ad6a7484

5 years agoMerge #619: Clear a copied secret key after negation
Gregory Maxwell [Thu, 16 May 2019 08:37:20 +0000 (08:37 +0000)]
Merge #619: Clear a copied secret key after negation

069870d Clear a copied secret key after negation (Seonpyo Kim)

Pull request description:

  It closes #618

Tree-SHA512: 05299597c886c5d1a913fd0ce8c698d2e513eb80fbd33d571a02fc6910cfd337324c6f0f27175eaf125eb3478d38187763680e859ece9a469a034c9b8a8d6920

5 years agoInstall headers automatically
Víctor Mayoral Vilches [Wed, 15 May 2019 07:54:35 +0000 (09:54 +0200)]
Install headers automatically

This fix install all the headers under include/ into
/usr/local/include. The fix solves problems that arise
when building libraries that depend on secp256k1 such
as bitcoin-system which require all the headers

5 years agoClear a copied secret key after negation
Seonpyo Kim [Wed, 15 May 2019 06:55:01 +0000 (15:55 +0900)]
Clear a copied secret key after negation

5 years agoPass scalar by reference in secp256k1_wnaf_const()
Tim Ruffing [Tue, 14 May 2019 09:43:54 +0000 (11:43 +0200)]
Pass scalar by reference in secp256k1_wnaf_const()

After this change, no struct or union is passed by value in the
entire codebase. This makes it easier to compile the library with
CompCert.

5 years agoMerge #612: Allow field_10x26_arm.s to compile for ARMv7 architecture
Gregory Maxwell [Thu, 9 May 2019 22:23:41 +0000 (22:23 +0000)]
Merge #612: Allow field_10x26_arm.s to compile for ARMv7 architecture

d4d270a Allow field_10x26_arm.s to compile for ARMv7 architecture (Roman Zeyde)

Pull request description:

  It would allow using optimized field operations on the TREZOR device, which is using ARMv7 Cortex-M4.
  Following https://github.com/trezor/trezor-core/pull/500 and part of https://github.com/trezor/trezor-firmware/issues/66.

Tree-SHA512: 73c0f03503feff01c6f4efd884e916ae1f43f55d525e8c3ea9372cf777aef6901585b74774c316dd7937abfff5e86be5b1acb569f9eeee9b73ae088f0f6b589d

5 years agoAllow field_10x26_arm.s to compile for ARMv7 architecture
Roman Zeyde [Sun, 21 Apr 2019 17:11:58 +0000 (20:11 +0300)]
Allow field_10x26_arm.s to compile for ARMv7 architecture

This page took 0.085542 seconds and 4 git commands to generate.