]> Git Repo - secp256k1.git/log
secp256k1.git
5 years agoMerge #516: improvements to random seed in src/tests.c
Gregory Maxwell [Thu, 21 Feb 2019 11:42:08 +0000 (11:42 +0000)]
Merge #516: improvements to random seed in src/tests.c

be40c4d Fixup for C90 mixed declarations. (Gregory Maxwell)
8b3841c fix bug in fread() failure check (Don Viszneki)
cddef0c tests: add warning message when /dev/urandom fails (Don Viszneki)

Pull request description:

  I've made two small changes to `src/tests.c` circa random seed generation.

  Added a warning when `/dev/urandom` fails, mostly to defend against the case that someone should use the code verbatim, but also to enhance its illustrative power.

  Also I fixed a bug with how the return value of `fread()` was being evaluated. In fact, `/dev/urandom` was never being applied before as the check on the return value of `fread()` always failed!

Tree-SHA512: 239dbe8316220c2f0e5b370bf9a18f78196e96cc4a7edea58cf2521b2c9cbc8da065be96aa859f90324d57e388d30f7670ce6bc1cca52e5162e5ca66b1a55b34

5 years agoMerge #562: Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse
Gregory Maxwell [Thu, 21 Feb 2019 05:32:47 +0000 (05:32 +0000)]
Merge #562: Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse

d3cb1f9 Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse (Ben Woosley)

Pull request description:

  This results in more self-documenting code.

  Constants defined here:
  https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/include/secp256k1.h#L175-L180

Tree-SHA512: 2026103c487a5ebdea9a2f5ec2be96d74e38d5b2269b4df11e354bb54aba2925b47c3185f530205019840b00fc3501121acfa5234faf1d095d71777826414f69

5 years agoFixup for C90 mixed declarations.
Gregory Maxwell [Thu, 21 Feb 2019 05:00:29 +0000 (05:00 +0000)]
Fixup for C90 mixed declarations.

Reported-by: Jonas Nick <[email protected]>
5 years agoMerge #509: Fix algorithm selection in bench_ecmult
Gregory Maxwell [Thu, 21 Feb 2019 04:45:39 +0000 (04:45 +0000)]
Merge #509: Fix algorithm selection in bench_ecmult

0f05173 Fix algorithm selection in bench_ecmult (Jonas Nick)

Pull request description:

  Without this commit using an unknown argument results in a segmentation fault.

Tree-SHA512: 85b8f977e62fa360ff6dc923bd86f08725c30e178d58f43d33cbd8eb69e54fa4ec76e4407624611a80554cf9961689bce6b216da735ac95b256d0d2f60fe3328

5 years agoMerge #518: Summarize build options after running configure
Gregory Maxwell [Thu, 21 Feb 2019 04:42:43 +0000 (04:42 +0000)]
Merge #518: Summarize build options after running configure

3965027 Summarize build options in configure script (Evan Klitzke)

Pull request description:

  This is a trivial build system change to summarize the build options after running configure.

  Example output:
  ```
  $ ./configure
  ....
  <many lines omitted>
  ...
  config.status: src/libsecp256k1-config.h is unchanged
  config.status: executing depfiles commands
  config.status: executing libtool commands

  Build Options:
    with endomorphism   = no
    with ecmult precomp = yes
    with jni            = no
    module ecdh         = no
    module recovery     = no

    asm                 = x86_64
    bignum              = gmp
    field               = 64bit
    scalar              = 64bit

    CC                  = gcc
    CFLAGS              = -g -O2 -W -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -fvisibility=hidden -O3
    CPPFLAGS            =
    LDFLAGS             =
  ```

  I tried to just include the configure options that looked interesting; let me know if there are any I didn't include that I should have.

Tree-SHA512: 428381654d772f76bc81210d39ba5c3f07a94dc6a6378a02ccc6f23ebce7f501896268bcd2e94e2b0d8aea54c9c70c44a9238a0f0960600f463b1e2847c7ed1f

5 years agoMerge #567: Correct order of libs returned on pkg-config --libs --static libsecp2…
Gregory Maxwell [Thu, 21 Feb 2019 04:35:57 +0000 (04:35 +0000)]
Merge #567: Correct order of libs returned on pkg-config --libs --static libsecp2…

89a20a8 Correct order of libs returned on pkg-config --libs --static libsecp256k1 call. (Phillip Mienk)

Pull request description:

  …56k1 call.

Tree-SHA512: 095f5e71837e63a2bb6e9cf04cabe7f1ec55cf0fc32b44c80a89c232efb7d74bf0f148a8cd29f9fa2999f02bbc638d9a086ffd50888aab6f9fd5db74e37ae4d4

5 years agoMerge #587: Make randomization of a non-signing context a noop
Gregory Maxwell [Thu, 21 Feb 2019 04:31:26 +0000 (04:31 +0000)]
Merge #587: Make randomization of a non-signing context a noop

6198375 Make randomization of a non-signing context a noop (Tim Ruffing)

Pull request description:

  Before this commit secp256k1_context_randomize called illegal_callback
  when called on a context not initialized for signing. This is not
  documented. Moreover, it is not desirable because non-signing contexts
  may use randomization in the future.

  This commit makes secp256k1_context_randomize a noop in this case. This
  is safe because the context cannot be used for signing anyway.

  This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82.

Tree-SHA512: 34ddfeb004d9da8f4a77c739fa2110544c28939378e779226da52f410a0e36b3aacb3ebd2e3f3918832a9027684c161789cfdc27a133f2f0e0f1c47e8363029c

5 years agoMerge #511: Portability fix for the configure scripts generated
Gregory Maxwell [Thu, 21 Feb 2019 04:27:36 +0000 (04:27 +0000)]
Merge #511: Portability fix for the configure scripts generated

270f6c8 Portability fix for the configure scripts generated (Pierre Pronchery)

Pull request description:

  Found thanks to the developer checks from the pkgsrc software
  distribution (for NetBSD, SmartOS, Minix, MacOS X, Linux, and more).

Tree-SHA512: 2589545aa4d0620db66e79df1dc148a487384b5169ba7323937490d802973388859d30d45b35ee3e614be6d49cb694f37f585a16caa87ad1e500a0b7368dcc0a

5 years agoMerge #552: Make constants static:
Gregory Maxwell [Thu, 21 Feb 2019 04:24:37 +0000 (04:24 +0000)]
Merge #552: Make constants static:

496c5b4 Make constants static: static const secp256k1_ge secp256k1_ge_const_g; static const int CURVE_B; (Russell O'Connor)

Pull request description:

  static const secp256k1_ge secp256k1_ge_const_g;
  static const int CURVE_B;

Tree-SHA512: df8d34777d3b1b90eef875d50c2870e2480f08685b399a22eaf584ce294766e0de3a41523757a23e311e633886c89400313421282beca791326a06695f348940

5 years agoMerge #551: secp256k1_fe_sqrt: Verify that the arguments don't alias.
Gregory Maxwell [Thu, 21 Feb 2019 04:21:54 +0000 (04:21 +0000)]
Merge #551: secp256k1_fe_sqrt: Verify that the arguments don't alias.

bf8b86c secp256k1_fe_sqrt: Verify that the arguments don't alias. (Russell O'Connor)

Pull request description:

Tree-SHA512: 4e9128625817be83a1259e7dbdb82c4be8ee0174af7d5e76eeac3245d23d6bf01378d9697dcb870eb61577afd7c0556cb3c6633e3b27504add14c10b18f7c607

5 years agoMerge #539: Assorted minor corrections
Gregory Maxwell [Thu, 21 Feb 2019 04:17:54 +0000 (04:17 +0000)]
Merge #539: Assorted minor corrections

52ab96f clean dependendies in field_*_impl.h (Russell O'Connor)
deff5ed Correct math typos in field_*.h (Russell O'Connor)
4efb3f8 Add check that restrict pointers don't alias with all parameters. (Russell O'Connor)

Pull request description:

  * add more checks for restrict pointers.
  * correct math typos.
  * refine dependencies on "num.h"

Tree-SHA512: c368f577927db2ace3e7f46850cb2fdf9d7d169b698a9697767e1f82e9e7091f2b2fea0f7cf173048eb4c1bb56824c884fa849c04c595ee97766c01f346a54ec

5 years agoMerge #550: Optimize secp256k1_fe_normalize_weak calls.
Gregory Maxwell [Thu, 21 Feb 2019 04:11:07 +0000 (04:11 +0000)]
Merge #550: Optimize secp256k1_fe_normalize_weak calls.

9bd89c8 Optimize secp256k1_fe_normalize_weak calls. Move secp256k1_fe_normalize_weak calls out of ECMULT_TABLE_GET_GE and ECMULT_TABLE_GET_GE_STORAGE and into secp256k1_ge_globalz_set_table_gej instead. (Russell O'Connor)

Pull request description:

  Move secp256k1_fe_normalize_weak calls out of ECMULT_TABLE_GET_GE and ECMULT_TABLE_GET_GE_STORAGE and into secp256k1_ge_globalz_set_table_gej instead.

Tree-SHA512: 7bbb1aca8e37a268a26d7061bd1f390db129e697792f1d5ddd10ea34927616edc26ef118b500c3e5e14d1d463196033ef64e4d34b765380325c24835458b7a9b

5 years agoMerge #579: Use __GNUC_PREREQ for detecting __builtin_expect
Pieter Wuille [Mon, 4 Feb 2019 22:30:56 +0000 (14:30 -0800)]
Merge #579: Use __GNUC_PREREQ for detecting __builtin_expect

c663397 Use __GNUC_PREREQ for detecting __builtin_expect (Tim Ruffing)

Pull request description:

Tree-SHA512: 659a721da835eb15966a2a5386d6ae4c3defbb6ad473905f14161a3cf36d1556d44d887602019c89ebeffdfd82ed469ff27914dc2aaee6648d1e0c8a22151c27

5 years agoMake randomization of a non-signing context a noop
Tim Ruffing [Sun, 27 Jan 2019 12:17:37 +0000 (13:17 +0100)]
Make randomization of a non-signing context a noop

Before this commit secp256k1_context_randomize called illegal_callback
when called on a context not initialized for signing. This is not
documented. Moreover, it is not desirable because non-signing contexts
may use randomization in the future.

This commit makes secp256k1_context_randomize a noop in this case. This
is safe because the context cannot be used for signing anyway.

This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82.

6 years agoUse __GNUC_PREREQ for detecting __builtin_expect
Tim Ruffing [Mon, 17 Dec 2018 10:46:54 +0000 (11:46 +0100)]
Use __GNUC_PREREQ for detecting __builtin_expect

6 years agoMerge #557: Eliminate scratch memory used when generating contexts
Pieter Wuille [Mon, 26 Nov 2018 17:12:55 +0000 (09:12 -0800)]
Merge #557: Eliminate scratch memory used when generating contexts

b3bf5f9 ecmult_impl: expand comment to explain how effective affine interacts with everything (Andrew Poelstra)
efa783f Store z-ratios in the 'x' coord they'll recover (Peter Dettman)
ffd3b34 add `secp256k1_ge_set_all_gej_var` test which deals with many infinite points (Andrew Poelstra)
84740ac ecmult_impl: save one fe_inv_var (Andrew Poelstra)
4704527 ecmult_impl: eliminate scratch memory used when generating context (Andrew Poelstra)
7f7a2ed ecmult_gen_impl: eliminate scratch memory used when generating context (Andrew Poelstra)

Pull request description:

  Builds on #553

Tree-SHA512: 6031a601a4a476c1d21fc8db219383e7930434d2f199543c61aca0118412322dd814a0109c385ff1f83d16897170dd0c25051697b0f88f15234b0059b661af41

6 years agoecmult_impl: expand comment to explain how effective affine interacts with everything
Andrew Poelstra [Sat, 10 Nov 2018 13:42:55 +0000 (13:42 +0000)]
ecmult_impl: expand comment to explain how effective affine interacts with everything

6 years agoStore z-ratios in the 'x' coord they'll recover
Peter Dettman [Fri, 9 Nov 2018 07:50:17 +0000 (14:50 +0700)]
Store z-ratios in the 'x' coord they'll recover

6 years agoadd `secp256k1_ge_set_all_gej_var` test which deals with many infinite points
Andrew Poelstra [Wed, 17 Oct 2018 19:50:37 +0000 (19:50 +0000)]
add `secp256k1_ge_set_all_gej_var` test which deals with many infinite points

6 years agoecmult_impl: save one fe_inv_var
Andrew Poelstra [Mon, 1 Oct 2018 21:00:41 +0000 (21:00 +0000)]
ecmult_impl: save one fe_inv_var

6 years agoecmult_impl: eliminate scratch memory used when generating context
Andrew Poelstra [Thu, 20 Sep 2018 23:34:02 +0000 (23:34 +0000)]
ecmult_impl: eliminate scratch memory used when generating context

6 years agoecmult_gen_impl: eliminate scratch memory used when generating context
Andrew Poelstra [Thu, 20 Sep 2018 22:24:57 +0000 (22:24 +0000)]
ecmult_gen_impl: eliminate scratch memory used when generating context

6 years agoMerge #553: add static context object which has no capabilities
Pieter Wuille [Tue, 6 Nov 2018 02:23:52 +0000 (18:23 -0800)]
Merge #553: add static context object which has no capabilities

40fde61 prevent attempts to modify `secp256k1_context_no_precomp` (Andrew Poelstra)
ed7c084 add static context object which has no capabilities (Andrew Poelstra)

Pull request description:

Tree-SHA512: a843ed7ba00a00a46eec3146ce428d4b49eb440af766f44d731b1f51553d08de8cc9a0af5ed114d0dfdca6f4bf4a2ede4dbd6a37d6bd818b81630089424a0ba5

6 years agoCorrect order of libs returned on pkg-config --libs --static libsecp256k1 call.
Phillip Mienk [Tue, 23 Oct 2018 00:24:45 +0000 (17:24 -0700)]
Correct order of libs returned on pkg-config --libs --static libsecp256k1 call.

6 years agoMerge #354: [ECDH API change] Support custom hash function
Pieter Wuille [Wed, 17 Oct 2018 19:12:31 +0000 (12:12 -0700)]
Merge #354: [ECDH API change] Support custom hash function

c8fbc3c [ECDH API change] Allow pass arbitrary data to hash function (Kirill Fomichev)
b00be65 [ECDH API change] Support custom hash function (Kirill Fomichev)

Pull request description:

  Solve #352

Tree-SHA512: f5985874d03e976cdb3d59036af7720636ad1488da40fd3bd7881b1fb71b05036a952013d519baa84c4ce4b558bdef25c4ce76b384b297e4d0aece9e37e78a01

6 years agoMake use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse
Ben Woosley [Tue, 9 Oct 2018 06:40:37 +0000 (15:40 +0900)]
Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse

This results in more self-documenting code.

6 years agoprevent attempts to modify `secp256k1_context_no_precomp`
Andrew Poelstra [Thu, 20 Sep 2018 17:50:43 +0000 (17:50 +0000)]
prevent attempts to modify `secp256k1_context_no_precomp`

6 years agoadd static context object which has no capabilities
Andrew Poelstra [Wed, 15 Aug 2018 21:27:25 +0000 (21:27 +0000)]
add static context object which has no capabilities

6 years agoMake constants static:
Russell O'Connor [Wed, 15 Aug 2018 19:42:06 +0000 (15:42 -0400)]
Make constants static:
static const secp256k1_ge secp256k1_ge_const_g;
static const int CURVE_B;

6 years agosecp256k1_fe_sqrt: Verify that the arguments don't alias.
Russell O'Connor [Tue, 14 Aug 2018 20:47:14 +0000 (16:47 -0400)]
secp256k1_fe_sqrt: Verify that the arguments don't alias.

6 years agoOptimize secp256k1_fe_normalize_weak calls.
Russell O'Connor [Mon, 13 Aug 2018 03:47:38 +0000 (23:47 -0400)]
Optimize secp256k1_fe_normalize_weak calls.
Move secp256k1_fe_normalize_weak calls out of ECMULT_TABLE_GET_GE and ECMULT_TABLE_GET_GE_STORAGE and into secp256k1_ge_globalz_set_table_gej instead.

6 years agoclean dependendies in field_*_impl.h
Russell O'Connor [Fri, 6 Jul 2018 11:38:03 +0000 (07:38 -0400)]
clean dependendies in field_*_impl.h

6 years agoCorrect math typos in field_*.h
Russell O'Connor [Fri, 6 Jul 2018 11:53:32 +0000 (07:53 -0400)]
Correct math typos in field_*.h

6 years agoAdd check that restrict pointers don't alias with all parameters.
Russell O'Connor [Fri, 6 Jul 2018 11:26:57 +0000 (07:26 -0400)]
Add check that restrict pointers don't alias with all parameters.

6 years agoMerge #529: fix tests.c in the count == 0 case
Pieter Wuille [Thu, 31 May 2018 19:00:10 +0000 (12:00 -0700)]
Merge #529: fix tests.c in the count == 0 case

95e99f1 fix tests.c in the count == 0 case (Andrew Poelstra)

Pull request description:

  Fixes #528

Tree-SHA512: 8b28d84f95bcd1337fbd7fb187dee2a9bad2b6b595eaf42a2d855e5784f48a1f3ad5739881b22eea115d32c4525feb69b41958699a165c847fcfb8096cc4903a

6 years ago[ECDH API change] Allow pass arbitrary data to hash function
Kirill Fomichev [Wed, 16 May 2018 21:12:46 +0000 (00:12 +0300)]
[ECDH API change] Allow pass arbitrary data to hash function

6 years ago[ECDH API change] Support custom hash function
Kirill Fomichev [Thu, 12 Nov 2015 08:43:06 +0000 (11:43 +0300)]
[ECDH API change] Support custom hash function

6 years agofix tests.c in the count == 0 case
Andrew Poelstra [Tue, 10 Apr 2018 19:32:04 +0000 (19:32 +0000)]
fix tests.c in the count == 0 case

6 years agoMerge #523: scratch: add stack frame support
Pieter Wuille [Thu, 5 Apr 2018 23:33:43 +0000 (16:33 -0700)]
Merge #523: scratch: add stack frame support

6fe5043 scratch: add stack frame support (Andrew Poelstra)

Pull request description:

  Replaces the single-blob stack space ith one that internally manages multiple blobs, which are exposed to the user as "frames". Users allocate new blobs with `secp256k1_scratch_allocate_frame` and deallocate them with `secp256k1_scratch_deallocate_frame`. Then any calls to `secp256k1_scratch_alloc` use the frame at the top of the stack. This is guaranteed to succeed, assuming that the frame allocation succeeded and that the user is not requesting more memory than the frame was allocated with.

Tree-SHA512: 0b2072c5b9df8f3b40fb6d76e94fcfcc6a03a7da33e31249b5f24b02eb8a3311f282f6a4732153d6101968de8f9a568009a72735a1cc688a0f3040055799a09d

6 years agoscratch: add stack frame support
Andrew Poelstra [Tue, 20 Mar 2018 13:21:33 +0000 (13:21 +0000)]
scratch: add stack frame support

6 years agoMerge #522: parameterize ecmult_const over input size
Pieter Wuille [Thu, 5 Apr 2018 21:08:07 +0000 (14:08 -0700)]
Merge #522: parameterize ecmult_const over input size

7c1b91b parameterize ecmult_const over input size (Andrew Poelstra)

Pull request description:

Tree-SHA512: 0afd0c0156add54209e79c623d780559dfd85910ef0a0c476bcabd1074ad468d7983b7b6bb6e8bd3fe6e9b8bc703d78d09c3b99f8da990dfe004bbdc65496e66

6 years agoparameterize ecmult_const over input size
Andrew Poelstra [Tue, 13 Mar 2018 16:32:51 +0000 (16:32 +0000)]
parameterize ecmult_const over input size

6 years agoMerge #513: Increase sparsity of pippenger fixed window naf representation
Pieter Wuille [Thu, 5 Apr 2018 16:45:08 +0000 (09:45 -0700)]
Merge #513: Increase sparsity of pippenger fixed window naf representation

ec0a7b3 Don't touch leading zeros in wnaf_fixed. (Jonas Nick)
9e36d1b Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar. (Jonas Nick)
96f68a0 Don't invert scalar in wnaf_fixed when it is even because a caller might intentionally give a scalar with many leading zeros. (Jonas Nick)
6dbb007 Increase sparsity of pippenger fixed window naf representation (Jonas Nick)

Pull request description:

  Fixes #506

Tree-SHA512: 49a237a7d09c0c376ba4e6b1f522b9aff2517e420dfef9df810fd5ba920e0b98be8fe3f730b32e41b4aef475bc4cf3b13220024bd8d6f40c2744e6f392ff97a8

6 years agoSummarize build options in configure script
Evan Klitzke [Sat, 10 Mar 2018 18:36:59 +0000 (10:36 -0800)]
Summarize build options in configure script

6 years agoFix algorithm selection in bench_ecmult
Jonas Nick [Fri, 23 Feb 2018 16:31:43 +0000 (16:31 +0000)]
Fix algorithm selection in bench_ecmult

6 years agoMerge #510: add a couple missing `const`s to ecmult_pippenger_wnaf
Pieter Wuille [Tue, 27 Mar 2018 01:28:18 +0000 (18:28 -0700)]
Merge #510: add a couple missing `const`s to ecmult_pippenger_wnaf

9b3ff03 add a couple missing `const`s to ecmult_pippenger_wnaf (Andrew Poelstra)

Pull request description:

Tree-SHA512: a58458bb4cb1af357b13a506ce8720ce9ecd0c1771a49d9f3ce9398ba7afc56977d722bbd30a63c7c76e63e659ed956d5e82ff762efc4b49488adf0756dc656a

6 years agoMerge #515: Fix typo
Pieter Wuille [Tue, 27 Mar 2018 00:18:35 +0000 (17:18 -0700)]
Merge #515: Fix typo

9b7c47a Fix typo (Dimitris Apostolou)

Pull request description:

Tree-SHA512: d61f3451152ed6094368456e1c57d7a7ff85f975045bedff4fcb5c446894d9c9029f6ff4bfe724eba8501843316bd965bff1a302a7ea4d1b9c3e4de2059cadd0

6 years agoMerge #512: secp256k1_ec_privkey_negate - fix documentation
Pieter Wuille [Tue, 27 Mar 2018 00:17:35 +0000 (17:17 -0700)]
Merge #512: secp256k1_ec_privkey_negate - fix documentation

1646ace secp256k1_ec_privkey_negate - fix documentation (Thomas Kerin)

Pull request description:

Tree-SHA512: 711973d3fc4c790cdc469ed5500f857d68fe186d41b97fbbddbc90723b2db60f3ee9fa01b44bcc1a70f246096b85b50ae2139602b98924ddecbcbc6adc7bd217

6 years agoDon't touch leading zeros in wnaf_fixed.
Jonas Nick [Thu, 22 Mar 2018 21:32:11 +0000 (21:32 +0000)]
Don't touch leading zeros in wnaf_fixed.

6 years agoFix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a...
Jonas Nick [Fri, 23 Mar 2018 13:57:16 +0000 (13:57 +0000)]
Fix bug in wnaf_fixed where the wnaf array is not completely zeroed when given a 0 scalar.

6 years agoDon't invert scalar in wnaf_fixed when it is even because a caller might
Jonas Nick [Sun, 11 Mar 2018 19:32:54 +0000 (15:32 -0400)]
Don't invert scalar in wnaf_fixed when it is even because a caller might
intentionally give a scalar with many leading zeros.

6 years agofix bug in fread() failure check
Don Viszneki [Tue, 6 Mar 2018 02:45:00 +0000 (18:45 -0800)]
fix bug in fread() failure check

the two middle arguments to fread() are easily confused, and cause the
checking of return value to fail incorrectly (and possibly succeed
incorrectly.)

6 years agotests: add warning message when /dev/urandom fails
Don Viszneki [Tue, 6 Mar 2018 02:43:31 +0000 (18:43 -0800)]
tests: add warning message when /dev/urandom fails

in case this code should ever be used as an example, a warning is a nice
way of helping ensure insecure keys are not generated

6 years agoFix typo
Dimitris Apostolou [Mon, 5 Mar 2018 16:53:33 +0000 (18:53 +0200)]
Fix typo

6 years agoIncrease sparsity of pippenger fixed window naf representation
Jonas Nick [Tue, 27 Feb 2018 21:34:08 +0000 (21:34 +0000)]
Increase sparsity of pippenger fixed window naf representation

6 years agosecp256k1_ec_privkey_negate - fix documentation
Thomas Kerin [Wed, 28 Feb 2018 13:10:07 +0000 (14:10 +0100)]
secp256k1_ec_privkey_negate - fix documentation

6 years agoPortability fix for the configure scripts generated
Pierre Pronchery [Mon, 26 Feb 2018 01:22:11 +0000 (02:22 +0100)]
Portability fix for the configure scripts generated

Found thanks to the developer checks from the pkgsrc software
distribution (for NetBSD, SmartOS, Minix, MacOS X, Linux, and more).

6 years agoadd a couple missing `const`s to ecmult_pippenger_wnaf
Andrew Poelstra [Sat, 24 Feb 2018 17:29:34 +0000 (17:29 +0000)]
add a couple missing `const`s to ecmult_pippenger_wnaf

6 years agoMerge #460: [build] Update ax_jni_include_dir.m4 macro
Gregory Maxwell [Tue, 6 Feb 2018 23:06:08 +0000 (23:06 +0000)]
Merge #460: [build] Update ax_jni_include_dir.m4 macro

e7daa9b [build] Tweak JNI macro to warn instead of error for JNI not found. (Karl-Johan Alm)
5b22977 [build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS (Karl-Johan Alm)

Pull request description:

  Prior to this patch, this macro fails to find a working directory for the JNI headers, and results in compile failure when doing
  ```
  ./configure --enable-experimental --enable-module-ecdh --enable-jni
  ```
  on more recent macOS versions. The relevant commit upstream is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=ab23d25b1f1ae544fffdaa0a94a794798695c672) from the [GNU.org page for the macro](https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html). The original (identical to the version in this commit) is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_jni_include_dir.m4).

  The compile failure:
  ```Bash
  $ make
  gcc -I. -g -O2 -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o
  gcc gen_context.o -o gen_context
  ./gen_context
    CC       src/libsecp256k1_la-secp256k1.lo
    CC       src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo
  In file included from src/java/org_bitcoin_NativeSecp256k1.c:4:
  In file included from src/java/org_bitcoin_NativeSecp256k1.h:2:
  /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Headers/jni.h:45:10: fatal error:
        'jni_md.h' file not found
  #include "jni_md.h"
           ^
  1 error generated.
  make: *** [src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo] Error 1
  ```

Tree-SHA512: 9a8305b3ed67eba0de728f91cf435857a676ba10507ab8481a3c03b50e1ce0469a3d79e751d0a697018789f21e2aa48b7eccca4d225520a3863fcf23f1fd487a

6 years agoMerge #498: tests: Avoid calling fclose(...) with an invalid argument
Gregory Maxwell [Tue, 6 Feb 2018 23:04:39 +0000 (23:04 +0000)]
Merge #498: tests: Avoid calling fclose(...) with an invalid argument

5aae5b5 Avoid calling fclose(...) with an invalid argument (practicalswift)

Pull request description:

  Avoid calling `fclose(...)` with an invalid argument.

Tree-SHA512: f1a057b8c52089a3af1d9bfe97b751a4003b944d293147855eca452d1766c4ead5701d06f546153e654c9cb07b3fe2bcc4e28c8a54a27263d1e2434be123ca3b

6 years agoMerge #499: tests: Make sure we get the requested number of bytes from /dev/urandom
Gregory Maxwell [Tue, 6 Feb 2018 22:56:47 +0000 (22:56 +0000)]
Merge #499: tests: Make sure we get the requested number of bytes from /dev/urandom

82a96e4 tests: Make sure we get the requested number of bytes from /dev/urandom (practicalswift)

Pull request description:

  Make sure we get the requested number of bytes from `/dev/urandom`.

Tree-SHA512: 1b035942fd2a6ee2423fb2a2a0a0f294682c51434f86e5c106fb493d77f45aa8070662190aca6441fe389b8cdcc132d432517b8e826be2ac530a1511cd0c8919

6 years agoMerge #472: [build] Set --enable-jni to no by default instead of auto.
Gregory Maxwell [Tue, 6 Feb 2018 22:51:01 +0000 (22:51 +0000)]
Merge #472: [build] Set --enable-jni to no by default instead of auto.

57752d2 [build] Set --enable-jni to no by default instead of auto. (Karl-Johan Alm)

Pull request description:

  Having `--enable-jni` be `auto` doesn't make a lot of sense, and results in things like https://github.com/bitcoin/bitcoin/pull/11056.

Tree-SHA512: 27d6ea041f5d6e249857869ab87b8f7b1f6d18ec5ec82d2c46e692cd690b9f5c5857886725901a29d3539d427d8b6154d0c7909cfa2ce30bb3d4460c05708386

6 years agoMerge #494: Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS
Gregory Maxwell [Tue, 6 Feb 2018 22:43:19 +0000 (22:43 +0000)]
Merge #494: Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS

31abd3a Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS (Alexander Block)

Pull request description:

  The only reason OpenSSL 1.1 was not supported was the removal of direct
  access to r and s in ECDSA_SIG. This commit adds a simplified version of
  ECDSA_SIG_get0 for < 1.1 that can be used like ECDSA_SIG_get0 in >= 1.1

Tree-SHA512: 7ee49cd8424086bb96968c632b5babce50af98e13c414c4d5028a30fb86896956f829415a92c66387cde57941ab6999b0db823752cb36dd8932d15dd32980763

6 years agoMerge #495: Add bench_ecmult to .gitignore
Gregory Maxwell [Tue, 6 Feb 2018 22:26:47 +0000 (22:26 +0000)]
Merge #495: Add bench_ecmult to .gitignore

cb32940 Add bench_ecmult to .gitignore (Tony Rizko)

Pull request description:

Tree-SHA512: d346d3e99c9bd34a29741652e0f961dfdfce2c97aa8b26744a631a4eebfdf58afa127252b8a1c0772a89db74d1e26f55037794e9c2ab697511a66bffb5991909

7 years agotests: Make sure we get the requested number of bytes from /dev/urandom
practicalswift [Fri, 12 Jan 2018 10:23:28 +0000 (11:23 +0100)]
tests: Make sure we get the requested number of bytes from /dev/urandom

7 years agoAvoid calling fclose(...) with an invalid argument
practicalswift [Fri, 12 Jan 2018 10:18:25 +0000 (11:18 +0100)]
Avoid calling fclose(...) with an invalid argument

7 years agoAdd bench_ecmult to .gitignore
Tony Rizko [Sun, 31 Dec 2017 03:59:17 +0000 (19:59 -0800)]
Add bench_ecmult to .gitignore

7 years agoSupport OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS
Alexander Block [Thu, 28 Dec 2017 10:36:24 +0000 (11:36 +0100)]
Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS

The only reason OpenSSL 1.1 was not supported was the removal of direct
access to r and s in ECDSA_SIG. This commit adds a simplified version of
ECDSA_SIG_get0 for < 1.1 that can be used like ECDSA_SIG_get0 in >= 1.1

7 years agoMerge #487: fix tests typo, s/changed/unchanged
Pieter Wuille [Thu, 21 Dec 2017 22:29:50 +0000 (14:29 -0800)]
Merge #487: fix tests typo, s/changed/unchanged

0e96cdc fix typo, s/changed/unchanged (Daniel Cousens)

Pull request description:

Tree-SHA512: 023f04d3743318123977d1c4600d664e2b7578ad973db54b9e65629344be087949540b3450ba467de33d319738304a46aa4caae084cfe387fdf87ed8242ac9ce

7 years agoMerge #463: Reduce usage of hardcoded size constants
Pieter Wuille [Thu, 21 Dec 2017 22:07:15 +0000 (14:07 -0800)]
Merge #463: Reduce usage of hardcoded size constants

c7680e5 Reduce usage of hardcoded size constants (Thomas Snider)

Pull request description:

  In particular the usage of keylen in nonce_function_rfc6979 seemed precarious - in one conditional it was unconditionally set, then in the next it was added to.  While it was clearly correct as written, I think this change makes it easier to reason about for new eyes and more resistant to breakage if there is any future change to what gets fed into the PRNG.

Tree-SHA512: 2241c183acc0f318f85a11ccff7fe28de7777bc53dea93ab8308bad15871047a268c6a2b36f77a599dce536fca48ab305ea746223840bc10953c893daffa0a50

7 years agoMerge #490: Disambiguate bench functions and types
Pieter Wuille [Thu, 21 Dec 2017 22:05:36 +0000 (14:05 -0800)]
Merge #490: Disambiguate bench functions and types

1f46d60 Disambiguate bench functions and types (Pieter Wuille)

Pull request description:

  This fixes a Travis failure.

Tree-SHA512: ff601507c0bf286e29d202f3a4419977e394416e200c86848417040c79aad683399f6be1cc90b18842f4f7f2d928ef6f7562c1372bd4d4a258705819149972b2

7 years agoDisambiguate bench functions and types
Pieter Wuille [Tue, 19 Dec 2017 02:22:09 +0000 (18:22 -0800)]
Disambiguate bench functions and types

7 years agoMerge #480: Enable benchmark building by default
Pieter Wuille [Mon, 18 Dec 2017 22:38:35 +0000 (14:38 -0800)]
Merge #480: Enable benchmark building by default

7a78f60 Print whether we're building benchmarks (Pieter Wuille)
4afec9f Build benchmarks by default (Pieter Wuille)

Pull request description:

  Building benchmarks is fast, and I have on more than one occasion forgotten to pass `--enable-benchmark`, resulting in accidentally benchmarking a former build.

  Build them by default.

Tree-SHA512: ce9096e42d9c19b63644f6b7ae153e92f9a37c3727f380329dfa332ce22a5e43151f1525979bd3516dd12f568e5e389b0acda2c383fca0e80c3cadc1d9b1d55a

7 years agoMerge #486: Add pippenger_wnaf for multi-multiplication
Pieter Wuille [Fri, 8 Dec 2017 00:46:30 +0000 (16:46 -0800)]
Merge #486: Add pippenger_wnaf for multi-multiplication

d2f9c6b Use more precise pippenger bucket windows (Jonas Nick)
4c950bb Save some additions per window in _pippenger_wnaf (Peter Dettman)
a58f543 Add flags for choosing algorithm in ecmult_multi benchmark (Jonas Nick)
36b22c9 Use scratch space dependent batching in ecmult_multi (Jonas Nick)
355a38f Add pippenger_wnaf ecmult_multi (Jonas Nick)
bc65aa7 Add bench_ecmult (Pieter Wuille)
dba5471 Add ecmult_multi tests (Andrew Poelstra)
8c1c831 Generalize Strauss to support multiple points (Pieter Wuille)
548de42 add resizeable scratch space API (Andrew Poelstra)

Pull request description:

  This PR is based on #473 and adds a variant of "Pippengers algorithm" (see [Bernstein et al., Faster batch forgery identification](https://eprint.iacr.org/2012/549.pdf), page 15 and https://github.com/scipr-lab/libff/pull/10) for point multi-multiplication that performs better with a large number of points than Strauss' algorithm.

  ![aggsig](https://user-images.githubusercontent.com/2582071/32731185-12c0f108-c881-11e7-83c7-c2432b5fadf5.png)

  Thanks to @sipa for providing `wnaf_fixed`, benchmarking, and the crucial suggestion to use affine addition.

  The PR also makes `ecmult_multi` decide which algorithm to use, based on the number of points and the available scratch space.
  For restricted scratch spaces this can be further optimized in the future (f.e. a 35kB scratch space allows batches of 11 points with strauss or 95 points with pippenger; choosing pippenger would be 5% faster).

  As soon as this PR has received some feedback I'll repeat the benchmarks to determine the optimal `pippenger_bucket_window` with the new benchmarking code in #473.

Tree-SHA512: 8e155107a00d35f412300275803f912b1d228b7adff578bc4754c5b29641100b51b9d37f989316b636f7144e6b199febe7de302a44f498bbfd8d463bdbe31a5c

7 years agoUse more precise pippenger bucket windows
Jonas Nick [Wed, 6 Dec 2017 10:24:00 +0000 (10:24 +0000)]
Use more precise pippenger bucket windows

7 years agoSave some additions per window in _pippenger_wnaf
Peter Dettman [Thu, 30 Nov 2017 19:52:19 +0000 (02:52 +0700)]
Save some additions per window in _pippenger_wnaf

7 years agoAdd flags for choosing algorithm in ecmult_multi benchmark
Jonas Nick [Sun, 5 Nov 2017 20:17:11 +0000 (20:17 +0000)]
Add flags for choosing algorithm in ecmult_multi benchmark

7 years agoUse scratch space dependent batching in ecmult_multi
Jonas Nick [Sun, 5 Nov 2017 19:40:18 +0000 (19:40 +0000)]
Use scratch space dependent batching in ecmult_multi

7 years agoAdd pippenger_wnaf ecmult_multi
Jonas Nick [Thu, 14 Sep 2017 15:55:13 +0000 (17:55 +0200)]
Add pippenger_wnaf ecmult_multi

7 years agoAdd bench_ecmult
Pieter Wuille [Wed, 13 Sep 2017 03:05:39 +0000 (20:05 -0700)]
Add bench_ecmult

7 years agoAdd ecmult_multi tests
Andrew Poelstra [Wed, 16 Aug 2017 21:45:48 +0000 (14:45 -0700)]
Add ecmult_multi tests

7 years agoGeneralize Strauss to support multiple points
Pieter Wuille [Wed, 16 Aug 2017 21:45:27 +0000 (14:45 -0700)]
Generalize Strauss to support multiple points

API by Andrew Poelstra.

7 years agoadd resizeable scratch space API
Andrew Poelstra [Sat, 22 Jul 2017 18:03:17 +0000 (18:03 +0000)]
add resizeable scratch space API

Alignment support by Pieter Wuille.

7 years agofix typo, s/changed/unchanged
Daniel Cousens [Wed, 29 Nov 2017 01:32:01 +0000 (12:32 +1100)]
fix typo, s/changed/unchanged

7 years agoReduce usage of hardcoded size constants
Thomas Snider [Fri, 23 Jun 2017 06:31:23 +0000 (23:31 -0700)]
Reduce usage of hardcoded size constants

7 years agoMerge #479: Get rid of reserved _t in type names
Pieter Wuille [Wed, 8 Nov 2017 23:34:53 +0000 (15:34 -0800)]
Merge #479: Get rid of reserved _t in type names

d1dc9df Get rid of reserved _t in type names (Pieter Wuille)

Pull request description:

Tree-SHA512: 5da4a2cb15106c47fbe14346562444eff322a5e4e2386af8b0b879b72e22f08d704ac09746d6a22ff76e8892fc20208932b2a45d01de0e2e089686dabe45e633

7 years agoPrint whether we're building benchmarks
Pieter Wuille [Wed, 27 Sep 2017 22:13:46 +0000 (15:13 -0700)]
Print whether we're building benchmarks

7 years agoBuild benchmarks by default
Pieter Wuille [Wed, 27 Sep 2017 22:13:38 +0000 (15:13 -0700)]
Build benchmarks by default

7 years agoGet rid of reserved _t in type names
Pieter Wuille [Wed, 27 Sep 2017 22:01:26 +0000 (15:01 -0700)]
Get rid of reserved _t in type names

7 years agoMerge #474: Fix header guards using reserved identifiers
Pieter Wuille [Wed, 27 Sep 2017 21:53:44 +0000 (14:53 -0700)]
Merge #474: Fix header guards using reserved identifiers

abe2d3e Fix header guards using reserved identifiers (Dan Raviv)

Pull request description:

  Identifiers starting with an underscore and followed immediately by a capital letter are reserved by the C++ standard.

  The only header guards not fixed are those in the headers auto-generated from java.

Tree-SHA512: da31b8d718b3c3ffb81b3d12c93ce2d56c176f19a1936776c843fee069dbaa916946556cea16db34e1f977a937924d72c870230ac26e44386706ecd7cb25ba65

7 years agoMerge #478: Fixed multiple typos
Pieter Wuille [Mon, 25 Sep 2017 01:55:26 +0000 (18:55 -0700)]
Merge #478: Fixed multiple typos

8c7ea22 Fixed multiple typos (Dimitris Tsapakidis)

Pull request description:

  Forward port of fixes introduced in https://github.com/bitcoin/bitcoin/pull/10633 by @dimitris-t.

Tree-SHA512: a979b3e14bf2660cb0fcd809854654bd0f6277399afe948917be6c061a04835d404e590dc58bcb4a9e2ccfbfb38de944cbdba349092465f637606d3bee49fc16

7 years agoFixed multiple typos
Dimitris Tsapakidis [Mon, 25 Sep 2017 00:53:13 +0000 (17:53 -0700)]
Fixed multiple typos

7 years agoFix header guards using reserved identifiers
Dan Raviv [Sat, 26 Aug 2017 15:44:21 +0000 (18:44 +0300)]
Fix header guards using reserved identifiers

Identifiers starting with an underscore and followed immediately by a capital letter are reserved by the C++ standard.

The only header guards not fixed are those in the headers auto-generated from java.

7 years ago[build] Set --enable-jni to no by default instead of auto.
Karl-Johan Alm [Wed, 16 Aug 2017 06:45:07 +0000 (15:45 +0900)]
[build] Set --enable-jni to no by default instead of auto.

7 years agoMerge #459: Add pubkey prefix constants to include/secp256k1.h
Pieter Wuille [Thu, 10 Aug 2017 23:41:39 +0000 (16:41 -0700)]
Merge #459: Add pubkey prefix constants to include/secp256k1.h

bc61b91 add pubkey prefix constants to include/secp256k1.h (Andrew Poelstra)

Pull request description:

  In future multisig implementations we will need to pass nonces around, which are algebraically pubkeys but should not be decodable as pubkeys. The way to do this is to change the prefix byte from the ordinary 0x02/0x03 to something else. However, some forks (notably `secp256k1-zkp`) have started using some bytes for their own encodings, and if we continue to use hardcoded constants the risk of conflict is increased.

  This commit puts the prefixes used by the main library into the `include/secp256k1.h` so that the constants we're using will at least be in a standard easy-to-reference place.

Tree-SHA512: 37fa25be5074b7c519a9c69421320a62f32a3818f144254eb57f96c6657b993fc01962a5c670574275d1c59b095a6c89e60736123f032d6736907284eac526d7

7 years agoMerge #470: Fix wnaf_const documentation
Pieter Wuille [Thu, 10 Aug 2017 23:27:38 +0000 (16:27 -0700)]
Merge #470: Fix wnaf_const documentation

768514b Fix wnaf_const documentation with respect to return value and number of words set (Jonas Nick)

Pull request description:

Tree-SHA512: e2e49036c5930c74fff12626957a43000e5f86180791f2b857d279e83c609663ee5cbee4c3380f3df3d29e493f40051d63a8eff1badeea99e06652d9e72f4d29

7 years agoFix wnaf_const documentation with respect to return value and number of words set
Jonas Nick [Wed, 9 Aug 2017 08:54:30 +0000 (10:54 +0200)]
Fix wnaf_const documentation with respect to return value and number of words set

7 years agoMerge #458: Fix typo in API documentation
Pieter Wuille [Mon, 31 Jul 2017 07:44:08 +0000 (00:44 -0700)]
Merge #458: Fix typo in API documentation

b0452e6 Fix typo in API documentation (Tim Ruffing)

Pull request description:

Tree-SHA512: 0376756fc36004e9bb205c6b811e8b28ecd595db1fc2b577bf27c5c227d81ec8bca2e44cfab91fb76c9640d0f7c99970ce9ab94d72e26289cc8faeb747337309

7 years agoMerge #440: Fix typos
Pieter Wuille [Mon, 31 Jul 2017 07:40:59 +0000 (00:40 -0700)]
Merge #440: Fix typos

4c0f32e Fix typo: "Agressive" → "Aggressive" (practicalswift)
73aca83 Fix typo: "exectured" → "executed" (practicalswift)

Pull request description:

Tree-SHA512: 1dbb47789489aec4c133b049ccd007b67d719fe1e2500ba4c6242274a3b537027ceb17a311fca5e0e0324f0ecd48a53e84c0f51514f00fa7ef533ab3e6c87bd3

7 years agoMerge #468: Remove redundant conditional expression
Pieter Wuille [Mon, 31 Jul 2017 07:38:01 +0000 (00:38 -0700)]
Merge #468: Remove redundant conditional expression

2e1ccdc Remove redundant conditional expression (Dag Robole)

Pull request description:

Tree-SHA512: 999ed3d9d805ec48a92a17554097fcd9d62c2fe859346d381d3a7b38b767e45f57df6cd71eb6dddbea343e4e180c844900fed37d88d21f5a851bd044212aff2e

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